lite-xl / lite-xl-plugins

Plugins for the Lite XL editor
MIT License
369 stars 98 forks source link

eval:selected multi-cursor support #441

Open exelotl opened 4 months ago

exelotl commented 4 months ago

This PR makes it so that if you run eval:selected while having multiple selections, it will evaluate and replace the contents of each, rather than replacing all selections with the first result.

Note: some previous functionality:

if no text is selected, eval the current line and insert the result in the next line with "= " prefix. (https://github.com/lite-xl/lite-xl-plugins/pull/177)

has been removed as it doesn't play nice with multiple selections. Now it behaves as if the whole line had been selected, and replaces the line. Maybe @Titousensei could confirm that this is ok / won't ruin your workflow?