Tk Source Code

View Ticket
Login
Ticket UUID: 3574945
Title: Scrolling up with elided text doesn't play nice
Type: Bug Version: None
Submitter: talvo Created on: 2012-10-06 02:09:24
Subsystem: 18. [text] Assigned To: fvogel
Priority: 6 Severity: Minor
Status: Closed Last Modified: 2015-02-06 21:19:35
Resolution: Fixed Closed By: fvogel
    Closed on: 2015-02-06 21:19:35
Description:
Create a basic text widget with some elided text, for example:

pack [text .t -yscroll ".s set"] [scrollbar .s -command ".t yview"] -side left -fill y
.t tag config hide -elide 1
foreach x [list 0 1 2 3 4 5 6 7 8 9 0] {
  .t insert end "foo\nfoo\nfoo\nfoo\nfoo\nfoo\n"
  .t insert end "bar\nbar\nbar\nbar\nbar\nbar\n" hide
}


Then scroll the text a line at a time, either by clicking in the text widget and using the up/down arrow keys, or with

.t yview scroll 1 unit
.t yview scroll -1 unit

The text scrolls down without any problem, but when scrolling up again, it pauses whenever it gets to an ellided line, causing the scroll action to have no visible effect. (tested on 8.5.9 and 8.6b1 on Windows XP and Win 7)
User Comments: fvogel added on 2015-02-06 21:19:35:
Merged in branch text-elided and then to core-8-5-branch and trunk.

fvogel added on 2014-12-23 10:20:15:
The problem seen in Tablelist (see two comments below) is different and is now followed at:

http://core.tcl.tk/tk/tktview/c199ef90a67fa4ea440eac10aabbb28c532a74c7

fvogel added on 2014-12-15 20:23:07:
I have made some work regarding this issue and I believe this does no longer happen.

Work continues, there are still things to do to make elided newlines fully supported by the text widget.

See branch text-elided for the details.

fvogelnew1 added on 2013-05-29 12:36:58:
Another incarnation of the apparently same bug hit Tablelist and is described here:

https://groups.google.com/d/msg/comp.lang.tcl/hBIXFmZ-MpY/wXygfdVVLfUJ

fvogelnew1 added on 2013-01-21 13:49:34:
Here is an update on the matter:

I have investigated this issue quite deeply. It's not easy to get it right.

I have made to the conclusion that FindDLine is wrong: it does not account for the possibility of elided newlines. This is the root cause of several problems when moving the cursor in elided text, clicking in text widgets within elided ranges, selecting text, absence of cursor blinking and so on.

Fixing FinDLine in this regard is however not enough by itself. It is used in a number of places in the text widget code and all these places must be checked/updated to make sure elided newlines are taken into account there as well (they are currently not).

This takes time and is also in a rather low prio in my to-do list...

talvo added on 2012-10-06 14:38:00:
Ahh, it seems to only break using the keyboard if you omit the final \n from both of the insert lines, which also causes wish to hang, as mentioned in the ticket you linked.

fvogelnew1 added on 2012-10-06 14:24:08:
I could see the issue on 8.5.9 with

t yview scroll 1 unit
.t yview scroll -1 unit
 
but not with the keyboard. Could you please explain again how you trigger the bug with the keyboard?

Also, must check whether this can be reproduced with the latest sources (8.5.12 at least), since I have fixed issues when moving the cursor in elided text a few months ago, see:

http://sourceforge.net/tracker/?func=detail&aid=3021557&group_id=12997&atid=112997