aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHistoria <gravel.justness270@slmail.me>2024-07-01 16:34:27 -0400
committerHistoria <gravel.justness270@slmail.me>2024-07-01 16:34:27 -0400
commit75869491dfac6f5d6fc755ae855ae0e760f4ea80 (patch)
treebfac11c0c91eb0173850bbc225655e3540510f80
parent46589fed89c8075ee473b9e77b8e4d383b0c7033 (diff)
downloaddenote-fzf-lua-75869491dfac6f5d6fc755ae855ae0e760f4ea80.tar.gz
Fixed issue with default layout settings not working as expected
-rw-r--r--lua/denote-fzf-lua.lua10
-rw-r--r--lua/denote-fzf-lua/config.lua10
2 files changed, 11 insertions, 9 deletions
diff --git a/lua/denote-fzf-lua.lua b/lua/denote-fzf-lua.lua
index 180de4a..d685ef9 100644
--- a/lua/denote-fzf-lua.lua
+++ b/lua/denote-fzf-lua.lua
@@ -30,7 +30,7 @@ function M.copy_table(table)
return new_table
end
----@param force_slow bool - If true, act as if we don't have dependencies
+---@param force_slow boolean - If true, act as if we don't have dependencies
---Check for dependencies and optional dependencies
function M.has_prereqs(force_slow)
if vim.fn.executable('fzf') ~= 1 then return "no" end
@@ -41,7 +41,7 @@ function M.has_prereqs(force_slow)
return "yes"
end
----@param force_slow bool - If true, act as if we don't have dependencies
+---@param force_slow boolean - If true, act as if we don't have dependencies
---Sets the full path of the appropriate search script (regular or fallback)
function M.set_script_path(force_slow)
local lua_file_path = debug.getinfo(1, "S").source:sub(2)
@@ -73,7 +73,7 @@ function M.format_fzf_with_nth(options)
end
---@param f string - Field from search result
----@param delim delimiter character
+---@param delim string delimiter character
---Puts a field from the search results back into Denote format (e.g. two words to --two-words)
function M.repopulate_field(f, delim)
if f == "." then
@@ -83,9 +83,8 @@ function M.repopulate_field(f, delim)
end
end
----@param filename chopped up string with fields separated by multiple spaces
+---@param filename string chopped up string with fields separated by multiple spaces
function M.recombine_filename(filename)
- vim.print(filename)
local t = {}
filename = filename:gsub("%s%s+", "|")
t.path, t.year, t.month, t.day, t.hour, t.min, t.sec, t.sig, t.title, t.keywords, t.ext =
@@ -107,6 +106,7 @@ function M.search_files(options)
opts.fzf_opts["--with-nth"] = M.format_fzf_with_nth(options)
opts.fzf_opts['--header-lines'] = 1
opts.fzf_opts['--delimiter'] = "\\s{2,}"
+ -- print(vim.inspect(opts))
opts.actions = {
['default'] = function(selected, opts)
local filename = M.recombine_filename(selected[1])
diff --git a/lua/denote-fzf-lua/config.lua b/lua/denote-fzf-lua/config.lua
index 7fba4dc..04d3bdc 100644
--- a/lua/denote-fzf-lua/config.lua
+++ b/lua/denote-fzf-lua/config.lua
@@ -24,11 +24,13 @@ M.defaults = {
col = 0.50,
},
fzf_opts = {
- ['--reverse'] = true,
- ['--no-info'] = true,
+ ['--layout'] = false,
+ ['--reverse'] = true,
+ ['--info'] = false,
+ ['--no-info'] = true,
['--no-separator'] = true,
- ['--no-hscroll'] = true,
- ['-i'] = true,
+ ['--no-hscroll'] = true,
+ ['-i'] = true,
},
},
}