Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

[VSPCKAGE] Is it possible to determine whether the caret is in a blank space?

$
0
0

Technical Info

  • Visual Studio SDK Version: 2013
  • Windows Version: 8.1 x64
  • Project type: VS Package
  • Development Language: VB.Net and also C#

Question

I need to control the state of some commands that I inserted in the code editor contextmenu, then, when the contextmenu open, I would like to set my commands enabled or disabled if the caret is in a blank space.

I know how to add the BeforeQueryState handler, the problem is about detecting whether the caret is in a blankspace.

Efficiency is needed here, because I don't want to "charge" the contextmenu overall opening time everytime that I do right-click on the code editor window.

I also can't select the current word on the code editor window just to check that thing because selecting the current word is a behavior that will change user experience...

I will mean that the blankspace evaluation cannot implies selecting the current word on the code editor just to check whether is a word os a blank space.

What could I do?


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>