From ec1faca52806debe17d9cbd604455e17f1100926 Mon Sep 17 00:00:00 2001 From: Tei Leelo Roberts Date: Fri, 11 Aug 2023 15:05:51 +0200 Subject: [PATCH] chore: revert find_component limit --- lua/neogit/buffers/commit_select_view/init.lua | 2 +- lua/neogit/buffers/log_view/init.lua | 2 +- lua/neogit/lib/ui/init.lua | 9 --------- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/lua/neogit/buffers/commit_select_view/init.lua b/lua/neogit/buffers/commit_select_view/init.lua index 449b6fa65..15aa430fa 100644 --- a/lua/neogit/buffers/commit_select_view/init.lua +++ b/lua/neogit/buffers/commit_select_view/init.lua @@ -100,7 +100,7 @@ function M:open(action) if win and item and item.commit then local found = buffer.ui:find_component(function(c) return c.options.oid == item.commit.oid - end, { limit = 256 }) + end) if found then vim.api.nvim_win_set_cursor(win, { found.position.row_start, 0 }) diff --git a/lua/neogit/buffers/log_view/init.lua b/lua/neogit/buffers/log_view/init.lua index 7e4b76dc4..6bee07d76 100644 --- a/lua/neogit/buffers/log_view/init.lua +++ b/lua/neogit/buffers/log_view/init.lua @@ -152,7 +152,7 @@ function M:open() if win and item and item.commit then local found = buffer.ui:find_component(function(c) return c.options.oid == item.commit.oid - end, { limit = 256 }) + end) if found then vim.api.nvim_win_set_cursor(win, { found.position.row_start, 0 }) diff --git a/lua/neogit/lib/ui/init.lua b/lua/neogit/lib/ui/init.lua index cac21ff7e..79ee62af4 100644 --- a/lua/neogit/lib/ui/init.lua +++ b/lua/neogit/lib/ui/init.lua @@ -70,14 +70,6 @@ end function Ui._find_component(components, f, options) for _, c in ipairs(components) do - if options.limit then - if options.limit == 0 then - return nil - end - - options.limit = options.limit - 1 - end - if (options.include_hidden and c.options.hidden) or not c.options.hidden then if c.tag == "col" or c.tag == "row" then local res = Ui._find_component(c.children, f, options) @@ -98,7 +90,6 @@ end ---@class FindOptions ---@field include_hidden boolean ----@field limit number|nil --- Finds a ui component in the buffer ---