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

@@ -950,6 +950,21 @@ local options = {
type = 'string',
varname = 'p_bt',
},
{
defaults = 0,
desc = [=[
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.
]=],
full_name = 'busy',
redraw = { 'statuslines' },
noglob = true,
scope = { 'buf' },
short_desc = N_('buffer is busy'),
type = 'number',
varname = 'p_busy',
},
{
abbreviation = 'cmp',
defaults = 'internal,keepascii',
@@ -8640,6 +8655,7 @@ local options = {
'%=',
"%{% &showcmdloc == 'statusline' ? '%-10.S ' : '' %}",
"%{% exists('b:keymap_name') ? '<'..b:keymap_name..'> ' : '' %}",
"%{% &busy > 0 ? '◐ ' : '' %}",
"%{% &ruler ? ( &rulerformat == '' ? '%-14.(%l,%c%V%) %P' : &rulerformat ) : '' %}",
}),
desc = [=[