Re: git-gui: Long lines in commit message gets hidden, no scrollbar appears

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Bert,


Thanks for picking this up.
I just gave your patch a go, and I think there are a couple of issues.


Applying the patch yields:

$ git apply patch1.patch
patch1.patch:18: indent with spaces.
       -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set} \
patch1.patch:19: indent with spaces.
       -xscrollcommand {.vpane.lower.commarea.buffer.sbx set}
patch1.patch:21: indent with spaces.
       -orient vertical \
patch1.patch:24: indent with spaces.
       -orient horizontal \
patch1.patch:25: indent with spaces.
       -command [list $ui_comm xview]
warning: git-gui.sh has type 100644, expected 100755
error: patch failed: git-gui.sh:3363
error: git-gui.sh: patch does not apply


Replacing the spaces with tabs before applying, I notice the
horisontal scrollbar appears to be "outside" of the text input area.
And it doesn't follow the height of the commit message text input
area.
Here's a screenshot: https://i.imgur.com/721axUX.png


Birger

On Mon, Sep 2, 2019 at 2:06 PM Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx> wrote:
>
> Hi Birger,
>
> On Mon, Sep 2, 2019 at 11:13 AM Birger Skogeng Pedersen
> <birger.sp@xxxxxxxxx> wrote:
> >
> > Hi,
> >
> > I just noticed that long lines in the commit message widget does in
> > fact not show a horizontal scrollbar.
> > So if a line in the commit message is more than 75 characters, it gets
> > a bit confusing.
> > Should it not have a scrollbar?
> > Example shown here: https://i.imgur.com/I3d6nBJ.png
>
> the old reasoning was, that you should not create commit messages
> which are too wide. While I can follow this reasoning, hiding content
> is also not a good idea. Thus I tried a different aproach. Instead of
> not showing the content, I pop up a dialog, if the commit message
> contains too long lines and add you requested scrollbar.
>
> As I'm currently unable to send patches per mail, I pushed it to GitHub:
>
> https://github.com/bertwesarg/git-gui/tree/bw/commit-scrollbuffer
>
> And I will paste the scrollbuffer commit below.
>
> Best,
> Bert
>
> Author: Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx>
> Date:   Mon Sep 2 13:57:24 2019 +0200
>
>     git-gui: add horizontal scrollbar to commit buffer
>
>     Sugestted-by: Birger Skogeng Pedersen <birger.sp@xxxxxxxxx>
>     Signed-off-by: Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx>
>
> diff --git a/git-gui.sh b/git-gui.sh
> index a491085..919d1e9 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -3363,14 +3363,20 @@ ttext $ui_comm -background white -foreground black \
>         -relief sunken \
>         -width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
>         -font font_diff \
> -       -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
> +       -yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set} \
> +       -xscrollcommand {.vpane.lower.commarea.buffer.sbx set}
>  ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
> +       -orient vertical \
>         -command [list $ui_comm yview]
> +${NS}::scrollbar .vpane.lower.commarea.buffer.sbx \
> +       -orient horizontal \
> +       -command [list $ui_comm xview]
>
>  pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y
>  pack $ui_comm -side left -fill y
> +pack .vpane.lower.commarea.buffer.sbx -side bottom -fill x
>  pack .vpane.lower.commarea.buffer.header -side top -fill x
> -pack .vpane.lower.commarea.buffer.frame -side left -fill y
> +pack .vpane.lower.commarea.buffer.frame -side top -fill x
>  pack .vpane.lower.commarea.buffer -side left -fill y
>
>  # -- Commit Message Buffer Context Menu



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux