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

Reevalute size on window resize #609

Open
SamuelBorn opened this issue Sep 1, 2024 · 0 comments
Open

Reevalute size on window resize #609

SamuelBorn opened this issue Sep 1, 2024 · 0 comments

Comments

@SamuelBorn
Copy link

SamuelBorn commented Sep 1, 2024

I would like to have a terminal that always uses 40% of the available space.
I have the following config:

        require("toggleterm").setup({
            direction = "vertical",
            size = function() return vim.o.columns * 0.4 end,
            persist_size = false,
        })

The config allows that, but only between terminal reopens like:

  1. Terminal application window in fullscreen
  2. Open toggleterm
  3. its 40% width
  4. Close toggleterm
  5. Resize Terminal window
  6. Reopen toggleterm
  7. its 40% width of the the new Window size
  8. This is as I like it

Not working is the following:

current behavior

  1. Terminal application window in fullscreen
  2. Open toggleterm
  3. its 40% width
  4. Resize Terminal window
  5. Toggleterm still has 40% width of the old window size

desired behavior

I would like to see that on Window Resize also the size parameter gets reevaluated.

  1. Terminal application window in fullscreen
  2. Open toggleterm
  3. its 40% width
  4. Resize Terminal window
  5. Toggleterm has 40% width of the new window size
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

1 participant