Skip to content

Update the Vim script functionList #272

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

Merged
merged 1 commit into from
Sep 1, 2024
Merged

Update the Vim script functionList #272

merged 1 commit into from
Sep 1, 2024

Conversation

rdipardo
Copy link
Contributor

@rdipardo rdipardo commented Sep 1, 2024

/NotepadPlus/functionList/parser [@commentExpr]

  • the UDL targets "legacy" Vim script, in which comments begin with a double quote ("), not a hash (#) as in Vim9 script 1

/NotepadPlus/functionList/parser/function [@mainExpr], /NotepadPlus/functionList/parser/function/functionName [@nameExpr]

  • allow "namespaced" functions like those encountered in many Vim plugins. The conventional pattern is <vim_script_file_name>#<func_name>, assuming <vim_script_file_name> can be found on the file system. Any sub-directories must also be part of the name, similar to a Java package, e.g.,

    <root_dir>#<sub_dir>#<vim_script_file_name>#<func_name>
    

    A namespaced function cannot be qualified with s: because the auto-generated script id of a "private" function makes the name differ from the name of the file or directory on disk

  • end the function name pattern with \w* instead of \w+ to allow single-letter function names

Footnotes

  1. https://vimhelp.org/vim9.txt.html#vim9-differences

 commentExpr
 -----------

 * the UDL targets "legacy" Vim script, in which comments begin with a
   double quote ("), not a hash (#) as in Vim9 script [^1]

 mainExpr, nameExpr
 ------------------

 * allow "namespaced" functions like those encountered in many Vim
   plugins. The conventional pattern is `<vim_script_file_name>#<func_name>`,
   assuming `<vim_script_file_name>` can be found on the file system.
   Any sub-directories must also be part of the name, similar
   to a Java package, e.g.,

    <root_dir>#<sub_dir>#<vim_script_file_name>#<func_name>

   A namespaced function cannot be qualified with `s:` because the
   auto-generated script id of a "private" function makes the name differ
   from the name of the file or directory on disk

 * end the function name pattern with `\w*` instead of `\w+` to allow
   single-letter function names

  ---
  [^1] https://vimhelp.org/vim9.txt.html#vim9-differences
@rdipardo
Copy link
Contributor Author

rdipardo commented Sep 1, 2024

@pryrt, since I'm not a regex expert (reg‌ex‌pert?), reviews are certainly welcome.

@pryrt pryrt merged commit 1d6e1bd into notepad-plus-plus:master Sep 1, 2024
2 checks passed
@rdipardo rdipardo deleted the funclist/vimscript branch September 1, 2024 14:56
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.

2 participants