feat: add float autoclose option#1621
Conversation
|
I asked for that to be unconditionally added as I didn't consider the use case that the user desires this functionality. |
alex-courtis
left a comment
There was a problem hiding this comment.
view.float.autoclose = true
Tested OK:
- window focus is changed
Needs work:
actions.open_file.quit_on_open = false: float closes when opening file
|
Yes, the This is also documented: I didn't have that much testing time with the feature yet, so I'm not sure what I'd prefer yet. Right now I think that I'd like the setup of this PR (don't close on focus loss, close on open). I understand that the settings as set up by this PR are confusing. What about if we rename this setting to |
Good catch! That can be changed.
We can keep it simple and do it now: floating window respects both
|
|
RE defaults: users will experience disruption if they relied on the implicit |
|
I don't understand the disruption? I'll update the PR with the setting rename. |
The implicit Making both changes now will be less disruptive and I would be very greatful if you could make this change in this PR. |
|
ok, i'll research what is the breakage that the quit_on_open locking was supposed to workaround. i think fixing that shouldn't be too hard. |
eaec70f to
d1ababb
Compare
|
OK, I've updated the PR. I do not understand what was the issue with quit_on_open. I removed the setting blocking it and.. it worked right away for me. I couldn't find any issue... It seems to work just fine for me. It does turn out there can be a conflict between both options. If you say quit_on_focus_loss=true quit_on_focus_loss=false quit_on_focus_loss=false quit_on_focus_loss=true quit_on_focus_loss=false I've tested the four cases, everything looks good to me. I intend to use true+true for now, maybe i'll switch to quit_on_focus_loss=false+quit_on_open=true, I'll see. But so far I can't see any issues. |
|
Ok, I found an issue. The tree contents are not updated when we switch buffers. I'll check it out. |
|
false alert: I needed update_focused_file.update_root=true. I could have sworn that I didn't need that in the past. Anyway, nevermind. I know of no bugs right now. |
|
Thanks for updating. Unfortunately I'm not able to look at this until the weekend. |
|
no problem, thank you! In the meantime I'll keep using it through the week and be careful for glitches. As I said, I intend to use true+true for now, maybe i'll switch to quit_on_focus_loss=false+quit_on_open=true, I'll see. |
d1ababb to
6dd143a
Compare
alex-courtis
left a comment
There was a problem hiding this comment.
Tested OK.
Defaults match current behaviour.
Thanks for going the extra mile.
…_file.quit_on_open (nvim-tree#1621)
I like the float mode of the treeview, however I'd like it not to autoclose when the popup loses focus.
So I've added an option to that effect.