Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do i turn off syntax highlighting? #14

Closed
ioistired opened this issue Sep 30, 2019 · 8 comments · Fixed by #15
Closed

how do i turn off syntax highlighting? #14

ioistired opened this issue Sep 30, 2019 · 8 comments · Fixed by #15

Comments

@ioistired
Copy link

I don't like syntax highlighting. Is there a way I can turn it off?

@dandavison
Copy link
Owner

Is there a way I can turn it off?

Not yet, but thanks, this makes sense and should exist.

dandavison added a commit that referenced this issue Oct 1, 2019
@ioistired
Copy link
Author

Well, this "works", but I'm not really sure how to fix the background coloring for added/deleted lines.
screenshot of hard to read highlighting

@dandavison
Copy link
Owner

Hm, let's get that sorted out. As you saw, delta now accepts a new argument --theme=none which disables syntax highlighting. OK, let me ask a few questions:

  • How are you installing delta? What's your delta --version? Are you downloading the executables from the releases page? Or if you're building from the git repo, can you pull master and confirm what commit you're on?

  • It looks like you're on linux, can you confirm the OS and terminal app?

  • How are you configuring delta? Can you show me the line in your .gitconfig? Since you are using a dark terminal background, I'd recommend using --dark. However, it looks like you've got --light there (right?)

  • The widths of the background color look wrong in your screenshot. It could be a bug that I'm unaware of on your system, but I'm wondering -- did you happen to resize the terminal before taking the screenshot?

@ioistired
Copy link
Author

ioistired commented Oct 1, 2019

  1. git pull on master, followed by cargo install --path . --force. delta 0.0.10
  2. Arch Linux, xfce4-terminal 0.8.8
  3. You're right, I forgot --dark. My old line was pager = delta --theme none. pager = delta --theme none --dark improved things. Now it looks like this:
    screenshot
  4. I did not resize the terminal first. Just in case, the screenshot I posted in (3) is of a brand new terminal window. If I make the window wider afterwards, the "extra blank lines" (which are really caused by the overlong background colors being wrapped) disappear. Here is the same view, at a width of 138 (shortest width that is wide enough to contain the background colors):
    image

@ioistired
Copy link
Author

Just noticed that 0.0.10 is out of date. I'm on 2ba73e3 (0.0.12) now, and I can still reproduce.

@dandavison
Copy link
Owner

Ah, are there tab characters in the python code? Delta currently cannot calculate the correct line width when there are tabs present because it doesn't know how much width the tab takes up when it is rendered.

@ioistired
Copy link
Author

Yes, I use tabs for indentation. Should I find another tool?

@dandavison
Copy link
Owner

Hopefully your python code looks better on master now? By default, delta will render tabs 4 spaces wide, so it looks like you might need --tabs=8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants