@@ -138,40 +138,38 @@ M.find_files = function(opts)
138138 end
139139 local item_count = 0
140140 local over_limit = false
141- Job
142- :new ({
143- command = cmd ,
144- cwd = path ,
145- args = args ,
146- enable_recording = false ,
147- on_stdout = function (err , line )
148- if not over_limit then
149- if opts .on_insert then
150- opts .on_insert (err , line )
151- end
152- item_count = item_count + 1
153- over_limit = maximum_results and item_count > maximum_results
141+ Job :new ({
142+ command = cmd ,
143+ cwd = path ,
144+ args = args ,
145+ enable_recording = false ,
146+ on_stdout = function (err , line )
147+ if not over_limit then
148+ if opts .on_insert then
149+ opts .on_insert (err , line )
154150 end
155- end ,
156- on_stderr = function (err , line )
157- if not over_limit then
158- if opts .on_insert then
159- if not err then
160- err = line
161- end
162- opts .on_insert (err , line )
151+ item_count = item_count + 1
152+ over_limit = maximum_results and item_count > maximum_results
153+ end
154+ end ,
155+ on_stderr = function (err , line )
156+ if not over_limit then
157+ if opts .on_insert then
158+ if not err then
159+ err = line
163160 end
164- item_count = item_count + 1
165- over_limit = maximum_results and item_count > maximum_results
166- end
167- end ,
168- on_exit = function (_ , return_val )
169- if opts .on_exit then
170- opts .on_exit (return_val )
161+ opts .on_insert (err , line )
171162 end
172- end ,
173- })
174- :start ()
163+ item_count = item_count + 1
164+ over_limit = maximum_results and item_count > maximum_results
165+ end
166+ end ,
167+ on_exit = function (_ , return_val )
168+ if opts .on_exit then
169+ opts .on_exit (return_val )
170+ end
171+ end ,
172+ }):start ()
175173end
176174
177175return M
0 commit comments