Eskil

Check-in [881c0495ad]
Login

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

Overview
Comment:Debug function to auto-fill to two windows.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 881c0495ad23fcdc580c141a65085cdba84ce35f1a4c8af3dcabe94b56218963
User & Date: peter 2023-04-26 11:52:04.783
Context
2023-04-26
12:02
Added -printLineSpace. Corrected -printHeaderSize. check-in: 36ea024713 user: peter tags: trunk
11:52
Debug function to auto-fill to two windows. check-in: 881c0495ad user: peter tags: trunk
2021-09-23
14:40
More variants of Emacs detection check-in: 4eeb246a35 user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/eskil.tcl.
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
            set rightLines {}
            set state none
        }
        if {$newName ne ""} {
            # If fname is set, a file that had no contents has passed.
            # It could be a binary file or some other that the diffing source
            # could not handle.
            # Display the name to see that it is involved. 
            if {$fname ne ""} {
                foreach side {1 2} {
                    emptyLine $top $side
                    insertLine $top $side "" $divider patch
                    insertLine $top $side "" $fname   patch
                    insertLine $top $side "" $divider patch
                }







|







1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
            set rightLines {}
            set state none
        }
        if {$newName ne ""} {
            # If fname is set, a file that had no contents has passed.
            # It could be a binary file or some other that the diffing source
            # could not handle.
            # Display the name to see that it is involved.
            if {$fname ne ""} {
                foreach side {1 2} {
                    emptyLine $top $side
                    insertLine $top $side "" $divider patch
                    insertLine $top $side "" $fname   patch
                    insertLine $top $side "" $divider patch
                }
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
# Returns 1 if nothing was added.
proc editMenu {mW top side changeIndex x y} {

    if { ! [mayEdit $top $side]} {return 1}

    set other [expr {$side == 1 ? 2 : 1}]
    set editOther [mayEdit $top $other]
 
    set dW $::widgets($top,wDiff$side)
    set lW $::widgets($top,wLine$side)
    set oW $::widgets($top,wLine$other)

    set changed 1
    
    if {$changeIndex eq "_"} {
        # The popup is on unchanged line numbers
        set changed 0
        # Get the row that was clicked
        set index [$lW index @$x,$y]
        set row [lindex [split $index "."] 0]
        # Range is that row







|





|







2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
# Returns 1 if nothing was added.
proc editMenu {mW top side changeIndex x y} {

    if { ! [mayEdit $top $side]} {return 1}

    set other [expr {$side == 1 ? 2 : 1}]
    set editOther [mayEdit $top $other]

    set dW $::widgets($top,wDiff$side)
    set lW $::widgets($top,wLine$side)
    set oW $::widgets($top,wLine$other)

    set changed 1

    if {$changeIndex eq "_"} {
        # The popup is on unchanged line numbers
        set changed 0
        # Get the row that was clicked
        set index [$lW index @$x,$y]
        set row [lindex [split $index "."] 0]
        # Range is that row
2999
3000
3001
3002
3003
3004
3005






























































3006
3007
3008
3009
3010
3011
3012
    wm deiconify $top.balloon
}

proc unzoomRow {W} {
    set top [winfo toplevel $W]
    destroy $top.balloon
}































































# Reconfigure font
proc chFont {} {
    font configure myfont -size $::Pref(fontsize) -family $::Pref(fontfamily)
}

# Change color settings







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
    wm deiconify $top.balloon
}

proc unzoomRow {W} {
    set top [winfo toplevel $W]
    destroy $top.balloon
}

# Helper for fillWindowX
proc FillWindowX {W widthName newXName} {
    upvar 1 $widthName width $newXName newX
    set x [winfo rootx $W]
    set widths [::psballoon::FigureOutScreenWidths $W]
    set nScreen [expr {[llength $widths] / 2}]
    if {$nScreen <= 1} {
	set width [winfo screenwidth $W]
        set newX 0
	return
    }
    if {$nScreen == 2} {
        set minX [lindex $widths 0]
        set maxX [lindex $widths end]
        set width [expr {$maxX - $minX}]
	set newX $minX
	return
    }
    set widthList {}
    set i -1
    foreach {minX maxX} $widths {
        incr i
        lappend widthList [expr {$maxX - $minX}]
        if {$minX <= $x && $x < $maxX} {
            set screenI $i
        }
    }
    if {$screenI == 0} {
        set minX [lindex $widths 0]
        set maxX [lindex $widths 3]
        set width [expr {$maxX - $minX}]
        set newX $minX
        return
    }
    if {$screenI >= $nScreen-1} {
        set minX [lindex $widths end-3]
        set maxX [lindex $widths end]
        set width [expr {$maxX - $minX}]
        set newX $minX
        return
    }
    set widthL [expr {[lindex $widthList $screenI] + [lindex $widthList $screenI-1]}]
    set widthR [expr {[lindex $widthList $screenI] + [lindex $widthList $screenI+1]}]
    if {$widthL >= $widthR} {
        incr screenI -1
    }
    set minX [lindex $widths [* $screenI 2]]
    set maxX [lindex $widths [expr {$screenI * 2 + 3}]]
    set width [expr {$maxX - $minX}]
    set newX $minX
}

# Maximize window in X direction, trying to fill two screens
proc fillWindowX {W} {
    FillWindowX $W width newX
    set newY [winfo rooty $W]
    set height [winfo height $W]
    puts "$W [wm geometry $W]"
    puts "$W X $newX Y $newY W $width H $height"
    wm geometry $W ${width}x$height+$newX+$newY
}

# Reconfigure font
proc chFont {} {
    font configure myfont -size $::Pref(fontsize) -family $::Pref(fontfamily)
}

# Change color settings
3163
3164
3165
3166
3167
3168
3169


3170
3171
3172
3173
3174
3175
3176
        -command {set ::eskil(filter) {^Date}}
    $dMenu add separator
    $dMenu add command -label "Reread Source" -underline 0 \
        -command {EskilRereadSource}
        $dMenu add separator
    $dMenu add command -label "Normal Cursor" \
        -command [list normalCursor $top]


    $dMenu add separator
    # Runtime disable of C version of DiffUtil
    $dMenu add command -label "Tcl DiffUtil" -command DisableDiffUtilC
    $dMenu add command -label "Evalstats" -command {evalstats}
    $dMenu add command -label "_stats" -command {parray _stats}
}








>
>







3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
        -command {set ::eskil(filter) {^Date}}
    $dMenu add separator
    $dMenu add command -label "Reread Source" -underline 0 \
        -command {EskilRereadSource}
        $dMenu add separator
    $dMenu add command -label "Normal Cursor" \
        -command [list normalCursor $top]
    $dMenu add command -label "Fill X" \
        -command [list fillWindowX $top]
    $dMenu add separator
    # Runtime disable of C version of DiffUtil
    $dMenu add command -label "Tcl DiffUtil" -command DisableDiffUtilC
    $dMenu add command -label "Evalstats" -command {evalstats}
    $dMenu add command -label "_stats" -command {parray _stats}
}