tommcdo / vim-exchange

Easy text exchange operator for Vim
MIT License
756 stars 23 forks source link

Request: Swapping text across different buffers #15

Open svermeulen opened 10 years ago

svermeulen commented 10 years ago

Right now, It appears as though the last area marked for swapping is local to the window, or possibly the buffer. Seems more useful to me to just have one global concept of swapping text.

tommcdo commented 10 years ago

This would be a pretty easy change. I had chosen to use buffer-local exchanges, but I don't really remember the reasons. Looking at it now, I agree that it would be more useful to be able to set exchanges globally.

I'll whip something up shortly.

tommcdo commented 10 years ago

I remember the reasons now; not knowing where the buffer is. It could be hidden, or completely deleted. I'll have to think about this more before I implement anything.

blueyed commented 10 years ago

In case of a hidden or deleted buffer, it might just abort with an error - just like with overlapping text.

tommcdo commented 10 years ago

That seems like a sensible thing to do. I'll try it out when I get some available time.

tommcdo commented 10 years ago

A problem that comes to mind is the use of u after doing an exchange across two buffers.

I hope it's deemed acceptable that only the active buffer will be reverted; to cite some default Vim behaviour, consider the disappointment that arises when u follows dp in diff mode. It's not what the user wanted, but I think meeting the expectations of the user in a situation like this is just beyond reasonable.

blueyed commented 10 years ago

Agreed.