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)
diff --git a/src/testdir/test_listchars.vim b/src/testdir/test_listchars.vim
index 7068be7..160d247 100644
--- a/src/testdir/test_listchars.vim
+++ b/src/testdir/test_listchars.vim
@@ -381,6 +381,12 @@
   call VerifyScreenDump(buf, 'Test_listchars_04', {})
   call term_sendkeys(buf, "\<C-W>>")
   call VerifyScreenDump(buf, 'Test_listchars_05', {})
+  call term_sendkeys(buf, "\<C-W>h")
+  call term_sendkeys(buf, ":set nowrap foldcolumn=4\<CR>")
+  call term_sendkeys(buf, "15\<C-W><")
+  call VerifyScreenDump(buf, 'Test_listchars_06', {})
+  call term_sendkeys(buf, "4\<C-W><")
+  call VerifyScreenDump(buf, 'Test_listchars_07', {})
 
   " clean up
   call StopVimInTerminal(buf)