Suggestion: please implement line numbering in editor for library files

7 views
Skip to first unread message

ack

unread,
Nov 6, 2011, 5:29:59 PM11/6/11
to Reinteract
It would be very nice to have Reinteract show line numbers when
editing library files in a notebook.
This way it would be much easier to find the line in the library where
an exception or syntax error occured while recalculating a worksheet.
Any comments or suggestions?

Kind regards,

ack

Owen Taylor

unread,
Nov 7, 2011, 9:54:58 AM11/7/11
to reint...@googlegroups.com
Line numbers are certainly possible.

I think what I'd want to explore first though is being able to click
on a line in a traceback that is in a library file or somewhere else
in the current worksheet to get taken directly to the site of the
error ... much better than having to remember a line number as you
switch tabs and then scroll manually to find it.

It would be nice to be able to "take the traceback with you" and still
have that when you are looking at the other file ... I'm not sure how
that would work exactly - I could imagine a temporary pane opening at
the bottom of the window when you click on a line, but I'm still wary
of an IDE-style proliferation of extra panes.

- Owen

> --
> You received this message because you are subscribed to the Google Groups "Reinteract" group.
> To post to this group, send email to reint...@googlegroups.com.
> To unsubscribe from this group, send email to reinteract+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/reinteract?hl=en.
>
>

ack

unread,
Nov 7, 2011, 4:14:02 PM11/7/11
to Reinteract
On 7 nov, 15:54, Owen Taylor <owtay...@gmail.com> wrote:
> Line numbers are certainly possible.
>
> I think what I'd want to explore first though is being able to click
> on a line in a traceback that is in a library file or somewhere else
> in the current worksheet to get taken directly to the site of the
> error ... much better than having to remember a line number as you
> switch tabs and then scroll manually to find it.

Excellent!

> It would be nice to be able to "take the traceback with you" and still
> have that when you are looking at the other file ... I'm not sure how
> that would work exactly - I could imagine a temporary pane opening at
> the bottom of the window when you click on a line, but I'm still wary
> of an IDE-style proliferation of extra panes.

I've come to admire your constant struggle against 'feature bloat',
let's keep reinteract as nicely minimalist as possible, that's why i
like it :-)

Perhaps you could make the traceback a focussable popup balloon (like
the documentation which pops up when you hover the mouse over an
identifier). which only pops up when the mouse is over the
(highlighted!) line where the exception occurred. That would keep
clutter to a minimum.

-ack

Robert Schroll

unread,
Nov 7, 2011, 8:02:12 PM11/7/11
to reint...@googlegroups.com

I wasn't expecting this to work, but it did, so I'll share it. This
patch replaces the TextView with a GTKSourceView2.View as ancestor of
ShellView. Then, we can easily turn on line numbering in the
LibraryEditor. I haven't tested this carefully, so if it eats your
homework or craps on your carpet, you've been warned.

In the long run, I agree with Owen--intelligent exception reporting is
definitely preferable. But maybe this will be useful for you in the
short run.

Robert

0001-Use-GTKSourceView2-as-ancestor-for-ShellView.patch

ack

unread,
Nov 8, 2011, 3:11:49 PM11/8/11
to Reinteract
On 8 nov, 02:02, Robert Schroll <rschr...@gmail.com> wrote:
> I wasn't expecting this to work, but it did, so I'll share it.  This
> patch replaces the TextView with a GTKSourceView2.View as ancestor of
> ShellView.  Then, we can easily turn on line numbering in the
> LibraryEditor.  I haven't tested this carefully, so if it eats your
> homework or craps on your carpet, you've been warned.

Thanks, I will try it out while waiting for the (text) balloon to
pop :-)

-ack

ack

unread,
Nov 8, 2011, 4:38:49 PM11/8/11
to Reinteract
Works like a charm!

-ack

Robert Schroll

unread,
Dec 1, 2011, 12:53:49 AM12/1/11
to reint...@googlegroups.com
On 11/07/2011 08:02 PM, Robert Schroll wrote:
> I wasn't expecting this to work, but it did, so I'll share it. This
> patch replaces the TextView with a GTKSourceView2.View as ancestor of
> ShellView. Then, we can easily turn on line numbering in the
> LibraryEditor. I haven't tested this carefully, so if it eats your
> homework or craps on your carpet, you've been warned.

I've been using this patch for the past few weeks, mainly because I'm
too lazy to undo it. There's been no homework eaten, but I have noticed
an interesting side effect. Before, I would occasionally get worksheets
and libraries confused and try to execute a library. Since I've added
line numbers, this hasn't happened. I would have thought that the lack
of the bright rectangles next to the code was as good a visual
indicator, but apparently not. I don't know if this is because it's
harder to notice something that's not there than something that is, or
because line numbers remind me of a text editor, or what, but I'd like
to float the idea that line numbers in libraries is good purely for
visual distinction from worksheets.

Robert

Reply all
Reply to author
Forward
0 new messages