Giter Club home page Giter Club logo

Comments (5)

tmhedberg avatar tmhedberg commented on July 20, 2024

Try :SimpylFoldDocstring! and then reload the buffer.

This is counterintuitive behavior and the documentation is misleading; changing the configuration variable directly doesn't seem to have the intended effect. This is likely due to how we're caching folds. The command invalidates the cache, but changing the variable does not.

from simpylfold.

mmadrid avatar mmadrid commented on July 20, 2024

Try :SimpylFoldDocstring! and then reload the buffer.

This is counterintuitive behavior and the documentation is misleading; changing the configuration variable directly doesn't seem to have the intended effect. This is likely due to how we're caching folds. The command invalidates the cache, but changing the variable does not.

Thanks for the reply. This doesn't do anything.

from simpylfold.

tmhedberg avatar tmhedberg commented on July 20, 2024

If that's the case, then I don't know what to tell you. It works for me when I run the command and reload.

Adding let g:SimpylFold_fold_docstring = 0 to my .vimrc also works. However, changing the config variable after Vim has already loaded a Python buffer has no effect.

from simpylfold.

mmadrid avatar mmadrid commented on July 20, 2024

This is actually a misunderstanding on my part. It works as intended. What I thought g:SimpylFold_fold_docstring = 0 would do is not fold the docstring (and thus not the function def either), but fold the rest of the function contents so that I would always be able to see the docstring (something like below). I realize now that that is not the intended functionality, and that I'm not sure I want that anyway. It was a good exersize in learning about folding in Vim!

def a_function():
    """This is a multiline docstring
    It prints out three lines of stuff
    """
+--  3 lines: print("Some stuff")··························

from simpylfold.

eric-saintetienne avatar eric-saintetienne commented on July 20, 2024

I thought exactly the same thing, that the docstring would be visible but the code would be folded, because what I was looking forward is to get an overview of the code and see whether functions should be renamed.

The documentation/README needs to be updated to make this clear IMO. Like you I lost quite some time figuring why my docstrings would stay folded.

from simpylfold.

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.