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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -