diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-21 17:37:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-21 17:37:15 +0800 |
commit | 4a1fb37108bd8e53391c2ea4dbbe83bcfd6d3ee5 (patch) | |
tree | 1706f91d9fc563870a0843830ba0323ba35551af /src | |
parent | 8cd0ca1ce742a09df0b1b8201aaa13655d922b6c (diff) | |
parent | 6bdfb890fd26408408e85b5e0ea4a1fbeb8b048d (diff) | |
download | rneovim-4a1fb37108bd8e53391c2ea4dbbe83bcfd6d3ee5.tar.gz rneovim-4a1fb37108bd8e53391c2ea4dbbe83bcfd6d3ee5.tar.bz2 rneovim-4a1fb37108bd8e53391c2ea4dbbe83bcfd6d3ee5.zip |
Merge pull request #24820 from zeertzjq/vim-589edb340454
vim-patch:589edb340454,e46a44050562
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.lua | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index e786901c2f..f6ccc803c0 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -4012,7 +4012,7 @@ M.funcs = { }, getmousepos = { desc = [=[ - 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 @@ -8296,7 +8296,7 @@ M.funcs = { args = 2, base = 1, desc = [=[ - 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. @@ -8511,7 +8511,7 @@ M.funcs = { 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 ~ @@ -8593,7 +8593,7 @@ M.funcs = { " 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. @@ -10460,28 +10460,30 @@ M.funcs = { 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, e.g. after |d| + a Insert mode autocomplete active + x executing an autocommand + 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 ]=], fast = true, name = 'state', |