summaryrefslogtreecommitdiff
path: root/lua/telescope/builtin/files.lua
diff options
context:
space:
mode:
authortami5 <kkharji@protonmail.com>2022-03-13 20:11:27 +0300
committerGitHub <noreply@github.com>2022-03-13 18:11:27 +0100
commitef7b6ada6d91a1b2932492d78c730e4fc00cd2ea (patch)
treedda4cb7cb3357724c83e85666bc8dc5c1ee2e898 /lua/telescope/builtin/files.lua
parent75b57304323861631519e204d9fbca7bdbf1c4c5 (diff)
feat: improve UX with vim.notify (#1763)
* fix(notify): don't report request on new line * ref(notify): update message format * ref(msgs): always quote values + decrease duplication * fix(ci): undefined variables * ref(actions): temporary silent actions.__index errors * cleanup * revert: panic effort, we continue to use error for those Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
Diffstat (limited to 'lua/telescope/builtin/files.lua')
-rw-r--r--lua/telescope/builtin/files.lua23
1 files changed, 16 insertions, 7 deletions
diff --git a/lua/telescope/builtin/files.lua b/lua/telescope/builtin/files.lua
index 90e52f5..893588f 100644
--- a/lua/telescope/builtin/files.lua
+++ b/lua/telescope/builtin/files.lua
@@ -163,10 +163,10 @@ files.find_files = function(opts)
end)()
if not find_command then
- print(
- "You need to install either find, fd, or rg. "
- .. "You can also submit a PR to add support for another file finder :)"
- )
+ utils.notify("builtin.find_files", {
+ msg = "You need to install either find, fd, or rg",
+ level = "ERROR",
+ })
return
end
@@ -267,13 +267,19 @@ files.treesitter = function(opts)
local has_nvim_treesitter, _ = pcall(require, "nvim-treesitter")
if not has_nvim_treesitter then
- print "You need to install nvim-treesitter"
+ utils.notify("builtin.treesitter", {
+ msg = "User need to install nvim-treesitter needs to be installed",
+ level = "ERROR",
+ })
return
end
local parsers = require "nvim-treesitter.parsers"
if not parsers.has_parser(parsers.get_buf_lang(opts.bufnr)) then
- print "No parser for the current buffer"
+ utils.notify("builtin.treesitter", {
+ msg = "No parser for the current buffer",
+ level = "ERROR",
+ })
return
end
@@ -397,7 +403,10 @@ end
files.tags = function(opts)
local tagfiles = opts.ctags_file and { opts.ctags_file } or vim.fn.tagfiles()
if vim.tbl_isempty(tagfiles) then
- print "No tags file found. Create one with ctags -R"
+ utils.notify("builtin.tags", {
+ msg = "No tags file found. Create one with ctags -R",
+ level = "ERROR",
+ })
return
end