From b90818867c089d4987f1a48ee3666674826d6f4b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 9 Jul 2022 04:56:24 +0100 Subject: patch 9.0.0048: cursor in wrong column with mouse click after concealed text Problem: Cursor in wrong column with mouse click after concealed text. Solution: Store the text column when drawing text. --- src/globals.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/globals.h') diff --git a/src/globals.h b/src/globals.h index 6f2a1a5cd5..786c850d3c 100644 --- a/src/globals.h +++ b/src/globals.h @@ -32,15 +32,17 @@ EXTERN long Columns INIT(= 80); // nr of columns in the screen * The characters that are currently on the screen are kept in ScreenLines[]. * It is a single block of characters, the size of the screen plus one line. * The attributes for those characters are kept in ScreenAttrs[]. + * The byte offset in the line is kept in ScreenCols[]. * * "LineOffset[n]" is the offset from ScreenLines[] for the start of line 'n'. - * The same value is used for ScreenLinesUC[] and ScreenAttrs[]. + * The same value is used for ScreenLinesUC[], ScreenAttrs[] and ScreenCols[]. * * Note: before the screen is initialized and when out of memory these can be * NULL. */ EXTERN schar_T *ScreenLines INIT(= NULL); EXTERN sattr_T *ScreenAttrs INIT(= NULL); +EXTERN colnr_T *ScreenCols INIT(= NULL); EXTERN unsigned *LineOffset INIT(= NULL); EXTERN char_u *LineWraps INIT(= NULL); // line wraps to next line @@ -62,7 +64,7 @@ EXTERN int Screen_mco INIT(= 0); // value of p_mco used when EXTERN schar_T *ScreenLines2 INIT(= NULL); /* - * Buffer for one screen line (characters and attributes). + * One screen line to be displayed. Points into ScreenLines. */ EXTERN schar_T *current_ScreenLine INIT(= NULL); -- cgit v1.2.3