]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1413: spurious CursorHold triggered in GUI on startup v9.1.1413
authorGary Johnson <garyjohn@spocom.com>
Mon, 26 May 2025 18:10:25 +0000 (20:10 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 26 May 2025 18:10:25 +0000 (20:10 +0200)
commit318ff9c3627f595905064d11b0d66b63bfe89ff1
tree8e01c4ce8cf784d94abfa680caf299d9854f7b97
parenta004e5108c5620e9f831f96d2c584ba4d675b22b
patch 9.1.1413: spurious CursorHold triggered in GUI on startup

Problem:  spurious CursorHold triggered in GUI on startup
Solution: init global did_cursorhold flag to true
          (Gary Johnson)

When Vim is started in GUI mode, the CursorHold autocommand event is
triggered 'updatetime' milliseconds later, even when the user has not
pressed a key.  This is different from the behavior of Vim in terminal
mode, which does not trigger a CursorHold autocommand event at startup,
and contradicts the description of the CursorHold event in ":help
CursorHold", which states that the event is "[n]ot triggered until the
user has pressed a key".

The fix is to change the initial value of did_cursorhold from FALSE to
TRUE.  While it is true that the CursorDone event has not been done yet
at startup, it should appear to have been done until the user presses
a key.

fixes #17350
closes: #17382

Signed-off-by: Gary Johnson <garyjohn@spocom.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/globals.h
src/testdir/test_gui.vim
src/version.c