diff --git a/README.md b/README.md index 00503ac..b8dee40 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ make clean make install ``` -If you want install lehre manually, you can install from npm. +If you want to install lehre manually, you can install from npm. ```console $ yarn add -D lehre @@ -75,6 +75,15 @@ $ yarn add -D lehre Set installed `/path/to/node_modules/.bin/lehre` path to `g:jsdoc_lehre_path`. +#### Installing on Windows + +```console +# cd to /lib +npm install +``` + +If you want to set the path of [lehre](https://www.npmjs.com/package/lehre) manually on Windows, you should use the path with the file extension `.cmd`, such as `/path/to/node_modules/.bin/lehre.cmd`. + ## Usage 1. Move cursor on `function` keyword line diff --git a/autoload/jsdoc.vim b/autoload/jsdoc.vim index b7a9362..c65f5b5 100644 --- a/autoload/jsdoc.vim +++ b/autoload/jsdoc.vim @@ -9,11 +9,19 @@ set cpo&vim let g:jsdoc_templates_path = get(g:, 'jsdoc_templates_path', '') let g:jsdoc_formatter = get(g:, 'jsdoc_formatter', 'jsdoc') -let g:jsdoc_lehre_path = get( - \ g:, - \ 'jsdoc_lehre_path', - \ printf('%s/lib/lehre', expand(':p:h:h')) - \ ) +if has("win64") || has("win32") || has("win16") + let g:jsdoc_lehre_path = get( + \ g:, + \ 'jsdoc_lehre_path', + \ printf('%s/lib/node_modules/.bin/lehre.cmd', expand(':p:h:h')) + \ ) +else + let g:jsdoc_lehre_path = get( + \ g:, + \ 'jsdoc_lehre_path', + \ printf('%s/lib/lehre', expand(':p:h:h')) + \ ) +endif let s:is_method_regex = '^.\{-}\s*\([a-zA-Z_$][a-zA-Z0-9_$]*\)\s*(\s*\([^)]*\)\s*).*$' let s:is_declarelation = '^.\{-}=\s*\(\([a-zA-Z_$][a-zA-Z0-9_$]*\)\s*(\s*\([^)]*\)\s*)\|(\s*\([^)]*\)\s*\).*$'