I now have reasonable colors for highlighting of very dark and very light 
themes, as well as for no-theme color schemes that forgot to set the 
background color.

On Thursday, August 26, 2021 at 5:25:26 PM UTC-4 [email protected] wrote:

> @ekr asked me to see about getting Leo's body editor to highlight the 
> current line.  This was in response to a request in Issue 2150 
> <https://github.com/leo-editor/leo-editor/issues/2150>.  I've made some 
> progress, which I report here.  I'd say it's about 3/4 of the way there.
>
> I have a working script that, when run, highlights the cursor line in the 
> visible node's body.  Here's what is left to do:
>
> 1. The highlight color isn't visible for very dark or very light 
> background colors.  Currently the highlight color is a modification of the 
> text background color as specified in the theme's stylesheet.  The way this 
> color is arrived at needs to be improved .  And I'm not yet sure how to 
> handle the case where no theme at all is in use (some people have tweaked 
> Leo's colors without using a theme).
>
> The highlight color scheme works well with the three tbp_xxx_solarized.leo 
> themes.
>
> 2. The code needs to have a proper home.  Presumably this will be in the 
> qt_text.py plugin.
>
> 3. The code needs to be hooked up to the body's cursor events so that the 
> highlight code knows that it has to change lines.
>
> Also, as a longer term matter, the code does not use any wrappers or 
> abstractions, so it will only work for Qt-based Guis.  This can be 
> addressed later, if it appears that there might be a viable non-Qt Gui 
> version of Leo.
>
> I've attached the current version of the code.  Open it in Leo.  Select a 
> line in the top node.  Run the script by pressing CTRL-b.  The current line 
> should highlight, although you may not be able to see it if you are using a 
> very dark or light theme, including Leo's default theme.  Put the cursor on 
> a different line in the same body.  Press CTRL-b again.  The highlight 
> should shift to the new cursor line.
>
> Please let me know if you find any problems (apart from the actual 
> highlight color).
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/7e347fe3-e077-4817-ab16-3a9a4e3a12aen%40googlegroups.com.

Reply via email to