Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Syntax coloring bugs

86 views
Skip to first unread message

Edward K. Ream

unread,
Mar 31, 2025, 9:17:04 PMMar 31
to leo-editor
It seems that PR #4320 does not always compute the proper language to use for syntax coloring.

I consider this to be an urgent bug. I'll fix it immediately.

My apologies for this bug.

Edward

Edward K. Ream

unread,
Mar 31, 2025, 10:01:38 PMMar 31
to leo-editor
On Monday, March 31, 2025 at 8:17:04 PM UTC-5 Edward K. Ream wrote:

It seems that PR #4320 does not always compute the proper language to use for syntax coloring.

It appears that I was mistaken. I have created and then closed #4323.
As discussed in the issue, it looks like I found an strange edge case: the colorizer kinda did as instructed.

However, there may be a real bug lurking nearby. It seems that an @file node that doesn't contain an @language directive should use the file's type to compute a default @language directive for that node. The workaround for this edge case is to add the missing @language directive!

I plan to open a new issue after I investigate a bit. I doubt that recent PRs are culpable, but I can't say for sure yet.

Edward

Edward K. Ream

unread,
Mar 31, 2025, 10:01:38 PMMar 31
to leo-editor
On Monday, March 31, 2025 at 8:17:04 PM UTC-5 Edward K. Ream wrote:

It seems that PR #4320 does not always compute the proper language to use for syntax coloring.

Edward K. Ream

unread,
Apr 1, 2025, 6:56:16 AMApr 1
to leo-editor
On Monday, March 31, 2025 at 8:17:04 PM UTC-5 Edward K. Ream wrote:
It seems that PR #4320 does not always compute the proper language to use for syntax coloring.

I have reopened #4323. This issue now describes two minor bugs. Each bug is an edge case in complex code.

Yes, I'd like to fix both bugs, but I would rather do nothing than cause further problems.

Edward

Viktor Ransmayr

unread,
Apr 9, 2025, 4:20:37 AMApr 9
to leo-editor
Hello Edward,

I'm using this thread of yours to report an issue I'm having, since you started making those changes.

I'm adding a test outline, which demonstrates the problem in a hopefully simple form.

It's basically a stripped down form of an outline I'm using since years to keep a daily work log - but - only now has a colorization problem with @rst - nodes ...

I hope it provides additional input for your thread on 'Heads up: PR #4324 will need testing'. - See


With kind regards,

Viktor

---

Test-Outline.leo

Edward K. Ream

unread,
Apr 10, 2025, 8:52:37 AMApr 10
to leo-e...@googlegroups.com
On Wed, Apr 9, 2025 at 3:20 AM Viktor Ransmayr <viktor....@gmail.com> wrote:

>> I have reopened #4323. This issue now describes two minor bugs. Each bug is an edge case in complex code.
> I'm using this thread of yours to report an issue I'm having, since you started making those changes.

Thanks for your testing, Viktor. I shall investigate this report before merging PR #4324!

> I'm adding a test outline, which demonstrates the problem in a hopefully simple form.

[The test outline] now has a colorization problem with @rst - nodes.

I'll look into this problem immediately.

Edward

Edward K. Ream

unread,
Apr 11, 2025, 4:30:11 AMApr 11
to leo-e...@googlegroups.com
On Wed, Apr 9, 2025 at 3:20 AM Viktor Ransmayr <viktor....@gmail.com> wrote:

> I'm adding a test outline, which demonstrates the problem in a hopefully simple form.
...
> only now has a colorization problem with @rst - nodes

Please explain what you think the problem is. I don't see any difference between devel and the PR.

I ran Test-Outline.leo with --trace=coloring in "devel" and the PRs branch.
I see no difference either in the coloring itself or in traces that --trace=coloring produces.
Leo thinks all nodes should be colored as rst, including `@rst` nodes for external .html files.

Edward

Viktor Ransmayr

unread,
Apr 11, 2025, 5:35:56 AMApr 11
to leo-e...@googlegroups.com
Hello Edward,

Am Fr., 11. Apr. 2025 um 10:30 Uhr schrieb Edward K. Ream <edre...@gmail.com>:
On Wed, Apr 9, 2025 at 3:20 AM Viktor Ransmayr <viktor....@gmail.com> wrote:

> I'm adding a test outline, which demonstrates the problem in a hopefully simple form.
...
> only now has a colorization problem with @rst - nodes

Please explain what you think the problem is. I don't see any difference between devel and the PR.

Sorry for not having it stated explicitely. - The difference I'm reporting is b/w 'devel' and '6.8.3' !

With kind regards,

Viktor
 

Edward K. Ream

unread,
Apr 11, 2025, 6:19:44 AMApr 11
to leo-e...@googlegroups.com
Alright. I'll take a look.

Edward

Edward K. Ream

unread,
Apr 11, 2025, 6:31:51 AMApr 11
to leo-editor
On Friday, April 11, 2025 at 5:19:44 AM UTC-5 Edward K. Ream wrote:

>> Sorry for not having it stated explicitly. - The difference I'm reporting is b/w 'devel' and '6.8.3' !
> Alright. I'll take a look.

Did you mean 6.8.4, the last official release?
In any case, none of my tests show any differences between the 6.8.3, 6.8.4, and ekr-4323-computing-at-language branches.

Edward

Edward K. Ream

unread,
Apr 11, 2025, 6:34:14 AMApr 11
to leo-editor
On Friday, April 11, 2025 at 5:31:51 AM UTC-5 Edward K. Ream wrote:

> In any case, none of my tests show any differences between the 6.8.3, 6.8.4, and ekr-4323-computing-at-language branches.

You provided only the .leo file. Might the difference you see be in an external file?

Edward

Viktor Ransmayr

unread,
Apr 11, 2025, 7:01:02 AMApr 11
to leo-e...@googlegroups.com
Hello Edward,

 I am not a 100 percent sure - but - I doubt it, as I can see this behaviour in a Debian 12 as well as a Fedora 40 VM !

Here are the screenshots for the issue in the Debian VM.

Let me know, if you need any Linux  and/or PyPI package info ...

With kind regards,

Viktor
Screenshot-Test-Outline-Leo-6-8-4-devel.png
Screenshot-Test-Outline-Leo-6-8-3.png

Edward K. Ream

unread,
Apr 11, 2025, 8:26:24 AMApr 11
to leo-e...@googlegroups.com
On Fri, Apr 11, 2025 at 6:01 AM Viktor Ransmayr <viktor....@gmail.com> wrote:

> Here are the screenshots for the issue in the Debian VM.

Thanks for the clarification.

PR #4237 summarizes all changes between version 6.8.3 and Leo's 6.8.4 branch.

The change you see in coloring is likely due to new settings in leoSettings.leo:


Inserted link

Skip to content
Using Gmail with screen readers
1 of 1
Re: Syntax coloring bugs
Inbox
Viktor Ransmayr

Attachments6:01 AM (1 hour ago)

to leo-editor
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/leo-editor/CAAeSrGK-1muqoch-xV7p8owuJzTfXxEHeqQqE5QbJZJ%3D1-32vw%40mail.gmail.com.
 2 Attachments  •  Scanned by Gmail

leo-e...@googlegroups.com

On Fri, Apr 11, 2025 at 6:01 AM Viktor Ransmayr <viktor....@gmail.com> wrote:

> Here are the screenshots for the issue in the Debian VM.

Thanks for the clarification.

PR #4237 summarizes all changes between version 6.8.3 and Leo's 6.8.4 branch.

The changes you see in coloring are likely due to new settings in leoSettings.leo:

<v t="ekr.20250115101744.1"><vh>rest_comments (Python and Rust only)</vh>
<v t="ekr.20250115101744.2"><vh>@font rest.literal3</vh></v>
<v t="ekr.20250115101744.3"><vh>@font rest.literal4</vh></v>
<v t="ekr.20250115101744.4"><vh>@font rest.keyword5</vh></v>
<v t="ekr.20250115101744.5"><vh>@@@font rest_comments.literal1</vh></v>
<v t="ekr.20250115101744.6"><vh>@color rest_comments.literal1 = #d33682</vh></v>
<v t="ekr.20250115101744.7"><vh>@color rest_comments.literal2 = #d33682</vh></v>
<v t="ekr.20250115101744.8"><vh>@color rest_comments.literal3 = #d33682</vh></v>
<v t="ekr.20250115101744.9"><vh>@color rest_comments.literal4 = #d33682</vh></v>
<v t="ekr.20250115101744.10"><vh>@color rest.literal1 = #d33682</vh></v>
<v t="ekr.20250115101744.11"><vh>@color rest.literal2 = #d33682</vh></v>
<v t="ekr.20250115101744.12"><vh>@color rest.literal3 = #d33682</vh></v>
<v t="ekr.20250115101744.13"><vh>@color rest.literal4 = #d33682</vh></v>
<v t="ekr.20250115101744.14"><vh>@color rest.operator = #d33682</vh></v>
<v t="ekr.20250115101744.15"><vh>@@@color rest.keyword1 = #d33682</vh></v>
<v t="ekr.20250115101744.16"><vh>@color rest.keyword2 = #d33682</vh></v>
<v t="ekr.20250115101744.17"><vh>@color rest.keyword3 = #d33682</vh></v>
<v t="ekr.20250115101744.18"><vh>@color rest.keyword4 = #d33682</vh></v>
<v t="ekr.20250115101744.19"><vh>@color rest.keyword5 = #d33682</vh></v>

You can test this theory by setting these colors to, say, 'red' in your myLeoSettings.leo.

HTH.

Edward

Viktor Ransmayr

unread,
Apr 11, 2025, 11:38:31 AMApr 11
to leo-editor
Hello Edward,

Edward K. Ream schrieb am Freitag, 11. April 2025 um 14:26:24 UTC+2:
On Fri, Apr 11, 2025 at 6:01 AM Viktor Ransmayr <viktor....@gmail.com> wrote:
...
Thanks for the clarification.

PR #4237 summarizes all changes between version 6.8.3 and Leo's 6.8.4 branch.

The changes you see in coloring are likely due to new settings in leoSettings.leo:

<v t="ekr.20250115101744.1"><vh>rest_comments (Python and Rust only)</vh>
<v t="ekr.20250115101744.2"><vh>@font rest.literal3</vh></v>
<v t="ekr.20250115101744.3"><vh>@font rest.literal4</vh></v>
<v t="ekr.20250115101744.4"><vh>@font rest.keyword5</vh></v>
<v t="ekr.20250115101744.5"><vh>@@@font rest_comments.literal1</vh></v>
<v t="ekr.20250115101744.6"><vh>@color rest_comments.literal1 = #d33682</vh></v>
<v t="ekr.20250115101744.7"><vh>@color rest_comments.literal2 = #d33682</vh></v>
<v t="ekr.20250115101744.8"><vh>@color rest_comments.literal3 = #d33682</vh></v>
<v t="ekr.20250115101744.9"><vh>@color rest_comments.literal4 = #d33682</vh></v>
<v t="ekr.20250115101744.10"><vh>@color rest.literal1 = #d33682</vh></v>
<v t="ekr.20250115101744.11"><vh>@color rest.literal2 = #d33682</vh></v>
<v t="ekr.20250115101744.12"><vh>@color rest.literal3 = #d33682</vh></v>
<v t="ekr.20250115101744.13"><vh>@color rest.literal4 = #d33682</vh></v>
<v t="ekr.20250115101744.14"><vh>@color rest.operator = #d33682</vh></v>
<v t="ekr.20250115101744.15"><vh>@@@color rest.keyword1 = #d33682</vh></v>
<v t="ekr.20250115101744.16"><vh>@color rest.keyword2 = #d33682</vh></v>
<v t="ekr.20250115101744.17"><vh>@color rest.keyword3 = #d33682</vh></v>
<v t="ekr.20250115101744.18"><vh>@color rest.keyword4 = #d33682</vh></v>
<v t="ekr.20250115101744.19"><vh>@color rest.keyword5 = #d33682</vh></v>

You can test this theory by setting these colors to, say, 'red' in your myLeoSettings.leo.

I have tried - but - something did NOT work.

I tried to find "rest.literal" in 'leoSettings' outline of the 'devel' branch - but - failed :-(

Reading parts of PR #4237 I have the feeling that to many branches are involved ...

HTH ?

Viktor

Viktor Ransmayr

unread,
Apr 11, 2025, 1:14:03 PMApr 11
to leo-e...@googlegroups.com
Hello Edward,
To clarify my previous statement:

I'm using the released version from  PyPI - and - perform tests against 'devel' ...

But I have not  heard anything on the forum related to a '6.8.4' branch !

Have  I missed something ?

With kind regards,

Viktor 

Edward K. Ream

unread,
Apr 11, 2025, 2:08:30 PMApr 11
to leo-e...@googlegroups.com
On Fri, Apr 11, 2025 at 12:14 PM Viktor Ransmayr

> PR #4237 summarizes all changes between version 6.8.3 and Leo's 6.8.4 branch.
> The changes you see in coloring are likely due to new settings in leoSettings.leo:
...
> Reading parts of PR #4237 I have the feeling that too many branches are involved ...

I wasn't as helpful as I could have been.

This page lists all the closed PRs in Leo 6.8.4. Scanning down the list of PRs we see PR #4281:
Allow rest comments to be colored differently from @language rest.

> I tried to find "rest.literal" in 'leoSettings' outline of the 'devel' branch - but - failed :-(

The valid settings are @color rest.literal1 through @color rest.literal4.

Aha! You have found a compatibility bug! leoSettings defines two new settings as True:

@bool color-doc-parts-as-rest = True
@bool color-docstrings-as-rest = True

But these must have defaults of False to ensure legacy coloring does not change.

Many thanks for pointing out this serious bug. 

PR #4328 sets both these settings to False. Please test and let me know your results.

This PR is a draft. There may be more work to do. My tests don't show the same results as your screen shots, but that may be a result of different settings in my copy of myLeoSettings.leo.

> But I have not  heard anything on the forum related to a '6.8.4' branch !

The 6.8.4 contains all the work scheduled for Leo 6.8.4. As part of the release process I will merge the 6.8.4 branch into the master branch. So no, there has been no official announcement of the branch itself. This branch is part of the release machinery. Clear?

Edward

Viktor Ransmayr

unread,
Apr 12, 2025, 4:36:54 AMApr 12
to leo-editor
Hello Edward,

Edward K. Ream schrieb am Freitag, 11. April 2025 um 20:08:30 UTC+2:
On Fri, Apr 11, 2025 at 12:14 PM Viktor Ransmayr

> PR #4237 summarizes all changes between version 6.8.3 and Leo's 6.8.4 branch.
> The changes you see in coloring are likely due to new settings in leoSettings.leo:
...
> Reading parts of PR #4237 I have the feeling that too many branches are involved ...

I wasn't as helpful as I could have been.

This page lists all the closed PRs in Leo 6.8.4. Scanning down the list of PRs we see PR #4281:
Allow rest comments to be colored differently from @language rest.

> I tried to find "rest.literal" in 'leoSettings' outline of the 'devel' branch - but - failed :-(

The valid settings are @color rest.literal1 through @color rest.literal4.

Aha! You have found a compatibility bug! leoSettings defines two new settings as True:

@bool color-doc-parts-as-rest = True
@bool color-docstrings-as-rest = True

But these must have defaults of False to ensure legacy coloring does not change.

Many thanks for pointing out this serious bug. 

PR #4328 sets both these settings to False. Please test and let me know your results.

This PR is a draft. There may be more work to do. My tests don't show the same results as your screen shots, but that may be a result of different settings in my copy of myLeoSettings.leo.

 The issue persists ! - For the moment I tried everything I could think of w/o success ...

Here's my log:

###

Update PyVE for Leo from GitHub to current state of Leo's repository - OK - See "Log-001".

Switch to the 'ekr-rest-coloring2' branch & re-open this outline using the updated PyVE - OK? - See "Log-002".

* Answer: NO - Coloring issue still exists :-(

Open 'leoSettings.leo' & check status of the two settings ?

* Result: The two settings are correct, i.e., set to 'false' !

Open 'myLeoSettings.leo' & check '@enabled-plugins' ?

* Switch from 'viewrendered3.py' to 'viewrendered.py' & re-open this outline - OK? - See "Log-003".

    * Answer: NO - Coloring issue still exists :-(

* Comment out all rst3-related settings in 'myLeoSettings.leo' & re-open this outline - OK? - See "Log-004".

    * Answer: NO - Coloring issue still exists :-(

Re-open this outline using the PyVE with Leo 6.8.3 - OK - See "Log-005".

* Answer: YES - Coloring issue does not exist ...

**Report results & take a break ;-)**

###

Please let me know, if you have any other suggestions I should try out !

With kind regards,

Viktor

Edward K. Ream

unread,
Apr 12, 2025, 5:46:00 AMApr 12
to leo-e...@googlegroups.com
On Sat, Apr 12, 2025 at 3:36 AM Viktor Ransmayr <viktor....@gmail.com> wrote:

 > The issue persists ! - For the moment I tried everything I could think of w/o success ...

Thanks for your report. I have some theories. I'll find the culprit soon.

Edward

Viktor Ransmayr

unread,
Apr 12, 2025, 5:48:29 AMApr 12
to leo-e...@googlegroups.com
Hello Edward,

Am Sa., 12. Apr. 2025 um 10:36 Uhr schrieb Viktor Ransmayr <viktor....@gmail.com>:
Hello Edward,

Edward K. Ream schrieb am Freitag, 11. April 2025 um 20:08:30 UTC+2:
On Fri, Apr 11, 2025 at 12:14 PM Viktor Ransmayr

> PR #4237 summarizes all changes between version 6.8.3 and Leo's 6.8.4 branch.
> The changes you see in coloring are likely due to new settings in leoSettings.leo:
...
> Reading parts of PR #4237 I have the feeling that too many branches are involved ...

I wasn't as helpful as I could have been.

This page lists all the closed PRs in Leo 6.8.4. Scanning down the list of PRs we see PR #4281:
Allow rest comments to be colored differently from @language rest.

> I tried to find "rest.literal" in 'leoSettings' outline of the 'devel' branch - but - failed :-(

The valid settings are @color rest.literal1 through @color rest.literal4.

Aha! You have found a compatibility bug! leoSettings defines two new settings as True:

@bool color-doc-parts-as-rest = True
@bool color-docstrings-as-rest = True

But these must have defaults of False to ensure legacy coloring does not change.

Many thanks for pointing out this serious bug. 

PR #4328 sets both these settings to False. Please test and let me know your results.

This PR is a draft. There may be more work to do. My tests don't show the same results as your screen shots, but that may be a result of different settings in my copy of myLeoSettings.leo.

 The issue persists ! - For the moment I tried everything I could think of w/o success ...

Just to be sure that it is not related to any personal Leo settings, I tried to re-produce the coloring issue in a FRESH Debian VM.

It can be re-produced. - See screenshot !

With kind regards,

Viktor

Screenshot-Coloring-Issue-in-a-fresh-Debian-12-VM.png
Reply all
Reply to author
Forward
0 new messages