diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-01-14 19:50:30 +0100 |
---|---|---|
committer | Matthieu Coudron <mattator@gmail.com> | 2020-02-29 20:27:22 +0100 |
commit | 1a2be57da3f7e33af4e4eb3e0d36569feea71253 (patch) | |
tree | e38b97171e9539644e2be9eb36f02f17be2d13ee /src/nvim/mouse.c | |
parent | 49cd750d6a72efc0571a89d7a874bbb01081227f (diff) | |
download | rneovim-1a2be57da3f7e33af4e4eb3e0d36569feea71253.tar.gz rneovim-1a2be57da3f7e33af4e4eb3e0d36569feea71253.tar.bz2 rneovim-1a2be57da3f7e33af4e4eb3e0d36569feea71253.zip |
foldcolumn: allow auto:X
Similar to signcolumn, allow foldcolumn to adapt itself to the number of
folds.
Regression:
vim supports a maximum fdc of 12, this limits it to 9.
Diffstat (limited to 'src/nvim/mouse.c')
-rw-r--r-- | src/nvim/mouse.c | 11 |
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 = ' '; } |