]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.0768: MS-Windows: incorrect cursor position when restoring screen v9.1.0768
authorWilliam Bresler <wbresler@gmail.com>
Tue, 8 Oct 2024 19:30:48 +0000 (21:30 +0200)
committerChristian Brabandt <cb@256bit.org>
Tue, 8 Oct 2024 19:42:46 +0000 (21:42 +0200)
commitded59139fde2ba509abbe97f2f23b54080ed59f2
treee7e21757511b33638459413184b97daf89238f23
parent830a802f9176ad38f115c18015987a871c99f3a4
patch 9.1.0768: MS-Windows: incorrect cursor position when restoring screen

Problem:  MS-Windows: incorrect cursor position when restoring screen
          (after v9.1.0664)
Solution: Restore the VTP command for switching screens back to
          termcap_mode_end() (William Bresler)

Patch 9.1.0664 moved the VTP command for switching back to the main
screen buffer from termcap_mode_end() to mch_exit_c().  However, the
saved cursor position from the main screen continued to be restored
in termcap_mode_end().  This failed if the cursor position was beyond
the console window height, since the alternate screen buffer is always
the same size as the console window.

This patch restores the VTP command for switching back to the main
screen buffer to termcap_mode_end().  In order to preserve the effect
of patch 9.1.0664, the VTP command for switching back to the main
screen buffer in mch_exit_c() is issued only if termcap mode was not
active while exiting Vim.

See issue 15775 for a fuller description, with screen shots of the
problem.

fixes: #15775
closes: #15829

Signed-off-by: William Bresler <wbresler@gmail.com>
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/os_win32.c
src/version.c