Skip to content

Commit 6fba38b

Browse files
committed
doc
1 parent 9eedebd commit 6fba38b

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

doc/multicursor.txt

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ want to create your own complex action, see the |multicursor-api|.
189189
• mc.addKeymapLayer |multicursor-addKeymapLayer|
190190
• mc.removeKeymapLayer |multicursor-removeKeymapLayer|
191191
• mc.action |multicursor-action|
192+
• mc.onSafeState |multicursor-onSafeState|
192193

193194

194195
mc.addCursor(motion) *multicursor-addCursor*
@@ -228,7 +229,7 @@ mc.toggleCursor() *multicursor-toggleCursor*
228229
|multicursor-enableCursors|
229230

230231

231-
mc.lineAddCursor(direction) *multicursor-lineAddCursor*
232+
mc.lineAddCursor(direction, opts?) *multicursor-lineAddCursor*
232233
Add a cursor above or below the main cursor, skipping empty lines,
233234
specified by `direction`.
234235

@@ -243,9 +244,12 @@ mc.lineAddCursor(direction) *multicursor-lineAddCursor*
243244
Parameters: ~
244245
{direction} (`-1 | 1`) when passing in `-1` spawn a cursor in the
245246
previous line, while `1` spawn in the next line
247+
• {opts?} (`table?`) options
248+
• {opts.skipEmpty?} (`boolean?`) Whether lines shorter than cursor
249+
column should be skipped (default `true`)
246250

247251

248-
mc.lineSkipCursor(direction) *multicursor-lineSkipCursor*
252+
mc.lineSkipCursor(direction, opts?) *multicursor-lineSkipCursor*
249253
Move only the main cursor up or down a line, skipping empty lines,
250254
specified by `direction`.
251255

@@ -260,6 +264,9 @@ mc.lineSkipCursor(direction) *multicursor-lineSkipCursor*
260264
Parameters: ~
261265
{direction} (`-1 | 1`) when passing in `-1` spawn a cursor in the
262266
previous line, while `1` spawn in the next line
267+
• {opts?} (`table?`) options
268+
• {opts.skipEmpty?} (`boolean?`) Whether lines shorter than cursor
269+
column should be skipped (default `true`)
263270

264271

265272
mc.matchAddCursor(direction) *multicursor-matchAddCursor*
@@ -727,6 +734,22 @@ mc.action(func) *multicursor-action*
727734
|multicursor-api|
728735

729736

737+
mc.onSafeState(func, opts?) *multicursor-onSafeState*
738+
Execute callback upon reaching multicursor safestate.
739+
740+
Usage example: >lua
741+
mc.onSafeState(function(details)
742+
if details.wasMode ~= vim.fn.mode() then
743+
print("mode changed!")
744+
end
745+
end)
746+
<
747+
Parameters: ~
748+
{func} (`function`) function to execute on safe state.
749+
• {opts?} (`table?`) options
750+
• {opts.once?} (`boolean?`) only call func for a single safestate.
751+
752+
730753
==============================================================================
731754
API *multicursor-api*
732755

0 commit comments

Comments
 (0)