Skip to content

Conversation

macevhicz
Copy link
Contributor

Checklist

  • I have read the CONTRIBUTING.md document
  • I formatted my changes with black
  • I linted my changes with flake8
  • I have added documentation regarding my changes where necessary
  • Any pre-existing tests continue to pass
  • Additional tests were made covering my changes

Types of Changes

  • Bugfix (change that fixes an issue)
  • New Feature (change that adds functionality)
  • Documentation Update (if none of the other choices apply)

Proposed Changes

  • Speed up CodeHighlighter. Precompile regex patterns, and use a piped keyword regex pattern rather than loop thru keywords. Python regex automatically caches patterns, but since the keyword pattern was being repeatedly re-defined, I think it may have prevented the pattern caching from working as expected.
  • Set Code Highlighting colors to match between console and workboxes. The existing workbox colors were hard to differentiate. Also, the console keyword color was the same as stdOut color, so even though it was taking the time to highlight keywords, they were highlighting using the same color as normal output, so not they were not visually distinguishable.
  • Call updateColorScheme when setting the language. Currently, linked files had old color scheme when first shown, and after being saved.
  • Add an action, with a shortcut, to run the first workbox, where user may have their common imports, helper functions, etc.

@macevhicz macevhicz force-pushed the markm/general_updates4 branch from 5556d36 to 1cad35b Compare October 1, 2025 22:56
@macevhicz macevhicz marked this pull request as draft October 1, 2025 22:57
@macevhicz macevhicz force-pushed the markm/general_updates4 branch from 1cad35b to 55d6687 Compare October 1, 2025 22:59
@macevhicz macevhicz changed the title Markm/general updates4 Code Hightlighting updates Oct 2, 2025
@macevhicz macevhicz force-pushed the markm/general_updates4 branch 2 times, most recently from 33203ef to 29f4a24 Compare October 8, 2025 21:55
macevhicz and others added 5 commits October 8, 2025 15:54
Define formats and regex patterns, once, up front. For patterns with
multiple strings (ie keyword) use a single pipe pattern rather than
repeatedly iterate over each keyword, redefining the pattern each time.
Also, make keyword color different than stdout color
Without this, linked tabs do not show correct highlight colors when
- first opened
- after being saved
SyntaxErrors:
    - Do NOT include the text ", in" followed by a module
    - DO include the offending line of code
Other Exceptions
    - DO include the text ", in" followed by a module
    - Do NOT include the offending line of code if from stdIn (ie
          a workbox)
@macevhicz macevhicz force-pushed the markm/general_updates4 branch from 29f4a24 to d4f4b7d Compare October 8, 2025 23:00
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.

1 participant