patch 9.1.1562: close button always visible in the 'tabline'

Problem:  close button "X" is visible in the non-GUI 'tabline', even
          when the mouse is disabled
Solution: only show the button when 'mouse' contains any of the flags
          "anvi" (Girish Palya)

The tabline always displays an "X" (close) button, and the info popup
shows both a close button and a resize handle—even when the mouse is
disabled. These UI elements are only actionable with the mouse and serve
no purpose for keyboard users who disable the mouse. Displaying
non-functional, clickable elements in a non-GUI environment is
misleading and adds unnecessary visual clutter.

So remove the close button and resize handle when the mouse is disabled.
They appear again when mouse is enabled.

closes: #17765

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Girish Palya
2025-07-17 21:56:16 +02:00
committed by Christian Brabandt
parent b7fc24d3a3
commit fb45809f01
11 changed files with 112 additions and 12 deletions

View File

@ -1,4 +1,4 @@
*tabpage.txt* For Vim version 9.1. Last change: 2025 Jul 01
*tabpage.txt* For Vim version 9.1. Last change: 2025 Jul 17
VIM REFERENCE MANUAL by Bram Moolenaar
@ -363,6 +363,9 @@ A "+" will be shown for a tab page that has a modified window. The number of
windows in a tabpage is also shown. Thus "3+" means three windows and one of
them has a modified buffer.
An "X" (close button) will appear in the last column when multiple tabs are
open, but only if the 'mouse' is enabled.
The 'tabline' option allows you to define your preferred way to tab pages
labels. This isn't easy, thus an example will be given here.