replace move_to_eol loop with std::find
This commit is contained in:
parent
37ac605880
commit
abf07337c5
10
termite.cc
10
termite.cc
|
@ -467,14 +467,8 @@ static void move_to_eol(VteTerminal *vte, select_info *select) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
long column = 0;
|
auto iter = std::find(codepoints, codepoints + length, '\n');
|
||||||
for (; column < length; column++) {
|
set_cursor_column(vte, select, std::max(iter - codepoints - 1, 0l));
|
||||||
if (codepoints[column] == '\n') {
|
|
||||||
column = std::max(column - 1, 0l);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set_cursor_column(vte, select, column);
|
|
||||||
|
|
||||||
g_free(codepoints);
|
g_free(codepoints);
|
||||||
g_free(content);
|
g_free(content);
|
||||||
|
|
Loading…
Reference in New Issue