doing 2.0.18 → 2.0.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/Gemfile.lock +15 -5
  4. data/README.md +1 -1
  5. data/bin/doing +2 -18
  6. data/doing.gemspec +5 -4
  7. data/doing.rdoc +2 -2
  8. data/generate_completions.sh +3 -3
  9. data/lib/doing/cli_status.rb +6 -2
  10. data/lib/doing/completion/bash_completion.rb +185 -0
  11. data/lib/doing/completion/fish_completion.rb +175 -0
  12. data/lib/doing/completion/string.rb +17 -0
  13. data/lib/doing/completion/zsh_completion.rb +140 -0
  14. data/lib/doing/completion.rb +39 -0
  15. data/lib/doing/version.rb +1 -1
  16. data/lib/doing/wwid.rb +18 -6
  17. data/lib/doing.rb +1 -1
  18. data/lib/helpers/fzf/.goreleaser.yml +119 -0
  19. data/lib/helpers/fzf/.rubocop.yml +28 -0
  20. data/lib/helpers/fzf/ADVANCED.md +565 -0
  21. data/lib/helpers/fzf/BUILD.md +49 -0
  22. data/lib/helpers/fzf/CHANGELOG.md +1193 -0
  23. data/lib/helpers/fzf/Dockerfile +11 -0
  24. data/lib/helpers/fzf/LICENSE +21 -0
  25. data/lib/helpers/fzf/Makefile +166 -0
  26. data/lib/helpers/fzf/README-VIM.md +486 -0
  27. data/lib/helpers/fzf/README.md +712 -0
  28. data/lib/helpers/fzf/bin/fzf-tmux +233 -0
  29. data/lib/helpers/fzf/doc/fzf.txt +512 -0
  30. data/lib/helpers/fzf/go.mod +17 -0
  31. data/lib/helpers/fzf/go.sum +31 -0
  32. data/lib/helpers/fzf/install +382 -0
  33. data/lib/helpers/fzf/install.ps1 +65 -0
  34. data/lib/helpers/fzf/main.go +14 -0
  35. data/lib/helpers/fzf/man/man1/fzf-tmux.1 +68 -0
  36. data/lib/helpers/fzf/man/man1/fzf.1 +1001 -0
  37. data/lib/helpers/fzf/plugin/fzf.vim +1048 -0
  38. data/lib/helpers/fzf/shell/completion.bash +381 -0
  39. data/lib/helpers/fzf/shell/completion.zsh +329 -0
  40. data/lib/helpers/fzf/shell/key-bindings.bash +96 -0
  41. data/lib/helpers/fzf/shell/key-bindings.fish +172 -0
  42. data/lib/helpers/fzf/shell/key-bindings.zsh +114 -0
  43. data/lib/helpers/fzf/src/LICENSE +21 -0
  44. data/lib/helpers/fzf/src/algo/algo.go +884 -0
  45. data/lib/helpers/fzf/src/algo/algo_test.go +197 -0
  46. data/lib/helpers/fzf/src/algo/normalize.go +492 -0
  47. data/lib/helpers/fzf/src/ansi.go +409 -0
  48. data/lib/helpers/fzf/src/ansi_test.go +427 -0
  49. data/lib/helpers/fzf/src/cache.go +81 -0
  50. data/lib/helpers/fzf/src/cache_test.go +39 -0
  51. data/lib/helpers/fzf/src/chunklist.go +89 -0
  52. data/lib/helpers/fzf/src/chunklist_test.go +80 -0
  53. data/lib/helpers/fzf/src/constants.go +85 -0
  54. data/lib/helpers/fzf/src/core.go +351 -0
  55. data/lib/helpers/fzf/src/history.go +96 -0
  56. data/lib/helpers/fzf/src/history_test.go +68 -0
  57. data/lib/helpers/fzf/src/item.go +44 -0
  58. data/lib/helpers/fzf/src/item_test.go +23 -0
  59. data/lib/helpers/fzf/src/matcher.go +235 -0
  60. data/lib/helpers/fzf/src/merger.go +120 -0
  61. data/lib/helpers/fzf/src/merger_test.go +88 -0
  62. data/lib/helpers/fzf/src/options.go +1691 -0
  63. data/lib/helpers/fzf/src/options_test.go +457 -0
  64. data/lib/helpers/fzf/src/pattern.go +425 -0
  65. data/lib/helpers/fzf/src/pattern_test.go +209 -0
  66. data/lib/helpers/fzf/src/protector/protector.go +8 -0
  67. data/lib/helpers/fzf/src/protector/protector_openbsd.go +10 -0
  68. data/lib/helpers/fzf/src/reader.go +201 -0
  69. data/lib/helpers/fzf/src/reader_test.go +63 -0
  70. data/lib/helpers/fzf/src/result.go +243 -0
  71. data/lib/helpers/fzf/src/result_others.go +16 -0
  72. data/lib/helpers/fzf/src/result_test.go +159 -0
  73. data/lib/helpers/fzf/src/result_x86.go +16 -0
  74. data/lib/helpers/fzf/src/terminal.go +2832 -0
  75. data/lib/helpers/fzf/src/terminal_test.go +638 -0
  76. data/lib/helpers/fzf/src/terminal_unix.go +26 -0
  77. data/lib/helpers/fzf/src/terminal_windows.go +45 -0
  78. data/lib/helpers/fzf/src/tokenizer.go +253 -0
  79. data/lib/helpers/fzf/src/tokenizer_test.go +112 -0
  80. data/lib/helpers/fzf/src/tui/dummy.go +46 -0
  81. data/lib/helpers/fzf/src/tui/light.go +987 -0
  82. data/lib/helpers/fzf/src/tui/light_unix.go +110 -0
  83. data/lib/helpers/fzf/src/tui/light_windows.go +145 -0
  84. data/lib/helpers/fzf/src/tui/tcell.go +721 -0
  85. data/lib/helpers/fzf/src/tui/tcell_test.go +392 -0
  86. data/lib/helpers/fzf/src/tui/ttyname_unix.go +47 -0
  87. data/lib/helpers/fzf/src/tui/ttyname_windows.go +14 -0
  88. data/lib/helpers/fzf/src/tui/tui.go +625 -0
  89. data/lib/helpers/fzf/src/tui/tui_test.go +20 -0
  90. data/lib/helpers/fzf/src/util/atomicbool.go +34 -0
  91. data/lib/helpers/fzf/src/util/atomicbool_test.go +17 -0
  92. data/lib/helpers/fzf/src/util/chars.go +198 -0
  93. data/lib/helpers/fzf/src/util/chars_test.go +46 -0
  94. data/lib/helpers/fzf/src/util/eventbox.go +96 -0
  95. data/lib/helpers/fzf/src/util/eventbox_test.go +61 -0
  96. data/lib/helpers/fzf/src/util/slab.go +12 -0
  97. data/lib/helpers/fzf/src/util/util.go +138 -0
  98. data/lib/helpers/fzf/src/util/util_test.go +40 -0
  99. data/lib/helpers/fzf/src/util/util_unix.go +47 -0
  100. data/lib/helpers/fzf/src/util/util_windows.go +83 -0
  101. data/lib/helpers/fzf/test/fzf.vader +175 -0
  102. data/lib/helpers/fzf/test/test_go.rb +2626 -0
  103. data/lib/helpers/fzf/uninstall +117 -0
  104. data/scripts/generate_bash_completions.rb +6 -12
  105. data/scripts/generate_fish_completions.rb +7 -16
  106. data/scripts/generate_zsh_completions.rb +6 -15
  107. 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