diff --git a/lua/navigator.lua b/lua/navigator.lua index 18e1c8e..7ec9494 100644 --- a/lua/navigator.lua +++ b/lua/navigator.lua @@ -3,6 +3,7 @@ _NgConfigValues = { debug = false, -- log output not implemented width = 0.6, -- valeu of cols TODO allow float e.g. 0.6 preview_height = 0.35, + preview_lines = 40, height = 0.35, default_mapping = true, keymaps = {}, -- e.g keymaps={{key = "GR", func = "references()"}, } this replace gr default mapping diff --git a/lua/navigator/gui.lua b/lua/navigator/gui.lua index 5736271..17453b6 100644 --- a/lua/navigator/gui.lua +++ b/lua/navigator/gui.lua @@ -122,7 +122,8 @@ function M.new_list_view(opts) width = math.min(120, width) local wheight = math.floor(1 + api.nvim_get_option("lines") * (_NgConfigValues.height + _NgConfigValues.preview_height)) - local pheight = math.floor(api.nvim_get_option("lines") * _NgConfigValues.preview_height) + local pheight = math.max(_NgConfigValues.preview_lines, math.floor( + api.nvim_get_option("lines") * _NgConfigValues.preview_height)) local prompt = opts.prompt or false if opts.rawdata then data = items diff --git a/lua/navigator/render.lua b/lua/navigator/render.lua index ca18d85..c3cdde1 100644 --- a/lua/navigator/render.lua +++ b/lua/navigator/render.lua @@ -75,6 +75,7 @@ function M.prepare_for_render(items, opts) call_by_presented = true end end + -- log(items[1]) for i = 1, #items do local space