2022-12-17 23:33:21 +08:00
|
|
|
local db = require("Trans").db
|
2022-12-19 21:57:13 +08:00
|
|
|
-- local conf = require("Trans").conf
|
2022-12-17 23:33:21 +08:00
|
|
|
|
|
|
|
local group = vim.api.nvim_create_augroup('closedb', { clear = true })
|
|
|
|
vim.api.nvim_create_autocmd('VimLeave', {
|
|
|
|
group = group,
|
|
|
|
pattern = '*',
|
|
|
|
callback = function()
|
|
|
|
if db:isopen() then
|
|
|
|
db:close()
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
2022-12-19 21:57:13 +08:00
|
|
|
vim.api.nvim_create_user_command('TranslateCurosorWord', require("Trans").query_cursor, {})
|
2022-12-19 22:23:12 +08:00
|
|
|
|
|
|
|
-- TODO: set command to close preview window automatically
|