33
44local UI = require (' wincent.commandt.private.ui' )
55
6- local merge = require (' wincent.commandt.private.merge' )
76local popd = require (' wincent.commandt.popd' )
87local pushd = require (' wincent.commandt.pushd' )
98local relativize = require (' wincent.commandt.private.relativize' )
@@ -17,16 +16,13 @@ local function file_finder(directory)
1716 local finder = require (' wincent.commandt.private.finders.file' )(' .' , options )
1817
1918 ui = UI .new ()
20- ui :show (
21- finder ,
22- merge (options , {
23- name = ' file' ,
24- on_open = function (result )
25- return relativize (directory , result )
26- end ,
27- on_close = popd ,
28- })
29- )
19+ ui :show (finder , options , {
20+ name = ' file' ,
21+ on_open = function (result )
22+ return relativize (directory , result )
23+ end ,
24+ on_close = popd ,
25+ })
3026end
3127
3228local function watchman_finder (directory )
@@ -35,15 +31,12 @@ local function watchman_finder(directory)
3531 local finder = require (' wincent.commandt.private.finders.watchman' )(directory , options )
3632
3733 ui = UI .new ()
38- ui :show (
39- finder ,
40- merge (options , {
41- name = ' watchman' ,
42- on_open = function (result )
43- return relativize (directory , result )
44- end ,
45- })
46- )
34+ ui :show (finder , options , {
35+ name = ' watchman' ,
36+ on_open = function (result )
37+ return relativize (directory , result )
38+ end ,
39+ })
4740end
4841
4942local function finder (name , directory )
@@ -92,17 +85,12 @@ local function finder(name, directory)
9285 finder .fallback = require (' wincent.commandt.private.finders.fallback' )(finder , directory , options )
9386 end
9487
95- -- TODO: fix type smell here. we're merging "mode", a property that exists
96- -- inside matcher configs, into the top level, along with "name".
9788 ui = UI .new ()
98- ui :show (
99- finder ,
100- merge (options , {
101- name = name ,
102- mode = mode ,
103- on_close = config .on_close ,
104- })
105- )
89+ ui :show (finder , options , {
90+ name = name ,
91+ mode = mode ,
92+ on_close = config .on_close ,
93+ })
10694end
10795
10896return finder
0 commit comments