vim-patch:40daa13: runtime(gleam): Update ftplugin, use recommended_style config variable

Wrap the setting of basic whitespace formatting options in a conditional
block, following the de facto standard.

Setting 'et', 'sts' and 'sw' can be disabled by setting
"gleam_recommended_style" to false.

Follow up to PR vim/vim#17086.

closes: vim/vim#17128

40daa1358c

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
Christian Clason
2025-04-16 20:04:34 +02:00
committed by Christian Clason
parent 95a255a548
commit 5aa35691ab
2 changed files with 19 additions and 5 deletions

View File

@@ -625,6 +625,16 @@ possibilities: >
The `:Cycle` command is also mapped to the CTRL-A and CTRL-X keys.
For details, see `git-rebase --help`.
GLEAM *ft-gleam-plugin*
By default the following options are set for the recommended gleam style: >
setlocal expandtab shiftwidth=2 softtabstop=2
To disable this behavior, set the following variable in your vimrc: >
let g:gleam_recommended_style = 0
GO *ft-go-plugin*
By default the following options are set, based on Golang official docs: >

View File

@@ -2,7 +2,7 @@
" Language: Gleam
" Maintainer: Kirill Morozov <kirill@robotix.pro>
" Previous Maintainer: Trilowy (https://github.com/trilowy)
" Last Change: 2025-04-12
" Last Change: 2025 Apr 16
if exists('b:did_ftplugin')
finish
@@ -11,11 +11,15 @@ let b:did_ftplugin = 1
setlocal comments=://,:///,:////
setlocal commentstring=//\ %s
setlocal expandtab
setlocal formatprg=gleam\ format\ --stdin
setlocal shiftwidth=2
setlocal softtabstop=2
let b:undo_ftplugin = "setlocal com< cms< fp< et< sw< sts<"
let b:undo_ftplugin = "setlocal com< cms< fp<"
if get(g:, "gleam_recommended_style", 1)
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2
let b:undo_ftplugin ..= " | setlocal et< sw< sts<"
endif
" vim: sw=2 sts=2 et