Token KeyPress Split Problem

SyntaxEditor for Windows Forms Forum

Posted 20 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 20 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 20 years ago by Greg Shaffer - Boulder
Avatar
TextChanged is fine.

Thanks,
Greg
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.