This is good news. I poked around with Leo's QScintilla widget and I was 
able to get line numbers showing up. It looks great! But Leo's QScintilla 
need's quite a bit of work before it's really ready for daily use. I 
noticed you only implemented the Python lexer.

The bad news is like you said you're mostly at the mercy of the QScintilla 
lexers. There might be a way to add the Leo directives with the custom 
Lexer or by subclassing one of the built in lexers.

It's good to know that there might be a future in QScintilla. 

That said, the subclassed QFrame class in the link 
<https://john.nachtimwald.com/2009/08/15/qtextedit-with-line-numbers/> from 
my previous post works with both QTextEdit and QTextBrowser (which both 
inherit from QFrame). I'm not assuming that the custom class in that link 
is a drop in replacement but it should behave very similarly to a regular 
QTextEdit.

Whilst somewhat wishful thinking this is a part of Leo I'm interested in 
putting some work into in the future.


On Thursday, April 2, 2015 at 7:15:02 PM UTC-4, Edward K. Ream wrote:
>
> On Thu, Apr 2, 2015 at 7:23 AM, john lunzer <[email protected] 
> <javascript:>> wrote:
>
>> I just want to float this and get a sense for what the level of effort 
>> would be to add left gutter line numbers to the body pane.
>>
>
> ​Leo has some support for QScintilla​ 
> <http://pyqt.sourceforge.net/Docs/QScintilla2/>. QScintilla does support 
> line numbers in the gutter.
>
> This replaces Leo's default QTextBrowser widget with a scintilla widget::
>
>    @bool qt-use-scintilla = False
>
> Alas, there are problems with Leo's QScintilla widget--it appears 
> impossible to syntax color Leo's directives. There are also advantages, 
> which you might like to explore.
>
> It may sound minor but one of the features I miss the most in Leo is left 
>> gutter line numbers. I've done some searches on the group and it seems like 
>> the last time anyone mentioned line numbers in the body pane was back in 
>> 2010.
>>
>
> ​Similarly, minor sounding requests can be very difficult to do :-) Afaik, 
> the QTextBrowser <http://doc.qt.io/qt-5/qtextbrowser.html>class does not 
> support gutters or line numbers.
>
> Edward
>

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

Reply via email to