aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mouse.c
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-03-02 13:56:27 +0100
committerGitHub <noreply@github.com>2020-03-02 13:56:27 +0100
commitd22fd58629c6aa93d808d74a7e6dee79e3246ae0 (patch)
treecda0f3a59a076bae4c1cf4f6e51328eee560cf1e /src/nvim/mouse.c
parente35ff7371f4a61621587744a7620200380abbbe9 (diff)
parent6f261d23942feb22e5aa2881bc645bce5c5ce946 (diff)
downloadrneovim-d22fd58629c6aa93d808d74a7e6dee79e3246ae0.tar.gz
rneovim-d22fd58629c6aa93d808d74a7e6dee79e3246ae0.tar.bz2
rneovim-d22fd58629c6aa93d808d74a7e6dee79e3246ae0.zip
Merge pull request #11716 from teto/folds_auto_backup
[RFC] foldcolumn autowidth
Diffstat (limited to 'src/nvim/mouse.c')
-rw-r--r--src/nvim/mouse.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index e395654e04..32d8352d9b 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -73,6 +73,7 @@ int jump_to_mouse(int flags,
int col = mouse_col;
int grid = mouse_grid;
int mouse_char;
+ int fdc = 0;
mouse_past_bottom = false;
mouse_past_eol = false;
@@ -131,6 +132,7 @@ retnomove:
if (wp == NULL) {
return IN_UNKNOWN;
}
+ fdc = win_fdccol_count(wp);
dragwin = NULL;
// winpos and height may change in win_enter()!
if (grid == DEFAULT_GRID_HANDLE && row >= wp->w_height) {
@@ -165,9 +167,8 @@ retnomove:
|| (!on_status_line
&& !on_sep_line
&& (wp->w_p_rl
- ? col < wp->w_width_inner - wp->w_p_fdc
- : col >= wp->w_p_fdc + (cmdwin_type == 0 && wp == curwin
- ? 0 : 1))
+ ? col < wp->w_width_inner - fdc
+ : col >= fdc + (cmdwin_type == 0 && wp == curwin ? 0 : 1))
&& (flags & MOUSE_MAY_STOP_VIS)))) {
end_visual_mode();
redraw_curbuf_later(INVERTED); // delete the inversion
@@ -305,8 +306,8 @@ retnomove:
}
// Check for position outside of the fold column.
- if (curwin->w_p_rl ? col < curwin->w_width_inner - curwin->w_p_fdc :
- col >= curwin->w_p_fdc + (cmdwin_type == 0 ? 0 : 1)) {
+ if (curwin->w_p_rl ? col < curwin->w_width_inner - fdc :
+ col >= fdc + (cmdwin_type == 0 ? 0 : 1)) {
mouse_char = ' ';
}