Coder Social home page Coder Social logo

Problem with folds about linediff.vim HOT 8 OPEN

andrewradev avatar andrewradev commented on May 28, 2024
Problem with folds

from linediff.vim.

Comments (8)

AndrewRadev avatar AndrewRadev commented on May 28, 2024

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.

hcgraf avatar hcgraf commented on May 28, 2024

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.

AndrewRadev avatar AndrewRadev commented on May 28, 2024

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.

hcgraf avatar hcgraf commented on May 28, 2024

Ok, I think I tracked it down, it was quite a tough one ;)

It happens only if

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.

hcgraf avatar hcgraf commented on May 28, 2024

OK now again with automatic testcase with minimal vimrc, so it should be reproducible independently of the environment.

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.

AndrewRadev avatar AndrewRadev commented on May 28, 2024

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.

xaizek avatar xaizek commented on May 28, 2024

@AndrewRadev, see :help autocmd-disable. There are 'eventignore' and :noautocmd. Sounds like they might be useful here.

from linediff.vim.

AndrewRadev avatar AndrewRadev commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.