Skip to content

frontend: Fix editor buglets#116

Merged
juliaogris merged 2 commits intomasterfrom
editor-fix
Mar 29, 2023
Merged

frontend: Fix editor buglets#116
juliaogris merged 2 commits intomasterfrom
editor-fix

Conversation

@juliaogris
Copy link
Member

  • Highlight first, not last error token in line
  • Fix empty/delete-all editor bug

Fix empty editor bug, which is caused by the editor module not
responding when its value/content changes to "". "" is falsy - oops.
This was the result of highlighting errors where we'd call

        editor.update({errorLines})

without content value. To keep the value for new value being undefined
we changed `this.value = value` to:

        this.value = value || this.value

This promptly didn't update for value === "" (falsy) and resulted in the
weird behaviour when emptying the editor. Fixed now with explicit check
again null and undefined.

This had to happen at some point. 🎉
We highlight the offending token with an error message, but due to the
limited data structure (don't feel like refactoring now, plus
performance is already an issue) - we only allow for one token
highlight per error lines. Typically the first error is the most
meaningful, whereas later errors are sometimes just follow-ons - so
only highlight the first error.
Copy link
Member

@camh- camh- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥒

@github-actions
Copy link

firebase-deployment: https://evy-lang--116-9uxno6cz.web.app (ff5595e)

@juliaogris juliaogris merged commit 4a70c1d into master Mar 29, 2023
@juliaogris juliaogris deleted the editor-fix branch March 29, 2023 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants