Comments (8)
Thank you for the detailed bug report, I really appreciate the example.
Unfortunately, I can't seem to reproduce the issue :/. My guess is that there's some setting that I have that's making the difference. Could you show me your .vimrc? I might be able to find the setting like that. Let me know what your Vim version is as well, just in case.
from linediff.vim.
Thank you for your fast reply!
You're right, with a minimal vimrc, it doesn't occur.
My vimrc is quite big and a lot of plugins, so I don't want you to work through all of that ;)
I'll do my own investigations and I'll report back if I find the culprit!
Thanks anyway!
from linediff.vim.
It's likely that it's a setting and not a plugin, because i can't think of any plugin that could affect this one. If you manage to narrow it down to whatever setting is causing this, do let me know. There might be something I could do on the plugin side to prevent people from being affected by it.
from linediff.vim.
Ok, I think I tracked it down, it was quite a tough one ;)
It happens only if
- Nerd-Tree-Tabs plugin is enabled (https://github.com/jistr/vim-nerdtree-tabs)
- The Nerd-Tree is open when starting the linediff
The Nerd-Tree-Tabs plugin which tries to make a NerdTree buffer persistent over all tabs. It's probably a quite hacky abuse of the way vim handles buffers/tabs, so that's probably the reason it interferes here :(
OK, at least I have a workaround now (just close Nerdtree).
But of course, if you want to have a closer look at it and find a proper solution (or maybe a bug in NerdtreeTabs), that would be even better :)
from linediff.vim.
OK now again with automatic testcase with minimal vimrc, so it should be reproducible independently of the environment.
- download / clone linediff, nerdtree, nerdtree-tabs to ~/.vim/bundle/
- create a new folder with three files:
vimrc
set nocompatible
filetype off
set runtimepath=~/.vim/bundle/linediff.vim/
set runtimepath^=~/.vim/bundle/nerdtree/
set runtimepath^=~/.vim/bundle/vim-nerdtree-tabs/
filetype plugin indent on
test.txt
def one
two
end
def two
three
end
something at the end of the file
script.vim
NERDTreeTabsOpen
" move the cursor out of the NERDTree buffer
winc l
1,3fold
5,7fold
1,3Linediff
5,7Linediff
" change something in the right diff buffer
winc l
normal ciwabc
w
" back to the original test.txt buffer
normal gt
/something
- run the command in this folder:
vim -u vimrc test.txt -c 'source script.vim'
You have reproduced the bug, if you get an error message saying that 'something' was not found.
By commenting the first line in script.vim
'something' is found.
from linediff.vim.
Okay, I've managed to reproduce it, and I think the key is the setting g:nerdtree_tabs_synchronize_focus
. If I set it to 0, the issue doesn't seem to happen. My guess is that, when I switch around buffers, an autocommand catches the event and switches to the NERDTree instead. I can't really think of how I could fix this on my end, to be honest, but if this setting works, it might be the simplest way to avoid this happening.
from linediff.vim.
@AndrewRadev, see :help autocmd-disable
. There are 'eventignore'
and :noautocmd
. Sounds like they might be useful here.
from linediff.vim.
Thanks, @xaizek, it might be something to experiment with. I'm not sure it'll work, since I think it's autocommands that get triggered outside the plugin that do this. Still, it's something to try.
from linediff.vim.
Related Issues (20)
- Show LineDiff Automatically in Merge Files HOT 12
- E97: Cannot create diffs HOT 3
- Strange errors on :Linediff HOT 5
- Adding vim-repeat support HOT 2
- Linediff specific diffopts HOT 2
- Doesn't work with different source files. HOT 15
- Add diff screenshot to README HOT 1
- Undo changes HOT 4
- Improvement: diff multiple blocks HOT 3
- Lineedit command? HOT 2
- Error messages due to backslashes on filepaths HOT 9
- Update the buffers after creation from original file? HOT 3
- Provide keybindings to jump between differences HOT 4
- Don't work in MacVim (GUI) HOT 3
- What OSS license is this governed by? HOT 2
- Vim patch 9.0.907 causes E1312 when temporary buffers are closed HOT 3
- Adjusting cursor position when diff starts HOT 2
- diff tab remains open after LinediffReset HOT 2
- How to set vertical split for "diff tab" HOT 4
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 linediff.vim.