5a78f7c: Leo shows line number in gutter by default

92 views
Skip to first unread message

Edward K. Ream

unread,
Jul 1, 2015, 9:45:46 AM7/1/15
to leo-e...@googlegroups.com
This completes #186: Left Gutter Line numbers

To disable, set @bool use_gutter = False

Here are the new settings in leoSettings.leo, with defaults as shown::
   
@bool use_gutter = True
@color gutter-bg = @LightSteelBlue1
@color gutter-fg = black
@int gutter-w-adjust = 12
@int gutter-y-adjust = 10
@string gutter-font-family = @font-family
@string gutter-font-size = @small-font-size
@string gutter-font-style = @font-style
@string gutter-font-weight = @font-weight

The w/y adjust settings are kludges that depend on the font size.

Jacob Peck

unread,
Jul 1, 2015, 10:21:32 AM7/1/15
to leo-e...@googlegroups.com
Nice work!  Looks snazzy.

The font-related settings don't work on my machine, for a few reasons in NumberBar.__init__:

- "gutter_font_slant" is not "gutter_font_style"
- "gutter_font_size" is completely ignored by LeoQtGui.getFontFromParams, because strings with 'px' or 'pt' don't cast to an int, meaning it defaults to c.config.defaultBodyFontSize
- c.config.getFontFromParams doesn't do dereferencing, so "@string gutter-font-family = @font-family" will try to create a font of the family "@font-family", rather than the value of @font-family, etc.

By using absolute values instead of dereferenced values, I was able to get everything but the size working -- that still defaults to c.config.defaultBodyFontSize.

Thanks,
-->Jake
--
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 post to this group, send email to leo-e...@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Terry Brown

unread,
Jul 1, 2015, 1:27:31 PM7/1/15
to leo-e...@googlegroups.com
On Wed, 1 Jul 2015 06:45:46 -0700 (PDT)
"Edward K. Ream" <edre...@gmail.com> wrote:

> This completes #186
> <https://github.com/leo-editor/leo-editor/issues/186>: Left Gutter
> Line numbers

I noticed a couple of things:

- for @auto, it seems it's displaying body relative, rather than file
relative, line numbers

- it slows down text handling so that given a line like:

common2code['Yellow-shafted Flicker'] = common2code['Northern Flicker']

if I put the cursor in front of the Y and hold down delete to clear
the quotes, the overrun that occurs when I take my finger off delete
as the cursor reaches the closing quote is excessive. This happens
even if the above code is the only code in the body.

This problem exists to a degree without gutters enabled, so maybe
the only real solution is to avoid processing aged key events, but
enabling gutters makes it noticeably worse.

Aside: I regret contributing nothing to Leo recently except whiny
complaints about exciting new features, but a recent conspiracy of work
deadlines has been followed by some significant family events which
have now created to backlog at work, so I'm using Leo all the time, but
haven't had time to do anything Leo related for a while.

Cheers -Terry

john lunzer

unread,
Jul 1, 2015, 4:22:33 PM7/1/15
to leo-e...@googlegroups.com
Edward, just in awe of Leo and its champion! The line gutter is magnificent, everything I thought it would be and more.

I'm having an issue with the colors. They aren't registering. I'm using the Leo Dark theme (solarized) and it's just using my default background and text colors regardless of what the bg/fg settings are, which makes it not a big deal but eventually I'd like to set the colors to be a little darker than the rest of Leo. 

john lunzer

unread,
Jul 1, 2015, 5:30:52 PM7/1/15
to leo-e...@googlegroups.com
Additionally, the body frame border does not extend around the line gutter. My intuition tells me that it should as right now it just doesn't look right. I think a further justification would be for people who choose wider frame borders it will definitely look off.

Chris George

unread,
Jul 1, 2015, 6:59:14 PM7/1/15
to leo-e...@googlegroups.com
I have noticed the lagginess and over run of the cursor for a week or two now. I just opened Kate and Leo. I created some text and tried moving the cursor using the arrow keys. When I hold down the arrow key in Leo, the cursor moves one character in the direction, pauses, then starts moving through the text. When I let go of the arrow key, the cursor continues to move for a few characters, a number that increases with the amount of time I hold down the key and the more text I scroll through.

In Kate, holding down the arrow key causes the cursor to move one character in the direction and pauses, then continues to scroll. The difference is that when I release the key, the cursor stops immediately.

No ideas about what might cause it, I have already modified my use of Leo so that I never scroll with the cursor.

Chris

Edward K. Ream

unread,
Jul 2, 2015, 10:39:52 AM7/2/15
to leo-editor
​​On Wed, Jul 1, 2015 at 9:21 AM, Jacob Peck <gates...@gmail.com> wrote:
Nice work!  Looks snazzy.


- "gutter_font_slant" is not "gutter_font_style"

​I'll fix this asap.
 
- "gutter_font_size" is completely ignored by LeoQtGui.
​​
getFontFromParams, because strings with 'px' or 'pt' don't cast to an int, meaning it defaults to c.config.defaultBodyFontSize

​Good catch.  This is separate problem.  I'll look into it.​
 

- c.config.getFontFromParams doesn't do dereferencing, so "@string gutter-font-family = @font-family" will try to create a font of the family "@font-family", rather than the value of @font-family, etc.

​Again, an existing problem unrelated to gutters per se.  I'll look into it.

Edward​
 
​​

Edward K. Ream

unread,
Jul 2, 2015, 10:42:24 AM7/2/15
to leo-editor
On Wed, Jul 1, 2015 at 12:27 PM, 'Terry Brown' via leo-editor <leo-e...@googlegroups.com> wrote:

I noticed a couple of things:

 - for @auto, it seems it's displaying body relative, rather than file
   relative, line numbers

​True for all kinds of @<file> nodes.  It would be expensive to give the line relative to the start of the file.  Essentially the full goto-global-line machinery would be needed.​
 

 - it slows down text handling so that given a line like:

   common2code['Yellow-shafted Flicker'] = common2code['Northern Flicker']

   if I put the cursor in front of the Y and hold down delete to clear
   the quotes, the overrun that occurs when I take my finger off delete
   as the cursor reaches the closing quote is excessive.  This happens
   even if the above code is the only code in the body.

   This problem exists to a degree without gutters enabled, so maybe
   the only real solution is to avoid processing aged key events, but
   enabling gutters makes it noticeably worse.

​I don't see the problem here.  It may be related to your usage.​
 

Aside: I regret contributing nothing to Leo recently

​Family and work must come before Leo.  I'll look forward to your return :-)

Edward

Edward K. Ream

unread,
Jul 3, 2015, 6:47:32 AM7/3/15
to leo-editor
On Wed, Jul 1, 2015 at 9:21 AM, Jacob Peck <gates...@gmail.com> wrote:
- "gutter_font_slant" is not "gutter_font_style"

​Fixed at ae3f5c3.

EKR

Edward K. Ream

unread,
Jul 3, 2015, 5:09:31 PM7/3/15
to leo-editor
On Thu, Jul 2, 2015 at 9:39 AM, Edward K. Ream <edre...@gmail.com> wrote:

​4fcd91 fixes several configuration problems by not using
​​
getFontFromParams in the gutter class.  Indeed, getFontFromParams is intended only for use by the syntax coloring code.  All the other code can and should use Leo's stylesheets.

Most settings apply to stylesheets.  For such settings @-replacements are made.  But the syntax-coloring settings do have the @-replacements applied.

Edward

john lunzer

unread,
Jul 6, 2015, 10:09:24 AM7/6/15
to leo-e...@googlegroups.com
After the most recent changes (from the first introduction of the gutter) the gutter-font-family is no longer setting the gutter font for me. I have:
@string gutter-font-family = Courier

Additionally my color settings are still not being applied. Again, I am using the leo_dark_theme 0 (solarized) theme.
Reply all
Reply to author
Forward
0 new messages