Xuyuanp / nerdtree-git-plugin

A plugin of NERDTree showing git status
Do What The F*ck You Want To Public License
2.08k stars 150 forks source link

github repos not displaying if base folder wasnt a repo #179

Closed HeCodes2Much closed 3 years ago

HeCodes2Much commented 3 years ago

Self-Diagnosis

Environment (for bug reports)

let g:NERDTreeGitStatusUseNerdFonts = 1 let g:NERDTreeGitStatusIndicatorMapCustom = { \ 'Modified' :'✹', \ 'Staged' :'✚', \ 'Untracked' :'✭', \ 'Renamed' :'➜', \ 'Unmerged' :'═', \ 'Deleted' :'✖', \ 'Dirty' :'✗', \ 'Ignored' :'☒', \ 'Clean' :'✔︎', \ 'Unknown' :'?', \ }

" Start NERDTree. If a file is specified, move the cursor to its window. autocmd StdinReadPre let s:std_in=1 autocmd VimEnter NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif

" Exit Vim if NERDTree is the only window left. autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif


- Other NERDTree-dependent Plugins
    - [ ] jistr/vim-nerdtree-tabs
    - [x] ryanoasis/vim-devicons
    - [ ] tiagofumo/vim-nerdtree-syntax-highlight
    - [ ] Others (specify):
- [x] I've verified the issue occurs with only `nerdtree-git-plugin` installed.
- [x] Copy-Paste `call gitstatus#doctor#Say()` outputs

```vim
Vim:

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Nov 15 2020 16:46:37)
Included patches: 1-1989
Compiled by Arch Linux
Huge version without GUI.  Features included (+) or not (-):
+acl               +cindent           +cursorshape       +file_in_path      +job               +menu              +mouse_urxvt       +popupwin          +signs             +tcl/dyn           +vartabs           -X11
+arabic            -clientserver      +dialog_con        +find_in_path      +jumplist          +mksession         +mouse_xterm       +postscript        +smartindent       +termguicolors     +vertsplit         -xfontset
+autocmd           -clipboard         +diff              +float             +keymap            +modify_fname      +multi_byte        +printer           -sound             +terminal          +virtualedit       -xim
+autochdir         +cmdline_compl     +digraphs          +folding           +lambda            +mouse             +multi_lang        +profile           +spell             +terminfo          +visual            -xpm
-autoservername    +cmdline_hist      -dnd               -footer            +langmap           -mouseshape        -mzscheme          +python/dyn        +startuptime       +termresponse      +visualextra       -xsmp
-balloon_eval      +cmdline_info      -ebcdic            +fork()            +libcall           +mouse_dec         +netbeans_intg     +python3/dyn       +statusline        +textobjects       +viminfo           -xterm_clipboard
+balloon_eval_term +comments          +emacs_tags        +gettext           +linebreak         +mouse_gpm         +num64             +quickfix          -sun_workshop      +textprop          +vreplace          -xterm_save
-browse            +conceal           +eval              -hangul_input      +lispindent        -mouse_jsbterm     +packages          +reltime           +syntax            +timers            +wildignore
++builtin_terms    +cryptv            +ex_extra          +iconv             +listcmds          +mouse_netterm     +path_extra        +rightleft         +tag_binary        +title             +wildmenu
+byte_offset       +cscope            +extra_search      +insert_expand     +localmap          +mouse_sgr         +perl/dyn          +ruby/dyn          -tag_old_static    -toolbar           +windows
+channel           +cursorbind        -farsi             +ipv6              +lua/dyn           -mouse_sysmouse    +persistent_undo   +scrollbind        -tag_any_white     +user_commands     +writebackup
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.32/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr
/local/lib -Wl,--as-needed -o vim        -lm -ltinfo -lelf    -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.32/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib
-L/usr/lib/perl5/5.32/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc   -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm
================================================================================
NERDTree:
version: 6.9.11
root: /home/dt
================================================================================
Git:
version: git version 2.29.2
workdir:
================================================================================
Options:
NERDTreeGitStatusShowIgnored = '0'
NERDTreeGitStatusConcealBrackets = '0'
NERDTreeGitStatusGitBinPath = 'git'
NERDTreeGitStatusShowClean = '0'
NERDTreeGitStatusUseNerdFonts = 1
NERDTreeGitStatusEnable = '1'
NERDTreeGitStatusUpdateOnCursorHold = '1'
NERDTreeGitStatusAlignIfConceal = '1'
NERDTreeGitStatusLogLevel = '2'
NERDTreeGitStatusPorcelainVersion = '2'
NERDTreeGitStatusMapPrevHunk = '[c'
NERDTreeGitStatusUntrackedFilesMode = 'normal'
NERDTreeGitStatusDirDirtyOnly = '1'
NERDTreeGitStatusUpdateOnWrite = '1'
NERDTreeGitStatusIndicatorMapCustom = {
  \   'Dirty': '✗',
  \   'Untracked': '✭',
  \   'Deleted': '✖',
  \   'Ignored': '☒',
  \   'Unknown': '?',
  \   'Renamed': '➜',
  \   'Modified': '✹',
  \   'Unmerged': '═',
  \   'Staged': '✚',
  \   'Clean': '✔︎',
  \ }
NERDTreeGitStatusMapNextHunk = ']c'
================================================================================
Others:
vim-devicons: yes
WebDevIconsNerdTreeGitPluginForceVAlign = 1
WebDevIconsNerdTreeAfterGlyphPadding = ' '
WebDevIconsNerdTreeBeforeGlyphPadding = ' '
----------------------------------------
vim-nerdtree-syntax-highlight: no
----------------------------------------
vim-nerdtree-tabs: no
================================================================================

Steps to Reproduce the Issue

launch vim in ~

Current Result (Include screenshots where appropriate.)

i have ~/.gitlabs where i have all my git repo but when i open vim no icons show on any repo

1609525038

Expected Result

1609525072

Xuyuanp commented 3 years ago

We can't (or shouldn't) detect git repo in sub folders.

HeCodes2Much commented 3 years ago

ok no problem 👍🏽