Giter VIP home page Giter VIP logo

Comments (12)

joonty avatar joonty commented on August 19, 2024

Interesting... does this happen if you create a new tab in Vim, open a few buffers then close the tab and return to the file with the manual folds? This is essentially all that Vdebug should be doing, so it might be that it's something that Vim does. Unless there's some weird side effect going on!

from vdebug.

qstrahl avatar qstrahl commented on August 19, 2024

Only happens with Vdebug as far as I can tell.

from vdebug.

joonty avatar joonty commented on August 19, 2024

OK, intriguing. Will investigate.

from vdebug.

joonty avatar joonty commented on August 19, 2024

Hi there,

Finally been able to give this some time, but I can't reproduce it: folds are remembered for me. Can you give me an example of the steps you're using, with vim commands?

Thanks

from vdebug.

qstrahl avatar qstrahl commented on August 19, 2024
  • Open a vim file with folds, or :set fdm=manual and make some
  • zM: close all folds
  • zo on a fold: open it
  • <F10>: set a breakpoint
  • <F5>: start debugging

The fold(s) should be reset/destroyed by this point. Best tried with manual folds for full effect.

Edit: Also, it is not necessary to set a breakpoint. Simply starting the debugger will do it.

from vdebug.

joonty avatar joonty commented on August 19, 2024

Hi Quinn,

I've managed to reproduce this with setting foldmethod to marker and setting a manual fold. It appears that reloading the file in vim (e.g. with :e) clears manual folds defined in that file, and that's what Vdebug is doing - it loads every file that Xdebug (or whichever engine) tells it to, and if you've defined manual folds then they get cleared as a result of Vim's normal behaviour.

Do you know if there's any "soft" loading that Vim can do? I.e. load the file only if there isn't already a buffer, otherwise show that buffer?

Thanks

from vdebug.

qstrahl avatar qstrahl commented on August 19, 2024
function s:edit(filename)
    try 
        execute 'buffer' fnameescape(a:filename)
    catch /^Vim\%((\a\+)\)\=:E94/ 
        execute 'edit' fnameescape(a:filename)
    endtry
endfunction

Should do the trick.

Edit: added fnameescape() for good measure (unsure if your filenames will already be escaped)

from vdebug.

joonty avatar joonty commented on August 19, 2024

Nice, thanks for that. I'll give it a whirl when I can.

from vdebug.

joonty avatar joonty commented on August 19, 2024

Hey Quinn,

I added your function (slightly modified) and managed to get some manual folds remembered. Seems to work pretty well, but if you could give the updated dev branch a go you're probably best placed to test it.

Cheers

from vdebug.

joonty avatar joonty commented on August 19, 2024

@qstrahl have you given this a go?

Thanks

from vdebug.

qstrahl avatar qstrahl commented on August 19, 2024

Sorry, completely forgot about this! I'd love to close the issue, but currently can't confirm due to #84

from vdebug.

qstrahl avatar qstrahl commented on August 19, 2024

Confirmed fixed as of cb9ebd3

from vdebug.

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.