Browse Source

fix overtype to resolve commands in punk::lib

master
Julian Noble 8 months ago
parent
commit
86443e03c6
  1. 9
      src/bootsupport/modules/overtype-1.6.0.tm
  2. 5
      src/bootsupport/modules/punk/mix/templates/layouts/project/src/make.tcl
  3. 5
      src/modules/punk/mix/templates/layouts/project/src/make.tcl
  4. 9
      src/vendormodules/overtype-1.6.0.tm

9
src/bootsupport/modules/overtype-1.6.0.tm

@ -85,6 +85,8 @@ namespace eval overtype {
namespace import ::punk::assertion::assert namespace import ::punk::assertion::assert
punk::assertion::active true punk::assertion::active true
namespace path ::punk::lib
namespace export * namespace export *
variable default_ellipsis_horizontal "..." ;#fallback variable default_ellipsis_horizontal "..." ;#fallback
variable default_ellipsis_vertical "..." variable default_ellipsis_vertical "..."
@ -2219,7 +2221,7 @@ proc overtype::renderline {args} {
set re_row_move {\x1b\[([0-9]*)(A|B)$} set re_row_move {\x1b\[([0-9]*)(A|B)$}
set re_both_move {\x1b\[([0-9]*)(?:;){0,1}([0-9]*)H$} ;# or "f" ? set re_both_move {\x1b\[([0-9]*)(?:;){0,1}([0-9]*)H$} ;# or "f" ?
set re_vt_sequence {\x1b\[([0-9]*)(?:;){0,1}([0-9]*)~$} set re_vt_sequence {\x1b\[([0-9]*)(?:;){0,1}([0-9]*)~$}
set re_cursor_save {\x1b\[s$} set re_cursor_save {\x1b\[s$} ;#note probable incompatibility with DECSLRM (set left right margin)!
set re_cursor_restore {\x1b\[u$} set re_cursor_restore {\x1b\[u$}
set re_cursor_save_dec {\x1b7$} set re_cursor_save_dec {\x1b7$}
set re_cursor_restore_dec {\x1b8$} set re_cursor_restore_dec {\x1b8$}
@ -2230,6 +2232,9 @@ proc overtype::renderline {args} {
#remap of DEC cursor_save/cursor_restore from ESC sequence to equivalent CSI #remap of DEC cursor_save/cursor_restore from ESC sequence to equivalent CSI
#probably not ideal - consider putting cursor_save/cursor_restore in functions so they can be called from the appropriate switch branch instead of using this mapping #probably not ideal - consider putting cursor_save/cursor_restore in functions so they can be called from the appropriate switch branch instead of using this mapping
#review - cost/benefit of function calls within these switch-arms instead of inline code? #review - cost/benefit of function calls within these switch-arms instead of inline code?
#todo - consider CSI s DECSLRM vs ansi.sys \x1b\[s - we need \x1b\[s for oldschool ansi art - but may have to enable only for that.
#we should probably therefore reverse this mapping so that x1b7 x1b8 are the primary codes for save/restore
set code [string map [list \x1b7 \x1b\[s \x1b8 \x1b\[u ] $code] set code [string map [list \x1b7 \x1b\[s \x1b8 \x1b\[u ] $code]
@ -2497,6 +2502,8 @@ proc overtype::renderline {args} {
break break
} }
s { s {
# - todo - make ansi.sys CSI s cursor save only apply for certain cases? - may need to support DECSLRM instead which uses same code
#$re_cursor_save #$re_cursor_save
#cursor save could come after last column #cursor save could come after last column
if {$overflow_idx != -1 && $idx == $overflow_idx} { if {$overflow_idx != -1 && $idx == $overflow_idx} {

5
src/bootsupport/modules/punk/mix/templates/layouts/project/src/make.tcl

@ -412,12 +412,13 @@ if {$::punkmake::command ne "project"} {
exit 1 exit 1
} }
file mkdir $projectroot/lib ;#needs to exist
#only a single consolidated /modules folder used for target #only a single consolidated /modules folder used for target
set target_modules_base $projectroot/modules set target_modules_base $projectroot/modules
file mkdir $target_modules_base file mkdir $target_modules_base
#external libs and modules first - and any supporting files - no 'building' required #external libs and modules first - and any supporting files - no 'building' required
if {[file exists $sourcefolder/vendorlib]} { if {[file exists $sourcefolder/vendorlib]} {
#exclude README.md from source folder - but only the root one #exclude README.md from source folder - but only the root one
@ -777,7 +778,7 @@ foreach vfs $vfs_folders {
} }
} }
} }
#assertion $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config #assert $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config
#todo - non kit based - zipkit? #todo - non kit based - zipkit?

5
src/modules/punk/mix/templates/layouts/project/src/make.tcl

@ -412,12 +412,13 @@ if {$::punkmake::command ne "project"} {
exit 1 exit 1
} }
file mkdir $projectroot/lib ;#needs to exist
#only a single consolidated /modules folder used for target #only a single consolidated /modules folder used for target
set target_modules_base $projectroot/modules set target_modules_base $projectroot/modules
file mkdir $target_modules_base file mkdir $target_modules_base
#external libs and modules first - and any supporting files - no 'building' required #external libs and modules first - and any supporting files - no 'building' required
if {[file exists $sourcefolder/vendorlib]} { if {[file exists $sourcefolder/vendorlib]} {
#exclude README.md from source folder - but only the root one #exclude README.md from source folder - but only the root one
@ -777,7 +778,7 @@ foreach vfs $vfs_folders {
} }
} }
} }
#assertion $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config #assert $runtimes is a list of executable names suffixed with .exe if on windows - whether or not specified with .exe in the mapvfs.config
#todo - non kit based - zipkit? #todo - non kit based - zipkit?

9
src/vendormodules/overtype-1.6.0.tm

@ -85,6 +85,8 @@ namespace eval overtype {
namespace import ::punk::assertion::assert namespace import ::punk::assertion::assert
punk::assertion::active true punk::assertion::active true
namespace path ::punk::lib
namespace export * namespace export *
variable default_ellipsis_horizontal "..." ;#fallback variable default_ellipsis_horizontal "..." ;#fallback
variable default_ellipsis_vertical "..." variable default_ellipsis_vertical "..."
@ -2219,7 +2221,7 @@ proc overtype::renderline {args} {
set re_row_move {\x1b\[([0-9]*)(A|B)$} set re_row_move {\x1b\[([0-9]*)(A|B)$}
set re_both_move {\x1b\[([0-9]*)(?:;){0,1}([0-9]*)H$} ;# or "f" ? set re_both_move {\x1b\[([0-9]*)(?:;){0,1}([0-9]*)H$} ;# or "f" ?
set re_vt_sequence {\x1b\[([0-9]*)(?:;){0,1}([0-9]*)~$} set re_vt_sequence {\x1b\[([0-9]*)(?:;){0,1}([0-9]*)~$}
set re_cursor_save {\x1b\[s$} set re_cursor_save {\x1b\[s$} ;#note probable incompatibility with DECSLRM (set left right margin)!
set re_cursor_restore {\x1b\[u$} set re_cursor_restore {\x1b\[u$}
set re_cursor_save_dec {\x1b7$} set re_cursor_save_dec {\x1b7$}
set re_cursor_restore_dec {\x1b8$} set re_cursor_restore_dec {\x1b8$}
@ -2230,6 +2232,9 @@ proc overtype::renderline {args} {
#remap of DEC cursor_save/cursor_restore from ESC sequence to equivalent CSI #remap of DEC cursor_save/cursor_restore from ESC sequence to equivalent CSI
#probably not ideal - consider putting cursor_save/cursor_restore in functions so they can be called from the appropriate switch branch instead of using this mapping #probably not ideal - consider putting cursor_save/cursor_restore in functions so they can be called from the appropriate switch branch instead of using this mapping
#review - cost/benefit of function calls within these switch-arms instead of inline code? #review - cost/benefit of function calls within these switch-arms instead of inline code?
#todo - consider CSI s DECSLRM vs ansi.sys \x1b\[s - we need \x1b\[s for oldschool ansi art - but may have to enable only for that.
#we should probably therefore reverse this mapping so that x1b7 x1b8 are the primary codes for save/restore
set code [string map [list \x1b7 \x1b\[s \x1b8 \x1b\[u ] $code] set code [string map [list \x1b7 \x1b\[s \x1b8 \x1b\[u ] $code]
@ -2497,6 +2502,8 @@ proc overtype::renderline {args} {
break break
} }
s { s {
# - todo - make ansi.sys CSI s cursor save only apply for certain cases? - may need to support DECSLRM instead which uses same code
#$re_cursor_save #$re_cursor_save
#cursor save could come after last column #cursor save could come after last column
if {$overflow_idx != -1 && $idx == $overflow_idx} { if {$overflow_idx != -1 && $idx == $overflow_idx} {

Loading…
Cancel
Save