1

Re: Visual Assist's context menu can't be closed with ESC and vaxesc prob.

Hello,

I found two issues, rather minor ones, but nevertheless, well.....

I have installed Visual Assist X and ViEmu (see below for configuration
details). If I open the "main" context menu of Visual Assist X or the
snippet context menu, I can't close them with ESC. I either have
to select a menu element or I have to click with the mouse in the code
window. This is annoying since I use ViEmu to avoid using the mouse ;-)
If ViEmu is disabled, this problem does not exist.

This issue seems to happen not to all VAX context menus. At least
the VAX refactor context menu can be closed with ESC.
The context menus of VS itself seems to be not affeted.

If I open the "main" context menu while in normal mode I can
select menu items with cursor up/down and select a menu item
by pressing enter. But when pressing ESC, ViEmu changes
from insert mode into normal mode instead of closing the
the context menu. Now when pressing the cursor keys, the
caret can be moved (not the menu selection). Pressing ESC
again does nothing change.
If I then change into insert mode, the context menu is closed
and a break point is set in the line in which the caret was!
(so whenever I forget the shortcut to set a breakpoint I could do it that way ;-) )
For the snippet context menu the behavior is similar, but the
breakpoint is not set (hmmm...???).


The context menus can be opened these ways:
Main context menu:
Hold shift and right-click mouse or use the VAssistX.OpenContextMenu command to open it.

Refactor context menu:
map the command VAssistX.OpenRefactorContextMenu to any shortcut and press this shortcut

Snippet context menu:
map the command VAssistX.VaSnippetInsert to any shortcut and press this shortcut


It does not matter whether the ViEmu setting vaxesc is enabled or disabled.

And this leads me to a second issue:
The vaxesc setting seems to be broken. According to ViEmu's manual this setting
should control how the ESC key is handled if VAX shows an autocompletion list.
From the manual:

"vaxesc" activates specific behavior in ViEmu when Visual Assist is detected to be running for the ESC key in insert mode. If active, this will ensure ESC returns to normal mode even if there is a Visual Assist autocompletion drop-down window present. If not active, ESC will return to normal mode if no autocompletion drop-down is present, but it will just close the autocompletion drop-down if it is present (requiring another ESC keypress to return to normal mode).

But I can't see here any difference. I always have to press ESC twice to come back
into normal mode if an autocompletion list is open.


Can someone confirm these issues? Are there any workarounds or settings
to fix this?


Greetings
  LoveVim

--------------------------------------
Some info about my system:
  ViEmu 2.2.9
  Visual Assist X 10.5.1727.0
  Visual Studio 2008 Standard, SP 1, German
  Plugins: ViEmu and Visual Assist X
  Windows XP

2

Re: Visual Assist's context menu can't be closed with ESC and vaxesc prob.

vaxesc has never worked for me either.

3

Re: Visual Assist's context menu can't be closed with ESC and vaxesc prob.

LoveVim,

Indeed, the handling of <Esc> is problematic in Visual Studio in general, and it is still more problematic when you have ViEmu and Visual Assist installed. Those kinds of issues have been known to be fixed by reinstalling ViEmu and Visual Assist again in a different order. It is really awkward, since installation order shouldn't really affect this kind of thing at all, but it can affect things.

VaxEsc works fine in most cases, but the provisions it takes don't always work for some reason. If enabled, what that option does is it intercepts the Esc VS command at the BeforeExecute level, processes it as a vi key, and then cancels any further progress of the Esc VS command. ViEmu also closes the Intellisense drop-down and/or the VAX one, by passing a new ECMD_CANCEL command to the next handler in the view's command chain. This is indeed an ugly system, but it's the only thing the VS command system allows.

If VaxEsc is not set, BeforeExecute filtering is not done, and the command is left to go through its usual means. Often, this means the Esc keypress will close the drop-down, but not go back to normal mode.

In VS2010, the display portion of the editor has been greatly improved, but the input side of things is largely untouched, even left worse since the move to WPF (Win32 windows allow more points of interception). I hope things can be improved somewhat.

One other solution I have in mind is using nukes to address this: installing a windows message hook to get keypresses before anyone else, even Visual Studio, and then I will be able to get them for sure. It will have other problems, but I will make sure I have access to everything regardless of Visual Studio. I was considering this as the best way to address interception in VS2010, but I was talked into trying something more "civilized" by some VS devs, which I will do shortly. Some of this may see its way back to pre-VS2010 ViEmu.

All in all, input handling will evolve significantly in the near future, so hopefully this are will also improve. I'm taking note of this and will post back here and let you know by email if/when there are updates.

Regards,

  -- Jon

4

Re: Visual Assist's context menu can't be closed with ESC and vaxesc prob.

Hi Jon,

Thank you very much for the detailed and fast response.

Jon wrote:

Those kinds of issues have been known to be fixed by reinstalling ViEmu and Visual Assist again in a different order.

The initial installation order before posting here was ViEmu followed by VAX (VS has been started and used after installing ViEmu).

I followed your tip and I deinstalled ViEmu and VAX and changed the installation order:
VAX followed by ViEmu (with starting and using VS2008 after installing VAX).
But still the same behavior.

Jon wrote:

All in all, input handling will evolve significantly in the near future, so hopefully this are will also improve. I'm taking note of this and will post back here and let you know by email if/when there are updates.

Great. I'm looking forward to hear from you.

Regards,
  LoveVim

Last edited by LoveVim (2009-06-27 22:08:06)

5

Re: Visual Assist's context menu can't be closed with ESC and vaxesc prob.

LoveVim, thanks, I will try to look into this as soon as I can have a look at input handling again, which I will have to soon due to the needs of the new VS2010 version.

Regards,

  Jon