summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-15 11:00:00 -0300
committerpommicket <pommicket@gmail.com>2023-08-15 11:31:06 -0300
commitad8c5d1466eb8edf2e6343f28026ae993ac31f2c (patch)
treeb4a9d475b47cc978c66d830ea61a99c0464af9f8 /command.c
parent4ea381d6a8a2a560213de896bab2aad02a70f937 (diff)
use home/end with selector
Diffstat (limited to 'command.c')
-rw-r--r--command.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/command.c b/command.c
index 598e0d2..b6b5324 100644
--- a/command.c
+++ b/command.c
@@ -259,11 +259,13 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen
autocomplete_close(ted);
break;
case CMD_START_OF_LINE:
- if (buffer) buffer_cursor_move_to_start_of_line(buffer);
+ if (ted->selector_open) selector_home(ted, ted->selector_open);
+ else if (buffer) buffer_cursor_move_to_start_of_line(buffer);
autocomplete_close(ted);
break;
case CMD_END_OF_LINE:
- if (buffer) buffer_cursor_move_to_end_of_line(buffer);
+ if (ted->selector_open) selector_end(ted, ted->selector_open);
+ else if (buffer) buffer_cursor_move_to_end_of_line(buffer);
autocomplete_close(ted);
break;
case CMD_SELECT_START_OF_LINE:
@@ -275,11 +277,13 @@ void command_execute_ex(Ted *ted, Command c, const CommandArgument *full_argumen
autocomplete_close(ted);
break;
case CMD_START_OF_FILE:
- if (buffer) buffer_cursor_move_to_start_of_file(buffer);
+ if (ted->selector_open) selector_home(ted, ted->selector_open);
+ else if (buffer) buffer_cursor_move_to_start_of_file(buffer);
autocomplete_close(ted);
break;
case CMD_END_OF_FILE:
- if (buffer) buffer_cursor_move_to_end_of_file(buffer);
+ if (ted->selector_open) selector_end(ted, ted->selector_open);
+ else if (buffer) buffer_cursor_move_to_end_of_file(buffer);
autocomplete_close(ted);
break;
case CMD_SELECT_START_OF_FILE: