diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-06-29 07:31:28 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2026-06-29 08:47:54 +0800 |
| commit | 07c37f66459d583e347c1ad54357e778b477434e (patch) | |
| tree | 0332033492f98bde839702fb4de1f5a1f91272c7 /runtime/ftplugin/python.vim | |
| parent | 0c828415dd5ad27b2c75eaa5050eff85db78f54d (diff) | |
| download | rneovim-07c37f66459d583e347c1ad54357e778b477434e.tar.gz rneovim-07c37f66459d583e347c1ad54357e778b477434e.tar.bz2 rneovim-07c37f66459d583e347c1ad54357e778b477434e.zip | |
vim-patch:1f33732: runtime: guard recommended style settings consistently
Normalize the 15 existing guards to the documented two-level form
get(g:, 'X_recommended_style', get(g:, 'filetype_recommended_style', 1)):
fix the two non-standard "!exists() || != 0" guards (python, arduino) and
tolk's wrong fallback variable, and convert the simple one-level guards.
Add the guard to filetype plugins that set stylistic indentation/format
options without one: aap, abap, ada, cabal, cobol, elixir, falcon,
graphql, heex, idris2, mermaid, occam, racket, scala, swift, tera.
Settings that are required rather than stylistic are left untouched, e.g.
make/gomod/scdoc (mandatory tabs), chatito and vroom (indent mandated by
the format), and the textwidth/formatoptions cases in gitcommit/help/
jjdescription.
Supported by AI.
fixes: vim/vim#20036
closes: vim/vim#20650
https://github.com/vim/vim/commit/1f33732613304958c935f302d8cb44bddc7f672f
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'runtime/ftplugin/python.vim')
| -rw-r--r-- | runtime/ftplugin/python.vim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim index 6f20468896..50d86537d9 100644 --- a/runtime/ftplugin/python.vim +++ b/runtime/ftplugin/python.vim @@ -6,6 +6,7 @@ " Repository: https://github.com/tpict/vim-ftplugin-python " Last Change: 2024/05/13 " 2024 Nov 30 use pytest compiler (#16130) +" 2026 Jun 27 by Vim Project (normalize recommended style guard) if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -119,7 +120,8 @@ if has("browsefilter") && !exists("b:browsefilter") endif endif -if !exists("g:python_recommended_style") || g:python_recommended_style != 0 +if get(g:, 'python_recommended_style', + \ get(g:, 'filetype_recommended_style', 1)) " As suggested by PEP8. setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4 endif |