mirror of
https://github.com/neovim/neovim.git
synced 2026-05-05 13:35:02 +00:00
fix(mouse): mouseclick after conceal_lines is miscalculated #33451
Problem: Computed buffer line for mouse position does not take into
account concealed lines on the reached row.
Solution: Adjust for concealed lines at the end of the loop computing
the buffer position.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "nvim/buffer_defs.h"
|
||||
#include "nvim/charset.h"
|
||||
#include "nvim/cursor.h"
|
||||
#include "nvim/decoration.h"
|
||||
#include "nvim/drawscreen.h"
|
||||
#include "nvim/edit.h"
|
||||
#include "nvim/eval.h"
|
||||
@@ -1659,6 +1660,12 @@ bool mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump)
|
||||
lnum++;
|
||||
}
|
||||
|
||||
// Mouse row reached, adjust lnum for concealed lines.
|
||||
while (decor_conceal_line(win, lnum - 1, false)) {
|
||||
lnum++;
|
||||
hasFolding(win, lnum, NULL, &lnum);
|
||||
}
|
||||
|
||||
if (!retval) {
|
||||
// Compute the column without wrapping.
|
||||
int off = win_col_off(win) - win_col_off2(win);
|
||||
|
||||
Reference in New Issue
Block a user