From f351c0d2b1d638b12424e6e7dedb9fe1bbce1f7e Mon Sep 17 00:00:00 2001 From: Sarunas Nejus Date: Tue, 7 Apr 2020 21:35:09 +0100 Subject: [PATCH] Fix `highlight_builtins` when `highlight_all` isn't set Fixes #66 Closes #67 --- README.md | 2 +- doc/python-syntax.txt | 2 +- syntax/python.vim | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 37062f7..922c335 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ let g:python_highlight_all = 1 | --------------------------------------------- | -------------------------------------------------------------- | ------- | | `g:python_version_2` | Python 2 mode | `0` | | `b:python_version_2` | Python 2 mode (buffer local) | `0` | -| `g:python_highlight_builtins` | Highlight builtin functions and objects | `0` | +| `g:python_highlight_builtins` | Highlight builtin objects, types, and functions | `0` | | `g:python_highlight_builtin_objs` | Highlight builtin objects only | `0` | | `g:python_highlight_builtin_types` | Highlight builtin types only | `0` | | `g:python_highlight_builtin_funcs` | Highlight builtin functions only | `0` | diff --git a/doc/python-syntax.txt b/doc/python-syntax.txt index 8c8f8f2..2a25373 100644 --- a/doc/python-syntax.txt +++ b/doc/python-syntax.txt @@ -57,7 +57,7 @@ following command to your `~/.config/nvim/init.vim` or `~/.vimrc`: > Python 2 mode (buffer local) `g:python_highlight_builtins` (default `0`) - Highlight builtin functions and objects + Highlight builtin functions, types, and objects `g:python_highlight_builtin_objs` (default `0`) Highlight builtin objects only diff --git a/syntax/python.vim b/syntax/python.vim index 5cac25c..ba9b464 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -41,11 +41,6 @@ call s:EnableByDefault('g:python_highlight_builtin_funcs_kwarg') if s:Enabled('g:python_highlight_all') call s:EnableByDefault('g:python_highlight_builtins') - if s:Enabled('g:python_highlight_builtins') - call s:EnableByDefault('g:python_highlight_builtin_objs') - call s:EnableByDefault('g:python_highlight_builtin_funcs') - call s:EnableByDefault('g:python_highlight_builtin_types') - endif call s:EnableByDefault('g:python_highlight_exceptions') call s:EnableByDefault('g:python_highlight_string_formatting') call s:EnableByDefault('g:python_highlight_string_format') @@ -59,6 +54,12 @@ if s:Enabled('g:python_highlight_all') call s:EnableByDefault('g:python_highlight_operators') endif +if s:Enabled('g:python_highlight_builtins') + call s:EnableByDefault('g:python_highlight_builtin_objs') + call s:EnableByDefault('g:python_highlight_builtin_funcs') + call s:EnableByDefault('g:python_highlight_builtin_types') +endif + " " Function calls "