diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-07 07:21:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-07 07:21:12 +0800 |
commit | 36941942d60915d9f78defd6aaf713a27952e16a (patch) | |
tree | cb3c9ab9d44b4822e8b9328009243e9f3e2c4237 /src | |
parent | 06c4edf46bf65ec6b540de355cf1a691533f1df9 (diff) | |
download | rneovim-36941942d60915d9f78defd6aaf713a27952e16a.tar.gz rneovim-36941942d60915d9f78defd6aaf713a27952e16a.tar.bz2 rneovim-36941942d60915d9f78defd6aaf713a27952e16a.zip |
fix(drawline): inline virt_text hl_mode inside syntax/extmark hl (#24273)
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/drawline.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 029a89f109..9bfe2da214 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -1114,10 +1114,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl bool area_highlighting = false; // Visual or incsearch highlighting in this line int vi_attr = 0; // attributes for Visual and incsearch highlighting int area_attr = 0; // attributes desired by highlighting - int saved_area_attr = 0; // idem for area_attr int search_attr = 0; // attributes desired by 'hlsearch' - int saved_search_attr = 0; // search_attr to be used when n_extra - // goes to zero int vcol_save_attr = 0; // saved attr for 'cursorcolumn' int decor_attr = 0; // attributes desired by syntax and extmarks bool has_syntax = false; // this buffer has syntax highl. @@ -1150,8 +1147,13 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl int prev_c1 = 0; // first composing char for prev_c bool search_attr_from_match = false; // if search_attr is from :match - bool saved_search_attr_from_match = false; // if search_attr is from :match bool has_decor = false; // this buffer has decoration + + int saved_search_attr = 0; // search_attr to be used when n_extra goes to zero + int saved_area_attr = 0; // idem for area_attr + int saved_decor_attr = 0; // idem for decor_attr + bool saved_search_attr_from_match = false; + int win_col_offset = 0; // offset for window columns char buf_fold[FOLD_TEXT_LEN]; // Hold value returned by get_foldtext @@ -1836,11 +1838,12 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl // TODO(bfredl): this is ugly as fuck. look if we can do this some other way. saved_search_attr = search_attr; saved_area_attr = area_attr; + saved_decor_attr = decor_attr; saved_search_attr_from_match = search_attr_from_match; - search_attr_from_match = false; search_attr = 0; area_attr = 0; - extmark_attr = 0; + decor_attr = 0; + search_attr_from_match = false; n_skip = 0; } } @@ -2014,6 +2017,9 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl if (area_attr == 0 && *ptr != NUL) { area_attr = saved_area_attr; } + if (decor_attr == 0) { + decor_attr = saved_decor_attr; + } if (wlv.extra_for_extmark) { // wlv.extra_attr should be used at this position but not |