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

Ignores git log highlighting #49

Closed
t-scutulatus opened this issue Jun 26, 2021 · 17 comments
Closed

Ignores git log highlighting #49

t-scutulatus opened this issue Jun 26, 2021 · 17 comments
Labels
waiting waiting for a reply or more info

Comments

@t-scutulatus
Copy link

If nvimpager is set as:

git config core.pager nvimpager

no highlighting occurs when git log command is used.

@lucc
Copy link
Owner

lucc commented Jun 29, 2021

I can not reproduce this with the available information.

  • Is nvimpager running when you execute git log or not? Or is only the highlighting off but nvimpager displays the log in black and white?
  • Did you set that option globally or locally in a git repo? Is $PAGER or $GIT_PAGER set?
  • Does the highlighting work when you activate it manually with :setf git?
  • Is the log you tested with longer or shorter than your terminal? Or rather are you running in cat or pager mode?

@lucc lucc added the waiting waiting for a reply or more info label Jul 6, 2021
@midirhee12
Copy link

@p-scvtvlatvs Ensure that you don't have $PAGER set to something other than nvimpager as it will overwrite the core.pager configuration for git iirc.

@t-scutulatus
Copy link
Author

@lucc:

  1. I think it is executed because it displays the log in black and white.
  2. I set it globally and I used the PAGER environment variable as well.
  3. I haven't tried :setf yet...
  4. The log is shorter than the terminal width and height.

@t-scutulatus
Copy link
Author

t-scutulatus commented Aug 27, 2021

@cvoges12:
If I unset PAGER the default pager is used (I think is less).

@lucc
Copy link
Owner

lucc commented Sep 3, 2021

if you are in less and press h it should show to help text of less (it says "SUMMARY OF LESS COMMANDS" at the top). If you are in nvimpager and execute :lua print(nvimpager) it should print "table: 0x7f4e48937d20" or so, especially not nil.

Does the highlighting work when you execute git log | nvimpager -c or git log | nvimpager -p or nvimpager ./some/file?

@t-scutulatus
Copy link
Author

Yes, it highlights with all the three commands.

@lucc
Copy link
Owner

lucc commented Sep 3, 2021

If these commands work than we can at least conclude that nvimpager works on your machine.

Can you please:

  1. find out if nvimpager is run or if another pager is run
  2. when nvimpager runs try setf git and see if that activates highlighting
  3. tell me what operating system you are on
  4. run git diff and the inside nvimpager run :lua print(require('nvimpager')._testable.detect_parent_process())

@t-scutulatus
Copy link
Author

t-scutulatus commented Sep 3, 2021

  1. Yes, it runs.
  2. Yes, highlighting seems to be activated, but everything turns black and white when git log is run.
  3. Arch Linux
  4. It returns the git value.

git config -l and git log still returns black and white. However, git diff highlights...

@lucc
Copy link
Owner

lucc commented Sep 3, 2021

That sounds strange. I can currently not reproduce this (in a arch linux container).

Can you try git log > file ; nvim file?

@t-scutulatus
Copy link
Author

Yes, I can see the output in nvim.

@lucc
Copy link
Owner

lucc commented Sep 3, 2021

The output or also the highlight?

I am at loss here. It seems that neovim and nvimpager are installed and working. You will have to find a way to debug this and give more precise info what is happening behind the scenes.

@t-scutulatus
Copy link
Author

Just the output.

@lucc
Copy link
Owner

lucc commented Sep 4, 2021

Ok, my neovim shows highlighting when I open a file that contains git log output. So the problem seems to be with the runtime files of your neovim.

  • what happens if you open the output of git log with nvim and then execute :setf git?
  • How did you install neovim?
  • which version of neovim is installed?
  • are several versions installed? which -a nvim
  • what is the output of :filter git scriptnames in nvimpager with git log and what is it for git diff (where highlighting seems to work)
  • what is the output of :echo globpath(&rtp, '*/git.vim') in nvim and nvimpager?

@t-scutulatus
Copy link
Author

t-scutulatus commented Sep 4, 2021

  1. Nothing.
  2. With pacman.
  3. 0.4.4
  4. Two; /bin/nvim and /usr/bin/nvim
  5. With git log is:
    /usr/share/nvim/runtime/syntax/git.vim
    /usr/share/nvim/runtime/ftplugin/git.vim
    For git diff is the same.
  6. Nothing for nvim and for nvimpager, the same as bullet 5.

@lucc
Copy link
Owner

lucc commented Sep 4, 2021

If you installed your neovim with pacman and still have 0.4.4 I assume you did not do a system update in a long time. Mind doing one?

@lucc
Copy link
Owner

lucc commented Sep 4, 2021

I am really out of ideas by now. It seems that your syntax file is loaded correctly but just not applied. It does not look like you have multible versions of the same file installed. It also looks like the issue is not with nvimpager but already with plain nvim.

You will have to dig around a bit more yourself because it is really difficult for me to do this debugging remotely. If you have any more questions or need help with the debugging please ask but please also provide the info what you have tried and how it went up front.

@lucc
Copy link
Owner

lucc commented Jan 2, 2022

Closed until further info is available.

@lucc lucc closed this as completed Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting waiting for a reply or more info
Projects
None yet
Development

No branches or pull requests

3 participants