kylechui / nvim-surround

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

Extend move_cursor to support a customize function #281

Closed hulufei closed 1 month ago

hulufei commented 7 months ago

Checklist

Is your feature request related to a problem? Please describe. For example, I added a link surround for markdown files, and I want to jump to the open ( after surrounding, so that I can input link immediately. I thought move_cursor was there for this kind of cases, but it seems limited.

Describe the solution you'd like So, is it a good idea to extend move_cursor to support a customize function to do "post surround" stuffs?

Additional context Add any other context or screenshots about the feature request here.

kylechui commented 7 months ago

I'm not too sure yet; at the very least for your case you can use the add function to auto populate the link from your clipboard, or something similar.

hulufei commented 7 months ago

Thanks for the tip. I can get the link input with get_input(), but it's not as intuitive as input inside (), since we can benifit from autocompletion.

kylechui commented 1 month ago

Currently working on adding move_cursor = "sticky"|"end"; I would need to think harder about a user-defined function since there would need to be some kind of well-defined API.

Edit: Seems like getting every edge case is incredibly hard to do, while also respecting all the operations (CC: @ces42)

kylechui commented 1 month ago

Thanks for the tip. I can get the link input with get_input(), but it's not as intuitive as input inside (), since we can benifit from autocompletion.

Related: #145