Tk Source Code

View Ticket
Login
2014-03-13
09:00 Ticket [3472539fff] Moving the cursor in elided text freezes Tk status still Closed with 1 other change artifact: f2ba2d3dde user: jan.nijtmans
2014-02-19
21:42 Ticket [3472539fff]: 1 change artifact: 9c7214b593 user: andreask
2012-01-20
02:59 Closed ticket [3472539fff]. artifact: cbf4c08672 user: nijtmans
02:59 Ticket [3472539fff]: 4 changes artifact: d0722181ba user: nijtmans
2012-01-19
15:35 Ticket [3472539fff]: 1 change artifact: 4979b4c055 user: nijtmans
15:35 Ticket [3472539fff]: 4 changes artifact: f9a8097b31 user: nijtmans
2012-01-18
22:27 Ticket [3472539fff]: 1 change artifact: 1e176a0d68 user: fvogelnew1
14:54 Ticket [3472539fff]: 4 changes artifact: ae6079671e user: fvogelnew1
03:04 Ticket [3472539fff]: 4 changes artifact: e056478b1b user: fvogelnew1
03:04 Add attachment 3021557_V1_1.patch to ticket [3472539fff] artifact: 4f8ea1fec6 user: fvogelnew1
03:03 Ticket [3472539fff] Moving the cursor in elided text freezes Tk status still Open with 4 other changes artifact: bd03625fe9 user: fvogelnew1
00:08 Ticket [3472539fff]: 4 changes artifact: 6cd58c38b3 user: fvogelnew1
2012-01-17
12:40 Ticket [3472539fff]: 4 changes artifact: d5158bcbb6 user: nijtmans
2012-01-12
03:40 Ticket [3472539fff]: 4 changes artifact: 08c7d7cbff user: fvogelnew1
03:30 Ticket [3472539fff]: 1 change artifact: 1cc7a8cb15 user: fvogelnew1
03:29 Add attachment 3021557_V1.patch to ticket [3472539fff] artifact: d4f79893cf user: fvogelnew1
03:29 Ticket [3472539fff] Moving the cursor in elided text freezes Tk status still Open with 4 other changes artifact: a65304daf7 user: fvogelnew1
2012-01-11
20:29 New ticket [3472539fff]. artifact: effa5d9eee user: fvogelnew1

Ticket UUID: 3472539
Title: Moving the cursor in elided text freezes Tk
Type: Patch Version: None
Submitter: fvogel Created on: 2012-01-11 20:29:47
Subsystem: 18. [text] Assigned To: jan.nijtmans
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2014-03-13 09:00:51
Resolution: Fixed Closed By: nijtmans
    Closed on: 2012-01-19 19:59:05
Description:
The attached patch fixes item 3021557:

Moving the cursor in elided text freezes Tk:
https://sourceforge.net/tracker/?func=detail&aid=3021557&group_id=12997&atid=112997

The patch is against the latest Fossil sources.

The existing text.test suite passes with no failure (but one completely unrelated: text-33.11).
I have added one test item for issue 3021557 that the patch is fixing.
User Comments: nijtmans added on 2012-01-20 02:59:04:
Merged to trunk as well, everthing done.

François, many thanks for your work on this!  Including a
test-case, keeping everyone involved, clearly helped
in getting this resolved.

nijtmans added on 2012-01-19 15:35:45:
Done as suggested, this indeed fixes the test.

Committed to core-8-5-branch. Trunk still to go,
there I will use the original test as supplied.

fvogelnew1 added on 2012-01-18 14:54:04:
Another way: add

.t configure -wrap none

before the update in the -setup part of test-9.2.44

This does apparently not impact any other test since it's anyway also done just after test-9.2.44

This may be the best solution, but the choice is up to you.

fvogelnew1 added on 2012-01-18 03:04:47:

File Added - 433302: 3021557_V1_1.patch

fvogelnew1 added on 2012-01-18 03:03:28:
Sorry, this is my mistake. In the currently committed test the text widget really is packed. However it has quite a small width, which changes the expected results because of lines wrapping (we're measuring -displaylines here!).

The fix is simple: shorten the lines so that they do not wrap, or adapt the expected results by taking the wrapping into account.

The attached patch "3021557_V1_1.patch" takes the first path.

fvogelnew1 added on 2012-01-18 00:08:57:
The test fails for me on Windows as well.

The cause seems that the widget is not packed during the test.
The test I originally provided in my patch used a dedicated text widget, did pack it and destroy it at the end of the test.
The test currently committed in branch bug-3021557 does not pack the text widget it is using.

However, even when packing the widget there is still something odd in the testing since it still fails whereas running the test case test-9.2.44 standalone in wish succeeds. Are the successive test cases really independent from each other? I doubt.

nijtmans added on 2012-01-17 12:40:08:
Branch bug-3021557 created, derived from core-8-5-branch

On Ubuntu, the test fails, but that's because currently many Tk tests
are dependant on font sizes available at the machine. This is
a known fact. On trunk this is better, but still not 100%

fvogelnew1 added on 2012-01-12 03:40:42:
Note about efficiency:

The fix replaces a loop calling TkBTreeNextLine by a single test with TkTextIndexCmp.

This was already proposed as an alternate option in a comment in the source code, highlighting alledged better efficiency of the loop calling TkBTreeNextLine.

It turns out that the loop calling TkBTreeNextLine did not do what is wanted, which is the cause of the bug, whereas TkTextIndexCmp is the right thing to do.

Regarding efficiency, I did not find any difference between the current bugged code and the patched code. The script I used for timing both cases is the following:

text .t
pack .t
.t insert end [string repeat "abcde\n" 2000]
update
time {.t count -displaylines 1.0 end} 100

I have then concluded that the comment about lesser efficiency of the single call to TkTextIdexCmp as compared to the loop repeatedly calling TkBTreeNextLine was actually not relevant.

fvogelnew1 added on 2012-01-12 03:29:48:

File Added - 432755: 3021557_V1.patch

Attachments: