Coder Social home page Coder Social logo

Comments (6)

ofseed avatar ofseed commented on June 19, 2024 1

I know this option, and I fixed a bug about this : ), see: #182

There's a more complicated situation in my use case. I'm using 'statuscolumn' to arrange my sign columns, there's no way to disable 'statuscolumn' except a hook to do this.

from kitty-scrollback.nvim.

mikesmithgh avatar mikesmithgh commented on June 19, 2024 1

Hey @ofseed I added the callback after_paste_window_ready that has a first parameter containing the window and buffer ids of the scrollback buffer, paste window, and paste window footer. The paste window data will be in form similar to:

local paste_window_data = {
  scrollback_buffer = { bufid = p.bufid, winid = p.winid },
  paste_window = { bufid = p.paste_bufid, winid = p.paste_winid },
  paste_window_footer = { bufid = p.footer_bufid, winid = p.footer_winid },
}

I played around a bit and created this example:

require('kitty-scrollback').setup({
  {
    callbacks = {
      after_paste_window_ready = function(pastewin_data, kitty_data, opts)
        local stc = '%#ErrorMsg#%{(v:lnum%2)?" ".v:lnum:""}' .. '%#WarningMsg#%{!(v:lnum%2)?" ".v:lnum:""} '
        vim.api.nvim_set_option_value('statuscolumn', stc, {
          win = pastewin_data.paste_window.winid,
        })

        vim.keymap.set({ '' }, '<Tab>', '<Plug>(KsbToggleFooter)', {
          buffer = pastewin_data.paste_window.bufid,
        })

        if pastewin_data.paste_window_footer.winid then
          vim.api.nvim_set_option_value('statuscolumn', 'help:', {
            win = pastewin_data.paste_window_footer.winid,
          })
        end
      end,
    },
  },
})

callback-example

Please let me know if you run into any issues

from kitty-scrollback.nvim.

mikesmithgh avatar mikesmithgh commented on June 19, 2024

Hey @ofseed thanks for reporting.

Regarding adjusting window options, there are overrides exposed via:

Options Type Description
paste_window.winopts_overrides fun(paste_winopts: KsbWinOpts): table<string,any>? Paste float window overrides, see nvim_open_win() for configuration
paste_window.footer_winopts_overrides fun(footer_winopts: KsbWinOpts, paste_winopts: KsbWinOpts): table<string,any>? Paste footer window overrides, see nvim_open_win() for configuration

There is an example of this in Advanced Configuration Examples named ksb_example_paste_win_winopts.

But, I agree, there is no general hook if you want to do something based on the bufnr or winid. What are you trying to trigger when the paste window opens?

from kitty-scrollback.nvim.

mikesmithgh avatar mikesmithgh commented on June 19, 2024

I know this option, and I fixed a bug about this : ), see: #182

😅 oops, didn't realize.

There's a more complicated situation in my use case. I'm using 'statuscolumn' to arrange my sign columns, there's no way to disable 'statuscolumn' except a hook to do this.

Ah, I see yeah you are right.

from kitty-scrollback.nvim.

mikesmithgh avatar mikesmithgh commented on June 19, 2024

🎉 This issue has been resolved in version 4.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

from kitty-scrollback.nvim.

ofseed avatar ofseed commented on June 19, 2024

It runs without problems, thank you!

from kitty-scrollback.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.