tcl-hacks

Check-in [1cd0a87f38]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:redraw wants attention .. or do I live with overdrawing for now?
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1cd0a87f38b84f42479b9da268f54ba861a19588
User & Date: aspect 2018-05-17 13:14:00
Context
2018-05-17
15:16
put getline in a namespace check-in: ec40ff26f2 user: aspect tags: trunk
13:14
redraw wants attention .. or do I live with overdrawing for now? check-in: 1cd0a87f38 user: aspect tags: trunk
13:01
update readme. Nearly there check-in: ea0ae249f7 user: aspect tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to getline/getline.tcl.

109
110
111
112
113
114
115

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
    method redraw {} {
        my redraw-preceding
        my redraw-following
        my redraw-line
    }

    method redraw-line {} { output redraw }

    method redraw-preceding {} {
        set pos [input pos]
        lset Lines $Lineidx [input get]
        set idx $Lineidx
        while {![my is-first-line]} { my prior-line }
        while {$Lineidx > $idx}      { my next-line }
        my goto $pos
    }
    method redraw-following {} {
        set pos [input pos]
        lset Lines $Lineidx [input get]
        set idx $Lineidx
        while {![my is-last-line]} { my next-line }
        output emit [tty::down]
        output emit [tty::erase-line]
        output emit [tty::up]
        while {$Lineidx > $idx}   { my prior-line }
        my goto $pos
    }

    method insert {s} {







>













|







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
    method redraw {} {
        my redraw-preceding
        my redraw-following
        my redraw-line
    }

    method redraw-line {} { output redraw }
    # these redraw too much by virtue of next/prior-line'ing over the whole input
    method redraw-preceding {} {
        set pos [input pos]
        lset Lines $Lineidx [input get]
        set idx $Lineidx
        while {![my is-first-line]} { my prior-line }
        while {$Lineidx > $idx}      { my next-line }
        my goto $pos
    }
    method redraw-following {} {
        set pos [input pos]
        lset Lines $Lineidx [input get]
        set idx $Lineidx
        while {![my is-last-line]} { my next-line }
        output emit \n      ;# tty::down won't force a scroll
        output emit [tty::erase-line]
        output emit [tty::up]
        while {$Lineidx > $idx}   { my prior-line }
        my goto $pos
    }

    method insert {s} {