You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing my own Tokenizer, that is not line based.
To interface with ace, of course, I need to create line 'states'.
the background Tokenizer uses string comparison to compare line-states.
if (this.states[row] + "" !== data.state + "")
this of course does not work properly unless line states are strings
Expected Behavior
I expected to be able to provide line-states that are not strings.
Current Behavior
line-states not correctly compared, and thus tokens not correctly updated.
Reproduction Steps
use an object to represent line-states rather than a string
Possible Solution
work-around is to ensure that state+"" does return something that 'encodes' the state.
(ie a toString for the state object
correct fix would be a true object comparison in BackgroundTokenizer
Additional Information/Context
No response
Ace Version / Browser / OS / Keyboard layout
1.32.3
The text was updated successfully, but these errors were encountered:
dhakehurst
changed the title
BackgroundTokenizer: State comparisone should be be via string compare
BackgroundTokenizer: State comparison should not be via string compare
Jan 8, 2024
toString does not work on null|undefined, so it might need some null/undefined checks to be sure. Maybe there needs to be a check for toString itself. There should be no performance impact, though it should be fine as it runs in the background.
Describe the bug
I am implementing my own Tokenizer, that is not line based.
To interface with ace, of course, I need to create line 'states'.
the background Tokenizer uses string comparison to compare line-states.
if (this.states[row] + "" !== data.state + "")
this of course does not work properly unless line states are strings
Expected Behavior
I expected to be able to provide line-states that are not strings.
Current Behavior
line-states not correctly compared, and thus tokens not correctly updated.
Reproduction Steps
use an object to represent line-states rather than a string
Possible Solution
work-around is to ensure that
state+""
does return something that 'encodes' the state.(ie a
toString
for the state objectcorrect fix would be a true object comparison in BackgroundTokenizer
Additional Information/Context
No response
Ace Version / Browser / OS / Keyboard layout
1.32.3
The text was updated successfully, but these errors were encountered: