added the option editor_smart_home_end, swiched off by default.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Ilia Maslakov 2012-04-26 11:11:46 +04:00
parent fc62bc7fd6
commit dc79096167
3 changed files with 9 additions and 0 deletions

View File

@ -87,6 +87,7 @@ int option_persistent_selections = 1;
int option_cursor_beyond_eol = 0; int option_cursor_beyond_eol = 0;
int option_line_state = 0; int option_line_state = 0;
int option_line_state_width = 0; int option_line_state_width = 0;
int option_smart_home_end = 0;
int option_edit_right_extreme = 0; int option_edit_right_extreme = 0;
int option_edit_left_extreme = 0; int option_edit_left_extreme = 0;
@ -1047,6 +1048,9 @@ edit_bol_var (WEdit * edit, long current)
long tmp; long tmp;
int b; int b;
if (!option_smart_home_end)
return edit_bol (edit, current);
if (current < 0) if (current < 0)
current = 0; current = 0;
@ -1072,6 +1076,9 @@ edit_eol_var (WEdit * edit, long current)
long tmp; long tmp;
int b; int b;
if (!option_smart_home_end)
return edit_eol (edit, current);
if (current >= edit->last_byte) if (current >= edit->last_byte)
current = edit->last_byte; current = edit->last_byte;

View File

@ -54,6 +54,7 @@ extern int visible_tws;
extern int simple_statusbar; extern int simple_statusbar;
extern int option_check_nl_at_eof; extern int option_check_nl_at_eof;
extern int show_right_margin; extern int show_right_margin;
extern int option_smart_home_end;
/*** declarations of public functions ************************************************************/ /*** declarations of public functions ************************************************************/

View File

@ -308,6 +308,7 @@ static const struct
{ "editor_option_auto_para_formatting", &option_auto_para_formatting }, { "editor_option_auto_para_formatting", &option_auto_para_formatting },
{ "editor_option_typewriter_wrap", &option_typewriter_wrap }, { "editor_option_typewriter_wrap", &option_typewriter_wrap },
{ "editor_edit_confirm_save", &edit_confirm_save }, { "editor_edit_confirm_save", &edit_confirm_save },
{ "editor_smart_home_end", &option_smart_home_end },
{ "editor_syntax_highlighting", &option_syntax_highlighting }, { "editor_syntax_highlighting", &option_syntax_highlighting },
{ "editor_persistent_selections", &option_persistent_selections }, { "editor_persistent_selections", &option_persistent_selections },
{ "editor_cursor_beyond_eol", &option_cursor_beyond_eol }, { "editor_cursor_beyond_eol", &option_cursor_beyond_eol },