summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
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: