-
-
Notifications
You must be signed in to change notification settings - Fork 305
feat: allow Border
s and popup
s to be resized
#180
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
Conversation
- adds table to keep track of `Border`s associated to `popup`s - adds function to resize a `popup` - relies on nvim-lua/plenary.nvim#180
@Conni2461 could you have a look at this and nvim-lua/popup.nvim#15 and let me know what you think. I'm trying to set something up that would be useful for rearranging windows within |
This looks already great. Thanks for tackling that :) (We should reduce duplication between, I am thinking that with a api like that we can resolve these telescope issues:
Am i missing something that you want to do ("rearranging windows") Also we need to see that in action at the same time, interested in developing vimresize or toggle preview, while implementing this? vimresize can maybe even happen on popup.nvim level, right? Oh and right now i do not think you break other plugins, you are only extending api :) So thanks again |
Cool, I'll refactor stuff to reduce overlap between Those were the main uses in telescope that I was thinking of, but in principle this should allow any layout changes wanted for telescope (e.g. changing layout strategy on the fly, resizing the results window to fit things in,...). Yeh, I was working on stuff to get |
- rename `Border:resize` to `Border:set_size` - allow `Border:set_size` to be passed on option to create a window rather than resize - remove overlapped parts from `Border:new` and use `Border:set_size` with `create_window` set to `true`
- implements `Picker:recalculate_layout` function - adds an autocommand to call this function on the `VimResized` event - relies on nvim-lua/plenary.nvim#180 and nvim-lua/popup.nvim#15 Currently has issues when the results window increases in height
Border
s to be resizedBorder
s and popup
s to be resized
I have added the functionality from the I think this functionality is complete enough to merge now, I can't think of anything else to add. @Conni2461 could you have a look and let me know your thoughts? |
Border
s and popup
s to be resizedBorder
s and popup
s to be resized
Just 1-2 suggestions from my end but otherwise good job, looking forward for toggleable preview and VimResized :) |
I think the failed checks are due to neovim removing a "nightly" tagged release? I still have a few things to change based on @fdschmidt93's feedback, but thought it best to mention this first as this will affect checks for any other PRs for plenary (and I think telescope too). |
I've had a bit more of a think about it and I think it would be better to factor out the posisitioning stuff from I'll have a go at this today/tomorrow, and then hopefully the neovim Also, once this and #227 are merged, I was thinking about refactoring |
Completely agree and also had similar things in mind. I briefly glanced at https://github.com/MunifTanjim/nui.nvim and fzf-lua's implementation which all around both look a lot more ergonomic pretty much going that route. |
Okay, from my perspective this is now ready to merge. @fdschmidt93 yes, |
tj said exactly the same thing to me a month ago 🤣 i just quote him my answer was kinda like that. Good idea we should focus on building what works on us and we can always build the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. Thanks :)
I'll run it for the day and maybe do some popup_move
this evening, after that i would merge
Oh also. If you do that popup refactor, do you want "access", permissions to merge stuff. I havent talked with tj about that (just came to my mind) but i hardly think he will have a issue with that 😆 If you want i can give you permissions later. Maybe that easier than always waiting for me 🤣 |
I'm happy to write the PR either way. If it makes it easier to have an extra person who can merge stuff for plenary, then I'm happy to help out with reviewing stuff over here.
Ah, that's weird. I hadn't had any issues, but was working with my layout refactor branch for telescope (see here). |
Hmm maybe that would solve the CI in telescope 🤔 You could try switching the branch ci pulls in your telescope branch, maybe that fixes ci then could merge both at the same time. I could run both PRs for the rest of the week. I think is super busy lately (i have caught him playing dota 🤣) the stuff i saw from that pr looked good i just also didnt understand the failing ci. |
@Conni2461 as suggested I tried switching the branch for ci in the telescope PR, but it doesn't fix the issues over there Don't really know what's going on now 🤣 Will see if I can figure stuff out |
@Conni2461 I've tried to find the point in the commit history for telescope where stuff diverged enough to cause this issue and it is before we move |
- this then matches terminology for popups
@Conni2461 I think I have fixed the stuff in this PR that was breaking I don't think there is anything more to do on the |
I tested it and i havent seen any regressions for telescope, so i dont see any reason why not merging right now :) Thanks for all the hard work :) |
- implements `Picker:recalculate_layout` function - adds an autocommand to call this function on the `VimResized` event - relies on nvim-lua/plenary.nvim#180 and nvim-lua/popup.nvim#15 Currently has issues when the results window increases in height
- implements `Picker:recalculate_layout` function - adds an autocommand to call this function on the `VimResized` event - relies on nvim-lua/plenary.nvim#180 and nvim-lua/popup.nvim#15 Currently has issues when the results window increases in height lint
Adds a function to resize a
Border
based on updatedcontent_win_options
andborder_win_options
Initial commit is a first attempt and probably needs looking through closely to make sure I haven't missed anything.