Merge branch '61_rectangular_select'

* 61_rectangular_select:
  add description of editor_cursor_beyond_eol into  mcedit.1.in
  fix: incorrect move/delete block if 'Cursor beyond end of line' swiched on
  fix: mouse selection if line state swiched on.
  Ticket #61 (Misbehaving rectangular select in editor)
This commit is contained in:
Ilia Maslakov 2009-08-21 13:43:41 +00:00
commit 96b33bae87
5 changed files with 16 additions and 8 deletions

View File

@ -464,6 +464,9 @@ Toggle show visible tabs, if editor_visible_tabs=1 tabs showed as '<---->'
.I editor_persistent_selections
Do not remove block selection after moving the cursor.
.TP
.I editor_cursor_beyond_eol
Allow moving cursor beyond the end of line.
.TP
.I editor_syntax_highlighting
enable syntax highlighting.
.TP

View File

@ -1653,6 +1653,7 @@ edit_move_to_prev_col (WEdit * edit, long p)
edit->over_col = 0;
}
} else {
edit->over_col = 0;
if (is_in_indent (edit) && option_fake_half_tabs) {
edit_update_curs_col (edit);
if (space_width)
@ -2655,6 +2656,7 @@ edit_execute_cmd (WEdit *edit, int command, int char_for_insertion)
edit_delete_to_line_begin (edit);
break;
case CK_Enter:
edit->over_col = 0;
if (option_auto_para_formatting) {
edit_double_newline (edit);
if (option_return_does_auto_indent)
@ -2881,12 +2883,16 @@ edit_execute_cmd (WEdit *edit, int command, int char_for_insertion)
break;
case CK_Copy:
if ( option_cursor_beyond_eol && edit->over_col > 0 )
edit_insert_over (edit);
edit_block_copy_cmd (edit);
break;
case CK_Remove:
edit_block_delete_cmd (edit);
break;
case CK_Move:
if ( option_cursor_beyond_eol && edit->over_col > 0 )
edit_insert_over (edit);
edit_block_move_cmd (edit);
break;

View File

@ -1209,8 +1209,8 @@ edit_delete_column_of_text (WEdit * edit)
c = edit_move_forward3 (edit, edit_bol (edit, m1), 0, m1);
d = edit_move_forward3 (edit, edit_bol (edit, m2), 0, m2);
b = min (c, d);
c = max (c, d);
b = max(min (c, d), min (edit->column1, edit->column2));
c = max (c, d + edit->over_col);
while (n--) {
r = edit_bol (edit, edit->curs1);

View File

@ -386,9 +386,6 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
start_col_real = (col =
(int) edit_move_forward3 (edit, b, 0,
q)) + edit->start_col;
c1 = min (edit->column1, edit->column2);
c2 = max (edit->column1, edit->column2);
if ( option_line_state ) {
cur_line = edit->start_line + row;
if ( cur_line <= edit->total_lines ) {
@ -423,6 +420,8 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
if (column_highlighting) {
int x;
x = edit_move_forward3 (edit, b, 0, q);
c1 = min (edit->column1, edit->column2);
c2 = max (edit->column1, edit->column2);
if (x >= c1 && x < c2)
p->style |= MOD_MARKED;
} else

View File

@ -95,14 +95,14 @@ edit_event (WEdit * edit, Gpm_Event * event, int *result)
long line_len = edit_move_forward3 (edit, edit_bol (edit, edit->curs1), 0,
edit_eol(edit, edit->curs1));
if ( event->x > line_len ) {
edit->over_col = event->x - line_len;
edit->over_col = event->x - line_len - option_line_state_width - 1;
edit->prev_col = line_len;
} else {
edit->over_col = 0;
edit->prev_col = event->x;
edit->prev_col = event->x - option_line_state_width - 1;
}
} else {
edit->prev_col = event->x - edit->start_col - 1;
edit->prev_col = event->x - edit->start_col - option_line_state_width - 1;
}
if (--event->y > (edit->curs_row + 1))