0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.3122: with 'nowrap' cursor position is unexected in narrow window

Problem:    With 'nowrap' cursor position is unexected in narrow window.
            (Leonid V.  Fedorenchik)
Solution:   Put cursor on the last non-empty line. (closes #8525)
This commit is contained in:
Bram Moolenaar
2021-07-08 13:19:31 +02:00
parent 41fb723ee9
commit 30441bb3d5
5 changed files with 33 additions and 1 deletions

View File

@@ -993,8 +993,12 @@ curs_columns(
if (textwidth <= 0)
{
// No room for text, put cursor in last char of window.
// If not wrapping, the last non-empty line.
curwin->w_wcol = curwin->w_width - 1;
curwin->w_wrow = curwin->w_height - 1;
if (curwin->w_p_wrap)
curwin->w_wrow = curwin->w_height - 1;
else
curwin->w_wrow = curwin->w_height - 1 - curwin->w_empty_rows;
}
else if (curwin->w_p_wrap && curwin->w_width != 0)
{