mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d639b70e7 | ||
|
|
6318406f66 | ||
|
|
496b61ead1 | ||
|
|
5af6859846 |
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,17 +1,21 @@
|
||||
# Change Log
|
||||
|
||||
#### 6.1...
|
||||
- **.1**: Catch errors when trying to read CHANGELOG.md. (PhilRunninger) [#1045](https://github.com/scrooloose/nerdtree/pull/1045)
|
||||
- **.0**: If file path doesn't exist, :NERDTreeFind its parent directory instead. (PhilRunninger) [#1043](https://github.com/scrooloose/nerdtree/pull/1043)
|
||||
#### 6.0...
|
||||
- **.0**: Make the behavior of window splits consistent [#1035](https://github.com/scrooloose/nerdtree/pull/1035)
|
||||
- **.1**: Reintroduce necessary variable mistakenly removed. (PhilRunninger) [#1040](https://github.com/scrooloose/nerdtree/pull/1040)
|
||||
- **.0**: Make the behavior of window splits consistent (dragonxlwang, PhilRunninger) [#1035](https://github.com/scrooloose/nerdtree/pull/1035)
|
||||
#### 5.3...
|
||||
- **.3**: Fix (p)ath not displaying in the minimal menu [#1038](https://github.com/scrooloose/nerdtree/pull/1038)
|
||||
- **.2**: Enable events when closing NerdTree window. [#1037](https://github.com/scrooloose/nerdtree/pull/1037)
|
||||
- **.1**: Fix the `e` key mapping to use netrw if desired [#1031](https://github.com/scrooloose/nerdtree/pull/1031)
|
||||
- **.0**: Add file extension and size to sorting capabilities [#1029](https://github.com/scrooloose/nerdtree/pull/1029)
|
||||
- **.3**: Fix (p)ath not displaying in the minimal menu (tuzz) [#1038](https://github.com/scrooloose/nerdtree/pull/1038)
|
||||
- **.2**: Enable events when closing NerdTree window. (PhilRunninger) [#1037](https://github.com/scrooloose/nerdtree/pull/1037)
|
||||
- **.1**: Fix the `e` key mapping to use netrw if desired (PhilRunninger) [#1031](https://github.com/scrooloose/nerdtree/pull/1031)
|
||||
- **.0**: Add file extension and size to sorting capabilities (PhilRunninger) [#1029](https://github.com/scrooloose/nerdtree/pull/1029)
|
||||
#### 5.2...
|
||||
- **.9**: Suppress events for intermediate window/tab/buffer changes [#1026](https://github.com/scrooloose/nerdtree/pull/1026)
|
||||
- **.9**: Suppress events for intermediate window/tab/buffer changes (PhilRunninger) [#1026](https://github.com/scrooloose/nerdtree/pull/1026)
|
||||
- **.8**: Revert [#1019](https://github.com/scrooloose/nerdtree/pull/1019) to fix nvim artifacts and flickering. (PhilRunninger) [#1021](https://github.com/scrooloose/nerdtree/pull/1021)
|
||||
- **.7**: Use :mode only in neovim. MacVim still needs to use :redraw! [#1019](https://github.com/scrooloose/nerdtree/pull/1019)
|
||||
- **.6**: In CHANGELOG.md and PR template, make reference to PR a true HTML link. [#1017](https://github.com/scrooloose/nerdtree/pull/1017)
|
||||
- **.7**: Use :mode only in neovim. MacVim still needs to use :redraw! (PhilRunninger) [#1019](https://github.com/scrooloose/nerdtree/pull/1019)
|
||||
- **.6**: In CHANGELOG.md and PR template, make reference to PR a true HTML link. (PhilRunninger) [#1017](https://github.com/scrooloose/nerdtree/pull/1017)
|
||||
- **.5**: Use `:mode` instead of `:redraw!` when updating menu. (PhilRunninger) [#1016](https://github.com/scrooloose/nerdtree/pull/1016)
|
||||
- **.4**: When searching for root line num, stop at end of file. (PhilRunninger) [#1015](https://github.com/scrooloose/nerdtree/pull/1015)
|
||||
- **.3**: Fix `<CR>` key map on the bookmark (lkebin) [#1014](https://github.com/scrooloose/nerdtree/pull/1014)
|
||||
|
||||
@@ -10,17 +10,20 @@ let s:rootNERDTreePath = resolve(expand("<sfile>:p:h:h"))
|
||||
" change log is shown for the current version; otherwise, only the version
|
||||
" number is shown.
|
||||
function! nerdtree#version(...)
|
||||
let l:changelog = readfile(join([s:rootNERDTreePath, "CHANGELOG.md"], nerdtree#slash()))
|
||||
let l:text = 'Unknown'
|
||||
let l:line = 0
|
||||
while l:line <= len(l:changelog)
|
||||
if l:changelog[l:line] =~ '\d\+\.\d\+'
|
||||
let l:text = substitute(l:changelog[l:line], '.*\(\d\+.\d\+\).*', '\1', '')
|
||||
let l:text .= substitute(l:changelog[l:line+1], '^.\{-}\(\.\d\+\).\{-}:\(.*\)', a:0>0 ? '\1:\2' : '\1', '')
|
||||
break
|
||||
endif
|
||||
let l:line += 1
|
||||
endwhile
|
||||
try
|
||||
let l:changelog = readfile(join([s:rootNERDTreePath, "CHANGELOG.md"], nerdtree#slash()))
|
||||
let l:line = 0
|
||||
while l:line <= len(l:changelog)
|
||||
if l:changelog[l:line] =~ '\d\+\.\d\+'
|
||||
let l:text = substitute(l:changelog[l:line], '.*\(\d\+.\d\+\).*', '\1', '')
|
||||
let l:text .= substitute(l:changelog[l:line+1], '^.\{-}\(\.\d\+\).\{-}:\(.*\)', a:0>0 ? '\1:\2' : '\1', '')
|
||||
break
|
||||
endif
|
||||
let l:line += 1
|
||||
endwhile
|
||||
catch
|
||||
endtry
|
||||
return l:text
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -284,6 +284,9 @@ endfunction
|
||||
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
|
||||
function! s:findAndRevealPath(pathStr)
|
||||
let l:pathStr = !empty(a:pathStr) ? a:pathStr : expand('%:p')
|
||||
if !filereadable(l:pathStr)
|
||||
let l:pathStr = fnamemodify(l:pathStr, ':h')
|
||||
endif
|
||||
|
||||
if empty(l:pathStr)
|
||||
call nerdtree#echoWarning('no file for the current buffer')
|
||||
|
||||
@@ -158,12 +158,13 @@ function! s:Opener._newSplit()
|
||||
if onlyOneWin
|
||||
let &splitright = (g:NERDTreeWinPos ==# "left")
|
||||
endif
|
||||
" If only one window (ie. NERDTree), split vertically instead.
|
||||
let splitMode = onlyOneWin ? "vertical" : ""
|
||||
|
||||
" Open the new window
|
||||
try
|
||||
call nerdtree#exec('wincmd p', 1)
|
||||
" If only one window (ie. NERDTree), split vertically instead.
|
||||
call nerdtree#exec(onlyOneWin ? "vertical split" : "split",1)
|
||||
call nerdtree#exec(splitMode . " split",1)
|
||||
catch /^Vim\%((\a\+)\)\=:E37/
|
||||
call g:NERDTree.CursorToTreeWin()
|
||||
throw "NERDTree.FileAlreadyOpenAndModifiedError: ". self._path.str() ." is already open and modified."
|
||||
|
||||
Reference in New Issue
Block a user