Giter Club home page Giter Club logo

Comments (9)

igrekster avatar igrekster commented on May 18, 2024

I figured it out, it was my ~/.lesskeyrc -- I have -J or --status-column enabled which reduces the width by one character. I wonder if it would be possible to detect it, or have a way to override.

from delta.

dandavison avatar dandavison commented on May 18, 2024

Hm, this was supposed to have been fixed in v0.0.13 by #22. Let's get to the bottom of this!

I'm not managing to reproduce yet in MacOS iTerm2 with delta 0.0.14. Here's a little experiment. Notice how, in the first case, delta is leaving one character of space unused at the right edge of the terminal. This is what is should always do by default, since #22. In the second case, less is invoked with -J, and so it inserts an extra space in the left column, but the lines do not overflow on the right because of the extra space which was left there for this reason.

Can you reproduce this? (If not, can you double check the version of delta that is being invoked by git (maybe pipe git output into a delta executable explicitly) and post the relevant contents of your ~.lesskey).

With LESS environment variable equal to empty string (export LESS=):
image

With export LESS=-J:
image

from delta.

dandavison avatar dandavison commented on May 18, 2024

Also, if it's still mysterious, could you post the values of the environment variables PAGER, BAT_PAGER and LESS?

from delta.

igrekster avatar igrekster commented on May 18, 2024

Notice how, in the first case, delta is leaving one character of space unused at the right edge of the terminal. This is what is should always do by default, since #22. In the second case, less is invoked with -J, and so it inserts an extra space in the left column, but the lines do not overflow on the right because of the extra space which was left there for this reason.

Well, in my case less -J adds two spaces:

image

$ less --version
less 531 (PCRE regular expressions)
Copyright (C) 1984-2017  Mark Nudelman

I've built git-delta from the sources attached to the release: https://github.com/dandavison/delta/archive/0.0.14.tar.gz

$ delta --version
delta 0.0.14

My .lesskeyrc : LESS=-imJMWR

My environment:

$ env | grep -i -e '\(less\|pager\)'
LESS=-R -M --shift 5
LESSCOLOR=yes
LESSOPEN=|/usr/bin/lesspipe.sh %s
MANPAGER=manpager
PAGER=/usr/bin/less

I've unset all of my environment and removed the lesskey file, and tried the pipe mode:

$ env | grep -i -e '\(less\|pager\)'
MANPAGER=manpager
PAGER=/usr/bin/less
$ git show --color=always | delta

image

And with LESS=-J:

$ git show --color=always | LESS=-J delta

image

I've also tried the the latest commit, which gives me the same behaviour:

$ git describe --tags
0.0.14-1-gba454ba

This is inside tmux.

from delta.

igrekster avatar igrekster commented on May 18, 2024

I did a bit of digging, it appears to have changed in version 525 of less:

gwsw/less@0a150b3#diff-94003069247e17a040faa638addca45cR166

from delta.

dandavison avatar dandavison commented on May 18, 2024

Thanks! Should be fixed in master by #43, would you be able to confirm?

from delta.

igrekster avatar igrekster commented on May 18, 2024

This is exactly the path I was using as a workaround ;-)
I've built and tested the latest master -- looking good, thank you very much for fixing it promptly.

$ git describe --tags
0.0.14-5-g4b7bbdd

from delta.

fdcds avatar fdcds commented on May 18, 2024

I noticed the same (without using any arguments to less), but the effect appears to depend on the theme. I remember that the output was fine with --dark, but broken in this way with --light. I am currently on a different monitor (different resolution) and cannot reproduce it here, though.

from delta.

dandavison avatar dandavison commented on May 18, 2024

@fdcds thanks! Do please let us know if you see this problem with the current version.

from delta.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.