]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
press <Esc> to close popup window
authorSong-Tianxiang <149415622+Song-Tianxiang@users.noreply.github.com>
Wed, 17 Jan 2024 02:09:53 +0000 (10:09 +0800)
committerGitHub <noreply@github.com>
Wed, 17 Jan 2024 02:09:53 +0000 (10:09 +0800)
The default way uses <C-c> to close the popup window, the escape key is added to also close the popup window.

autoload/lsp/hover.vim

index 1aaddf90085f9898f5d3d45a7d0a031db1448bf8..485fdd3af3fe25f5253340f9e2399f95f558abc2 100644 (file)
@@ -90,6 +90,11 @@ def HoverWinFilterKey(hoverWin: number, key: string): bool
     keyHandled = true
   endif
 
+  if key == "\<Esc>"
+    hoverWin->popup_close()
+    keyHandled = true
+  endif
+
   return keyHandled
 enddef