Commit Graph

166 Commits

Author SHA1 Message Date
Phil Runninger
ac2d3b077a Merge branch 'disable-cascade' of git://github.com/juanibiapina/nerdtree into juanibiapina-disable-cascade 2016-09-08 01:02:17 -04:00
Phil Runninger
4428aba2a2 Replace strchars() with a backward compatible workaround. 2016-08-26 08:59:25 -04:00
Phil Runninger
0b73db9368 Simplify some statements. Don't convert path WinToUnix. 2016-08-26 01:32:04 -04:00
Skyler
7730c8731a Quick syntax issue fix 2016-08-25 18:20:32 -07:00
Skyler Lipthay
b5519197e9 Added support for the copy command for both file and directory nodes on Windows systems 2016-08-25 18:19:38 -07:00
Martin Grenfell
15445be5fb remove unneeded exec
As @mkoskar pointed out at:
https://github.com/scrooloose/nerdtree/pull/576#issuecomment-218470556
2016-05-11 16:28:34 +01:00
Mike Zueff
5458680265 Fixed read-only files opening. 2016-04-30 04:08:18 +03:00
Martin Grenfell
35c859179d update initialization of default value for g:NERDTreeCreatePrefix
Init it with the rest of the option defaults - rather than specify the
default at point of use. For consistency.

See #550.
2016-04-26 09:17:03 +01:00
Martin Grenfell
0cb999c070 Merge pull request #550 from wincent/keepalt
Make window creation command configurable
2016-04-26 09:05:57 +01:00
d.chernyatiev
1a55a93788 Remove empty segments 2016-04-25 19:05:17 +04:00
Juan Ibiapina
b2bbed41fa Add option to disable collapsing of diretory names 2016-03-05 14:20:04 -03:00
Juan Ibiapina
88946e9832 Rewrite getCascade recursively 2016-03-05 13:59:27 -03:00
Juan Ibiapina
7f6c608a35 Remove extra whitespace at the end of the line 2016-03-05 13:35:41 -03:00
Alex Carlson
dfb9111786 Allow user-defined RO indicator.
(inspired by overwriting g:NERDTreeDirArrowCollapsible/Expandable)

Replace instances of the RO string with a variable that the user can
override. Useful for custom unicode glyphs, i.e. Font Awesome.

* Initialize variable g:NERDTreeGlyphReadOnly = "RO".
   -> plugin/NERD_tree.vim
* Replace instances of 'RO' with g:NERDTreeGlyphReadOnly
2016-02-26 17:57:40 -08:00
Greg Hurrell
9843fd3686 Make window creation command configurable
This commit adds a `NERDTreeCreatePrefix` setting that can be used to
prefix the `:edit` command that is used to create the NERDTree tree
window. Defaults to "silent", meaning that out of the box the window
will be created with "silent edit".

Users may wish to configure this to produce other effects. For example,
`NERDTreeCreatePrefix` can be set to "silent keepalt keepjumps" in order
to make NERDTree create its window with "silent keepalt keepjumps edit".

This can be used to create an effect analogous to the `g:netrw_altfile`
setting in netrw. An example of why you might want to do this is
described here:

    https://github.com/tpope/vim-vinegar/issues/25

I'm not using vim-vinegar myself, but I am using something like it here:

    https://github.com/wincent/wincent/blob/3efaa8fa50895/roles/dotfiles/files/.vim/plugin/mappings.vim#L60

And having `NERDTreeCreatePrefix` enables me to map "-" to show the
current file in context, and `^-6` to jump back to it.
2016-02-09 00:17:46 -08:00
Maxim Bublis
6251ab1e63 Add support for natural sorting order. 2016-01-19 00:21:13 -08:00
Devraj Mehta
afe99a46d8 update api call to open directory tree in window 2016-01-17 18:51:36 -05:00
Martin Grenfell
2f8a72144f silence an ls! call 2015-11-27 10:14:45 +00:00
Martin Grenfell
bbb819d696 bugfix for win trees when using "stay in current win" command variants
Previously maps like T would not restore the cursor position. Not sure
why the code was like this in the first place... hopefully I haven't
just broken a bunch of shit.

Closes #146.
2015-11-26 19:52:40 +00:00
Martin Grenfell
0544ff524c handle tab tree buffers being :bdeleted
Closes #375
2015-11-26 19:14:51 +00:00
Martin Grenfell
fddac60afb fix a bug that occurs when opening window trees
Closes #507
2015-11-26 09:31:55 +00:00
Martin Grenfell
c800aa27e2 fix a bug with C mapping
Closes #512
2015-11-26 09:27:44 +00:00
Martin Grenfell
a2b06bbac3 remove references to NERDTreeDirArrows
Closes #515
2015-11-26 00:25:06 +00:00
Martin Grenfell
677a83b2b6 remove NERDTreeDirArrows option
Use +/~ for windows - which seems to not have the arrow chars in its
default font. TBH I don't really understand this.

Inprove the UI indent matching so that it should handle any combo of
open/close symbol lengths e.g. the fancy arrows are 3 bytes each,
whereas +/~ are 1 byte each.
2015-11-25 23:29:00 +00:00
Martin Grenfell
fb15cfbf45 fix flag rendering for cascading dirs
Use the innermost dirs flags only. Previously each dirs flags were
rendered inline i.e.

    [x]dir1/[y]dir2/[z]dir3/

This looked bad and broke the UI. Now we only render the flags for dir3
- and render them on the left side of the cascade.

Not sure if this is ultimately the right decision - but will do for now.
2015-11-25 22:12:52 +00:00
Martin Grenfell
af39458989 rework the cascading slightly to correctly show open/closed dir arrows 2015-11-24 22:06:04 +00:00
Martin Grenfell
2cef8bb602 make cascading dirs more compact
Render cascading dirs on one line i.e.

    > foo/bar/baz
      file1

instead of

    > foo
      > bar
        > baz
          > file1

This should be useful things like java projects that have deep dir
structures.

Remove the old UI view (pre the dir arrows) as this simply isnt worth
supporting for a proof of concept. This may get added back - or not.
2015-11-24 20:59:35 +00:00
Martin Grenfell
ee4d42cfed encapsulate dep on g:NERDTreeMinimalUI in a function 2015-11-22 14:02:56 +00:00
Martin Grenfell
dd754c7bc6 add path.isAncestor 2015-11-20 19:16:07 +00:00
Martin Grenfell
9eb0004278 fix a syntax issue for older versions of vim
closes #508
2015-11-20 19:15:51 +00:00
Martin Grenfell
7c6795c5a2 fix a typo 2015-11-20 16:45:05 +00:00
Martin Grenfell
a60bd34a33 add NERDTree.getroot()
Eventually 'root' will become a "private" instance var '_root'
2015-11-20 16:16:12 +00:00
Martin Grenfell
c4f8681b77 add NERDTree.getRoot() and NERDTree.ForCurrentTab() 2015-11-20 01:52:38 +00:00
Martin Grenfell
665f326577 remove dependency on b:NERDTree from classes that dont need it
Inject it where needed.
2015-11-20 01:44:12 +00:00
Martin Grenfell
a0de028688 wipeout "stale" nerdtree bufs
When :NERDTree is called several times and &hidden is set, stale
nerdtree bufs will exist. Wipe them out.
2015-11-19 23:44:39 +00:00
Martin Grenfell
cedb40b4f5 move TreeFileNode.makeRoot() to NERDTree.changeRoot(node) 2015-11-16 13:17:59 +00:00
Martin Grenfell
71ee64fed7 add TreeDirNode.getDirChildren() - using this in a plugin 2015-11-16 11:30:16 +00:00
Martin Grenfell
bf217c75f9 fix a couple of var references in UI 2015-11-16 11:29:54 +00:00
Martin Grenfell
d36b793656 dont use b:NERDTreeRoot internally, but leave the var there for compat
Use b:NERDTree.root instead. I will eventually remove  b:NERDTreeRoot
altogether - but this will break some other plugins so leave it for now.
2015-11-16 11:28:24 +00:00
Martin Grenfell
0b966aa23a refactor TreeDirNode.reveal slightly 2015-11-16 09:35:31 +00:00
Martin Grenfell
b4fa33c39c remove some confusing redundancy from a few function calls 2015-11-15 01:04:03 +00:00
Martin Grenfell
83d108894e move a bunch of b:NERDTree.* vars into the b:NERDTree.ui obj 2015-11-15 00:45:57 +00:00
Martin Grenfell
4d8a0c90cb move b:NERDTreePreviousBuf into NERDTree class 2015-11-14 13:10:08 +00:00
Martin Grenfell
5c20274761 move b:NERDTreeType into the NERDTree class and add some query methods 2015-11-14 12:01:55 +00:00
Martin Grenfell
848857d18b rename "primary" and "secondary" trees to "tab" and "window" trees
This is much more accurate and descriptive.
2015-11-14 11:50:01 +00:00
Martin Grenfell
0c13ebc126 remove some old commented code 2015-11-13 15:08:01 +00:00
Martin Grenfell
47c20c4b64 Merge pull request #378 from Xuyuanp/up/master
fix #363
2015-11-12 14:29:12 +00:00
hiberabyss
34630f3926 issue #147: add support to ~ expand in bookmarks 2015-09-20 00:53:39 +08:00
Igor Tatarintsev
dc29ec2db3 Added global variables for changing default arrows
g:NERDTreeDirArrowExpandable
g:NERDTreeDirArrowCollapsable
2015-09-11 23:52:37 +06:00
Igor Tatarintsev
188bd92658 Added global variables for changing default arrows 2015-09-11 23:44:06 +06:00
Rick van Hattem
013c607ba4 Fixed incompatibility with older Vim versions
Fixed incompatibility with older Vim versions that are compiled without float function support such as `log10` and `ceil`

This fixes #452
2015-05-22 13:14:01 +02:00
Martin Grenfell
af85499eda rename 2 sort key related vars
rename s:format to s:sortKeyFormat - purely for descriptive reasons

rename self.sortKey to self._sortKey - the convention is to use leading
underscores to indicate private vars
2015-05-13 20:29:03 +01:00
Martin Grenfell
99fa465b5d fix syntax error 2015-05-13 20:27:22 +01:00
Vincent Tsang
10261d60a0 Updated the comment 2015-05-11 11:59:10 +08:00
Vincent Tsang
80e184df56 Refactor code to use getSortKey() and replace regular expression with
simple string comparison in tree_dir_node.vim
2015-05-11 11:56:08 +08:00
Vincent Tsang
57d5bd7731 Speed up sortChildren() by using sorting token
This improves the sorting functions from 12 seconds to 0.66 seconds for
~4000 objects
2015-05-09 22:47:33 +08:00
Martin Grenfell
a87b1bf3c5 Merge branch 'update_reuse_option' 2015-05-06 21:42:03 +01:00
Martin Grenfell
76dbc0c8ee Merge branch 'add_path_filter_api' 2015-05-06 20:58:55 +01:00
Martin Grenfell
da3874cf93 fix a bug when opening files in a new tab
On bufleave we save the nerdtree window state. However, sometimes when
bufleave is triggered the tree is no longer open in this tab - e.g. for
secondary trees or mappings that open in another tab. Dont bother saving
screen state in these cases as the code doing the saving assumes the
tree is available in this tab.
2015-05-04 20:25:43 +01:00
Martin Grenfell
7270212214 bugfix for secondary trees occurring when the screen state is saved 2015-05-03 11:14:34 +01:00
Martin Grenfell
64a9579c11 add a path filter API
Add an API to allow custom "path filter callbacks" to be added.

Previously we allowed one path filtering function to exist called
`NERDTreeCustomIgnoreFilter`. This has been removed and replaced with an
API to allow any number of such functions to exist -  via the new
`NERDTreeAddPathFilter()`
2015-05-02 22:21:41 +01:00
Martin Grenfell
fc4bcb4806 remove UI.lolcats()... not sure what the story is there 2015-05-02 15:26:59 +01:00
Martin Grenfell
8b189cb263 move some rendering and cursor moving functions out of autoload 2015-05-02 15:24:59 +01:00
Martin Grenfell
b0114d202b move dumpHelp out of autoload 2015-05-02 15:05:28 +01:00
Martin Grenfell
53d2de86eb move the closeTree functions out of autoload
Remove `closeTreeIfOpen` and just make `closeTree` fail silently.
2015-05-02 15:03:54 +01:00
Martin Grenfell
0d88ce946f move isTreeOpen() out of autoload 2015-05-02 14:44:32 +01:00
Martin Grenfell
8270b6d717 move nerdtree#getTreeWinNum out of autoload 2015-05-02 14:32:21 +01:00
Martin Grenfell
973c9906f8 refactor 3 more functions out of the monolithic autoload file 2015-05-02 14:17:52 +01:00
Martin Grenfell
f8499462c5 Revert "Use different arrow characters for compatibility."
This reverts commit f6cad7e957.
2015-05-02 11:29:43 +01:00
Martin Grenfell
5cec19365a Merge pull request #411 from xdl/master
Fix for nonexistent dir/bookmarks given to NERDTree commands
2015-05-01 16:05:35 +01:00
Martin Grenfell
87b27802b5 allow control over whether to reuse windows in different tabs
When opening a file we will "reuse" a window if the buffer is already
open somewhere.

Add an option to NERDTreeOpener to configure it to not reuse windows
across tabs.
2015-05-01 15:33:06 +01:00
Curtiss Howard
f6cad7e957 Use different arrow characters for compatibility. 2015-04-17 17:36:23 -04:00
xiaodili
6dfbcd660a Return early if exception was thrown in pathForString 2014-12-21 17:44:41 +00:00
Giacomo Comitti
ba26044746 Truncate paths at slashes. 2014-11-20 07:50:47 +01:00
Martin Grenfell
3d421b8ec5 use the built in fnamemodify() to make a path relative
Closes #383
2014-10-29 19:18:28 +00:00
Martin Grenfell
1c08146224 apply @mixvin's windows path fix at the top of the method instead 2014-10-29 11:20:58 +00:00
mixvin
cd8d87fa57 Fix opening file path, in Windows 2014-10-29 11:17:53 +00:00
Xuyuan Pang
8e06723c04 fix #363 2014-09-01 17:32:59 +08:00
Xuyuan Pang
8cd045d0e2 add refreshDirFlags method to avoid refreshing too many files 2014-07-19 17:57:41 +08:00
Martin Grenfell
c2dd750860 move nerdtree#treeExists.* methods into the NERDTree class 2014-07-17 20:31:17 +01:00
Martin Grenfell
fd14757c04 add proper events and make the notifier class generic
Expand the event system to have explicit Event objects and potentially
many Notifiers. Previously they was only one notifier and one (implied)
event.

A lot of this is stolen from #358.
2014-07-17 20:18:09 +01:00
Martin Grenfell
f9a933991d allow plugins to override the default mappings 2014-07-15 19:00:17 +01:00
Martin Grenfell
9f351de594 Merge branch 'master' into expt_add_path_flags_and_git 2014-07-09 09:26:17 +01:00
Martin Grenfell
1e0d1cbc8f move some more view code into the UI class 2014-07-09 09:25:25 +01:00
Martin Grenfell
2f59cc2080 Merge branch 'master' into expt_add_path_flags_and_git 2014-07-08 09:47:38 +01:00
Martin Grenfell
8644622000 Merge branch 'master' into expt_add_path_flags_and_git
Conflicts:
	autoload/nerdtree.vim
	lib/nerdtree/creator.vim
2014-07-08 09:38:43 +01:00
Lucas Caton
1784de15dd Updating creator.vim file (this fixes #352) 2014-07-08 10:57:39 +10:00
Martin Grenfell
23dfc6d818 continue breaking down the epic autoload module
Add 2 new classes and move code into them from autoload:

* NERDTree. Each nerdtree buffer now has a NERDTree object that holds
  the root node and will old other util functions
* UI. Each NERDTree object holds a UI object which is responsible for
  rendering, getting the current node, etc

Still a fair few methods to sort through in autoload (many of which will
end up in the above classes) - need sleep though.
2014-07-07 22:59:28 +01:00
Martin Grenfell
f982f61e8a continue breaking up the autoload/nerdtree god module 2014-07-07 21:34:57 +01:00
Martin Grenfell
86488b1aa0 move ui functions out into their own autoload
All of the autoload shit needs to be cleaned up... break it out first
2014-07-07 19:36:34 +01:00
Martin Grenfell
04d9b27541 add .refreshFlags() to path/dir/file objects
This will trigger the path refresh callbacks without refreshing the
path's from disk (which takes ages)
2014-07-07 18:24:37 +01:00
Martin Grenfell
3941389f13 fix a retarded bug with FlagSet.clearFlags 2014-07-06 23:36:45 +01:00
Martin Grenfell
32cf3ee62d allow flags to be scoped to a plugin
Add new FlagSet class and init each Path with one.

Call Path.flagSet.addFlag(scope, flag) instead of Path.addFlag(flag)
2014-07-05 20:51:21 +01:00
Martin Grenfell
a7428eba38 add proof of concept for path flags API and add git modified flags 2014-07-05 00:29:45 +01:00
Martin Grenfell
d162c08fd7 comment and tweak the <LeftRelease> fix in 24561ad 2014-07-02 20:54:14 +01:00
Martin Grenfell
2a769a7263 Merge pull request #298 from buggo/master
Fix error 121 when clicking on command line below another window
2014-07-02 20:49:59 +01:00
Martin Grenfell
0ee888ee17 simplify the <cr> mapping definition 2014-07-02 20:25:17 +01:00
Shane Smith
82cd4f5a9f Fix <CR> not working if active node map is special char such as <Right> 2014-07-01 20:29:52 -04:00
Martin Grenfell
4b89264dfc Merge branch 'better-set-filetype' of https://github.com/inkarkat/nerdtree into inkarkat-better-set-filetype 2014-06-27 19:37:17 +01:00
Martin Grenfell
0928b5b026 Merge pull request #251 from pendulm/master
fix typo and smart close single child directory
2014-06-27 19:25:48 +01:00