Skip to content

Commit 159d0b5

Browse files
committed
refactor(nvim): use imported snacks module
1 parent a729353 commit 159d0b5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.config/nvim/lua/specs/snacks.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Plugin.opts = {
8787
confirm = function(picker, item)
8888
picker:close()
8989

90+
local snacks = require('snacks')
91+
9092
if item and item.file then
9193
-- Check if the project is already open by checking the cwd of each tab
9294
local tabpages = vim.api.nvim_list_tabpages()
@@ -112,7 +114,7 @@ Plugin.opts = {
112114

113115
-- Change cwd to the selected project, only for this tab
114116
vim.cmd('tcd ' .. vim.fn.fnameescape(item.file))
115-
Snacks.picker.smart()
117+
snacks.picker.smart()
116118
end
117119
end,
118120
},
@@ -260,7 +262,8 @@ Plugin.init = function()
260262
vim.api.nvim_create_autocmd('User', {
261263
pattern = 'VeryLazy',
262264
callback = function()
263-
Snacks.toggle.option('spell', { name = 'Spelling' }):map('<Space>us')
265+
local snacks = require('snacks')
266+
snacks.toggle.option('spell', { name = 'Spelling' }):map('<Space>us')
264267
end,
265268
})
266269
end

0 commit comments

Comments
 (0)