stop forward word movement at the end of the text
This commit is contained in:
parent
7328e96110
commit
a2bafff951
10
termite.cc
10
termite.cc
|
@ -212,7 +212,7 @@ static void move_backward(VteTerminal *vte, select_info *select, F predicate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
glong length;
|
long length;
|
||||||
gunichar *codepoints = g_utf8_to_ucs4(content, -1, NULL, &length, NULL);
|
gunichar *codepoints = g_utf8_to_ucs4(content, -1, NULL, &length, NULL);
|
||||||
|
|
||||||
if (!codepoints) {
|
if (!codepoints) {
|
||||||
|
@ -263,12 +263,18 @@ static void move_forward(VteTerminal *vte, select_info *select, F predicate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gunichar *codepoints = g_utf8_to_ucs4(content, -1, NULL, NULL, NULL);
|
long length;
|
||||||
|
gunichar *codepoints = g_utf8_to_ucs4(content, -1, NULL, &length, NULL);
|
||||||
|
|
||||||
if (!codepoints) {
|
if (!codepoints) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// prevent going past the end (get_text_range adds a \n)
|
||||||
|
if (codepoints[length - 1] == '\n') {
|
||||||
|
codepoints[--length] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
bool end_of_word = false;
|
bool end_of_word = false;
|
||||||
|
|
||||||
for (gunichar *c = codepoints; *c != 0; c++) {
|
for (gunichar *c = codepoints; *c != 0; c++) {
|
||||||
|
|
Loading…
Reference in New Issue