From 07c37f66459d583e347c1ad54357e778b477434e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 29 Jun 2026 07:31:28 +0800 Subject: 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 Co-Authored-By: Claude Opus 4.8 (1M context) --- runtime/ftplugin/python.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/ftplugin/python.vim') 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 -- cgit