@@ -189,6 +189,7 @@ want to create your own complex action, see the |multicursor-api|.
189
189
• mc.addKeymapLayer | multicursor-addKeymapLayer |
190
190
• mc.removeKeymapLayer | multicursor-removeKeymapLayer |
191
191
• mc.action | multicursor-action |
192
+ • mc.onSafeState | multicursor-onSafeState |
192
193
193
194
194
195
mc.addCursor(motion) *multicursor-addCursor*
@@ -228,7 +229,7 @@ mc.toggleCursor() *multicursor-toggleCursor*
228
229
• | multicursor-enableCursors |
229
230
230
231
231
- mc.lineAddCursor(direction) *multicursor-lineAddCursor*
232
+ mc.lineAddCursor(direction, opts?) *multicursor-lineAddCursor*
232
233
Add a cursor above or below the main cursor, skipping empty lines,
233
234
specified by `direction` .
234
235
@@ -243,9 +244,12 @@ mc.lineAddCursor(direction) *multicursor-lineAddCursor*
243
244
Parameters: ~
244
245
• {direction} (`-1 | 1`) when passing in `-1 ` spawn a cursor in the
245
246
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` )
246
250
247
251
248
- mc.lineSkipCursor(direction) *multicursor-lineSkipCursor*
252
+ mc.lineSkipCursor(direction, opts?) *multicursor-lineSkipCursor*
249
253
Move only the main cursor up or down a line, skipping empty lines,
250
254
specified by `direction` .
251
255
@@ -260,6 +264,9 @@ mc.lineSkipCursor(direction) *multicursor-lineSkipCursor*
260
264
Parameters: ~
261
265
• {direction} (`-1 | 1`) when passing in `-1 ` spawn a cursor in the
262
266
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` )
263
270
264
271
265
272
mc.matchAddCursor(direction) *multicursor-matchAddCursor*
@@ -727,6 +734,22 @@ mc.action(func) *multicursor-action*
727
734
• | multicursor-api |
728
735
729
736
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
+
730
753
==============================================================================
731
754
API *multicursor-api*
732
755
0 commit comments