vim-exchange icon indicating copy to clipboard operation
vim-exchange copied to clipboard

Request: Swapping text across different buffers

Open svermeulen opened this issue 11 years ago • 6 comments

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.

svermeulen avatar Dec 25 '13 01:12 svermeulen

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 avatar Dec 25 '13 02:12 tommcdo

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.

tommcdo avatar Dec 25 '13 02:12 tommcdo

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

blueyed avatar Jan 29 '14 03:01 blueyed

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

tommcdo avatar Jan 29 '14 12:01 tommcdo

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.

tommcdo avatar Jan 29 '14 18:01 tommcdo

Agreed.

blueyed avatar Jan 29 '14 21:01 blueyed