doing 2.0.18 → 2.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/Gemfile.lock +15 -5
- data/README.md +1 -1
- data/bin/doing +2 -18
- data/doing.gemspec +5 -4
- data/doing.rdoc +2 -2
- data/generate_completions.sh +3 -3
- data/lib/doing/cli_status.rb +6 -2
- data/lib/doing/completion/bash_completion.rb +185 -0
- data/lib/doing/completion/fish_completion.rb +175 -0
- data/lib/doing/completion/string.rb +17 -0
- data/lib/doing/completion/zsh_completion.rb +140 -0
- data/lib/doing/completion.rb +39 -0
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +18 -6
- data/lib/doing.rb +1 -1
- data/lib/helpers/fzf/.goreleaser.yml +119 -0
- data/lib/helpers/fzf/.rubocop.yml +28 -0
- data/lib/helpers/fzf/ADVANCED.md +565 -0
- data/lib/helpers/fzf/BUILD.md +49 -0
- data/lib/helpers/fzf/CHANGELOG.md +1193 -0
- data/lib/helpers/fzf/Dockerfile +11 -0
- data/lib/helpers/fzf/LICENSE +21 -0
- data/lib/helpers/fzf/Makefile +166 -0
- data/lib/helpers/fzf/README-VIM.md +486 -0
- data/lib/helpers/fzf/README.md +712 -0
- data/lib/helpers/fzf/bin/fzf-tmux +233 -0
- data/lib/helpers/fzf/doc/fzf.txt +512 -0
- data/lib/helpers/fzf/go.mod +17 -0
- data/lib/helpers/fzf/go.sum +31 -0
- data/lib/helpers/fzf/install +382 -0
- data/lib/helpers/fzf/install.ps1 +65 -0
- data/lib/helpers/fzf/main.go +14 -0
- data/lib/helpers/fzf/man/man1/fzf-tmux.1 +68 -0
- data/lib/helpers/fzf/man/man1/fzf.1 +1001 -0
- data/lib/helpers/fzf/plugin/fzf.vim +1048 -0
- data/lib/helpers/fzf/shell/completion.bash +381 -0
- data/lib/helpers/fzf/shell/completion.zsh +329 -0
- data/lib/helpers/fzf/shell/key-bindings.bash +96 -0
- data/lib/helpers/fzf/shell/key-bindings.fish +172 -0
- data/lib/helpers/fzf/shell/key-bindings.zsh +114 -0
- data/lib/helpers/fzf/src/LICENSE +21 -0
- data/lib/helpers/fzf/src/algo/algo.go +884 -0
- data/lib/helpers/fzf/src/algo/algo_test.go +197 -0
- data/lib/helpers/fzf/src/algo/normalize.go +492 -0
- data/lib/helpers/fzf/src/ansi.go +409 -0
- data/lib/helpers/fzf/src/ansi_test.go +427 -0
- data/lib/helpers/fzf/src/cache.go +81 -0
- data/lib/helpers/fzf/src/cache_test.go +39 -0
- data/lib/helpers/fzf/src/chunklist.go +89 -0
- data/lib/helpers/fzf/src/chunklist_test.go +80 -0
- data/lib/helpers/fzf/src/constants.go +85 -0
- data/lib/helpers/fzf/src/core.go +351 -0
- data/lib/helpers/fzf/src/history.go +96 -0
- data/lib/helpers/fzf/src/history_test.go +68 -0
- data/lib/helpers/fzf/src/item.go +44 -0
- data/lib/helpers/fzf/src/item_test.go +23 -0
- data/lib/helpers/fzf/src/matcher.go +235 -0
- data/lib/helpers/fzf/src/merger.go +120 -0
- data/lib/helpers/fzf/src/merger_test.go +88 -0
- data/lib/helpers/fzf/src/options.go +1691 -0
- data/lib/helpers/fzf/src/options_test.go +457 -0
- data/lib/helpers/fzf/src/pattern.go +425 -0
- data/lib/helpers/fzf/src/pattern_test.go +209 -0
- data/lib/helpers/fzf/src/protector/protector.go +8 -0
- data/lib/helpers/fzf/src/protector/protector_openbsd.go +10 -0
- data/lib/helpers/fzf/src/reader.go +201 -0
- data/lib/helpers/fzf/src/reader_test.go +63 -0
- data/lib/helpers/fzf/src/result.go +243 -0
- data/lib/helpers/fzf/src/result_others.go +16 -0
- data/lib/helpers/fzf/src/result_test.go +159 -0
- data/lib/helpers/fzf/src/result_x86.go +16 -0
- data/lib/helpers/fzf/src/terminal.go +2832 -0
- data/lib/helpers/fzf/src/terminal_test.go +638 -0
- data/lib/helpers/fzf/src/terminal_unix.go +26 -0
- data/lib/helpers/fzf/src/terminal_windows.go +45 -0
- data/lib/helpers/fzf/src/tokenizer.go +253 -0
- data/lib/helpers/fzf/src/tokenizer_test.go +112 -0
- data/lib/helpers/fzf/src/tui/dummy.go +46 -0
- data/lib/helpers/fzf/src/tui/light.go +987 -0
- data/lib/helpers/fzf/src/tui/light_unix.go +110 -0
- data/lib/helpers/fzf/src/tui/light_windows.go +145 -0
- data/lib/helpers/fzf/src/tui/tcell.go +721 -0
- data/lib/helpers/fzf/src/tui/tcell_test.go +392 -0
- data/lib/helpers/fzf/src/tui/ttyname_unix.go +47 -0
- data/lib/helpers/fzf/src/tui/ttyname_windows.go +14 -0
- data/lib/helpers/fzf/src/tui/tui.go +625 -0
- data/lib/helpers/fzf/src/tui/tui_test.go +20 -0
- data/lib/helpers/fzf/src/util/atomicbool.go +34 -0
- data/lib/helpers/fzf/src/util/atomicbool_test.go +17 -0
- data/lib/helpers/fzf/src/util/chars.go +198 -0
- data/lib/helpers/fzf/src/util/chars_test.go +46 -0
- data/lib/helpers/fzf/src/util/eventbox.go +96 -0
- data/lib/helpers/fzf/src/util/eventbox_test.go +61 -0
- data/lib/helpers/fzf/src/util/slab.go +12 -0
- data/lib/helpers/fzf/src/util/util.go +138 -0
- data/lib/helpers/fzf/src/util/util_test.go +40 -0
- data/lib/helpers/fzf/src/util/util_unix.go +47 -0
- data/lib/helpers/fzf/src/util/util_windows.go +83 -0
- data/lib/helpers/fzf/test/fzf.vader +175 -0
- data/lib/helpers/fzf/test/test_go.rb +2626 -0
- data/lib/helpers/fzf/uninstall +117 -0
- data/scripts/generate_bash_completions.rb +6 -12
- data/scripts/generate_fish_completions.rb +7 -16
- data/scripts/generate_zsh_completions.rb +6 -15
- metadata +144 -9
@@ -0,0 +1,175 @@
|
|
1
|
+
Execute (Setup):
|
2
|
+
let g:dir = fnamemodify(g:vader_file, ':p:h')
|
3
|
+
unlet! g:fzf_layout g:fzf_action g:fzf_history_dir
|
4
|
+
Log 'Test directory: ' . g:dir
|
5
|
+
Save &acd
|
6
|
+
|
7
|
+
Execute (fzf#run with dir option):
|
8
|
+
let cwd = getcwd()
|
9
|
+
let result = fzf#run({ 'source': 'git ls-files', 'options': '--filter=vdr', 'dir': g:dir })
|
10
|
+
AssertEqual ['fzf.vader'], result
|
11
|
+
AssertEqual 0, haslocaldir()
|
12
|
+
AssertEqual getcwd(), cwd
|
13
|
+
|
14
|
+
execute 'lcd' fnameescape(cwd)
|
15
|
+
let result = sort(fzf#run({ 'source': 'git ls-files', 'options': '--filter e', 'dir': g:dir }))
|
16
|
+
AssertEqual ['fzf.vader', 'test_go.rb'], result
|
17
|
+
AssertEqual 1, haslocaldir()
|
18
|
+
AssertEqual getcwd(), cwd
|
19
|
+
|
20
|
+
Execute (fzf#run with Funcref command):
|
21
|
+
let g:ret = []
|
22
|
+
function! g:FzfTest(e)
|
23
|
+
call add(g:ret, a:e)
|
24
|
+
endfunction
|
25
|
+
let result = sort(fzf#run({ 'source': 'git ls-files', 'sink': function('g:FzfTest'), 'options': '--filter e', 'dir': g:dir }))
|
26
|
+
AssertEqual ['fzf.vader', 'test_go.rb'], result
|
27
|
+
AssertEqual ['fzf.vader', 'test_go.rb'], sort(g:ret)
|
28
|
+
|
29
|
+
Execute (fzf#run with string source):
|
30
|
+
let result = sort(fzf#run({ 'source': 'echo hi', 'options': '-f i' }))
|
31
|
+
AssertEqual ['hi'], result
|
32
|
+
|
33
|
+
Execute (fzf#run with list source):
|
34
|
+
let result = sort(fzf#run({ 'source': ['hello', 'world'], 'options': '-f e' }))
|
35
|
+
AssertEqual ['hello'], result
|
36
|
+
let result = sort(fzf#run({ 'source': ['hello', 'world'], 'options': '-f o' }))
|
37
|
+
AssertEqual ['hello', 'world'], result
|
38
|
+
|
39
|
+
Execute (fzf#run with string source):
|
40
|
+
let result = sort(fzf#run({ 'source': 'echo hi', 'options': '-f i' }))
|
41
|
+
AssertEqual ['hi'], result
|
42
|
+
|
43
|
+
Execute (fzf#run with dir option and noautochdir):
|
44
|
+
set noacd
|
45
|
+
let cwd = getcwd()
|
46
|
+
call fzf#run({'source': ['/foobar'], 'sink': 'e', 'dir': '/tmp', 'options': '-1'})
|
47
|
+
" No change in working directory
|
48
|
+
AssertEqual cwd, getcwd()
|
49
|
+
|
50
|
+
call fzf#run({'source': ['/foobar'], 'sink': 'tabe', 'dir': '/tmp', 'options': '-1'})
|
51
|
+
AssertEqual cwd, getcwd()
|
52
|
+
tabclose
|
53
|
+
AssertEqual cwd, getcwd()
|
54
|
+
|
55
|
+
Execute (Incomplete fzf#run with dir option and autochdir):
|
56
|
+
set acd
|
57
|
+
let cwd = getcwd()
|
58
|
+
call fzf#run({'source': [], 'sink': 'e', 'dir': '/tmp', 'options': '-0'})
|
59
|
+
" No change in working directory even if &acd is set
|
60
|
+
AssertEqual cwd, getcwd()
|
61
|
+
|
62
|
+
Execute (FIXME: fzf#run with dir option and autochdir):
|
63
|
+
set acd
|
64
|
+
call fzf#run({'source': ['/foobar'], 'sink': 'e', 'dir': '/tmp', 'options': '-1'})
|
65
|
+
" Working directory changed due to &acd
|
66
|
+
AssertEqual '/foobar', expand('%')
|
67
|
+
AssertEqual '/', getcwd()
|
68
|
+
|
69
|
+
Execute (fzf#run with dir option and autochdir when final cwd is same as dir):
|
70
|
+
set acd
|
71
|
+
cd /tmp
|
72
|
+
call fzf#run({'source': ['/foobar'], 'sink': 'e', 'dir': '/', 'options': '-1'})
|
73
|
+
" Working directory changed due to &acd
|
74
|
+
AssertEqual '/', getcwd()
|
75
|
+
|
76
|
+
Execute (fzf#wrap):
|
77
|
+
AssertThrows fzf#wrap({'foo': 'bar'})
|
78
|
+
|
79
|
+
let opts = fzf#wrap('foobar')
|
80
|
+
Log opts
|
81
|
+
AssertEqual '~40%', opts.down
|
82
|
+
Assert opts.options =~ '--expect='
|
83
|
+
Assert !has_key(opts, 'sink')
|
84
|
+
Assert has_key(opts, 'sink*')
|
85
|
+
|
86
|
+
let opts = fzf#wrap('foobar', {}, 0)
|
87
|
+
Log opts
|
88
|
+
AssertEqual '~40%', opts.down
|
89
|
+
|
90
|
+
let opts = fzf#wrap('foobar', {}, 1)
|
91
|
+
Log opts
|
92
|
+
Assert !has_key(opts, 'down')
|
93
|
+
|
94
|
+
let opts = fzf#wrap('foobar', {'down': '50%'})
|
95
|
+
Log opts
|
96
|
+
AssertEqual '50%', opts.down
|
97
|
+
|
98
|
+
let opts = fzf#wrap('foobar', {'down': '50%'}, 1)
|
99
|
+
Log opts
|
100
|
+
Assert !has_key(opts, 'down')
|
101
|
+
|
102
|
+
let opts = fzf#wrap('foobar', {'sink': 'e'})
|
103
|
+
Log opts
|
104
|
+
AssertEqual 'e', opts.sink
|
105
|
+
Assert !has_key(opts, 'sink*')
|
106
|
+
|
107
|
+
let opts = fzf#wrap('foobar', {'options': '--reverse'})
|
108
|
+
Log opts
|
109
|
+
Assert opts.options =~ '--expect='
|
110
|
+
Assert opts.options =~ '--reverse'
|
111
|
+
|
112
|
+
let g:fzf_layout = {'window': 'enew'}
|
113
|
+
let opts = fzf#wrap('foobar')
|
114
|
+
Log opts
|
115
|
+
AssertEqual 'enew', opts.window
|
116
|
+
|
117
|
+
let opts = fzf#wrap('foobar', {}, 1)
|
118
|
+
Log opts
|
119
|
+
Assert !has_key(opts, 'window')
|
120
|
+
|
121
|
+
let opts = fzf#wrap('foobar', {'right': '50%'})
|
122
|
+
Log opts
|
123
|
+
Assert !has_key(opts, 'window')
|
124
|
+
AssertEqual '50%', opts.right
|
125
|
+
|
126
|
+
let opts = fzf#wrap('foobar', {'right': '50%'}, 1)
|
127
|
+
Log opts
|
128
|
+
Assert !has_key(opts, 'window')
|
129
|
+
Assert !has_key(opts, 'right')
|
130
|
+
|
131
|
+
let g:fzf_action = {'a': 'tabe'}
|
132
|
+
let opts = fzf#wrap('foobar')
|
133
|
+
Log opts
|
134
|
+
Assert opts.options =~ '--expect=a'
|
135
|
+
Assert !has_key(opts, 'sink')
|
136
|
+
Assert has_key(opts, 'sink*')
|
137
|
+
|
138
|
+
let opts = fzf#wrap('foobar', {'sink': 'e'})
|
139
|
+
Log opts
|
140
|
+
AssertEqual 'e', opts.sink
|
141
|
+
Assert !has_key(opts, 'sink*')
|
142
|
+
|
143
|
+
let g:fzf_history_dir = '/tmp'
|
144
|
+
let opts = fzf#wrap('foobar', {'options': '--color light'})
|
145
|
+
Log opts
|
146
|
+
Assert opts.options =~ "--history '/tmp/foobar'"
|
147
|
+
Assert opts.options =~ '--color light'
|
148
|
+
|
149
|
+
let g:fzf_colors = { 'fg': ['fg', 'Error'] }
|
150
|
+
let opts = fzf#wrap({})
|
151
|
+
Assert opts.options =~ '^--color=fg:'
|
152
|
+
|
153
|
+
Execute (fzf#shellescape with sh):
|
154
|
+
AssertEqual '''''', fzf#shellescape('', 'sh')
|
155
|
+
AssertEqual '''\''', fzf#shellescape('\', 'sh')
|
156
|
+
AssertEqual '''""''', fzf#shellescape('""', 'sh')
|
157
|
+
AssertEqual '''foobar>''', fzf#shellescape('foobar>', 'sh')
|
158
|
+
AssertEqual '''\\\"\\\''', fzf#shellescape('\\\"\\\', 'sh')
|
159
|
+
AssertEqual '''echo ''\''''a''\'''' && echo ''\''''b''\''''''', fzf#shellescape('echo ''a'' && echo ''b''', 'sh')
|
160
|
+
|
161
|
+
Execute (fzf#shellescape with cmd.exe):
|
162
|
+
AssertEqual '^"^"', fzf#shellescape('', 'cmd.exe')
|
163
|
+
AssertEqual '^"\\^"', fzf#shellescape('\', 'cmd.exe')
|
164
|
+
AssertEqual '^"\^"\^"^"', fzf#shellescape('""', 'cmd.exe')
|
165
|
+
AssertEqual '^"foobar^>^"', fzf#shellescape('foobar>', 'cmd.exe')
|
166
|
+
AssertEqual '^"\\\\\\\^"\\\\\\^"', fzf#shellescape('\\\"\\\', 'cmd.exe')
|
167
|
+
AssertEqual '^"echo ''a'' ^&^& echo ''b''^"', fzf#shellescape('echo ''a'' && echo ''b''', 'cmd.exe')
|
168
|
+
|
169
|
+
AssertEqual '^"C:\Program Files ^(x86^)\\^"', fzf#shellescape('C:\Program Files (x86)\', 'cmd.exe')
|
170
|
+
AssertEqual '^"C:/Program Files ^(x86^)/^"', fzf#shellescape('C:/Program Files (x86)/', 'cmd.exe')
|
171
|
+
AssertEqual '^"%%USERPROFILE%%^"', fzf#shellescape('%USERPROFILE%', 'cmd.exe')
|
172
|
+
|
173
|
+
Execute (Cleanup):
|
174
|
+
unlet g:dir
|
175
|
+
Restore
|