@ -881,9 +881,8 @@ tcl::namespace::eval overtype {
set cursor_saved_position [tcl::dict::create]
set cursor_saved_position [tcl::dict::create]
set cursor_saved_attributes ""
set cursor_saved_attributes ""
} else {
} else {
#TODO
#FUTURE: Handle restore without save case
#?restore without save?
#Should move to home position and reset ansi SGR when no save data available
#should move to home position and reset ansi SGR?
#puts stderr "overtype::renderspace cursor_restore without save data available"
#puts stderr "overtype::renderspace cursor_restore without save data available"
}
}
#If we were inserting prior to hitting the cursor_restore - there could be overflow_right data - generally the overtype functions aren't for inserting - but ansi can enable it
#If we were inserting prior to hitting the cursor_restore - there could be overflow_right data - generally the overtype functions aren't for inserting - but ansi can enable it
@ -1196,7 +1195,7 @@ tcl::namespace::eval overtype {
wrapmoveforward {
wrapmoveforward {
#doesn't seem to be used by fruit.ans testfile
#doesn't seem to be used by fruit.ans testfile
#used by dzds.ans
#used by dzds.ans
#note that cursor_forward may move deep into the next line - or even span multiple lines !TODO
#FIXED: cursor_forward can move deep into the next line or span multiple lines - handled below
set c $renderwidth
set c $renderwidth
set r $post_render_row
set r $post_render_row
if {$post_render_col > $renderwidth} {
if {$post_render_col > $renderwidth} {
@ -2572,8 +2571,9 @@ tcl::namespace::eval overtype {
lset overmap 0 "$startpadding[lindex $overmap 0]"
lset overmap 0 "$startpadding[lindex $overmap 0]"
} else {
} else {
if {[punk::ansi::ta::detect $overdata]} {
if {[punk::ansi::ta::detect $overdata]} {
#TODO!! rework this.
#FUTURE: Optimize for large files with no newlines
#e.g 200K+ input file with no newlines - we are wastefully calling split_codes_single repeatedly on mostly the same data.
#Currently wastefully calling split_codes_single repeatedly on mostly the same data.
#Consider caching or streaming approach for 200K+ input files.
#set overmap [punk::ansi::ta::split_codes_single $startpadding$overdata]
#set overmap [punk::ansi::ta::split_codes_single $startpadding$overdata]
set overmap [punk::ansi::ta::split_codes_single $overdata]
set overmap [punk::ansi::ta::split_codes_single $overdata]
lset overmap 0 "$startpadding[lindex $overmap 0]"
lset overmap 0 "$startpadding[lindex $overmap 0]"
@ -2599,9 +2599,9 @@ tcl::namespace::eval overtype {
#???
#???
set colcursor $opt_colstart
set colcursor $opt_colstart
#TODO - make a little virtual column object
#FUTURE: Create a virtual column object for cleaner column tracking
#we need to refer to column1 or columnmin? or columnmax without calculating offsets due to to startcolumn
#Currently need to refer to column1 or columnmin/columnmax without calculating offsets due to startcolumn.
#need to lock-down what start column means from perspective of ANSI codes moving around - the offset perspective is unclear and a mess .
#Need to clarify what start column means from ANSI code movement perspective - offset perspective is unclear .
#set re_diacritics {[\u0300-\u036f]+|[\u1ab0-\u1aff]+|[\u1dc0-\u1dff]+|[\u20d0-\u20ff]+|[\ufe20-\ufe2f]+}
#set re_diacritics {[\u0300-\u036f]+|[\u1ab0-\u1aff]+|[\u1dc0-\u1dff]+|[\u20d0-\u20ff]+|[\ufe20-\ufe2f]+}
@ -3046,10 +3046,9 @@ tcl::namespace::eval overtype {
set instruction overflow_splitchar
set instruction overflow_splitchar
break
break
} elseif {$owidth > 2} {
} elseif {$owidth > 2} {
#? tab?
#FUTURE: Handle wide graphemes and tabs
#TODO!
#Could be tab with length dependent on tabstops/elastic tabstop settings
puts stderr "overtype::renderline long overtext grapheme '[ansistring VIEW -lf 1 -vt 1 $ch]' not handled"
puts stderr "overtype::renderline long overtext grapheme '[ansistring VIEW -lf 1 -vt 1 $ch]' not handled"
#tab of some length dependent on tabstops/elastic tabstop settings?
}
}
} elseif {$idx >= $overflow_idx} {
} elseif {$idx >= $overflow_idx} {
#REVIEW
#REVIEW
@ -3394,8 +3393,7 @@ tcl::namespace::eval overtype {
#we've mapped 7 and 8bit escapes to values we can handle as literals in switch statements to take advantange of jump tables.
#we've mapped 7 and 8bit escapes to values we can handle as literals in switch statements to take advantange of jump tables.
switch -- $leadernorm {
switch -- $leadernorm {
1006 {
1006 {
#TODO
#FUTURE: Implement mouse event handling
#
switch -- [tcl::string::index $codenorm end] {
switch -- [tcl::string::index $codenorm end] {
M {
M {
puts stderr "mousedown $codenorm"
puts stderr "mousedown $codenorm"
@ -3845,7 +3843,7 @@ tcl::namespace::eval overtype {
#(for use with selective erase: DECSED and DECSEL)
#(for use with selective erase: DECSED and DECSEL)
set param [tcl::string::range $codenorm 4 end-2]
set param [tcl::string::range $codenorm 4 end-2]
if {$param eq ""} {set param 0}
if {$param eq ""} {set param 0}
#TODO - store like SGR in stacks - replays?
#FUTURE: Store DECSCA like SGR in stacks for replay capability
switch -exact -- $param {
switch -exact -- $param {
0 - 2 {
0 - 2 {
#canerase
#canerase
@ -4425,8 +4423,7 @@ tcl::namespace::eval overtype {
} else {
} else {
set sos_content [string range $code 2 end-2] ;#ST is \x1b\\
set sos_content [string range $code 2 end-2] ;#ST is \x1b\\
}
}
#return in some useful form to the caller
#FUTURE: Return SOS content in useful form to the caller
#TODO!
lappend sos_list [list string $sos_content row $cursor_row column $cursor_column]
lappend sos_list [list string $sos_content row $cursor_row column $cursor_column]
puts stderr "overtype::renderline ESCX SOS UNIMPLEMENTED. code [ansistring VIEW -lf 1 -vt 1 -nul 1 $code]"
puts stderr "overtype::renderline ESCX SOS UNIMPLEMENTED. code [ansistring VIEW -lf 1 -vt 1 -nul 1 $code]"
}
}