Add a guard to make sure no output is printed in "--headless" mode;#7
Open
axrt wants to merge 1 commit into
Open
Add a guard to make sure no output is printed in "--headless" mode;#7axrt wants to merge 1 commit into
axrt wants to merge 1 commit into
Conversation
Owner
|
Just curious, aren't there a lot of other plugins with print statements? How do you handle those? |
|
Very good question indeed.. I think the difference here might be stemming from that most plugins do print out, it's not happening during the initialization though. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
First of all, thank you for the plugin, it is very very helpful.
I would greatly appreciate if you choose to accept this tiny contribution. Please consider the description below:
Description of the problem at hand
Whenever I start neovim in headless mode (using the
--headlessflag), this plugin is loaded, and, due to the fact that not all of my repos have any bookmarks what so ever, sometimes I get the "No bookmakrs!" output fromlua/telescope/_extensions/vim_bookmarks.lua:102in the base; This may or may not mess up my downstream scripts if those happen to make use of the output printed by neovim;Proposed mitigation
As suggested by lines 101-104 in
lua/telescope/_extensions/vim_bookmarks.luafrom the cl, check if neovim is being launched in headless mode, if not - allow the warning print, block if otherwise; the check is done throughnvim_list_uis, which returns empty (nil-table) in case ofheadlessmode;Thank you for reviewing!