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.


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.


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.


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.