mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
show error message only when no word is under cursor
This commit is contained in:
parent
44e9e5a1ce
commit
acc3ed7829
@ -36,11 +36,15 @@ keymap.set("n", "N", "", {
|
||||
})
|
||||
|
||||
local no_word_under_cursor = function()
|
||||
local word_under_cursor = vim.fn.expand("<cword>")
|
||||
local cursor_word = vim.fn.expand("<cword>")
|
||||
|
||||
local msg = "E348: No string under cursor"
|
||||
api.nvim_err_writeln(msg)
|
||||
return word_under_cursor == ""
|
||||
local result = cursor_word == ""
|
||||
if result then
|
||||
local msg = "E348: No string under cursor"
|
||||
api.nvim_err_writeln(msg)
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
keymap.set("n", "*", "", {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user