Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Update :Validate command definition to prevent error
Browse files Browse the repository at this point in the history
This change updates the :Validate command definition to drop the
-complete=file option, and updates the docs to indicate the :Validate
command does not take a file argument.

Otherwise, without this change, loading of eclim/ftplugin/xml.vim in
versions of vim later than 8.2.3140 will fail with the error message
“E1208: -complete used without -nargs” — due to this vim change:

vim/vim@de69a73

That change causes vim to explicitly check for the case where -nargs=0
is used with -complete — because it doesn’t seem to make sense to use
-complete without also actually permitting arguments for completion.

And in org.eclim.core/vim/eclim/autoload/eclim/xml/validate.vim, there
doesn’t actually seem to be any support for handling any file argument
passed to the :Validate command. So that’s why this patch drops the
-complete=file option — rather than setting -nargs=1 — and that’s why
the patch also updates the docs to indicate :Validate takes no argument.

Fixes #615

Related: vim/vim#8544
  • Loading branch information
sideshowbarker committed Sep 3, 2021
1 parent 8bcbe33 commit 97be979
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions doc/content/vim/xml/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ following command is still available for validating xml files on demand.

.. _\:Validate_xml:

**:Validate** [<file>] -
Validate the supplied file or the current file if no file name provided.
**:Validate** -
Validate the the current file.

If eclimd is not currently running, and the xmllint command is available,
eclim will validate the xml file using that. Eclim will never use xmllint
Expand Down
2 changes: 1 addition & 1 deletion org.eclim.core/vim/eclim/ftplugin/xml.vim
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ endif
" Command Declarations {{{

if !exists(":Validate")
command -nargs=0 -complete=file -bang -buffer Validate
command -nargs=0 -bang -buffer Validate
\ :call eclim#xml#validate#Validate(0, '<bang>')

command -nargs=? -buffer DtdDefinition
Expand Down

0 comments on commit 97be979

Please sign in to comment.