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

1f33732613

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
zeertzjq
2026-06-29 07:31:28 +08:00
parent 0c828415dd
commit 07c37f6645
31 changed files with 144 additions and 50 deletions

View File

@@ -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