summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-02-09 12:12:00 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-02-10 18:56:43 +0100
commit9b9ec62a8eed075560a07d32267f33856304571e (patch)
treeea439a1351fd9bf0cdb6605202554a5757f940b2 /src
parent69a3dd21dc49df200ea9500436b5d7e66dc9d04e (diff)
downloadweechat-9b9ec62a8eed075560a07d32267f33856304571e.zip
core: allow /input move_next_word going to the end of line
When the input buffer contains non word characters at the end, /input move_next_word will stop moving at the end of the last word. This is a bit confusing and not in line with what readline does (think bash). When there are no words left in the input buffer, make /input move_next_word go to the end of line. Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui-input.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c
index 7119128c9..b80725c8b 100644
--- a/src/gui/gui-input.c
+++ b/src/gui/gui-input.c
@@ -1174,11 +1174,7 @@ gui_input_move_next_word (struct t_gui_buffer *buffer)
buffer->input_buffer_pos = buffer->input_buffer_length;
}
else
- {
- buffer->input_buffer_pos =
- utf8_pos (buffer->input_buffer,
- utf8_prev_char (buffer->input_buffer, pos) - buffer->input_buffer);
- }
+ buffer->input_buffer_pos = buffer->input_buffer_length;
gui_input_text_cursor_moved_signal (buffer);
}