Comments (3)
The reason the highlighting is getting screwed up is because the option diff
is being set in the status window, causing all 3 to be diffed. When I check verbose set diff?
in the status window after the fact I see this:
diff
Last set from Lua
So what is happening is that you're invoking stage_hunk
from gitsigns.nvim, which is written in Lua, and then some Lua code is setting an option that screws up the highlighting.
Fugitive has no Lua code. Meanwhile, have a look at this Lua code from gitsigns.nvim:
for _, w in ipairs(api.nvim_list_wins()) do
if api.nvim_win_is_valid(w) then
local b = api.nvim_win_get_buf(w)
local bname = api.nvim_buf_get_name(b)
if bname == bufname or vim.startswith(bname, 'fugitive://') then
if should_reload(b) then
api.nvim_buf_call(b, function()
vim.cmd.doautocmd('BufReadCmd')
vim.cmd.diffthis()
end)
end
end
end
Note in particular the check for vim.startswith(bname, 'fugitive://')
(which matches the status window) and the invocation of vim.cmd.diffthis()
(which turns on the diff
option).
This is very straightforwardly 100% a Gitsigns issue.
from vim-fugitive.
You might find vim.fn.FugitiveParse(bname)
helpful. Try :echo FugitiveParse(bufname())
in each of the fugitive://
buffers to see how it works.
from vim-fugitive.
Thanks for pointing me in the right direction!
I'll try to fix it and send a PR to gitsigns
from vim-fugitive.
Related Issues (20)
- the cursor doesn't go back to the buffer that opened the status buffer when using "gq" HOT 1
- `:Git log` display is inconsistent with command-line defaults
- E1513: Cannot switch buffer. 'winfixbuf' is enabled when refreshing HOT 1
- FugitivePager is triggered for non-fugitive BufReadPost Events
- Completion of the commit hash in cmdline? HOT 2
- Do not open quickfix on `:G difftool`
- Option to disable winfixbuf. HOT 6
- [Feature request] Allow custom format string for status buffer log lines HOT 1
- file does not belong to a Git repository. issue still there
- issue still there HOT 3
- `Git difftool -y` reports errors about newly created files
- [Question] Look-around branch autocompletion
- support for difftastic HOT 1
- :Gedit and similar commands spawn non-persistent buffers HOT 2
- confusing section folding toggle behavior
- Is there a way to "force" color to be enabled for a Git command that just loads a split? HOT 2
- Git Commit Showing Empty COMMIT_EDITMSG HOT 1
- `:Git <any-command> --help` mishandles formatting HOT 7
- `:Git stash list` does nothing when the stash is empty HOT 1
- Partial hunk staging doesn't work with nvim as EDITOR environment variable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-fugitive.