Coder Social home page Coder Social logo

Comments (3)

cdelledonne avatar cdelledonne commented on August 19, 2024

Hi, thank you for posting this.

I agree that the detection of the top-level directory could use some improvement. Other than what you suggest, the top-level directory should also be computed each time it is needed, and not only when the plugin is loaded (this is the current behaviour), so that if the user changes the CWD, the path to the top-level directory is updated accordingly.

At the moment, I am quite busy with some other stuff and cannot work on this plugin too much, would you be interested in preparing a pull request for this yourself? Otherwise I can take this up in a few weeks.

To recap, what we would need is the following

  • By default, detect top-level directory using git rev-parse
  • If that fails for some reason—e.g., we're not in a Git directory, fallback to using the current method that searches for root markers defined in g:cmake_root_markers
  • Recompute top-level directory each time it is needed
  • Support showing the top-level directory in the statusline
  • Perhaps add a config option to disable showing the top-level directory in the statusline

Am I missing something?

from vim-cmake.

matu3ba avatar matu3ba commented on August 19, 2024

You are missing the case, if we are in a git submodule folder. Aside, that looks good to me.
I can not really tell you, when I find the time to do this as I never have written alot vimscript before.

from vim-cmake.

cdelledonne avatar cdelledonne commented on August 19, 2024

You are missing the case, if we are in a git submodule folder.

Doesn't that still fall under "By default, detect top-level directory using git rev-parse"? The two options you listed, --show-toplevel and --show-superproject-working-tree, should give us what we need, right?

I can not really tell you, when I find the time to do this as I never have written alot vimscript before.

Vimscript is a little ugly but not too difficult. If you are interested in submitting a PR, whenever you find time, I can review your work step by step.

from vim-cmake.

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.