Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeEditor highlighting broken with wxPython #1990

Open
greschd opened this issue Mar 9, 2023 · 0 comments
Open

CodeEditor highlighting broken with wxPython #1990

greschd opened this issue Mar 9, 2023 · 0 comments

Comments

@greschd
Copy link
Contributor

greschd commented Mar 9, 2023

Description

Using the wxPython backend, the CodeEditor highlighting does not work as expected. In particular, only some of the lines are being highlighted. See the following video:

Video0.mp4

The video is generated from the following code: https://github.com/greschd/traitsui_code_editor_syntax_highlighting_issue/blob/main/code_editor_test.py

In particular, only selected lines appear to be highlighted, depending on which line was last edited.

Additional context

I can get the syntax highlighting to appear correctly by removing the following lines:

else:
self.control.StartStyling(position)
self.control.SetStyling(style_length, stc.STC_STYLE_DEFAULT)

However, I'm not familiar enough with wx.stc highlighting to know if this might be the correct solution, or what else this might break. I have not tested this in combination with the options selected_line, dim_lines, etc..

Environment

Tested on the following environments, with the same behavior everywhere:

  • OS: Windows 11
    • Python 3.9
      • wxPython 4.1.1
      • wxPython 4.2.0
    • Python 3.10
      • wxPython 4.2.0
  • OS: Ubuntu 20.04 on WSL2
    • Python 3.8
      • wxPython 4.2.0
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

No branches or pull requests

1 participant