lambdalisue / vim-manpager

Use Vim as a MANPAGER program
MIT License
62 stars 5 forks source link

MAN pages with spaces throw exception #4

Closed Konfekt closed 8 years ago

Konfekt commented 8 years ago

:MAN git\ grep and :MAN 'git grep' threw

Error detected while processing function <SNR>221_MAN[7]..manpager#open[2]..manpager#load[1]..<SNR>309_args:
line    4:
E121: Undefined variable: s:man_sect_arg
E15: Invalid expression: [s:man_sect_arg, a:section, a:page]
Error detected while processing function <SNR>221_MAN[7]..manpager#open[2]..manpager#load:
line    1:
E712: Argument of extend() must be a List or Dictionary
lambdalisue commented 8 years ago

Prob. $ man git-grep

Konfekt commented 8 years ago

Works! How about catching spaces in s:man_sect_arg and throwing a more informative error instead, like echoerr Spaces, ' ', not allowed. Use dashes, '-', instead!

Konfekt commented 8 years ago

On a second thought: Best to replace all spaces by -. Because for example hitting K on the visual selection git grep looks for git grep and throws an error. Thus better look for git-grep right away.

lambdalisue commented 8 years ago

You are probably right. I'll think about that.

lambdalisue commented 8 years ago

@Konfekt Probably it is fixed now. Try the latest HEAD.

Konfekt commented 8 years ago

Thanks, works fine ! Now in shell as in Vim manpages with spaces are accepted.