1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// vim:fileencoding=utf-8:noet
//! Port of `powerline/segments/vim/plugin/nerdtree.py`.
// from __future__ import (unicode_literals, division, absolute_import, print_function) // py:2
// try: import vim except ImportError: vim = object() // py:4-7
// from powerline.bindings.vim import bufvar_exists // py:9
// from powerline.segments.vim import window_cached // py:10
use cratebufvar_exists;
use ;
/// Port of `nerdtree()` from
/// `powerline/segments/vim/plugin/nerdtree.py:14`.
///
/// Return directory that is shown by the current buffer.
///
/// Highlight groups used: `nerdtree:path` or `file_name`.
///
/// Rust port: without `vim.eval(...)` we cannot read NERDTreeRoot's
/// path. Returns `None` (matches the upstream py:17 short-circuit
/// when NERDTreeRoot is not set).