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

Suppress warnings and disable plugin functionality for non-modifiable buffers. #31

Closed
wants to merge 1 commit into from

Conversation

Peglah
Copy link

@Peglah Peglah commented Mar 3, 2024

Good for when you use Neovim to view man pages among other things.

@mawkler
Copy link
Owner

mawkler commented Mar 4, 2024

Hi @Peglah and thank you for contributing to Modicator!

However, modicator doesn't check the modifiable option, so it should never warn about it already. Also, I'm not sure that I agree that Modicator should be disabled in buffers where modifiable = false, since it is still possible to switch between Normal and Visual mode.

Could you please elaborate on any issues that your were having when viewing man pages that lead you to create this PR? I don't have any issues doing :Man nvim with modicator.nvim on main.

@Peglah
Copy link
Author

Peglah commented Mar 4, 2024

Hi @mawkler and thank you for looking at my PR.

These are the steps I've taken:
Installed modicator with lazy.nvim (just default config) according to the modicator readme.
Set Neovim as manpager with export MANPAGER='nvim +Man!' as stated in help:filetype.

When I run man nvim from the terminal I get the warning: modicator.nvim: modicator requires `number` to be set. Run `:set number` or add `vim.o.number = true` to your init.lua.

I realize I can export MANPAGER="nvim +Man! -c 'set number'" to force the numbers again but I would prefer to look at man pages without numbering. I didn't know about the visual mode in non-modifiable buffers and it really is a valid point, hence I no longer think modicator should be disabled.

Can you replicate my issue? What are your thoughts?

@mawkler mawkler closed this in 0140310 Mar 5, 2024
@mawkler
Copy link
Owner

mawkler commented Mar 5, 2024

@Peglah Those warnings you were seeing are just to help you with setting up Modicator. Modicator continues to work for buffers other than :Man (which disables those options for just that buffer) so you can ignore the warnings. I have pushed a commit that sets the show_warnings option to false by default, so you should no longer be seeing the warnings. Let me know if you have any more issues!

@Peglah
Copy link
Author

Peglah commented Mar 5, 2024

@mawkler I understand the reasoning for having the warnings. It's a nice help for new users. 0140310 solved all my issues. Thank you very much!

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.

None yet

2 participants