diff --git a/README.md b/README.md index 250ad16..190c9d7 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", }, --Override default floating window mappings @@ -472,8 +472,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/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", }, }) < diff --git a/lua/grapple/settings.lua b/lua/grapple/settings.lua index e6d2c2f..f259860 100644 --- a/lua/grapple/settings.lua +++ b/lua/grapple/settings.lua @@ -429,11 +429,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", }, --Override default floating window mappings diff --git a/lua/grapple/window.lua b/lua/grapple/window.lua index 7ab231e..63c2a0f 100644 --- a/lua/grapple/window.lua +++ b/lua/grapple/window.lua @@ -56,20 +56,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 = string.format("Press '%s' to toggle Help", app.settings.win_mappings.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 = string.format("Press '%s' to toggle Help", app.settings.win_mappings.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))