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

Can Conjure be configured to be silent (i.e. no popup) when starting? #51

Closed
daveyarwood opened this issue Jul 17, 2019 · 10 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@daveyarwood
Copy link
Sponsor Contributor

As I've been using Conjure, I've been noticing that I tend to reflexively press <localleader>cq to close the initial Conjure log that pops up and tells me the results of its trying to connect to any prepls as configured in conjure.edn:

; conjure/out | Welcome to Conjure! (v0.22.0-0-g0cbb94a56f)
; conjure/out | Adding :cwd

In practice, I don't care about these results upon starting Neovim, and I assume that it's just going to work when I'm ready to use it. (And if it doesn't work, I'll find out anyway!)

So I'm wondering, is there any way to configure Conjure not to pop up initially? I realize this is a bit complicated, because under the hood it's probably just doing what it always does with :out messages. And I do want the Conjure log to pop open for :out messages, in general, like if I evaluate something that prints to STDOUT, or if I run :ConjureUp. It would be nice, anyway. Thoughts welcome. :)

@Olical
Copy link
Owner

Olical commented Jul 17, 2019 via email

@daveyarwood
Copy link
Sponsor Contributor Author

I like the idea of tagging that output as conjure/up instead of out. I didn't realize you could do that with prepl, neat!

Rebinding <localleader>cu to run :ConjureUp followed by :ConjureOpenLog sounds workable to me. There are a couple of related QOL things that would make me happy in that workflow:

  • Having the ability to deliberately open the Conjure log in small mode would be nice. I have g:conjure_log_size_large set to 100%, which is what I want when I run :ConjureOpenLog by itself (to view large eval results, etc.), but to support opening it just to see the output following :ConjureUp, it would be nice to be able to open the log in small mode (i.e. 25%). It's a subtle thing, but it would feel more like the Conjure window is out of my way when I want it to be.

  • Ideally, I wouldn't ever have to run :ConjureUp manually. Typically, I have to run :ConjureUp if I started Vim before I started my prepl server, or if I have to restart my prepl server for whatever reason. (Maybe that idea is already on the road map? It reminds me of the discussion around Declaritive prepl connections #15 )

@Olical Olical self-assigned this Jul 17, 2019
@Olical Olical added the enhancement New feature or request label Jul 17, 2019
@Olical Olical added this to the v1.0.0 milestone Jul 17, 2019
Olical added a commit that referenced this issue Jul 17, 2019
@Olical
Copy link
Owner

Olical commented Jul 17, 2019

So I've split ConjureStatus and ConjureUp log entries out into their own categories. If you have changed g:conjure_log_auto_open you'll need to add status and maybe up if you wanna see connection syncing output. But yeah, maybe being able to control log size when opening it would be good too.

Let me know how you get on with this first 😃

@Olical
Copy link
Owner

Olical commented Jul 17, 2019

Something about how this is split up and configured smells to me right now, but I'll mull it over. Maybe I need to flip that list over so you choose what you don't want to see?

@daveyarwood
Copy link
Sponsor Contributor Author

"Everything by default" does sound good to me. Maybe that implies a separate config var like g:conjure_log_auto_open_blacklist. If you did that and continued to treat g:conjure_log_auto_open as a whitelist (default: everything), you could probably make this a non-breaking change.

I tried the develop branch and it's looking good from my perspective. 👍 I added status to my whitelist, and left up out so that the log doesn't pop open when I start Vim and Conjure tries to make its first connection to my prepl. I also added a <localleader>cU mapping that does :ConjureUp<CR>:ConjureOpenLog<CR>, but interestingly, I found that I didn't really need it, because in practice, I just run :ConjureUp (not seeing the output) and trust that it'll work, and if it doesn't work, I'll know as soon as I try to eval a form and the Conjure log pops open for the err message.

I think the next step is to have Conjure periodically re-up my connections, so that I never have to run :ConjureUp manually :)

@Olical
Copy link
Owner

Olical commented Jul 18, 2019

Cool that all sounds good to me! I'm glad it works, and yeah, you shouldn't have to see the log when you ConjureUp really. It should do exactly what you expect, if you need to check it you can.

I think if I add a blacklist I may well just do a breaking change and remove the existing config while it's still < 1.0.0. Having that legacy forever after 1.0.0 will be a little gross I think, especially if I think it's not the best UX and the interaction with the new config will be... questionable. Like what happens if you set both.

I think I'll swap it to a blacklist and document it well for the next release. Or I'll call it "suppress" maybe.

Not sure about running ConjureUp periodically but I'll give it some thought. You might be starting and stopping other prepls you don't want it to connect to until you ask / it might disconnect mid way through some execution. I'll give it some thought though!

@daveyarwood
Copy link
Sponsor Contributor Author

You're actually in a great position as the author of a plugin that's oriented around a log. Whenever you want to make a breaking change, if you want, you can follow a deprecation process where you notice when users are doing the old thing and print a warning to the log. In this case, for example, you could recognize when the old config variable is set and print a deprecation warning.

@Olical
Copy link
Owner

Olical commented Jul 18, 2019 via email

@Olical
Copy link
Owner

Olical commented Jul 21, 2019

Okay, g:conjure_log_auto_open has been swapped to g:conjure_log_blacklist, let me know how you get on!

e90c56a

Should solve your issues fairly nicely? I know it's a breaking change but I think it's for the best. Like a plaster, better to rip it off quickly.

@Olical Olical closed this as completed Jul 21, 2019
@daveyarwood
Copy link
Sponsor Contributor Author

I like it. I went through and figured out what I need in my blacklist to get the equivalent of my current whitelist:

let g:conjure_log_blacklist = ["up", "eval", "ret", "load-file"]

I like this because the intent reads much clearer than with the whitelist version. 👍

One thing you might consider before this gets pushed to master: the name "conjure log blacklist" might imply that it's a list of things not to include in the log, vs. what it really is, which is a list of things that should not result in the log popping open. As such, I think g:conjure_log_auto_open_blacklist is a better name because it's more precise. It is a bit lengthy, though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants