From 0f48173ab531a9012321714bbc29ae4cd57b7ac7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 17:09:31 +0800 Subject: vim-patch:589edb340454 Updte runtime files https://github.com/vim/vim/commit/589edb340454e7f1b19358f129287a636d53d0e1 Co-authored-by: Bram Moolenaar --- runtime/doc/builtin.txt | 33 ++++++++++++++++++--------------- runtime/lua/vim/_meta/vimfn.lua | 21 ++++++++++++--------- 2 files changed, 30 insertions(+), 24 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 2ce66d8cc2..af7bcf4392 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -7374,28 +7374,31 @@ state([{what}]) *state()* current state. Mostly useful in callbacks that want to do work that may not always be safe. Roughly this works like: - callback uses state() to check if work is safe to do. - If yes, then do it right away. - Otherwise add to work queue and add SafeState autocommand. - - When SafeState is triggered, check with state() if the work - can be done now, and if yes remove it from the queue and - execute. + Yes: then do it right away. + No: add to work queue and add a |SafeState| autocommand. + - When SafeState is triggered and executes your autocommand, + check with `state()` if the work can be done now, and if yes + remove it from the queue and execute. + Remove the autocommand if the queue is now empty. Also see |mode()|. When {what} is given only characters in this string will be added. E.g, this checks if the screen has scrolled: >vim - if state('s') != '' + if state('s') == '' + " screen has not scrolled These characters indicate the state, generally indicating that something is busy: - m halfway a mapping, :normal command, feedkeys() or - stuffed command - o operator pending or waiting for a command argument - a Insert mode autocomplete active - x executing an autocommand - S not triggering SafeState - c callback invoked, including timer (repeats for - recursiveness up to "ccc") - s screen has scrolled for messages + m halfway a mapping, :normal command, feedkeys() or + stuffed command + o operator pending or waiting for a command argument, + e.g. after |f| + a Insert mode autocomplete active + x executing an autocommand + S not triggering SafeState + c callback invoked, including timer (repeats for + recursiveness up to "ccc") + s screen has scrolled for messages stdioopen({opts}) *stdioopen()* With |--headless| this opens stdin and stdout as a |channel|. diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 70d1aa4a79..86d3dd21a1 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -8749,27 +8749,30 @@ function vim.fn.srand(expr) end --- current state. Mostly useful in callbacks that want to do --- work that may not always be safe. Roughly this works like: --- - callback uses state() to check if work is safe to do. ---- If yes, then do it right away. ---- Otherwise add to work queue and add SafeState autocommand. ---- - When SafeState is triggered, check with state() if the work ---- can be done now, and if yes remove it from the queue and ---- execute. +--- Yes: then do it right away. +--- No: add to work queue and add a |SafeState| autocommand. +--- - When SafeState is triggered and executes your autocommand, +--- check with `state()` if the work can be done now, and if yes +--- remove it from the queue and execute. +--- Remove the autocommand if the queue is now empty. --- Also see |mode()|. --- --- When {what} is given only characters in this string will be --- added. E.g, this checks if the screen has scrolled: >vim ---- if state('s') != '' +--- if state('s') == '' +--- " screen has not scrolled --- --- These characters indicate the state, generally indicating that --- something is busy: --- m halfway a mapping, :normal command, feedkeys() or ---- stuffed command ---- o operator pending or waiting for a command argument +--- stuffed command +--- o operator pending or waiting for a command argument, +--- e.g. after |f| --- a Insert mode autocomplete active --- x executing an autocommand --- S not triggering SafeState --- c callback invoked, including timer (repeats for ---- recursiveness up to "ccc") +--- recursiveness up to "ccc") --- s screen has scrolled for messages --- --- @param what? string -- cgit From 6bdfb890fd26408408e85b5e0ea4a1fbeb8b048d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 17:18:10 +0800 Subject: vim-patch:e46a44050562 Runtime file updates https://github.com/vim/vim/commit/e46a4405056276b4cbdacee76b11f85c8ea1830b Co-authored-by: Bram Moolenaar --- runtime/doc/builtin.txt | 13 ++++++------- runtime/lua/vim/_meta/vimfn.lua | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index af7bcf4392..079052b658 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -2662,7 +2662,7 @@ getmatches([{win}]) *getmatches()* < getmousepos() *getmousepos()* - Returns a Dictionary with the last known position of the + Returns a |Dictionary| with the last known position of the mouse. This can be used in a mapping for a mouse click. The items are: screenrow screen row @@ -5741,7 +5741,7 @@ screenchar({row}, {col}) *screenchar()* Returns -1 when row or col is out of range. screenchars({row}, {col}) *screenchars()* - The result is a List of Numbers. The first number is the same + The result is a |List| of Numbers. The first number is the same as what |screenchar()| returns. Further numbers are composing characters on top of the base character. This is mainly to be used for testing. @@ -5908,7 +5908,7 @@ searchcount([{options}]) *searchcount()* without the "S" flag in 'shortmess'. This works even if 'shortmess' does contain the "S" flag. - This returns a Dictionary. The dictionary is empty if the + This returns a |Dictionary|. The dictionary is empty if the previous pattern was not set and "pattern" was not specified. key type meaning ~ @@ -5990,7 +5990,7 @@ searchcount([{options}]) *searchcount()* " search again call searchcount() < - {options} must be a Dictionary. It can contain: + {options} must be a |Dictionary|. It can contain: key type meaning ~ recompute |Boolean| if |TRUE|, recompute the count like |n| or |N| was executed. @@ -7391,11 +7391,10 @@ state([{what}]) *state()* something is busy: m halfway a mapping, :normal command, feedkeys() or stuffed command - o operator pending or waiting for a command argument, - e.g. after |f| + o operator pending, e.g. after |d| a Insert mode autocomplete active x executing an autocommand - S not triggering SafeState + S not triggering SafeState, e.g. after |f| or a count c callback invoked, including timer (repeats for recursiveness up to "ccc") s screen has scrolled for messages diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index 86d3dd21a1..e393844724 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -3230,7 +3230,7 @@ function vim.fn.getmarklist(buf) end --- @return any function vim.fn.getmatches(win) end ---- Returns a Dictionary with the last known position of the +--- Returns a |Dictionary| with the last known position of the --- mouse. This can be used in a mapping for a mouse click. The --- items are: --- screenrow screen row @@ -6878,7 +6878,7 @@ function vim.fn.screenattr(row, col) end --- @return any function vim.fn.screenchar(row, col) end ---- The result is a List of Numbers. The first number is the same +--- The result is a |List| of Numbers. The first number is the same --- as what |screenchar()| returns. Further numbers are --- composing characters on top of the base character. --- This is mainly to be used for testing. @@ -7069,7 +7069,7 @@ function vim.fn.search(pattern, flags, stopline, timeout, skip) end --- without the "S" flag in 'shortmess'. This works even if --- 'shortmess' does contain the "S" flag. --- ---- This returns a Dictionary. The dictionary is empty if the +--- This returns a |Dictionary|. The dictionary is empty if the --- previous pattern was not set and "pattern" was not specified. --- --- key type meaning ~ @@ -7151,7 +7151,7 @@ function vim.fn.search(pattern, flags, stopline, timeout, skip) end --- " search again --- call searchcount() --- < ---- {options} must be a Dictionary. It can contain: +--- {options} must be a |Dictionary|. It can contain: --- key type meaning ~ --- recompute |Boolean| if |TRUE|, recompute the count --- like |n| or |N| was executed. @@ -8766,11 +8766,10 @@ function vim.fn.srand(expr) end --- something is busy: --- m halfway a mapping, :normal command, feedkeys() or --- stuffed command ---- o operator pending or waiting for a command argument, ---- e.g. after |f| +--- o operator pending, e.g. after |d| --- a Insert mode autocomplete active --- x executing an autocommand ---- S not triggering SafeState +--- S not triggering SafeState, e.g. after |f| or a count --- c callback invoked, including timer (repeats for --- recursiveness up to "ccc") --- s screen has scrolled for messages -- cgit