experemental commit

This commit is contained in:
Ilia Maslakov 2009-03-25 21:31:07 +00:00
parent 72d0a117b6
commit f312a93332
2 changed files with 35 additions and 0 deletions

View File

@ -63,6 +63,7 @@ int option_fake_half_tabs = 1;
int option_save_mode = EDIT_QUICK_SAVE; int option_save_mode = EDIT_QUICK_SAVE;
int option_save_position = 1; int option_save_position = 1;
int option_max_undo = 32768; int option_max_undo = 32768;
int option_persistent_block = 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;
@ -2212,6 +2213,25 @@ edit_execute_cmd (WEdit *edit, int command, int char_for_insertion)
edit_find_bracket (edit); edit_find_bracket (edit);
return; return;
} }
switch (command) {
case CK_Begin_Page:
case CK_End_Page:
case CK_Begin_Page_Highlight:
case CK_End_Page_Highlight:
case CK_Word_Left:
case CK_Word_Right:
case CK_Up:
case CK_Down:
case CK_Left:
case CK_Right:
if ( !option_persistent_block ) {
if (column_highlighting)
edit_push_action (edit, COLUMN_ON);
column_highlighting = 0;
edit_mark_cmd (edit, 1);
}
}
switch (command) { switch (command) {
case CK_Begin_Page: case CK_Begin_Page:
case CK_End_Page: case CK_End_Page:
@ -2237,6 +2257,13 @@ edit_execute_cmd (WEdit *edit, int command, int char_for_insertion)
/* basic cursor key commands */ /* basic cursor key commands */
switch (command) { switch (command) {
case CK_BackSpace: case CK_BackSpace:
/* if non persistent block and text selected */
if ( !option_persistent_block ) {
if ( edit->mark1 != edit->mark2 ) {
edit_block_delete_cmd (edit);
break;
}
}
if (option_backspace_through_tabs && is_in_indent (edit)) { if (option_backspace_through_tabs && is_in_indent (edit)) {
while (edit_get_byte (edit, edit->curs1 - 1) != '\n' while (edit_get_byte (edit, edit->curs1 - 1) != '\n'
&& edit->curs1 > 0) && edit->curs1 > 0)
@ -2255,6 +2282,13 @@ edit_execute_cmd (WEdit *edit, int command, int char_for_insertion)
edit_backspace (edit); edit_backspace (edit);
break; break;
case CK_Delete: case CK_Delete:
/* if non persistent block and text selected */
if ( !option_persistent_block ) {
if ( edit->mark1 != edit->mark2 ) {
edit_block_delete_cmd (edit);
break;
}
}
if (option_fake_half_tabs) { if (option_fake_half_tabs) {
int i; int i;
if (is_in_indent (edit) && left_of_four_spaces (edit)) { if (is_in_indent (edit) && left_of_four_spaces (edit)) {

View File

@ -282,6 +282,7 @@ extern int option_fill_tabs_with_spaces;
extern int option_return_does_auto_indent; extern int option_return_does_auto_indent;
extern int option_backspace_through_tabs; extern int option_backspace_through_tabs;
extern int option_fake_half_tabs; extern int option_fake_half_tabs;
extern int option_persistent_block;
typedef enum { typedef enum {
EDIT_QUICK_SAVE = 0, EDIT_QUICK_SAVE = 0,