Ticket #1412 (vertical selection issue)

fix: vertical selection issue then line state is switch on

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Daniel Borca 2009-08-17 19:50:35 +00:00 committed by Ilia Maslakov
parent 4afee14f94
commit ea219adec3
4 changed files with 21 additions and 7 deletions

View File

@ -1560,7 +1560,7 @@ void edit_update_curs_row (WEdit * edit)
void edit_update_curs_col (WEdit * edit)
{
edit->curs_col = edit_move_forward3(edit, edit_bol(edit, edit->curs1), 0, edit->curs1) + option_line_state_width;
edit->curs_col = edit_move_forward3(edit, edit_bol(edit, edit->curs1), 0, edit->curs1);
}
int

View File

@ -273,7 +273,8 @@ editcmd_dialog_completion_show (WEdit * edit, int max_len, int word_len,
/* calculate the dialog metrics */
compl_dlg_h = num_compl + 2;
compl_dlg_w = max_len + 4;
start_x = edit->curs_col + edit->start_col - (compl_dlg_w / 2);
start_x = edit->curs_col + edit->start_col - (compl_dlg_w / 2) +
EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width;
start_y = edit->curs_row + EDIT_TEXT_VERTICAL_OFFSET + 1;
if (start_x < 0)
@ -341,7 +342,8 @@ editcmd_dialog_select_definition_show (WEdit * edit, char *match_expr, int max_l
/* calculate the dialog metrics */
def_dlg_h = num_lines + 2;
def_dlg_w = max_len + 4;
start_x = edit->curs_col + edit->start_col - (def_dlg_w / 2);
start_x = edit->curs_col + edit->start_col - (def_dlg_w / 2) +
EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width;
start_y = edit->curs_row + EDIT_TEXT_VERTICAL_OFFSET + 1;
if (start_x < 0)

View File

@ -215,6 +215,9 @@ void edit_scroll_screen_over_cursor (WEdit * edit)
if (edit->num_widget_lines <= 0 || edit->num_widget_columns <= 0)
return;
edit->num_widget_columns -= EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width;
edit->num_widget_lines -= EDIT_TEXT_VERTICAL_OFFSET - 1;
r_extreme = EDIT_RIGHT_EXTREME;
l_extreme = EDIT_LEFT_EXTREME;
b_extreme = EDIT_BOTTOM_EXTREME;
@ -251,6 +254,9 @@ void edit_scroll_screen_over_cursor (WEdit * edit)
if (outby > 0)
edit_scroll_upward (edit, outby);
edit_update_curs_row (edit);
edit->num_widget_lines += EDIT_TEXT_VERTICAL_OFFSET - 1;
edit->num_widget_columns += EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width;
}
#define edit_move(x,y) widget_move(edit, y, x);
@ -266,7 +272,7 @@ print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
{
struct line_s *p;
int x = start_col_real + EDIT_TEXT_HORIZONTAL_OFFSET;
int x = start_col_real;
int x1 = start_col + EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width;
int y = row + EDIT_TEXT_VERTICAL_OFFSET;
int cols_to_skip = abs (x);
@ -274,7 +280,7 @@ print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
tty_setcolor (EDITOR_NORMAL_COLOR);
tty_draw_hline (edit->widget.y + y, edit->widget.x + x1,
' ', end_col + 1 - EDIT_TEXT_HORIZONTAL_OFFSET - x1);
' ', end_col + 1 - start_col);
if (option_line_state) {
int i;
@ -357,6 +363,11 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
unsigned int cur_line = 0;
char line_stat[LINE_STATE_WIDTH + 1];
if (row > edit->num_widget_lines - EDIT_TEXT_VERTICAL_OFFSET) {
return;
}
end_col -= EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width;
edit_get_syntax_color (edit, b - 1, &color);
q = edit_move_forward3 (edit, b, start_col - edit->start_col, 0);
start_col_real = (col =

View File

@ -102,7 +102,7 @@ edit_event (WEdit * edit, Gpm_Event * event, int *result)
edit->prev_col = event->x;
}
} else {
edit->prev_col = event->x - edit->start_col - 1 - option_line_state_width;
edit->prev_col = event->x - edit->start_col - 1;
}
if (--event->y > (edit->curs_row + 1))
@ -370,7 +370,8 @@ edit_callback (Widget *w, widget_msg_t msg, int parm)
case WIDGET_CURSOR:
widget_move (&e->widget, e->curs_row + EDIT_TEXT_VERTICAL_OFFSET,
e->curs_col + e->start_col + e->over_col);
e->curs_col + e->start_col + e->over_col +
EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width);
return MSG_HANDLED;
case WIDGET_DESTROY: