Compare commits

...

4 Commits
7.0.1 ... 7.1.0

Author SHA1 Message Date
Ali Rezvani
e5599272a9 chore: bump version to 7.1.0 (#1391) 2023-12-31 12:06:39 +03:30
Rocco Mao
ff9469a14a fix: mapping description in NERDTree.txt (#1393) 2023-12-26 04:38:17 +03:30
msibal6
fefea5d382 feat: add NERDTreeExplore command. (#1389)
* create a explorer command that opens a window tree at specified
directory

* update CHANGELOG.md

* Update CHANGELOG.md

* revert CHANGELOG.md

* CreateExplorerTree matches :Explore command

* prevent empty split when calling NERDTreeExplorer with invalid arg from modified buffer

* NERDTreeExplore/CreateExploreTree checks for hidden and
autowriteall settings
2023-12-23 03:47:43 +03:30
Leo Chung
a954661824 fix: typo in nerdtree.txt (#1390)
Signed-off-by: Leo Chung <gewalalb@gmail.com>
2023-12-20 18:55:39 +03:30
4 changed files with 31 additions and 2 deletions

View File

@@ -12,6 +12,11 @@
. .
- Pull Request Title n (PR Author) [PR Number](Link to PR) - Pull Request Title n (PR Author) [PR Number](Link to PR)
--> -->
#### 7.1
- **.0**:
- fix: typo in the docs. (bl4kraven) [#1390](https://github.com/preservim/nerdtree/pull/1390)
- feat: add NERDTreeExplore command. (msibal6) [#1389](https://github.com/preservim/nerdtree/pull/1389)
- fix: mapping description in NERDTree.txt. (roccomao) [#1393](https://github.com/preservim/nerdtree/pull/1393)
#### 7.0 #### 7.0
- **.1**: - **.1**:
- Fix NERDTreeFind to handle directory case sensitivity. (dangibson) [#1387](https://github.com/preservim/nerdtree/pull/1387) - Fix NERDTreeFind to handle directory case sensitivity. (dangibson) [#1387](https://github.com/preservim/nerdtree/pull/1387)

View File

@@ -642,6 +642,7 @@ endfunction
function! nerdtree#ui_glue#setupCommands() abort function! nerdtree#ui_glue#setupCommands() abort
command! -n=? -complete=dir -bar NERDTree :call g:NERDTreeCreator.CreateTabTree('<args>') command! -n=? -complete=dir -bar NERDTree :call g:NERDTreeCreator.CreateTabTree('<args>')
command! -n=? -complete=dir -bar NERDTreeToggle :call g:NERDTreeCreator.ToggleTabTree('<args>') command! -n=? -complete=dir -bar NERDTreeToggle :call g:NERDTreeCreator.ToggleTabTree('<args>')
command! -n=? -complete=dir -bar NERDTreeExplore :call g:NERDTreeCreator.CreateExploreTree('<args>')
command! -n=0 -bar NERDTreeClose :call g:NERDTree.Close() command! -n=0 -bar NERDTreeClose :call g:NERDTree.Close()
command! -n=1 -complete=customlist,nerdtree#completeBookmarks -bar NERDTreeFromBookmark call g:NERDTreeCreator.CreateTabTree('<args>') command! -n=1 -complete=customlist,nerdtree#completeBookmarks -bar NERDTreeFromBookmark call g:NERDTreeCreator.CreateTabTree('<args>')
command! -n=0 -bar NERDTreeMirror call g:NERDTreeCreator.CreateMirror() command! -n=0 -bar NERDTreeMirror call g:NERDTreeCreator.CreateMirror()

View File

@@ -287,7 +287,7 @@ I........Toggle whether hidden files displayed......................|NERDTree-I|
f........Toggle whether the file filters are used...................|NERDTree-f| f........Toggle whether the file filters are used...................|NERDTree-f|
F........Toggle whether files are displayed.........................|NERDTree-F| F........Toggle whether files are displayed.........................|NERDTree-F|
B........Toggle whether the bookmark table is displayed.............|NERDTree-B| B........Toggle whether the bookmark table is displayed.............|NERDTree-B|
L........Toggle whether the bookmark table is displayed.............|NERDTree-L| L........Toggle whether the number of lines in files is displayed...|NERDTree-L|
q........Close the NERDTree window..................................|NERDTree-q| q........Close the NERDTree window..................................|NERDTree-q|
A........Zoom (maximize/minimize) the NERDTree window...............|NERDTree-A| A........Zoom (maximize/minimize) the NERDTree window...............|NERDTree-A|
@@ -605,7 +605,7 @@ Toggles whether the bookmarks table is displayed.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-L* *NERDTree-L*
Default key: L Default key: L
Map setting: *NERDTreeMapToggleFileLiness* Map setting: *NERDTreeMapToggleFileLines*
Applies to: no restrictions. Applies to: no restrictions.
Toggles whether the number of lines in files is displayed. Toggles whether the number of lines in files is displayed.

View File

@@ -38,6 +38,29 @@ function! s:Creator.BufNamePrefix()
return 'NERD_tree_' return 'NERD_tree_'
endfunction endfunction
" FUNCTION: s:Creator.CreateExploreTree(dir) {{{1
function! s:Creator.CreateExploreTree(dir)
try
let path = g:NERDTreePath.New(a:dir)
catch /^NERDTree.InvalidArgumentsError/
call nerdtree#echo('Invalid directory name:' . a:dir)
return
endtry
let creator = s:Creator.New()
if getbufinfo('%')[0].changed && !&hidden && !&autowriteall
let l:splitLocation = g:NERDTreeWinPos ==# 'left' || g:NERDTreeWinPos ==# 'top' ? 'topleft ' : 'botright '
let l:splitDirection = g:NERDTreeWinPos ==# 'left' || g:NERDTreeWinPos ==# 'right' ? 'vertical' : ''
silent! execute l:splitLocation . l:splitDirection . ' new'
else
silent! execute 'enew'
endif
call creator.createWindowTree(a:dir)
"we want windowTree buffer to disappear after moving to any other buffer
setlocal bufhidden=wipe
endfunction
" FUNCTION: s:Creator.CreateTabTree(a:name) {{{1 " FUNCTION: s:Creator.CreateTabTree(a:name) {{{1
function! s:Creator.CreateTabTree(name) function! s:Creator.CreateTabTree(name)
let creator = s:Creator.New() let creator = s:Creator.New()