From c8b7cfc29767b48b0ddea53842e2c771d85e7c9c Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 15 Nov 2020 14:43:06 +0200 Subject: [PATCH] examples: small fix for ctrl-right at the last word of a line --- examples/term.ui/text_editor.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/term.ui/text_editor.v b/examples/term.ui/text_editor.v index 194846f333..1a259571d0 100644 --- a/examples/term.ui/text_editor.v +++ b/examples/term.ui/text_editor.v @@ -377,7 +377,7 @@ fn (mut b Buffer) move_to_word(movement Movement) { // then, move past all the letters and numbers for x+a >= 0 && x+a < line.len && (line[x+a].is_letter() || line[x+a].is_digit() || line[x+a] == `_`) { x += a } // if the cursor is out of bounds, move it to the next/previous line - if x + a >= 0 && x + a < line.len { + if x + a >= 0 && x + a <= line.len { x += a } else if a < 0 && y+1 > b.lines.len && y-1 >= 0 { y += a