mikesmithgh / kitty-scrollback.nvim

😽 Open your Kitty scrollback buffer with Neovim. Ameowzing!
Apache License 2.0
438 stars 11 forks source link

Buffer opens up with modifiable set to false #252

Closed PrayagS closed 4 months ago

PrayagS commented 4 months ago

Installed the plugin using lazy as specified in the README. It looks as follows,

{
    'mikesmithgh/kitty-scrollback.nvim',
    enabled = true,
    lazy = true,
    cmd = { 'KittyScrollbackGenerateKittens', 'KittyScrollbackCheckHealth' },
    event = { 'User KittyScrollbackLaunch' },
    -- version = '*', -- latest stable version, may have breaking changes if major version changed
    -- version = '^4.0.0', -- pin major version, include fixes and features that do not have breaking changes
    config = function()
        require('kitty-scrollback').setup({
            {
                status_window = {
                    style_simple = true,
                },
                visual_selection_highlight_mode = 'kitty',
            },
        })
    end,
},

The relevant portion in kitty configuration is as follows,

# kitty-scrollback.nvim Kitten alias
action_alias kitty_scrollback_nvim kitten /Users/prayagmatic/.local/share/nvim/lazy/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py

# Browse scrollback buffer in nvim
map kitty_mod+h kitty_scrollback_nvim
# Browse output of the last shell command in nvim
map kitty_mod+g kitty_scrollback_nvim --config ksb_builtin_last_cmd_output
# Show clicked command output in nvim
mouse_map ctrl+shift+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output

When I use any of these keybindings, the nvim buffer opens up as expected. However, I can't modify anything since it opens up with modifiable set to false.

I have tried the following extra arguments to nvim,

In all the cases, it always starts with modifiable set to false. It only works when I toggle it manually after the buffer is opened.

I can't exactly pinpoint as to who's overriding this value. Is it possible that the kitten or the nvim plugin is forcefully overriding this value?

TIA.

PrayagS commented 4 months ago

Well, this got fixed after toggling this plugin option, https://github.com/mikesmithgh/kitty-scrollback.nvim/blob/08960ad9a96ff6ea6269157dbd4a8a499f7a4311/lua/kitty-scrollback/configs/defaults.lua#L63

Closing this issue. Though still curious as to how it was being set to false. I checked launch.lua and saw that it is explicitly defined as true, https://github.com/mikesmithgh/kitty-scrollback.nvim/blob/08960ad9a96ff6ea6269157dbd4a8a499f7a4311/lua/kitty-scrollback/launch.lua#L148