Leo's improved colorizer is in devel!

30 views
Skip to first unread message

Edward K. Ream

unread,
Nov 11, 2024, 2:25:19 PM11/11/24
to leo-editor

PR #4147 (Leo's improved colorizer) is now part of the "devel" branch. The highlights:


- Fixed an ancient O(N) performance bug in the colorizer.

- Fixed bugs in @language jupytext, laying the foundation for similar languages, including @language vue. See #726.

- A new info issue #4158: Theory of Operation for the colorizer.


I skipped the official review. Testing will be our review!


This PR should be completely safe even if glitches remain.

Please test "devel" and report any problems.


Edward


P. S. The PR notes two issues relating to documentation. I'll be working on them for the next week or so.


EKR

lewis

unread,
Nov 11, 2024, 2:50:48 PM11/11/24
to leo-editor
Running Leo 6.8.3-devel, devel branch, build 2025714b3a
Python 3.13.0, PyQt version 6.7.3
Windows 10 AMD64 (build 10.0.19045) SP0

Uncaught exception in Leo...
Traceback (most recent call last):
  File "N:\git\leo-editor\leo\core\leoColorizer.py", line 2951, in highlightBlock
    self.colorizer._recolor(s)  # Highlight just one line.
    ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PygmentsColorizer' object has no attribute '_recolor'. Did you mean: 'recolor'?


The exception repeats many times.

Thomas Passin

unread,
Nov 11, 2024, 2:59:03 PM11/11/24
to leo-editor
On Monday, November 11, 2024 at 2:25:19 PM UTC-5 Edward K. Ream wrote:

I skipped the official review. Testing will be our review!


This PR should be completely safe even if glitches remain.

He, he.  Famous last words.

Edward K. Ream

unread,
Nov 11, 2024, 4:11:09 PM11/11/24
to leo-e...@googlegroups.com
On Mon, Nov 11, 2024 at 1:50 PM lewis <lewi...@fastmail.com.au> wrote:
Running Leo 6.8.3-devel, devel branch, build 2025714b3a
Python 3.13.0, PyQt version 6.7.3
Windows 10 AMD64 (build 10.0.19045) SP0

Uncaught exception in Leo...
Traceback (most recent call last):
  File "N:\git\leo-editor\leo\core\leoColorizer.py", line 2951, in highlightBlock
    self.colorizer._recolor(s)  # Highlight just one line.
    ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PygmentsColorizer' object has no attribute '_recolor'. Did you mean: 'recolor'?

Thanks for this report. I'll fix it today.

Edward

Edward K. Ream

unread,
Nov 11, 2024, 4:34:31 PM11/11/24
to leo-editor
On Monday, November 11, 2024 at 1:50:48 PM UTC-6 lewis wrote:

AttributeError: 'PygmentsColorizer' object has no attribute '_recolor'.

The fix, via PR #4168, is now in "devel."

As noted in the PR, the Pygments colorizer does not take advantage of the recent colorizing work. It probably never will.

Edward

lewis

unread,
Nov 12, 2024, 1:38:39 AM11/12/24
to leo-editor
Thanks for the fix.
The jedit colorizer is much better. I can't recall why I was even using Pygments colorizer :/

Edward K. Ream

unread,
Nov 12, 2024, 2:45:37 AM11/12/24
to leo-e...@googlegroups.com
On Tue, Nov 12, 2024 at 12:38 AM lewis <lewi...@fastmail.com.au> wrote:
Thanks for the fix.
The jedit colorizer is much better. I can't recall why I was even using Pygments colorizer :/

Well, I'm glad you did :-)

Edward
Reply all
Reply to author
Forward
0 new messages