bugGNU Octave - Bugs: bug #44040, GUI editor: horizontal scroll...


bug #44040: GUI editor: horizontal scroll doesn't quite reach the end of very long lines

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Sun 18 Jan 2015 08:05:19 PM UTC  
Category:  GUI Severity:  2 - Minor
Priority:  3 - Low Item Group:  Incorrect Result
Status:  Confirmed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Fri 15 Jan 2016 10:37:44 AM UTC, comment #13:

I have now tried this patch myself (and compiled the Octave source).

I do mostly share the observations of comment #9:

  • When I insert a 200 character text line into the editor, then the end key works well, and the horizontal scrollbar also works well. The only drawback: The horizontal scrollbar is slightly too long, but this doesn't disturb me at all. It was much worse before, when the scrollbar was too short and I couldn't reach the end of my text line. From this observations I would say: I prefer the version WITH the patch appplied, and not the one without.
  • But when I insert a 600 character text line, then the problem (as before without the patch) is still there: I cannot reach the end of the line by pressing the end key (once). And the horizontal scrollbar is also too short to reach the end of the line. This is very disturbing (as it was before).

So applying the patch would not fully solve this remaining issue. But I think a text line with 600 characters is no normal use case of the m-file editor in Octave. Whereas a 200 character text line can sometimes happen, e.g. when inserting a long text string with an absolute file name into the code (as I did).

So my conclusion would be:

  • Please do apply the patch from comment #9
  • But also do leave this issue open, since it is then only improved, and not fully solved. Maybe a new QScintilla version with help here.

(Note: I used Ubuntu 14.04 with libqscintilla2-dev in version 2.8.1-2ubuntu1 for my tests.)

Hartmut <hardy>
Wed 13 Jan 2016 08:33:09 PM UTC, comment #12:

Have you tried the patch? If you can build Octave yourself it's an easy patch to try out.

I can't remember if I did (probably I did but it may not have been satisfying for me, I don't remember).


Oh but I do remember; and it is described in my last comment #9.
The side effects are also described there.

All in all, there are issues with and without the patch that more or less balance out. Maybe a newer QScintilla would do the trick? Can't remember what version I had a year ago.

Philip Nienhuis <philipnienhuis>
Project Member
Wed 13 Jan 2016 07:45:12 PM UTC, comment #11:

I've also run into this (remaining) inconsistency of the horizontal scrollbar.

Are there plans to make use of Torsten's second patch (in comment #8) to fully fix this issue in the next release? Or are there any side effects of this patch to be expected?

Hartmut <hardy>
Fri 13 Mar 2015 09:28:14 PM UTC, comment #10:

Yes, for performance reasons Scintilla does not update the text width and assumes a fixed scroll width (2000 px per default).

Torsten <ttl>
Project Member
Fri 13 Mar 2015 11:44:04 AM UTC, comment #9:

The END key works fine now on Linux at least.
Ctrl-Right_arrow also works good, as does Ctrl-Left_arrow from the next line.

Dragging the scroll bar handle now does allow to reach the end of the longest line (OK and beyond but that's no big deal).
The scroll bar handle position doesn't match the expected position when the cursor is at the end of the longest line in a file (longest line in my test file was 552 characters); it is at about 80 % AFAICS. Some experimenting with doubling line length gives the impression it "asymptotically" will reach the rightmost position...
For m-files with max line length of 80 chars the scroll bar handle only gets a little off the leftmost position (say 15 % or so).

Is that what you meant, Torsten?

Philip Nienhuis <philipnienhuis>
Project Member
Fri 13 Mar 2015 06:02:05 AM UTC, comment #8:

There is probably not much what we can do here. The attached patch restores the default behavior of Scintilla, a certain scroll width right from the beginning regardless the length of the longest line. Could you please check whether this patch fixes the issue for you?

(file #33330)

Torsten <ttl>
Project Member
Sun 08 Mar 2015 02:32:44 PM UTC, comment #7:

I can confirm the behavior that Philip reports on Linux as well. Updating the bug summary to reflect the remaining issue. If I hold down the right arrow key so the cursor moves to the end of the long line, and keep holding it down until the screen is "bumped" to show the full line, then it seems to "fix" this problem. Until I type some more text at the end of the line, then it seems to forget how wide the display should be and the behavior comes back.

Mike Miller <mtmiller>
Project Administrator
Wed 21 Jan 2015 03:10:28 PM UTC, comment #6:

Re-opening this bug report.

After the fix the scroll bar still has a few glitches. See attached pics.

Steps to reproduce:

1. Put cursor at left margin on a very long line (upper pic)

2. Pull scroll bar handle to rightmost position (middle pic).
One can already see that there are still characters beyond the right margin.

3. press END key => cursor moves to end of line (lower pic).
Then the text is scrolled a little bit further to the left so that the rightmost chars on the long line display (with ~3 chars room to the right in pic 44040-B).

In the second pic 44040-C, initially the rightmost 3 characters weren't shown at all. I had to press the END key about 15 times before the rightmost line char was shown; with each key press the text scrolled a mm or so to the left.

Expected behavior:
Pulling the scroll bar to the rightmost position reveals the rightmost characters on a long line as well;
Optionally: also leaves minimum room between rightmost character and right margin.

(Could this be a QScintilla issue?)

<status reset to "in progress">

(file #32885, file #32886)

Philip Nienhuis <philipnienhuis>
Project Member
Mon 19 Jan 2015 08:51:03 PM UTC, comment #5:

Works fine now.
Perhaps one can argue about proportionality of the width of the "handle" in the scroll bar but I am happy.

I'll close the report. Thanks for the fix!

Philip Nienhuis <philipnienhuis>
Project Member
Mon 19 Jan 2015 06:05:50 AM UTC, comment #4:

The issue is fixed on my system (Linux) with cset

Torsten <ttl>
Project Member
Mon 19 Jan 2015 05:45:43 AM UTC, comment #3:

This is not that obvious since previously the horizontal was always shown, regardless the length of the longest line in the file. But I can confirm the issue on my system: loading a file with longer lines does not automatically update the scroll bar.

Torsten <ttl>
Project Member
Sun 18 Jan 2015 10:55:18 PM UTC, comment #2:

But how about the attached pic then?

I'd expect a horizontal scroll bar to be able to see the rightmost portions of the @deftypefnx lines; I have the specific option selected in the Editor tab in the Preferences pane. With or without - no horizontal scroll bar.

In fact, I think it is reasonable to expect a horizontal scroll bar as soon as a line in the file (or in sight = in the part of the file that is visible in the editor pane) is wider than the rightmost margin.

Presently the only way I can see the last chars of those @deftypefnx lines is to go to that line end press the End button, or right arrow button repeatedly.
That is a clumsy way IMO.

(file #32862)

Philip Nienhuis <philipnienhuis>
Project Member
Sun 18 Jan 2015 10:05:54 PM UTC, comment #1:

When the scroll bar is active, it should only be shown, when a line grows to a specific length.

Torsten <ttl>
Project Member
Sun 18 Jan 2015 08:05:19 PM UTC, original submission:

(OK a minor regression, but it used to work)

The horizontal scroll bar is missing in the editor pane. Setting / unsetting the pref in the editor tab makes no difference.

(I'm at 9a944b9e1cb, branch gui-release, "provide a user preference for printing the debug location in the terminal")

Philip Nienhuis <philipnienhuis>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #33330:  bug44040_01.patch added by ttl (946B - text/x-diff)
file #32885:  44040-B.png added by philipnienhuis (85KiB - image/png)
file #32886:  44040-C.png added by philipnienhuis (60KiB - image/png)
file #32862:  bug44040_1.png added by philipnienhuis (67KiB - image/png)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by philipnienhuis (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 18 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-13 ttl Attached File- => Added bug44040_01.patch, #33330
    2015-03-11 mtmiller Dependencies- => bugs #44506 is dependent
    2015-03-08 mtmiller Severity3 - Normal => 2 - Minor
        Priority5 - Normal => 3 - Low
        Item GroupRegression => Incorrect Result
        StatusIn Progress => Confirmed
        Operating SystemMicrosoft Windows => Any
        SummaryGUI: horizontal scroll bar in editor missing => GUI editor: horizontal scroll doesn't quite reach the end of very long lines
    2015-01-27 rik5 Carbon-CopyRemoved 72865 => -
    2015-01-27 rik5 SummaryGUI: horizntal scroll bar in editor missing => GUI: horizontal scroll bar in editor missing
    2015-01-21 philipnienhuis Attached File- => Added 44040-B.png, #32885
        Attached File- => Added 44040-C.png, #32886
        StatusFixed => In Progress
        Open/ClosedClosed => Open
    2015-01-19 philipnienhuis StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2015-01-19 ttl StatusNone => Ready For Test
    2015-01-18 philipnienhuis Attached File- => Added bug44040_1.png, #32862

    Back to the top

    Powered by Savane 3.3