Comments (15)
Glad to have been part of this brainstorming. It is working for me too, without the set hidden
option!
from linediff.vim.
I don't have such problem, but remember someone telling me that he can't use linediff with several buffers, same issue as here (on GNU/Linux, but with Vundle probably).
It must be another plugin or setting in your vimrc
that causes this. One might be able to work around this in the plugin, but finding the cause without having your configuration will be really hard, so you might want to try disabling plugins/settings until linediff starts working properly.
from linediff.vim.
set nocompatible "Required by Vundle
filetype off "Required by Vundle
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'AndrewRadev/linediff.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
I issued a complete reinstall of Vundle plugins leaving only linediff in the above .vimrc
. It still won't work.
from linediff.vim.
Different blocks in same buffer do work without any issues or maintenance needed.
from linediff.vim.
Tried your configuration, everything works fine with single/multiple buffers. I ran Vim as vim -u tmp-vimrc
, so if you don't have any system-wide settings, setup should be the same.
from linediff.vim.
Have you tried on a Mac ? I'm using iTerm2, installed original iTerm to test, see attached gif please.
from linediff.vim.
I'm on GNU/Linux, terminal shouldn't matter (OS too, if we run the same configuration). Actually, I managed to reproduce it this time, your gif helped. Before I used :tabedit
or :vs
and it worked, if I do :edit
for the second file, it doesn't work (with this configuration, the one I usually use works fine either way). So far I have no idea, why it works this way, but it's not just your local problem.
from linediff.vim.
@niloct, it's not something you have in your vimrc
, it's something you don't have there. Try adding:
set hidden
Looks like getbufline()
function doesn't return lines from buffers which aren't hidden. And this is probably not a bug, because if buffer disappears from all windows and 'hidden'
isn't set, that buffer gets unloaded.
from linediff.vim.
Thanks for the great tip. It worked. So I misunderstood the help when it says that a buffer displayed in another window (other than current) does not get hidden. It gets unloaded then, without the option set hidden
.
from linediff.vim.
a buffer displayed in another window (other than current) does not get hidden.
That's correct statement. In the gif above you have only one window, each window displays only one buffer, so when you do :e y.txt
x.txt
gets unloaded and y.txt
is loaded. If x.txt
were still visible in another tab or split window, then it would still be considered as loaded.
from linediff.vim.
Awesome! Thanks again :)
from linediff.vim.
Thanks, @xaizek, for debugging the issue, I really appreciate your help :).
It does make sense that, if set hidden
is not on, the buffer would be lost. I'll try and see if there's a way to set "bufhidden" on a buffer that has been linediffed, and then restore it to its default, but it might be a bit tricky to juggle the value. For now, I think I'll put a comment in the documentation, at least.
from linediff.vim.
I think I may have fixed it, actually. Turns out it's not so complicated to save and restore the value :). However, the first buffer remains hidden (it was closed, after all), and if that first buffer's content has been changed, you can't quit -- Vim asks you to save all of your changes. But I think that might be fine, after all, you've closed this buffer, and are now making changes to it, I guess it's to be expected that Vim prompts you to finish up.
@niloct, if you'd like to test the behaviour of the plugin without the set hidden
option, I'd appreciate it, just so I know if what I did avoids this issue now.
from linediff.vim.
Thanks, @xaizek, for debugging the issue, I really appreciate your help :).
It was bothering me for a while that I didn't figure this one out back then.
@boo1ean look, after some 4 years I know what didn't work in your setup :-)
just so I know if what I did avoids this issue now.
Seems to work for me in test configuration.
from linediff.vim.
Cool, thanks. I'll remove the comment in the documentation then.
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
- Add diff screenshot to README HOT 1
- Undo changes HOT 4
- Problem with folds HOT 8
- 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.