Merge pull request #13244 from tk-shirasaka/fix/multigrid-click-foldcolumn

ui: Fix click on foldcolumn when ext_multigrid is enabled
This commit is contained in:
Matthieu Coudron 2020-11-10 00:54:54 +01:00 committed by GitHub
commit e786fb5afb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 965 additions and 374 deletions

View File

@ -75,6 +75,7 @@ int jump_to_mouse(int flags,
int grid = mouse_grid;
int mouse_char;
int fdc = 0;
ScreenGrid *gp = &default_grid;
mouse_past_bottom = false;
mouse_past_eol = false;
@ -125,16 +126,6 @@ retnomove:
if (flags & MOUSE_SETPOS)
goto retnomove; // ugly goto...
// Remember the character under the mouse, might be one of foldclose or
// foldopen fillchars in the fold column.
if (row >= 0 && row < Rows && col >= 0 && col <= Columns
&& default_grid.chars != NULL) {
mouse_char = utf_ptr2char(default_grid.chars[default_grid.line_offset[row]
+ (unsigned)col]);
} else {
mouse_char = ' ';
}
old_curwin = curwin;
old_cursor = curwin->w_cursor;
@ -333,6 +324,19 @@ retnomove:
}
}
// Remember the character under the mouse, might be one of foldclose or
// foldopen fillchars in the fold column.
if (ui_has(kUIMultigrid)) {
gp = &curwin->w_grid;
}
if (row >= 0 && row < Rows && col >= 0 && col <= Columns
&& gp->chars != NULL) {
mouse_char = utf_ptr2char(gp->chars[gp->line_offset[row]
+ (unsigned)col]);
} else {
mouse_char = ' ';
}
// Check for position outside of the fold column.
if (curwin->w_p_rl ? col < curwin->w_width_inner - fdc :
col >= fdc + (cmdwin_type == 0 ? 0 : 1)) {

File diff suppressed because it is too large Load Diff