diff --git a/README.md b/README.md index a4d36969..ebeee643 100644 --- a/README.md +++ b/README.md @@ -653,6 +653,8 @@ The configuration precedence is `default` > `global` > `builtin` > `user` where checkhealth = false, -- string? Sets the mode for coloring the Visual highlight group in the scrollback buffer window. darken uses a darkened version of the Normal highlight group to improve readability. kitty uses the colors defined for selection_foreground and selection_background in your Kitty configuration. nvim uses the default colors defined in the Visual highlight group. reverse reverses the foreground and background colors of the visual selection. visual_selection_highlight_mode = 'darken', + -- integer? Temporary column width during get-text operation to avoid hard wrapping (larger values may impact performance), see :h columns + scrollback_columns = 300, } ``` diff --git a/lua/kitty-scrollback/configs/defaults.lua b/lua/kitty-scrollback/configs/defaults.lua index 36792ab7..15932569 100644 --- a/lua/kitty-scrollback/configs/defaults.lua +++ b/lua/kitty-scrollback/configs/defaults.lua @@ -57,6 +57,7 @@ ---@field kitty_get_text KsbKittyGetText|nil options passed to get-text when reading scrollback buffer, see `kitty @ get-text --help` ---@field checkhealth boolean|nil if true execute :checkhealth kitty-scrollback and skip setup ---@field visual_selection_highlight_mode string | 'darken' | 'kitty' | 'nvim' | 'reverse' | nil +---@field scrollback_columns integer|nil temporary column width during get-text operation to avoid hard wrapping (larger values may impact performance), see :h columns local default_opts = { callbacks = nil, keymaps_enabled = true, @@ -90,6 +91,7 @@ local default_opts = { }, checkhealth = false, visual_selection_highlight_mode = 'darken', + scrollback_columns = 300, } return default_opts diff --git a/lua/kitty-scrollback/kitty_commands.lua b/lua/kitty-scrollback/kitty_commands.lua index db94f98f..0f17cd9e 100644 --- a/lua/kitty-scrollback/kitty_commands.lua +++ b/lua/kitty-scrollback/kitty_commands.lua @@ -78,7 +78,7 @@ M.get_text_term = function(get_text_opts, on_exit_cb) -- current window size. Note: a larger min_cols appears to impact performance -- defer is used as a timing workaround because this is expected to be called right before -- opening the terminal - p.orig_columns = defer_resize_term(300) + p.orig_columns = defer_resize_term(opts.scrollback_columns) -- set the shell used to sh to avoid imcompatabiliies with other shells (e.g., nushell, fish, etc) vim.o.shell = 'sh'