[wingide-users] The p and P commands don't work right in vim

Wingware Support support at wingware.com
Sun Jun 1 21:29:01 MDT 2008

Michael Hipp wrote:
> Ok, I did a bit more testing to find out what is going on...
> Turns out Wing is grabbing one character too many. Example:
> # A test line.
> # Now is the time.
> In Wing, if I put the cursor on the first character of 'line', hit 'v', 
> and then hit l 4 times to select 'line.' those 5 characters are 
> highlighted as expected. It "looks" right. But hitting y (yank) grabs 
> 'line.' as well as the trailing newline. So any pastes in the middle of 
> the following line end up on a line of their own.
> This is different than Vim in 3 ways:
> - Wing is grabbing one more character than it actually shows selected. 
> It's grabbing the one under the cursor as well as the one to the left 
> (which is highlighted). Vim only grabs those characters that are 
> highlighted (i.e. to the left of the cursor).
  - In vim, you can't grab the newline no matter how many times you hit
> 'l', you have to hit 'j' to get the newline.
> - In vim, even if you intentionally grab the trailing newline, when you 
> paste it into the middle of another line, it pastes the newline (thereby 
> splitting the line) but it does not put the pasted text on a line of its 
> own.
> Clear as mud?

This is due to the fact that the code editor underlying Wing lets the
cursor go to a location that it is not possible to place it in vim.
You would only be able to go onto the '.' and not past it in vim, so
would not run into this issue there.

In any case, vim does seem to grab the character under the cursor for
me on Linux, so I'm suspecting this difference of where the cursor
can go is what is the root of the problem.

Fixing this isn't so easy, since it's getting into fundamental editor
behavior.  It may be we can muck around w/ 'y' and similar to act more
like users would expect when the cursor is out of vim bounds, but I'd
rather fix things to disallow going there.


Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list