Tk Source Code

View Ticket
Login
Ticket UUID: 529239918cb719025bb9192428d1a75f685baf6e
Title: revised_text: default value for -spacemode not backwards compatible
Type: Bug Version: revised_text
Submitter: fvogel Created on: 2018-11-04 21:15:45
Subsystem: 18. [text] Assigned To: gcramer
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2018-11-10 09:30:43
Resolution: Wont Fix Closed By: fvogel
    Closed on: 2018-11-10 09:30:43
Description:
In revised_text, there is now a -spacemode option, with default "none".

The default should be "trim" to be backwards compatible with the legacy code.
User Comments: fvogel added on 2018-11-10 09:30:43:

TIP #466 now more precise to this respect.


fvogel added on 2018-11-10 09:24:18:

OK I understand better now.

No -spacemode option at all is fully backwards compatible with 8.6. That is, neither none, nor trim nor exact gives the same display as in 8.6 in all cases.

This is because of your opinion that bug reports [1082213fff] and [1754051fff] are invalid. These bugs were fixed in 8.6 (legacy code), but you have reverted the behavior in the revised_text version.

Okay, let's keep things as they are. but I'll add a note in TIP #466 so that I (at least) can remember this next time it puzzles me.


gcramer added on 2018-11-07 09:49:15:

On page Trimming Spaces I figured out that the display behavior of wish8.6 is buggy. Note that the two consecutive spaces are not trimmed with wish8.6, use left and right cursor movement for observation. The use of "trim" as a default is definitively not compatible. The fact is that the display behavior has been fixed in this special case, and the default behavior "none" of revised implementation is correct. Use other reliable editors (like vi) for comparison, the editor has to show the exact content (per default), and the revised implementation is doing this. The legacy code is gobbling the display of the second space, this makes editing error-prone, the user cannot see the difference between one and two spaces. Please also note that the display behavior of revised version is compatible to display behavior of wish8.5, this buggy gobbling of spaces has been introduced with version 8.6. Furthermore also the example given with attached spacemode.png shows that "trim" is incompatible, even with version 8.6.


fvogel added on 2018-11-06 19:50:02:

From your own example:

package require Tk
set font [list [font configure TkFixedFont -family] -14]
text .t -font $font -width 15 -height 3 -padx 5 -pady 5 -wrap word -insertofftime 0
# .t configure -spacemode none ; # "none" is the default in revised_text
.t insert end "two consecutive  spaces"
.t mark set insert 1.16
pack .t -fill both
focus .t

This does not give the same result in revised_text and in core-8-6-branch (see attached screenshot "comparison_revised_text_legacy.png" showing revised_text at the top and legacy at the bottom).

However, with .t configure -spacemode trim it does.


gcramer added on 2018-11-06 09:21:25:

I cannot understand. I've attached a (combined) screenshot, top created with legacy code (wish8.6), middle with space mode "none", and bottom with space mode "trim". Obviously default "none" is compatible.


Attachments: