From dc7909616777725323b987ecdb1ab4537f95a0b4 Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Thu, 26 Apr 2012 11:11:46 +0400 Subject: [PATCH] added the option editor_smart_home_end, swiched off by default. Signed-off-by: Ilia Maslakov --- src/editor/edit.c | 7 +++++++ src/editor/edit.h | 1 + src/setup.c | 1 + 3 files changed, 9 insertions(+) diff --git a/src/editor/edit.c b/src/editor/edit.c index 0fa52d09e..bbe88d669 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -87,6 +87,7 @@ int option_persistent_selections = 1; int option_cursor_beyond_eol = 0; int option_line_state = 0; int option_line_state_width = 0; +int option_smart_home_end = 0; int option_edit_right_extreme = 0; int option_edit_left_extreme = 0; @@ -1047,6 +1048,9 @@ edit_bol_var (WEdit * edit, long current) long tmp; int b; + if (!option_smart_home_end) + return edit_bol (edit, current); + if (current < 0) current = 0; @@ -1072,6 +1076,9 @@ edit_eol_var (WEdit * edit, long current) long tmp; int b; + if (!option_smart_home_end) + return edit_eol (edit, current); + if (current >= edit->last_byte) current = edit->last_byte; diff --git a/src/editor/edit.h b/src/editor/edit.h index df7103c28..6ec8a9019 100644 --- a/src/editor/edit.h +++ b/src/editor/edit.h @@ -54,6 +54,7 @@ extern int visible_tws; extern int simple_statusbar; extern int option_check_nl_at_eof; extern int show_right_margin; +extern int option_smart_home_end; /*** declarations of public functions ************************************************************/ diff --git a/src/setup.c b/src/setup.c index 791a2bc84..e2be01602 100644 --- a/src/setup.c +++ b/src/setup.c @@ -308,6 +308,7 @@ static const struct { "editor_option_auto_para_formatting", &option_auto_para_formatting }, { "editor_option_typewriter_wrap", &option_typewriter_wrap }, { "editor_edit_confirm_save", &edit_confirm_save }, + { "editor_smart_home_end", &option_smart_home_end }, { "editor_syntax_highlighting", &option_syntax_highlighting }, { "editor_persistent_selections", &option_persistent_selections }, { "editor_cursor_beyond_eol", &option_cursor_beyond_eol }, -- 2.11.4.GIT