diff --git a/lua/harpoon/config.lua b/lua/harpoon/config.lua index a341492..f101c97 100644 --- a/lua/harpoon/config.lua +++ b/lua/harpoon/config.lua @@ -74,7 +74,9 @@ function M.get_default_config() }, default = { - harpoon_wrap = true, + --- ui_nav_wrap allows the ability to enable(true) or disable(false) wrapping on prev and next list calls. + ui_nav_wrap = true, + --- select_with_nill allows for a list to call select even if the provided item is nil select_with_nil = false, diff --git a/lua/harpoon/list.lua b/lua/harpoon/list.lua index 8a9f211..13e891c 100644 --- a/lua/harpoon/list.lua +++ b/lua/harpoon/list.lua @@ -171,9 +171,9 @@ end function HarpoonList:next() self._index = self._index + 1 - if self._index > #self.items and self.config.harpoon_wrap then + if self._index > #self.items and self.config.ui_nav_wrap then self._index = 1 - elseif self._index > #self.items and not self.config.harpoon_wrap then + elseif self._index > #self.items and not self.config.ui_nav_wrap then self._index = #self.items end @@ -182,9 +182,9 @@ end function HarpoonList:prev() self._index = self._index - 1 - if self._index < 1 and self.config.harpoon_wrap then + if self._index < 1 and self.config.ui_nav_wrap then self._index = #self.items - elseif self._index < 1 and not self.config.harpoon_wrap then + elseif self._index < 1 and not self.config.ui_nav_wrap then self._index = 1 end