diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-04-26 01:55:00 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-02 13:11:26 +0200 |
commit | be11f80d018797b514ed7d01cde2e4c8f88cc8d2 (patch) | |
tree | e239d828751a6cef04b7906b515e8303891110a5 /src/nvim/drawline.c | |
parent | fba18a3b62310f4535d979a05288101b9af2ef50 (diff) | |
download | rneovim-be11f80d018797b514ed7d01cde2e4c8f88cc8d2.tar.gz rneovim-be11f80d018797b514ed7d01cde2e4c8f88cc8d2.tar.bz2 rneovim-be11f80d018797b514ed7d01cde2e4c8f88cc8d2.zip |
vim-patch:9.0.0640: cannot scroll by screen line if a line wraps
Problem: Cannot scroll by screen line if a line wraps.
Solution: Add the 'smoothscroll' option. Only works for CTRL-E and CTRL-Y
so far.
https://github.com/vim/vim/commit/f6196f424474e2a9c160f2a995fc2691f82b58f9
vim-patch:9.0.0641: missing part of the new option code
Problem: Missing part of the new option code.
Solution: Add missing WV_SMS.
https://github.com/vim/vim/commit/bbbda8fd81f6d720962b67ae885825bad9be4456
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r-- | src/nvim/drawline.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 9c6b5c3b8c..1112bf0463 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -607,7 +607,7 @@ static void handle_lnum_col(win_T *wp, winlinevars_T *wlv, int num_signs, int si // Draw the line number (empty space after wrapping). if (wlv->row == wlv->startrow + wlv->filler_lines) { get_line_number_str(wp, wlv->lnum, wlv->extra, sizeof(wlv->extra)); - if (wp->w_skipcol > 0) { + if (wp->w_skipcol > 0 && wlv->startrow == 0) { for (wlv->p_extra = wlv->extra; *wlv->p_extra == ' '; wlv->p_extra++) { *wlv->p_extra = '-'; } @@ -754,7 +754,7 @@ static void handle_breakindent(win_T *wp, winlinevars_T *wlv) wlv->n_extra = 0; } } - if (wp->w_skipcol > 0 && wp->w_p_wrap && wp->w_briopt_sbr) { + if (wp->w_skipcol > 0 && wlv->startrow == 0 && wp->w_p_wrap && wp->w_briopt_sbr) { wlv->need_showbreak = false; } // Correct end of highlighted area for 'breakindent', @@ -804,7 +804,7 @@ static void handle_showbreak_and_filler(win_T *wp, winlinevars_T *wlv) wlv->c_final = NUL; wlv->n_extra = (int)strlen(sbr); wlv->char_attr = win_hl_attr(wp, HLF_AT); - if (wp->w_skipcol == 0 || !wp->w_p_wrap) { + if ((wp->w_skipcol == 0 && wlv->startrow == 0) || !wp->w_p_wrap) { wlv->need_showbreak = false; } wlv->vcol_sbr = wlv->vcol + mb_charlen(sbr); @@ -1379,7 +1379,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange, // 'nowrap' or 'wrap' and a single line that doesn't fit: Advance to the // first character to be displayed. if (wp->w_p_wrap) { - v = wp->w_skipcol; + v = startrow == 0 ? wp->w_skipcol : 0; } else { v = wp->w_leftcol; } @@ -2595,7 +2595,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange, if (c == NUL) { // Highlight 'cursorcolumn' & 'colorcolumn' past end of the line. if (wp->w_p_wrap) { - v = wp->w_skipcol; + v = wlv.startrow == 0 ? wp->w_skipcol : 0; } else { v = wp->w_leftcol; } |