We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
So, I saw something similar in a folke plugin, and tinkered a bit with resizing the window depending on the content:
Here the quick-and-dirty solution I came up with. I feel like it would be a nice addition to Dressing itself. What do you think?
-- dynamically resize input field vim.api.nvim_create_autocmd("FileType", { group = vim.api.nvim_create_augroup("DressingInputWidth", {}), pattern = "DressingInput", callback = function(ctx) local win = vim.api.nvim_get_current_win() local startWidth = vim.api.nvim_win_get_width(win) local winOpts = vim.api.nvim_win_get_config(win) local pad = 3 vim.api.nvim_create_autocmd({ "TextChangedI", "TextChanged" }, { buffer = ctx.buf, callback = function() local lineLength = #vim.api.nvim_get_current_line() + pad local newWidth = math.max(startWidth, lineLength) vim.api.nvim_win_set_config(win, { relative = winOpts.relative, row = winOpts.row, col = math.floor((vim.o.columns - newWidth) / 2), width = newWidth, }) end, }) end, })
The text was updated successfully, but these errors were encountered:
Looks nice! I'd be open to looking at a PR
Sorry, something went wrong.
No branches or pull requests
So, I saw something similar in a folke plugin, and tinkered a bit with resizing the window depending on the content:
Pasted_image_2024-06-12_at_21.47.23.mp4
Here the quick-and-dirty solution I came up with. I feel like it would be a nice addition to Dressing itself. What do you think?
The text was updated successfully, but these errors were encountered: