From 5973328edaedb04425e2f6cb63b2efab4aeb5fcb Mon Sep 17 00:00:00 2001 From: Shadman Date: Mon, 7 Jul 2025 05:17:06 +0600 Subject: 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'. --- src/nvim/options.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nvim/options.lua') diff --git a/src/nvim/options.lua b/src/nvim/options.lua index bc21674204..d320e0928a 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -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 = [=[ -- cgit