1

Re: Behaviour of "Backwards range given, swap?" dialog

One minor annoyance is that if I have made a visual-line selection from bottom-to-top, and then decide to abandon the edit by pressing <Esc>, I get the backward range given dialog to confirm that I want to swap the range before doing... well, nothing (except returning to normal mode).

I'd love an additional setting in the ViEmu for Visual Studio settings to "always swap backward ranges," because I often find myself selecting bottom-to-top in visual-line mode, and I've never clicked "no" in that dialog.

Alternatively, a visual-line selection could always translate into a forward range, regardless of how the user created the selection, unless there is some utility in a backward range that I have not considered.

2

Re: Behaviour of "Backwards range given, swap?" dialog

Jay, I can't repro the behavior. Indeed, the "backwards range" message is not very useful, but I decided to implement it just to have more complete vim emulation. And by now I've learned better than try and "improve" vim! Some people have been using vi for 20+ years, and they may rely on that behavior. I could easily take out that warning, although the right way would be to have a user setting. I have taken note of the request and I'll hopefully be able to implement it in a future version.

But in any case, I can't reproduce the behavior you mention -- <esc> by itself doesn't trigger any warning for me. Are you sure you have no mapping that may cause it?

Please let me know the exact steps to reproduce it so that I can try to fix it.

3

Re: Behaviour of "Backwards range given, swap?" dialog

Actually, yes, it probably has to do with the addition of :noh to the Esc mapping.  That makes more sense.

With the same mapping in Vim I get E481: No range allowed, so it looks like ViEmu is checking that the range is valid first, even though the noh command isn't going to accept it in any event.

4

Re: Behaviour of "Backwards range given, swap?" dialog

I suppose you are using :map or :noremap, instead of :nmap or :nnoremap (with the leading  'n' to limit it to operating in normal mode). Changing that would remove the annoying dialog.

Apart from that I agree that some configurability of the 'backwards range' warning would be a good idea.

5

Re: Behaviour of "Backwards range given, swap?" dialog

I could easily take out that warning

10 years later, we're still seeing this totally superfluous, keystroke-adding warning.

the right way would be to have a user setting

Why? It's literally of no use to anyone, ever. It's a thing to which everyone just replies "yes" every single time it pops up.

Last edited by Eric Tetz (2019-07-09 17:32:02)

6

Re: Behaviour of "Backwards range given, swap?" dialog

Eric, you are right, it will be gone in the next release of ViEmu. Regards -- Jon

7

Re: Behaviour of "Backwards range given, swap?" dialog

This is finally fixed (with the question being removed) in ViEmu/VS 3.11:

http://www.viemu.com/blog/2020/12/13/ne … sion-3-11/

Regards,

  -- Jon