feat(ui): cleaner msg
This commit is contained in:
parent
9353418791
commit
85fea07d98
2 changed files with 3 additions and 4 deletions
|
@ -69,13 +69,12 @@ function M.rename()
|
||||||
-- echo the resulting changes
|
-- echo the resulting changes
|
||||||
local new_word = ''
|
local new_word = ''
|
||||||
if result and result.changes then
|
if result and result.changes then
|
||||||
local msg = ''
|
local msg = {}
|
||||||
for f, c in pairs(result.changes) do
|
for f, c in pairs(result.changes) do
|
||||||
new_word = c[1].newText
|
new_word = c[1].newText
|
||||||
msg = msg .. ('%d changes -> %s'):format(#c, utils.get_relative_path(f)) .. '\n'
|
table.insert(msg, ('%d changes -> %s'):format(#c, utils.get_relative_path(f)))
|
||||||
end
|
end
|
||||||
local currName = vim.fn.expand('<cword>')
|
local currName = vim.fn.expand('<cword>')
|
||||||
msg = msg:sub(1, #msg - 1)
|
|
||||||
vim.notify(msg, vim.log.levels.INFO, { title = ('Rename: %s -> %s'):format(currName, new_word) })
|
vim.notify(msg, vim.log.levels.INFO, { title = ('Rename: %s -> %s'):format(currName, new_word) })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -103,7 +103,7 @@ function M.update()
|
||||||
table.insert(errors, err)
|
table.insert(errors, err)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
:sync() -- or start()
|
:sync()
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Reference in a new issue