Skip to content
Discussion options

You must be logged in to vote

Testing revealed that the attempted fix causes problematic side effects.

Which led to realizing my advice to "instead check the current word is --" was very incorrect. The onadvance callback is specifically for advancing the argument index for the current word. If it advances preemptively for the next word, then the argument index ends up double-advancing in that case (which is completely correct behavior given the design and documentation).

So, the only thing that can be done about it is to add an extra blank word to the line_state if the cursor is past the end of the last real word in the line, so that onadvance can run one final time for the cursor position even though there isn't real…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
2 replies
@chrisant996
Comment options

@IMXEren
Comment options

Comment options

You must be logged in to vote
6 replies
@chrisant996
Comment options

@chrisant996
Comment options

Answer selected by IMXEren
@IMXEren
Comment options

@chrisant996
Comment options

@chrisant996
Comment options

@IMXEren
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working
2 participants