Re: [PATCH] [PATCH] git-gui: Add hotkeys to set widget focus
- From
Birger Skogeng Pedersen <birger.sp@gmail.com>
- Date
- Sep 2, 2019, 18:35 UTC
- Message-ID
- <CAGr--=L64jiE=x_McdfWJuQTz1Qo3wp0nc8xaeKBGe0GgW5Kxg@mail.gmail.com>
- In-Reply-To
- <20190902181954.zcxuyqrdzs3dzjtq@yadavpratyush.com>
On Mon, Sep 2, 2019 at 8:19 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> You missed removing this extra blank line. Will fix it up locally. > > > + set _index $file_lists_last_clicked($widget) > [snip]
To be honest I felt the blank line there was appropriate, in an attempt to follow the same code style as the rest of the git-gui.sh. For instance, the "add_range_to_selection" function (https://github.com/prati0100/git-gui/blob/master/git-gui.sh#L2601-L2625) has blank lines like this;
proc add_range_to_selection {w x y} {
global file_lists last_clicked selected_paths if {[lindex $last_clicked 0] ne $w} {
toggle_or_diff click $w $x $y
return
} set lno [lindex [split [$w index @$x,$y] .] 0]
set lc [lindex $last_clicked 1]
if {$lc < $lno} {
set begin $lc
set end $lno
} else {
set begin $lno
set end $lc
} foreach path [lrange $file_lists($w) \
[expr {$begin - 1}] \
[expr {$end - 1}]] {
set selected_paths($path) 1
}
$w tag add in_sel $begin.0 [expr {$end + 1}].0
}Not saying the blank line should defintely be there, I'm just saying my reasoning for keeping it there in the first place :-)
Birger