davidgranstrom / scnvim

Neovim frontend for SuperCollider.
GNU General Public License v3.0
208 stars 28 forks source link

[BUG] SCNvimHelp not working in the lua-config branch #185

Closed kflak closed 2 years ago

kflak commented 2 years ago

Describe the bug

Hit K on a Class produces this error:

Open ended string started on line 1 of interpreted text
ERROR: syntax error, unexpected $end, expecting ')'
  in interpreted text
  line 1 char 36:
  HelpBrowser.openHelpFor(\"SinOsc\") 

-----------------------------------
ERROR: Command line parse failed

Expected behavior

Help should work as per usual...

Steps to reproduce

Shift-K on a word. Also tried running :SCNvimHelp SinOsc and got the same result.

Additional context

Information

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

kflak commented 2 years ago

OK, found the bug:

Line 187 in help.lua needs to be changed from:

    local cmd = string.format([[HelpBrowser.openHelpFor(\"%s\")]], subject)

to

    local cmd = string.format([[HelpBrowser.openHelpFor("%s")]], subject)
kflak commented 2 years ago

However, it opens up the qt window, not a split window as before. Is this to be expected? Don't mind the qt browser, tbh, but it's nice to have the option...

davidgranstrom commented 2 years ago

@kflak Thanks for the report, should be fixed now with 367b4e3d9fe052e03ef89263b58832a99bd2df5b

To use the plain text help system you will need to specify the command used for the html -> plain text conversion (e.g. pandoc)

Add the following to scnvim.setup (adjust cmd according to your enviroment)

  documentation = {
    cmd = '/opt/homebrew/bin/pandoc',
  },
kflak commented 2 years ago

Great, works now on my system. Also plaintext works as expected with the modification to the config. I must say I am very excited about this rewrite!