Problems With '-startline'/'-endline'

Try this example:

text .t
.t mark set m 1.0
.t mark set n m
.t mark gravity m left
.t mark gravity n left
.t insert end "\n"
.t peer create .peer -startline 2 -endline 2
puts [.peer mark next m]
exit 0

With old text widget this script prints "n". This is erroneous in two ways, because both marks (m and n) should not be reachable inside the peer. The revised version will throw the error message there is no mark named "m". The same problem has been fixed in command mark previous.

Next problem, execute this example:

pack [text .t]
.t insert end "123\n456\n789"
.t configure -startline 1 -endline 3
.t mark set insert end
focus .t
update
event generate .t <<NextLine>> ;# simulating <Key-Down>

It will popup the error message bad text index "insert". I think that the -startline/-endline options are not very popular, otherwise this bug would be already detected.

Now this example, it will crash:

pack [text .t -startline 2]
.t insert end "Test"
# simulate a triple click
event generate .t <Button-1> -x 1 -y 1
event generate .t <Button-1> -x 1 -y 1
event generate .t <Button-1> -x 1 -y 1

The following example is also crashing wish8.6:

text .t -startline 2 -endline 2
.t search "text" 1.0
exit 0