Token KeyPress Split Problem

SyntaxEditor for Windows Forms Forum

Posted 15 years ago by Greg Shaffer - Boulder
Avatar
Hi Again,

If I have a token: "GooFoo" and I add a left paran in the middle "Goo(Foo" and then in the editor_KeyPress if I call Document.CurrentView.GetPreviousToken(), I don't get "Goo" as the previous token.

Is there a different event I should use that allows for some token processing to occur before I get notified that the document has changed?

Thanks,
Greg

Comments (2)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The problem here is that the KeyPress event fires before the character is inserted. Therefore you are on a GooFoo token and GetPreviousToken will return the token before it.

You can handle the TextChanging event which is the same as TextChanged but just happens before any change is made.

If you have any suggestions for changing how key presses work and the order in which events fire, please submit them now. We are considering changing some of that and could use some input from our end users. Thanks!


Actipro Software Support

Posted 15 years ago by Greg Shaffer - Boulder
Avatar
TextChanged is fine.

Thanks,
Greg
The latest build of this product (v2018.1 build 0341) was released 7 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.