-
Notifications
You must be signed in to change notification settings - Fork 19
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
Manual pages aren't displaying correctly #55
Comments
|
What version of nvim and nvimpager are you running? On which OS? If you do not have the newest version of nvimpager you can try to update that first. Otherwise we have to investigate (I can not reproduce your problem here (yet)). |
|
nvimpager-git 0.10.2.r6.g49315df-1 (https://aur.archlinux.org/packages/nvimpager-git/) |
|
I can reproduce this in a podman container like so: It might be that I am still using neovim 0.5 and arch linux already has 0.5.1. Can you check if this patch helps: diff --git a/lua/nvimpager.lua b/lua/nvimpager.lua
index 6737833..55f8685 100644
--- a/lua/nvimpager.lua
+++ b/lua/nvimpager.lua
@@ -392,7 +392,7 @@ end
local function detect_filetype()
if not doc then
if detect_man_page_in_current_buffer() then
- nvim.nvim_buf_set_option(0, 'filetype', 'man')
+ nvim.nvim_command('Man!')
end
else
if doc == 'git' then |
|
Sorry, but the patch didn't fix the problem. |
|
Ok, maybe this works better: diff --git a/lua/nvimpager.lua b/lua/nvimpager.lua
index 6737833..deebccf 100644
--- a/lua/nvimpager.lua
+++ b/lua/nvimpager.lua
@@ -390,18 +390,18 @@ end
-- Detect possible filetypes for the current buffer by looking at the pstree
-- or ansi escape sequences or manpage sequences in the current buffer.
local function detect_filetype()
- if not doc then
- if detect_man_page_in_current_buffer() then
- nvim.nvim_buf_set_option(0, 'filetype', 'man')
- end
+ if not doc and detect_man_page_in_current_buffer() then doc = 'man' end
+ if doc == 'git' then
+ -- Use nvim's syntax highlighting for git buffers instead of git's
+ -- internal highlighting.
+ strip_ansi_escape_sequences_from_current_buffer()
+ end
+ if doc == 'man' then
+ nvim.nvim_buf_set_option(0, 'readonly', false)
+ nvim.nvim_command("Man!")
+ nvim.nvim_buf_set_option(0, 'readonly', true)
else
- if doc == 'git' then
- -- Use nvim's syntax highlighting for git buffers instead of git's
- -- internal highlighting.
- strip_ansi_escape_sequences_from_current_buffer()
- elseif doc == 'pydoc' or doc == 'perldoc' or doc == 'ri' then
- doc = 'man'
- end
+ if doc == 'pydoc' or doc == 'perldoc' or doc == 'ri' then doc = 'man' end
nvim.nvim_buf_set_option(0, 'filetype', doc)
end
end |
|
Yep, that definitely works! TY!!! |
|
Hi, I have a problem with this patch. If I run |
|
I installed the latest version and now it works perfectly. TY. |
This is the output of
man nvimpager:https://i.imgur.com/lhZrjaN.png
Do you know what can I do?
The text was updated successfully, but these errors were encountered: