From 2c45b8357470d38a537843b2a967823acec4beb2 Mon Sep 17 00:00:00 2001 From: Futar Date: Sat, 7 Oct 2023 13:28:42 +0100 Subject: [PATCH] refactor --- lua/spooky/templates/choose/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/spooky/templates/choose/init.lua b/lua/spooky/templates/choose/init.lua index 309683e..9e34ede 100644 --- a/lua/spooky/templates/choose/init.lua +++ b/lua/spooky/templates/choose/init.lua @@ -33,12 +33,14 @@ M.choose = function (forced, log, buf, filepaths, user, do_with_choice, preview) end if ui == 'builtin' then - require('spooky.templates.choose.builtin').choose_one(filepaths, user, function (x) + local builtin_choose_one = require('spooky.templates.choose.builtin').choose_one + builtin_choose_one(filepaths, user, function (x) do_with_choice(x) did_write[buf] = true end) else - require('spooky.templates.choose.telescope').choose_one(buf, filepaths, user, function (x) + local telescope_choose_one = require('spooky.templates.choose.telescope').choose_one + telescope_choose_one(buf, filepaths, user, function (x) do_with_choice(x) did_write[buf] = true end, preview)