Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git: allow to show git project dir #2507

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

chrisbra
Copy link
Member

@chrisbra chrisbra commented Feb 6, 2022

This extension shows the project dir. It depends on Futivedir, so will
only work when the fugitive plugin is available.

closes #2505

chrisbra and others added 15 commits December 14, 2021 09:40
nvimlsp: use vim.diagnostic.get() if available
The current way to parse the statusline content and decide whether a
section is empty, has some flaws:

That is for the following reasons:
- accents are considered to be empty (which they really shouldn't)
- manually parsing the expressions using a
  `:while ... matchlist() ... endwhile` loop is slow and fragile
- grouping items such as %( %) are not considered

So replace the logic by using `substitute('pat', '\=add()', '')` to
capture all single expression groups into a list and then looping over
those to decide whether the section is empty.

fixes vim-airline#2411
…-condition

Test for the correct fern loaded variable.
unicode: Fix check for :UnicodeTable buffer
This extension shows the project dir. It depends on Futivedir, so will
only work when the fugitive plugin is available.

closes vim-airline#2505
Comment on lines +12 to +13
let dir = FugitiveGitDir(bufnr(''))
return empty(dir) ? '' : pathshorten(fnamemodify(simplify(dir .. '/../'), ':h:t'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will return the wrong result for submodules, multiple work trees, bare repositories, and probably other things. Recommended method to retrieve the work tree is FugitiveFind(':/', bufnr('')).

@chrisbra
Copy link
Member Author

ah, thanks for the hing. In general, I am not yet completely satisfied with the pull here, that's why I haven't merged it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: display topdir of git
8 participants