diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/tcltexed/lib/umlaut.tcl |
Initial commit
Diffstat (limited to 'support/tcltexed/lib/umlaut.tcl')
-rw-r--r-- | support/tcltexed/lib/umlaut.tcl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/support/tcltexed/lib/umlaut.tcl b/support/tcltexed/lib/umlaut.tcl new file mode 100644 index 0000000000..9de2d29bf6 --- /dev/null +++ b/support/tcltexed/lib/umlaut.tcl @@ -0,0 +1,37 @@ +# Copyright (C) 2000 - Martin Strauss - under terms of GPL +############################################################## +# umlaut routine +# +proc umlaut LIST { + global FocusEditorFlag + global FocusEditor + if $FocusEditorFlag then { + focus $FocusEditor.te.edit1 + foreach {FIND REPLACE} $LIST { + set FIND_L [string length "$FIND"] + if {$FIND != ""} then { + set modifiedflag 0 + undo_switch $FocusEditor.te.edit1 Save + set startindex [$FocusEditor.te.edit1 index insert] + set nowindex 1.0 + while {$nowindex != ""} { + $FocusEditor.te.edit1 mark set insert $nowindex + set NOW [$FocusEditor.te.edit1 get insert "insert + $FIND_L chars"] + if ![string compare $NOW $FIND] then { + # Ersetzt + $FocusEditor.te.edit1 delete insert "insert + $FIND_L chars" + $FocusEditor.te.edit1 insert insert $REPLACE + set modifiedflag 1 + } + # Sucht + set nowindex [$FocusEditor.te.edit1 search -- $FIND insert end] + } + $FocusEditor.te.edit1 mark set insert $startindex + if $modifiedflag { + event generate $FocusEditor.te.edit1 <<Modified>> + } + event generate $FocusEditor.te.edit1 <<Position_tail>> -when tail + } + } + } +} |