nvim-surround icon indicating copy to clipboard operation
nvim-surround copied to clipboard

Extend move_cursor to support a customize function

Open hulufei opened this issue 1 year ago • 2 comments

Checklist

  • [x] Have you read through :h nvim-surround to see if there might be any relevant information there?

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.

hulufei avatar Nov 16 '23 05:11 hulufei

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.

kylechui avatar Nov 16 '23 06:11 kylechui

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.

hulufei avatar Nov 16 '23 09:11 hulufei

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 avatar Jun 05 '24 15:06 kylechui

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

kylechui avatar Jun 08 '24 21:06 kylechui