Skip to content

Improve vim plugin error message if vim is too old or python support is missing #4437

@nirs

Description

@nirs

When trying the black vim plugin in builtin vim in macOS 14, we get this unclear error message:

The black.vim plugin requires vim7.0+ with Python 3.6 support.

The issues is that the builtin vim is not compiled with python3:

% /usr/bin/vim --version | grep python3
+cmdline_info      +libcall           -python3           +virtualedit

No issue with vim from homebrew:

% /opt/homebrew/bin/vim --version | grep python3
+cmdline_info      +libcall           +python3           +virtualedit

The error message is correct about the requirement, but not helpful to users.

This will be a more useful behavior:

  • If vim version is too old, fail with a message about vim version
  • If python3 support is missing, fail with a message about missing python support

Also the name of the helper function __BLACK_MISSING is confusing since black
is not missing but cannot be used with this vim executable.

Finally based on README.md, python3.8+ is required not, but the message is about python 3.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions