mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 03:43:50 -05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d639b70e7 | ||
|
|
6318406f66 |
@@ -1,5 +1,8 @@
|
|||||||
# Change Log
|
# 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...
|
#### 6.0...
|
||||||
- **.1**: Reintroduce necessary variable mistakenly removed. (PhilRunninger) [#1040](https://github.com/scrooloose/nerdtree/pull/1040)
|
- **.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)
|
- **.0**: Make the behavior of window splits consistent (dragonxlwang, PhilRunninger) [#1035](https://github.com/scrooloose/nerdtree/pull/1035)
|
||||||
|
|||||||
@@ -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
|
" change log is shown for the current version; otherwise, only the version
|
||||||
" number is shown.
|
" number is shown.
|
||||||
function! nerdtree#version(...)
|
function! nerdtree#version(...)
|
||||||
let l:changelog = readfile(join([s:rootNERDTreePath, "CHANGELOG.md"], nerdtree#slash()))
|
|
||||||
let l:text = 'Unknown'
|
let l:text = 'Unknown'
|
||||||
let l:line = 0
|
try
|
||||||
while l:line <= len(l:changelog)
|
let l:changelog = readfile(join([s:rootNERDTreePath, "CHANGELOG.md"], nerdtree#slash()))
|
||||||
if l:changelog[l:line] =~ '\d\+\.\d\+'
|
let l:line = 0
|
||||||
let l:text = substitute(l:changelog[l:line], '.*\(\d\+.\d\+\).*', '\1', '')
|
while l:line <= len(l:changelog)
|
||||||
let l:text .= substitute(l:changelog[l:line+1], '^.\{-}\(\.\d\+\).\{-}:\(.*\)', a:0>0 ? '\1:\2' : '\1', '')
|
if l:changelog[l:line] =~ '\d\+\.\d\+'
|
||||||
break
|
let l:text = substitute(l:changelog[l:line], '.*\(\d\+.\d\+\).*', '\1', '')
|
||||||
endif
|
let l:text .= substitute(l:changelog[l:line+1], '^.\{-}\(\.\d\+\).\{-}:\(.*\)', a:0>0 ? '\1:\2' : '\1', '')
|
||||||
let l:line += 1
|
break
|
||||||
endwhile
|
endif
|
||||||
|
let l:line += 1
|
||||||
|
endwhile
|
||||||
|
catch
|
||||||
|
endtry
|
||||||
return l:text
|
return l:text
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -284,6 +284,9 @@ endfunction
|
|||||||
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
|
" FUNCTION: s:findAndRevealPath(pathStr) {{{1
|
||||||
function! s:findAndRevealPath(pathStr)
|
function! s:findAndRevealPath(pathStr)
|
||||||
let l:pathStr = !empty(a:pathStr) ? a:pathStr : expand('%:p')
|
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)
|
if empty(l:pathStr)
|
||||||
call nerdtree#echoWarning('no file for the current buffer')
|
call nerdtree#echoWarning('no file for the current buffer')
|
||||||
|
|||||||
Reference in New Issue
Block a user