1

Re: Is ViEmu modifying files on incsearch?

Hi, I use ViEmu within VS2005 (thanks!).  In our group we run VS2005 integrated with Microsoft Source Safe, and due to the integration, we are automatically prompted to check out a file whenever we attempt to modify it in the editor.

When I'm using incremental search in vi (key "/" in normal mode), I am accustomed to pressing <return> when I've found what I am looking for, leaving my cursor positioned at the matching string.  But when I do this with ViEmu within VS2005, I am always prompted to check out the file, as if ViEmu is somehow attempting to modify the file.

In this case, pressing <esc> to cancel the search instead of <return> is not a viable workaround, because <esc> returns the cursor to the position it was before the search was started...not the intended effect.  Of course I can cancel out of the two "check out" dialogs that always pop up, but this makes using inc search too awkward to be of use.

Any ideas as to why this may be happening and how to fix it?

Thanks.

2

Re: Is ViEmu modifying files on incsearch?

Hi,

Thanks for the kind message. I remember using Sourcesafe integration back in the day, so I know what you mean.

ViEmu, per se, does not try to modify the file at all. When you press RETURN, it just changes the cursor position to the target search match position. In general, the behavior you are getting is not usual for ViEmu.

The problem is most likely due to interactions with VS input handling and the language service. RETURN is usually bound to Edit.BreakLine, the command that inserts a line break in the Visual Studio architecture, and one of the most abused commands by language services, third party add-ins, etc... If you think about it, RETURN usually *does* modify the file. The problem is that ViEmu tries to intercept it and defuse the modification attempt, which it usually can, but it seems in that case it isn't able to.

First question is: what language files are you editing? The Visual Basic language service is one of the usual suspects in these cases, as it's so different from other language support services. Second question is: does the problem happen also if you press RETURN just in normal mode, or in visual mode? Finally, can you open another type of file (say, a raw TXT file, or a file in another language), and check if it happens too? This will also prove valuable in diagnosing the problem.

The problem may also be due to an interaction with another 3rd party add-in, so it would be good to know what other software you are using (Resharper, CodeRush, Visual Assist and other similar tools are likely culprits -- less known tools are more problematic, because I've usually already fixed the interactions with the three main ones I listed). You can try deactivating other plug-ins, or uninstalling them altogether, to try to find the culprit.

Finally, you can go to Tools|Options|Keyboard, and try to unbind Edit.Breakline from RETURN. That may fix it, but it will likely also cause other unwanted side-effects. But it's possibly a worthwhile avenue to explore in fixing the issue.

All in all, I will wait for more info from you to try and diagnose the issue.

Regards and happy new year!

  -- Jon

3

Re: Is ViEmu modifying files on incsearch?

Hello again,

Kind words?  Not enough: I'll tell you I FOUGHT to get to use ViEmu in my organization..they are very strict and normally do not allow anything but their standard dev box...but after I proved how much more productive I am...

To try to address your questions, the only 3rd party tool I am using is ViEmu.  This happens while editing VB.NET code.

Unfortunately, it seems this problem is worse than I thought: it is intermittent.  I just tried it and it is not happening.  I must be performing a certain series of steps that causes it to begin happening.

I'm going to have to pay closer attention to what I am doing during dev sessions and see if I can get you more useful info.

Thanks for the support!

Cheers.

4

Re: Is ViEmu modifying files on incsearch?

Thanks so much again! I'm glad ViEmu is so valuable. ViEmu 2.5 is almost ready, including a few new features like multiple key-chord mapping, and ViEmu/VS2010 will be even greater.

If you can get me definite reproduction steps, that would be great. Still, I can try to repro it here with VS2005. This problem has definitely happened in the past, and it's specific to the (weird) VB language service.

  - Jon