add NewCursor binding for lua plugins
This adds a binding to the NewCursor function for use in lua plugins.
Just moved it.
Still, what about my question https://github.com/zyedidia/micro/issues/2920#issuecomment-1753917310?
I.e. isn't NewCursor() too low-level a detail to be exposed to plugins? Perhaps the needed functionality can be already achieved from Lua with existing BufPane methods like SpawnMultiCursor()? Or if those methods are not quite suitable since they do "too much", perhaps we should just add a new simple method to BufPane or to Buffer, which would, roughly speaking, just do NewCursor() + AddCursor() + MergeCursors() and nothing else?
Hi,
I would like to see three changes in multicursor behavior:
- Make multiple text selections, each with a cursor:
- Ctrl+Left+Click+Drag - Region
- Ctrl+DoubleClick - Word
- Ctrl+TripleClick - Line
- New actions ( see https://github.com/zyedidia/micro/issues/2920)
- SpawnMultiCursorAll - Search with current selection or current word, and select all for editing.
- SpawnMultiCursorFound - Select/edit all matches for last find, allows literal or regex searches. NB. Using the search facility will allow easy highlighting or scrolling to review all the selections before editing.
- Merge contiguous cursors on the same line
- Delete selections before any editing
SciTE does 1+3 for an example of functionality.
Kind Regards Gavin Holt
With #3441 merged, cursors can now be added via bp:SpawnCursorAtLoc() instead.