mizlan/iswap.nvim

Feature: in `iswap_with`, if only one other option, just directly swap

Closed this issue · 9 comments

As the title says. Technically the first/only other option is always going to be a (or the first configured hint key), but we can still cut it out i think.

I've been thinking about this. How about automatically swapping in general when there are only two items?

If we're going further we could also not show the hints if you do iswap when there is just one argument/thing to swap

I like the "autoswap" idea more. I'll work on that.

Try it out with setup { ... autoswap = true} (see README). Should work now.

I think you have left some debug prints in iswap_with? it seems the ranges to be swapped are getting printed. Otherwise it works perfectly

Are you referring to seeing this?

err('not on a node!', 1)

This one is purposely meant to be seen by the user. (I should probably word it to something more end-user-friendly). If you're seeing another message other than this, do you have debug = true in your setup() function? Otherwise those messages shouldn't show.

image

I get something like this everytime i do :ISwapWith

image

The number of lines printed is proportional to the number of options to swap

Wow, that is embarrassing. Should be fixed now!