kylechui / nvim-surround

Add/change/delete surrounding delimiter pairs with ease. Written with :heart: in Lua.
MIT License
2.98k stars 60 forks source link

make get_selection optionally accept list #183

Closed ryleelyman closed 1 year ago

ryleelyman commented 1 year ago

I'm working primarily with the LaTeX parser, which for various reasons has multiple node types as possible targets for doing something like implementing change surrounding environment in Lua. Concretely, the text

\begin{SOMETHING}
% yadda yadda
\end{SOMETHING}

will be captured as either generic_environment or math_environment depending on the contents of SOMETHING. Anyway for this reason it would be nice to be able to use the node option to get_selection with multiple arguments; hence the change.

kylechui commented 1 year ago

Thanks for helping out!