@@ -239,35 +239,6 @@ M.debugprint_operatorfunc_motion = function()
239
239
M .debugprint_operatorfunc_regular ()
240
240
end
241
241
242
- --- @param opts DebugprintFunctionOptionsInternal
243
- --- @return nil
244
- M .debugprint_regular = function (opts )
245
- if opts .variable == true then
246
- local filetype_config = get_filetype_config ()
247
-
248
- if filetype_config then
249
- opts .variable_name = utils .get_variable_name (
250
- global_opts .ignore_treesitter or opts .ignore_treesitter or false ,
251
- filetype_config
252
- )
253
-
254
- if not opts .variable_name then
255
- return
256
- end
257
- end
258
- end
259
-
260
- if opts .insert == true then
261
- return get_debugprint_line (opts )
262
- else
263
- cache_request = opts
264
- utils_operator .set_operatorfunc (
265
- " v:lua.require'debugprint'.debugprint_operatorfunc_regular"
266
- )
267
- return " g@l"
268
- end
269
- end
270
-
271
242
--- @param opts ? DebugprintFunctionOptions
272
243
--- @return string ?
273
244
M .debugprint = function (opts )
@@ -280,15 +251,38 @@ M.debugprint = function(opts)
280
251
return
281
252
end
282
253
283
- if func_opts .motion == true then
254
+ if func_opts .variable == true then
255
+ local filetype_config = get_filetype_config ()
256
+
257
+ if filetype_config then
258
+ func_opts .variable_name = utils .get_variable_name (
259
+ global_opts .ignore_treesitter
260
+ or func_opts .ignore_treesitter
261
+ or false ,
262
+ filetype_config
263
+ )
264
+
265
+ if not func_opts .variable_name then
266
+ return
267
+ end
268
+ end
269
+ end
270
+
271
+ if func_opts .insert == true then
272
+ cache_request = {}
273
+ return get_debugprint_line (func_opts )
274
+ elseif func_opts .motion == true then
284
275
cache_request = func_opts
285
276
utils_operator .set_operatorfunc (
286
277
" v:lua.require'debugprint'.debugprint_operatorfunc_motion"
287
278
)
288
279
return " g@"
289
280
else
290
- cache_request = {}
291
- return M .debugprint_regular (func_opts )
281
+ cache_request = func_opts
282
+ utils_operator .set_operatorfunc (
283
+ " v:lua.require'debugprint'.debugprint_operatorfunc_regular"
284
+ )
285
+ return " g@l"
292
286
end
293
287
end
294
288
0 commit comments