feat(options): add 'winpinned' to pin a window #39157

Problem:
- Unable to "pin" a window to prevent closing without specifically
  being targeted.
- :fclose closes hidden windows (even before visible windows).

Solution:
- Add 'winpinned' window-local option. When set, window is skipped by
  :fclose and :only. Pin the ui2 cmdline window (which should always be
  visible), so that it is not closed by :only/fclose.
- Skip over hidden (and pinned) windows with :fclose.

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
luukvbaal
2026-04-20 02:36:55 +02:00
committed by GitHub
parent 5f6abd34f5
commit fe986e5dd0
14 changed files with 88 additions and 9 deletions

View File

@@ -128,6 +128,7 @@ local options_list = {
{ 'winfixwidth', N_ 'keep the width of the window' },
{ 'winwidth', N_ 'minimal number of columns used for the current window' },
{ 'winminwidth', N_ 'minimal number of columns used for any window' },
{ 'winpinned', N_ 'prevent closing window with :only and :fclose' },
{ 'helpheight', N_ 'initial height of the help window' },
{ 'previewheight', N_ 'default height for the preview window' },
{ 'previewwindow', N_ 'identifies the preview window' },