mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 03:43:50 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d508aedce | ||
|
|
9afab6257b | ||
|
|
877f41e243 |
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -9,11 +9,5 @@ Closes # <!-- Issue number this PR addresses. If none, remove this line. -->
|
||||
- [ ] `MAJOR` version when you make incompatible API changes
|
||||
- [ ] `MINOR` version when you add functionality in a backwards-compatible manner
|
||||
- [ ] `PATCH` version when you make backwards-compatible bug fixes
|
||||
- [ ] Update [CHANGELOG.md](https://github.com/scrooloose/nerdtree/blob/master/CHANGELOG.md).
|
||||
<!--
|
||||
Use this format in CHANGELOG.md. Use the existing text as a template.
|
||||
|
||||
#### MAJOR.MINOR...
|
||||
- **.PATCH**: PR Title (Author) [#PR Number](link to PR)
|
||||
|
||||
-->
|
||||
- [ ] Update [CHANGELOG.md](https://github.com/scrooloose/nerdtree/blob/master/CHANGELOG.md), following the established pattern.
|
||||
- [ ] Tag the merge commit, e.g. `git tag -a 3.1.4 -m "v3.1.4" && git push origin --tags`
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Change Log
|
||||
|
||||
#### 5.3...
|
||||
- **.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)
|
||||
#### 5.2...
|
||||
- **.9**: Suppress events for intermediate window/tab/buffer changes [#1026](https://github.com/scrooloose/nerdtree/pull/1026)
|
||||
|
||||
@@ -72,6 +72,7 @@ function! nerdtree#ui_glue#createDefaultBindings()
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTabSilent, 'scope': 'Bookmark', 'callback': s . 'openInNewTabSilent' })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenExpl, 'scope': "DirNode", 'callback': s."openExplorer" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenExpl, 'scope': "FileNode", 'callback': s."openExplorer" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapDeleteBookmark, 'scope': "Bookmark", 'callback': s."deleteBookmark" })
|
||||
endfunction
|
||||
|
||||
@@ -413,24 +413,12 @@ function! s:Path.getSortKey()
|
||||
let metadata = []
|
||||
for tag in g:NERDTreeSortOrder
|
||||
if tag =~? '\[\[-\?timestamp\]\]'
|
||||
if self.isDirectory
|
||||
call add(metadata, 0)
|
||||
else
|
||||
call add(metadata, (tag =~ '-' ? -1 : 1) * getftime(self.str()))
|
||||
endif
|
||||
let metadata += [self.isDirectory ? 0 : getftime(self.str()) * (tag =~ '-' ? -1 : 1)]
|
||||
elseif tag =~? '\[\[-\?size\]\]'
|
||||
if self.isDirectory
|
||||
call add(metadata, 0)
|
||||
else
|
||||
call add(metadata, (tag =~ '-' ? -1 : 1) * getfsize(self.str()))
|
||||
endif
|
||||
let metadata += [self.isDirectory ? 0 : getfsize(self.str()) * (tag =~ '-' ? -1 : 1)]
|
||||
elseif tag =~? '\[\[extension\]\]'
|
||||
if self.isDirectory
|
||||
call add(metadata, '')
|
||||
else
|
||||
let extension = matchstr(self.getLastPathComponent(0), '[^.]\+\.\zs[^.]\+$')
|
||||
call add(metadata, extension == '' ? nr2char(str2nr('0x10ffff',16)) : extension)
|
||||
endif
|
||||
let extension = matchstr(self.getLastPathComponent(0), '[^.]\+\.\zs[^.]\+$')
|
||||
let metadata += [self.isDirectory ? '' : (extension == '' ? nr2char(str2nr('0x10ffff',16)) : extension)]
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
||||
@@ -523,7 +523,8 @@ endfunction
|
||||
" Open an explorer window for this node in the previous window. The explorer
|
||||
" can be a NERDTree window or a netrw window.
|
||||
function! s:TreeDirNode.openExplorer()
|
||||
call self.open({'where': 'p'})
|
||||
execute "wincmd p"
|
||||
execute "edit ".self.path.str({'format':'Edit'})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeDirNode.openInNewTab(options) {{{1
|
||||
|
||||
@@ -246,6 +246,12 @@ function! s:TreeFileNode.openInNewTab(options)
|
||||
call self.open(extend({'where': 't'}, a:options))
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeFileNode.openExplorer()
|
||||
function! s:TreeFileNode.openExplorer()
|
||||
execute "wincmd p"
|
||||
execute "edit ".self.path.getParent().str({'format':'Edit'})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeFileNode.putCursorHere(isJump, recurseUpward){{{1
|
||||
" Places the cursor on the line number this node is rendered on
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user