From 5caf3c8249d5cc51a98d2a78387811a0ad4f5ae0 Mon Sep 17 00:00:00 2001 From: Calvin Bochulak Date: Sun, 29 Sep 2024 03:57:04 -0600 Subject: [PATCH 1/2] feat: allow disabling of footer. Fixes #171 --- README.md | 16 ++++++++-------- lua/grapple/settings.lua | 8 +++++--- lua/grapple/window.lua | 13 ++++++------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 14272d9..bbb7641 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ While Grapple shares similarities to Harpoon (and other file navigation plugins) ## Requirements -- [Neovim >= 0.9](https://github.com/neovim/neovim/releases/tag/v0.9.0) +- [Neovim >= 0.10](https://github.com/neovim/neovim/releases/tag/v0.10.0) - [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) (optional) ## Quickstart @@ -282,13 +282,13 @@ require("grapple").setup({ border = "single", focusable = false, style = "minimal", - title_pos = "center", - -- Custom: fallback title for Grapple windows - title = "Grapple", + title = "Grapple", -- fallback title for Grapple windows + title_pos = "center", + title_padding = " ", -- custom: adds padding around window title - -- Custom: adds padding around window title - title_padding = " ", + -- footer = "", -- disable footer + footer_pos = "center", }, }) ``` @@ -457,8 +457,8 @@ Where: - **`direction`**: `"next"` | `"prev"` - **`opts?`**: `table` - - **`scope?`**: `string` scope name (default: `settings.scope`) - - **`all?`**: `boolean` (default: `false`) + - **`scope?`**: `string` scope name (default: `settings.scope`) + - **`all?`**: `boolean` (default: `false`)
Examples diff --git a/lua/grapple/settings.lua b/lua/grapple/settings.lua index eb44971..69c2de3 100644 --- a/lua/grapple/settings.lua +++ b/lua/grapple/settings.lua @@ -423,11 +423,13 @@ local DEFAULT_SETTINGS = { border = "single", focusable = false, style = "minimal", + + title = "Grapple", -- fallback title for Grapple windows title_pos = "center", - title = "Grapple", + title_padding = " ", -- custom: adds padding around window title - -- Custom: adds padding around window title - title_padding = " ", + -- footer = "", -- disable footer + footer_pos = "center", }, ---Values for which a buffer should be excluded from being tagged diff --git a/lua/grapple/window.lua b/lua/grapple/window.lua index 51b525f..d017cab 100644 --- a/lua/grapple/window.lua +++ b/lua/grapple/window.lua @@ -54,20 +54,19 @@ function Window:window_options() end if not opts.title then - opts.title_pos = nil + opts.title = "" + end + + if not opts.footer then + opts.footer = "Press '?' to toggle Help" end -- Remove custom fields if opts.title_padding then + ---@diagnostic disable-next-line: inject-field opts.title_padding = nil end - -- Add "help" footer for nvim-0.10 - if vim.fn.has("nvim-0.10") == 1 then - opts.footer = "Press '?' to toggle Help" - opts.footer_pos = "center" - end - -- Window size if opts.width and opts.width < 1 then opts.width = math.max(1, math.floor(vim.o.columns * opts.width)) From b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7 Mon Sep 17 00:00:00 2001 From: cbochs Date: Sun, 29 Sep 2024 09:57:30 +0000 Subject: [PATCH 2/2] chore(docs): auto generate docs --- doc/grapple.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/grapple.txt b/doc/grapple.txt index b5496eb..b13c486 100644 --- a/doc/grapple.txt +++ b/doc/grapple.txt @@ -1,4 +1,4 @@ -*grapple.txt* For NVIM v0.9.0 Last change: 2024 May 18 +*grapple.txt* For NVIM v0.9.0 Last change: 2024 September 29 ============================================================================== Table of Contents *grapple-table-of-contents* @@ -52,7 +52,7 @@ FEATURES *grapple-grapple.nvim-features* REQUIREMENTS *grapple-grapple.nvim-requirements* -- Neovim >= 0.9 +- Neovim >= 0.10 - nvim-web-devicons (optional) @@ -286,13 +286,13 @@ Default Settings ~ border = "single", focusable = false, style = "minimal", - title_pos = "center", - -- Custom: fallback title for Grapple windows - title = "Grapple", + title = "Grapple", -- fallback title for Grapple windows + title_pos = "center", + title_padding = " ", -- custom: adds padding around window title - -- Custom: adds padding around window title - title_padding = " ", + -- footer = "", -- disable footer + footer_pos = "center", }, }) <