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
Fix remember window size #2120
Fix remember window size #2120
Conversation
A log if that helps |
And you for sure dont have a line in your config that sets the lines and columns? |
I'm 99% sure, but what is the exact config variable name and ill search for it
There's also nothing for lines except these which arent it:
|
its super weird. Your log file indicates that the lines and columns are getting set which triggers a window resize |
Could that be set in the config file? As in, its reading from the config file properly but breaking after? Because one thing I do notice (like last time) is the config is actually saved properly, just reading it seems to be the problem. (indicated by it being broken for awhile, and when I use a compiled version that works, suddenly it restores back the size I had saved some time ago as if nothing was ever wrong) |
The config file does have a maximized setting but I dont think that would conflict here. The persistent file is in the nvim-data directory and should be read just like before. |
here are my main settings, and gui settings below. probably not very helpful
|
Yeah doesn't look like it gets set at all. Very strange... |
More specifically the last one, 2027, is where he fixed it the first time |
Ill look into it more tomorrow. The timing is subtle i think |
@Kethku, based on the log the problem is that it reads the initial columns and lines. The resizing implementation is based on the fact that the columns and lines autocommand is only called when the user sets the column or line manually But with your changes it's also called with the initial value. And a couple of other things that I did not had time to review in the original PR
|
Okeydokey. I will put it back. Thanks for taking a look. |
And |
I'm working on 4. Small hiccup here is that I dont think we can call dictwatcheradd from lua. Theres a fair amount of discussion in the neovim repo about using metatables to do something similar but I'm not sure how that would work with the way we do global variables. I feel like maybe I'm missing something obvious. @fredizzimo do you know of another way to get global variable notifications? |
…nt for initial read of the settings
160a02b
to
78a2b2c
Compare
Aight @9mm let me know if the current set of changes works for you. @fredizzimo I ended up creating a global function via an vimscript exec and then calling that to work around not being able to pass the g: dictionary from the lua side. I think its possible theres a better way to do this but thats the best I've got for now. Other than that I addressed your other concerns. Should be good to go I think. |
@Kethku that fixed it! |
The new option observation starts sending notifications earlier than the previous solution. So we need to ignore the columns and lines change notifications until the ui has finished initializing or we don't properly set the window size
What kind of change does this PR introduce?
Did this PR introduce a breaking change?