feat(options): per-buffer 'busy' status #34493

Problem:
Plugins cannot mark a buffer as "busy".

Solution:
- Add a buffer-local 'busy' option.
- Show a busy indicator in the default 'statusline'.
This commit is contained in:
Shadman
2025-07-07 05:17:06 +06:00
committed by GitHub
parent 6fd2a3040f
commit 5973328eda
10 changed files with 77 additions and 6 deletions

View File

@@ -224,6 +224,7 @@ OPTIONS
• 'pummaxwidth' sets maximum width for the completion popup menu.
• 'winborder' "bold" style.
• |g:clipboard| accepts a string name to force any builtin clipboard tool.
• 'busy' sets a buffer "busy" status. Indicated in the default statusline.
PERFORMANCE
@@ -265,6 +266,7 @@ UI
• Error messages are more concise:
• "Error detected while processing:" changed to "Error in:".
• "Error executing Lua:" changed to "Lua:".
• 'busy' status is shown in default statusline with symbol ◐
VIMSCRIPT

View File

@@ -1217,6 +1217,13 @@ A jump table for the options with a short description can be found at |Q_op|.
without saving. For writing there must be matching |BufWriteCmd|,
|FileWriteCmd| or |FileAppendCmd| autocommands.
*'busy'*
'busy' number (default 0)
local to buffer
Sets a buffer "busy" status. Indicated in the default statusline.
When busy status is larger then 0 busy flag is shown in statusline.
The semantics of "busy" are arbitrary, typically decided by the plugin that owns the buffer.
*'casemap'* *'cmp'*
'casemap' 'cmp' string (default "internal,keepascii")
global
@@ -6184,7 +6191,7 @@ A jump table for the options with a short description can be found at |Q_op|.
an expensive expression can negatively affect render performance.
*'statusline'* *'stl'* *E540* *E542*
'statusline' 'stl' string (default "%<%f %h%w%m%r %=%{% &showcmdloc == 'statusline' ? '%-10.S ' : '' %}%{% exists('b:keymap_name') ? '<'..b:keymap_name..'> ' : '' %}%{% &ruler ? ( &rulerformat == '' ? '%-14.(%l,%c%V%) %P' : &rulerformat ) : '' %}")
'statusline' 'stl' string (default "%<%f %h%w%m%r %=%{% &showcmdloc == 'statusline' ? '%-10.S ' : '' %}%{% exists('b:keymap_name') ? '<'..b:keymap_name..'> ' : '' %}%{% &busy > 0 ? '◐ ' : '' %}%{% &ruler ? ( &rulerformat == '' ? '%-14.(%l,%c%V%) %P' : &rulerformat ) : '' %}")
global or local to window |global-local|
Sets the |status-line|.

View File

@@ -404,6 +404,7 @@ Options:
- 'ttimeout', 'ttimeoutlen' behavior was simplified
- 'winblend' pseudo-transparency in floating windows |api-floatwin|
- 'winhighlight' window-local highlights
- 'busy' busy status for buffers
Performance:
- Signs are implemented using Nvim's internal "marktree" (btree) structure.

View File

@@ -664,6 +664,14 @@ vim.o.bt = vim.o.buftype
vim.bo.buftype = vim.o.buftype
vim.bo.bt = vim.bo.buftype
--- Sets a buffer "busy" status. Indicated in the default statusline.
--- When busy status is larger then 0 busy flag is shown in statusline.
--- The semantics of "busy" are arbitrary, typically decided by the plugin that owns the buffer.
---
--- @type integer
vim.o.busy = 0
vim.bo.busy = vim.o.busy
--- Specifies details about changing the case of letters. It may contain
--- these words, separated by a comma:
--- internal Use internal case mapping functions, the current
@@ -6853,7 +6861,7 @@ vim.wo.stc = vim.wo.statuscolumn
---
---
--- @type string
vim.o.statusline = "%<%f %h%w%m%r %=%{% &showcmdloc == 'statusline' ? '%-10.S ' : '' %}%{% exists('b:keymap_name') ? '<'..b:keymap_name..'> ' : '' %}%{% &ruler ? ( &rulerformat == '' ? '%-14.(%l,%c%V%) %P' : &rulerformat ) : '' %}"
vim.o.statusline = "%<%f %h%w%m%r %=%{% &showcmdloc == 'statusline' ? '%-10.S ' : '' %}%{% exists('b:keymap_name') ? '<'..b:keymap_name..'> ' : '' %}%{% &busy > 0 ? '◐ ' : '' %}%{% &ruler ? ( &rulerformat == '' ? '%-14.(%l,%c%V%) %P' : &rulerformat ) : '' %}"
vim.o.stl = vim.o.statusline
vim.wo.statusline = vim.o.statusline
vim.wo.stl = vim.wo.statusline