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;
|
||||
}
|
||||
|
||||
long column = 0;
|
||||
for (; column < length; column++) {
|
||||
if (codepoints[column] == '\n') {
|
||||
column = std::max(column - 1, 0l);
|
||||
break;
|
||||
}
|
||||
}
|
||||
set_cursor_column(vte, select, column);
|
||||
auto iter = std::find(codepoints, codepoints + length, '\n');
|
||||
set_cursor_column(vte, select, std::max(iter - codepoints - 1, 0l));
|
||||
|
||||
g_free(codepoints);
|
||||
g_free(content);
|
||||
|
|
Loading…
Reference in New Issue