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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user