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

feat: add dev log toggling #121

Closed
wants to merge 1 commit into from
Closed

feat: add dev log toggling #121

wants to merge 1 commit into from

Conversation

rlch
Copy link
Collaborator

@rlch rlch commented Jan 20, 2022

@rlch the reason I don't want to really entertain the idea of "toggling" the dev log is that it can be opened in any possible way that nvim allows opening a buffer so the whole idea of toggling is quite complex since you might be toggling a tab or a split or it might replace the current window, which means it's quite hard to know what is being opened or closed. I did look into this at some point last year and it proved to be quite complex to try and cover all these cases. The above command would work if you opened a split but not if you opened this buffer using a tab.

I have only accounted for the dev log buffer being opened as a split. Creating this PR as a small foundation to build off to properly implement this feature.

closes #84

@rlch
Copy link
Collaborator Author

rlch commented Jan 21, 2022

@akinsho Thoughts on allowing the developer to specify a function which handles closing the window? Seems logical seeing as the developer already has control over how the buffer is opened.

@akinsho
Copy link
Owner

akinsho commented Jan 21, 2022

@rlch I think if a user is going to go as far as creating a custom opener or closer I'm not sure what the benefit is to having it as part of this plugin? I'm really not sold on the complexity of this whole issue, it doesn't really tie together nicely. It makes me wonder if the log buffer should be only one type of window e.g. a tab or a split and then it's more consistent but if it's as versatile as I designed it to be then I don't think this plugin needs to invent complex toggling behaviour or offer an entry point for that complexity.

coc-flutter doesn't do this as far as I recall and I think not getting into this complex buffer toggling logic business is a good idea as I can just envision endless bugs or questions about how do I toggle X or can we pass X to the toggler function and so on and so forth.

My main goal at this point with the plugin is to reduce the maintenance burden as much as possible so any feature or functionality that gets added should I think be aimed at reducing the work of maintenance or at least should definitely not add to it (by much/at all) since I find myself really pressed for time atm and get daily issues/feature requests across like 4+ plugins 😭

@rlch
Copy link
Collaborator Author

rlch commented Jan 21, 2022

@rlch I think if a user is going to go as far as creating a custom opener or closer I'm not sure what the benefit is to having it as part of this plugin? I'm really not sold on the complexity of this whole issue, it doesn't really tie together nicely. It makes me wonder if the log buffer should be only one type of window e.g. a tab or a split and then it's more consistent but if it's as versatile as I designed it to be then I don't think this plugin needs to invent complex toggling behaviour or offer an entry point for that complexity.

coc-flutter doesn't do this as far as I recall and I think not getting into this complex buffer toggling logic business is a good idea as I can just envision endless bugs or questions about how do I toggle X or can we pass X to the toggler function and so on and so forth.

My main goal at this point with the plugin is to reduce the maintenance burden as much as possible so any feature or functionality that gets added should I think be aimed at reducing the work of maintenance or at least should definitely not add to it (by much/at all) since I find myself really pressed for time atm and get daily issues/feature requests across like 4+ plugins 😭

Yep, I completely empathize.

Is it worth closing this PR? Or do you think enforcing, for example, a VSC-style debug console (horizontal/vertical) split if a toggle option is enabled is a better idea? That way, we can have backwards compatibility with people who want their own attaching behaviour and a sane-default for people like me who want to be able to toggle.

@RobertBrunhage
Copy link
Contributor

RobertBrunhage commented Jul 20, 2022

Adding an additional pain point regarding not having something like this.

When we manually close the devlog split and open it from the buffer again we lose the auto-scroll functionality. Having a way in the plugin to either toggle or just open it again, like a FlutterOpenLog (would also apply the autoscroll). This would let us not having to re-implement the auto-scroll logic in our neovim config.

To clearify this would just open the log in the current buffer and apply the auto-scroll logic already in this repo.

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

Successfully merging this pull request may close these issues.

[Feature request]: Toggle logs like outline
3 participants