1

Re: Bug or ID10T User Error?

ViEmu 2.5.5 for VS 2010 with ReSharper and a bunch of other things installed.

I was trying to yank this code fragment to register a in small-v visual mode.

   OnPropertyChanged("TestName");

If I start from the beginning using these keystrokes

   <Esc><Esc>^v$"ay

ViEmu tosses a pair of unwanted quotes at the end:

   OnPropertyChanged("TestName");""

Puzzled, I checked the docs because I'm not even a white-belt vi/vim user yet.  ;-)  Couldn't find anything wrong.  On a whim I tried from the other end using these keystrokes.

   <Esc><Esc>$v^"ay

and that works, though it misses the ; at the end.

Is this a bug (the "" at the end using v) or a misunderstanding on my part?  Thanks!

2

Re: Bug or ID10T User Error?

I think what you want to do is:
<Esc><Esc>"ay$

This will place the yanked line into register a, to paste it you would type:
"ap

This worked in VS2005 (I use this functionality frequently, along with multi-line yanks into registers), and now that I am on VS2010 I can assure you it works there as well.

3

Re: Bug or ID10T User Error?

I too use yank-line(s)-to-register a lot.  In this case, because of where the text was to be put I didn't want the NewLine as part of the yank.  The interesting thing is that visual from ^ to $ appends a pair of quotes to the end, but going from $ to ^ works as expected. 

Can anyone duplicate this behavior?  Suppose I have the line of code

   _resultsFileNameUpper = resultsFileName.ToUpperInvariant();

and I want to yank
                    resultsFileName.ToUpperInvariant();
into register b.  These keystrokes work fine.
   <Esc><Esc>$vbbbb"by
except the semicolon isn't part of the visual selection.  But both
   <Esc><Esc>^wwv$"
and
   <Esc><Esc>^wwveee"
append a pair of quotes at the end of the line as soon as I type the ".  The command line at the bottom is ok:
   -- VISUAL -- "
but the text isn't.

Thanks.

4

Re: Bug or ID10T User Error?

I would totally suspect an interaction with Resharper (or some other third party add-in). I have tested this in VS2010 with ViEmu/VS2010, and it works as you would expect (it doesn't add the quotes at the end). Can you try disabling or uninstalling R# to verify this?

Also, please try the latest ViEmu/VS2010 2.5.7, see here:

  http://www.viemu.com/blog/2010/08/16/viemuvs2010-257-with-visual-assist-and-resharper-support/

As it has provisions for R#. Let me know how it works.

Apart from that, it's expected that doing $v^y won't copy the last character, ViEmu implements "selection=exclusive" mode (see :help selection in vim for the details), and thus it doesn't include the last character when selecting backwards. Implementing selection=inclusive mode remains a pending feature for a future vrsion of ViEmu.

Regards,

  -- Jon