javascript - codemirror: detect when last character in line is deleted -
how mode "know" when last character in line deleted?
say, type something, , mode object receives calls token(stream, state)
type. if delete characters 1 one, say, pressing backspace, token
method gets called every time except when delete last character (in case blankline
called).
this not convenient if build ast tokens. need delete part of ast represented last deleted character. use blankline
if associate deletion of last character, cannot find way.
please help.
a mode doesn't , shouldn't know changes document. parses stream given. can have other code listen "change"
events, , update data structures used mode in response them.
Comments
Post a Comment