Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Firenvim show a floating window on the page rather than replace the textbox? #1640

Open
YousufSSyed opened this issue Oct 5, 2024 · 1 comment

Comments

@YousufSSyed
Copy link

YousufSSyed commented Oct 5, 2024

I just started using Firenvim and its been kinda buggy, especially on small text boxes. It seems like a floating window / element would be more helpful if I could still see the textbox (and perhaps as it's being edited!), and avoid the issue of small text boxes.

@glacambre
Copy link
Owner

Does automatically expanding the size of the Firenvim frame to match the buffer's height solve your problem? You can add the following piece of code to your init.lua to do that:

if vim.g.started_by_firenvim then
  local max_height = 10
  local id = vim.api.nvim_create_augroup("ExpandLinesOnTextChanged", { clear = true })
  vim.api.nvim_create_autocmd({"TextChanged", "TextChangedI"}, {
    group = id,
    callback = function(ev)
      local height = vim.api.nvim_win_text_height(0, {}).all
      if height > vim.o.lines then
        if height < max_height then
          vim.o.lines = height
        else
          vim.o.lines = max_height
        end
      end
    end
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants