runtime: set 'cpoptions' for line-continuation in various runtime files

Commit: 
https://github.com/vim/vim/commit/fbbaa6ebe92b938f1f9ef008571c330a8d29166a
Author: Eisuke Kawashima <e-k...@users.noreply.github.com>
Date:   Wed Apr 16 18:20:59 2025 +0200

    runtime: set 'cpoptions' for line-continuation in various runtime files
    
    closes: https://github.com/vim/vim/issues/17121
    
    Signed-off-by: Eisuke Kawashima <e-k...@users.noreply.github.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/ftplugin/go.vim b/runtime/ftplugin/go.vim
index 57fc73cd1..f3cae0206 100644
--- a/runtime/ftplugin/go.vim
+++ b/runtime/ftplugin/go.vim
@@ -5,12 +5,16 @@
 " 2024 Jul 16 by Vim Project (add recommended indent style)
 " 2025 Mar 07 by Vim Project (add formatprg and keywordprg option #16804)
 " 2025 Mar 18 by Vim Project (use :term for 'keywordprg' #16911)
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 
 if exists('b:did_ftplugin')
   finish
 endif
 let b:did_ftplugin = 1
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 setlocal formatoptions-=t
 setlocal formatprg=gofmt
 
@@ -45,4 +49,7 @@ if !exists('*' .. expand('<SID>') .. 'GoKeywordPrg')
   endfunc
 endif
 
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
 " vim: sw=2 sts=2 et
diff --git a/runtime/ftplugin/heex.vim b/runtime/ftplugin/heex.vim
index becc071c3..2f53d22ee 100644
--- a/runtime/ftplugin/heex.vim
+++ b/runtime/ftplugin/heex.vim
@@ -2,12 +2,16 @@
 " Language: HEEx
 " Maintainer:  Mitchell Hanberg <vimnos...@mitchellhanberg.com>
 " Last Change: 2022 Sep 21
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 
 if exists("b:did_ftplugin")
   finish
 endif
 let b:did_ftplugin = 1
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 setlocal shiftwidth=2 softtabstop=2 expandtab
 
 setlocal comments=:<%!--
@@ -25,3 +29,6 @@ if exists("loaded_matchit") && !exists("b:match_words")
        \             '<\@<=\([^/!][^   >]*\)[^>]*\%(>\|$\):<\@<=/ >'
   let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words"
 endif
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftplugin/lprolog.vim b/runtime/ftplugin/lprolog.vim
index 1075a9c81..07ffc527c 100644
--- a/runtime/ftplugin/lprolog.vim
+++ b/runtime/ftplugin/lprolog.vim
@@ -2,7 +2,9 @@
 " Language:     LambdaProlog (Teyjus)
 " Maintainer:   Markus Mottl  <markus.mo...@gmail.com>
 " URL:          http://www.ocaml.info/vim/ftplugin/lprolog.vim
-" Last Change:  2023 Aug 28 - added undo_ftplugin (Vim Project)
+" Last Change:  2025 Apr 16
+"               2025 Apr 16 - set 'cpoptions' for line continuation
+"               2023 Aug 28 - added undo_ftplugin (Vim Project)
 "               2006 Feb 05
 "               2001 Sep 16 - fixed 'no_mail_maps'-bug (MM)
 "               2001 Sep 02 - initial release  (MM)
@@ -12,6 +14,9 @@ if exists("b:did_ftplugin")
   finish
 endif
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 " Don't do other file type settings for this buffer
 let b:did_ftplugin = 1
 
@@ -43,3 +48,6 @@ if !exists("no_plugin_maps") && !exists("no_lprolog_maps")
   vnoremap <buffer> <Plug>BUncomOn 
<ESC>:'<,'><CR>`<O<ESC>0i/*<ESC>`>o<ESC>0i*/<ESC>`<
   vnoremap <buffer> <Plug>BUncomOff <ESC>:'<,'><CR>`<dd`>dd`<
 endif
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftplugin/mediawiki.vim b/runtime/ftplugin/mediawiki.vim
index 461824610..399de421e 100644
--- a/runtime/ftplugin/mediawiki.vim
+++ b/runtime/ftplugin/mediawiki.vim
@@ -3,6 +3,7 @@
 " Home: http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim
 " Last Change: 2024 Jul 14
 " Credits: chikamichi
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 "
 
 if exists("b:did_ftplugin")
@@ -10,6 +11,9 @@ if exists("b:did_ftplugin")
 endif
 let b:did_ftplugin = 1
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 " Many MediaWiki wikis prefer line breaks only at the end of paragraphs
 " (like in a text processor), which results in long, wrapping lines.
 setlocal wrap linebreak
@@ -40,3 +44,6 @@ setlocal foldmethod=expr
 
 let b:undo_ftplugin = "setl commentstring< comments< formatoptions< foldexpr< 
foldmethod<"
 let b:undo_ftplugin += " matchpairs< linebreak< wrap< textwidth<"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftplugin/mojo.vim b/runtime/ftplugin/mojo.vim
index ff5022993..c7f3b6b41 100644
--- a/runtime/ftplugin/mojo.vim
+++ b/runtime/ftplugin/mojo.vim
@@ -2,12 +2,16 @@
 " Language:    Mojo
 " Maintainer:  Riley Bruins <ribr...@gmail.com>
 " Last Change: 2024 Jul 07
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 
 if exists('b:did_ftplugin')
   finish
 endif
 let b:did_ftplugin = 1
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 setlocal include=^\s*\(from\\|import\)
 setlocal define=^\s*\(\(async\s\+\)\?def\\|class\)
 
@@ -39,3 +43,6 @@ let b:undo_ftplugin = 'setlocal include<'
       \ . '|setlocal suffixesadd<'
       \ . '|setlocal comments<'
       \ . '|setlocal commentstring<'
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftplugin/nroff.vim b/runtime/ftplugin/nroff.vim
index 7d3d2a597..1c6d4ebc7 100644
--- a/runtime/ftplugin/nroff.vim
+++ b/runtime/ftplugin/nroff.vim
@@ -7,12 +7,16 @@
 " Last Changes:
 "      2024 May 24 by Riley Bruins <ribr...@gmail.com> ('commentstring' #14843)
 "      2025 Feb 12 by Wu, Zhenyu <wuzhe...@ustc.edu> (matchit configuration 
#16619)
+"      2025 Apr 16 by Eisuke Kawashima (cpoptions #17121)
 
 if exists("b:did_ftplugin")
   finish
 endif
 let b:did_ftplugin = 1
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 setlocal commentstring=.\\"\ %s
 setlocal comments=:.\\"
 setlocal sections+=Sh
@@ -30,3 +34,6 @@ if exists('loaded_matchit')
         \ . ',^\.\s*FS\>:^\.\s*FE\>'
   let b:undo_ftplugin .= "| unlet b:match_words"
 endif
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/ftplugin/tera.vim b/runtime/ftplugin/tera.vim
index 65bae7004..ce4134ae0 100644
--- a/runtime/ftplugin/tera.vim
+++ b/runtime/ftplugin/tera.vim
@@ -2,12 +2,16 @@
 " Language:             Tera
 " Maintainer:           Muntasir Mahmud <muntasir.joypur...@gmail.com>
 " Last Change:          2025 Mar 08
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 
 if exists("b:did_ftplugin")
   finish
 endif
 let b:did_ftplugin = 1
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 setlocal autoindent
 
 setlocal commentstring={#\ %s\ #}
@@ -28,3 +32,6 @@ setlocal softtabstop=2
 let b:undo_ftplugin = "setlocal autoindent< commentstring< comments< " ..
       \ "includeexpr< suffixesadd< expandtab< shiftwidth< softtabstop<"
 let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/indent/cucumber.vim b/runtime/indent/cucumber.vim
index 5d144e426..33d4cc731 100644
--- a/runtime/indent/cucumber.vim
+++ b/runtime/indent/cucumber.vim
@@ -2,11 +2,14 @@
 " Language:    Cucumber
 " Maintainer:  Tim Pope <vimnos...@tpope.org>
 " Last Change: 2023 Dec 28
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 
 if exists("b:did_indent")
   finish
 endif
 let b:did_indent = 1
+let s:cpo_save = &cpo
+set cpo&vim
 
 setlocal autoindent
 setlocal indentexpr=GetCucumberIndent()
@@ -95,4 +98,7 @@ function! GetCucumberIndent(...) abort
   return prev.indent < 0 ? 0 : prev.indent
 endfunction
 
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
 " vim:set sts=2 sw=2:
diff --git a/runtime/syntax/asy.vim b/runtime/syntax/asy.vim
index ed2bf712f..de17d925d 100644
--- a/runtime/syntax/asy.vim
+++ b/runtime/syntax/asy.vim
@@ -3,6 +3,7 @@
 " Maintainer:   Avid Seeker <avidseek...@protonmail.com>
 "               Andy Hammerlindl
 " Last Change:  2022 Jan 05
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 
 " Hacked together from Bram Moolenaar's C syntax file, and Claudio Fleiner's
 " Java syntax file.
@@ -11,6 +12,9 @@ if exists("b:current_syntax")
   finish
 endif
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 " useful C/C++/Java keywords
 syn keyword     asyStatement     break return continue unravel
 syn keyword     asyConditional   if else
@@ -241,3 +245,5 @@ hi def link asyTodo                 Todo
 hi def link asyPathSpec             Statement
 
 let b:current_syntax = "asy"
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/jq.vim b/runtime/syntax/jq.vim
index 272dcb4eb..3275e2ef5 100644
--- a/runtime/syntax/jq.vim
+++ b/runtime/syntax/jq.vim
@@ -3,12 +3,16 @@
 " Maintainer:  Vito <vito.b...@gmail.com>
 " Last Change: 2024 Apr 17
 " Upstream: https://github.com/vito-c/jq.vim
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 "
 " Quit when a (custom) syntax file was already loaded
 if exists('b:current_syntax')
   finish
 endif
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 " syn include @jqHtml syntax/html.vim  " Doc comment HTML
 
 " jqTodo
@@ -128,3 +132,6 @@ hi def link jqString                 String
 hi def link jqInterpolationDelimiter Delimiter
 hi def link jqConditional            Conditional
 hi def link jqNumber                 Number
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/modula2.vim b/runtime/syntax/modula2.vim
index 6a9f4af6a..3c1346e9f 100644
--- a/runtime/syntax/modula2.vim
+++ b/runtime/syntax/modula2.vim
@@ -3,14 +3,21 @@
 " Maintainer:          Doug Kearns <dougkea...@gmail.com>
 " Previous Maintainer: p...@artcom0.north.de (Peter Funk)
 " Last Change:         2024 Jan 04
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 
 if exists("b:current_syntax")
   finish
 endif
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 let dialect = modula2#GetDialect()
 exe "runtime! syntax/modula2/opt/" .. dialect .. ".vim"
 
 let b:current_syntax = "modula2"
 
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
 " vim: nowrap sw=2 sts=2 ts=8 noet:
diff --git a/runtime/syntax/pacmanlog.vim b/runtime/syntax/pacmanlog.vim
index 98abd5868..798b48f72 100644
--- a/runtime/syntax/pacmanlog.vim
+++ b/runtime/syntax/pacmanlog.vim
@@ -2,11 +2,15 @@
 " Language: pacman.log
 " Maintainer: Ronan Pigott <ro...@rjp.ie>
 " Last Change: 2023 Dec 04
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 
 if exists("b:current_syntax")
   finish
 endif
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 syn sync maxlines=1
 syn region pacmanlogMsg start='\S' end='$' keepend 
contains=pacmanlogTransaction,pacmanlogALPMMsg
 syn region pacmanlogTag start='\['hs=s+1 end='\]'he=e-1 keepend 
nextgroup=pacmanlogMsg
@@ -39,3 +43,6 @@ hi def link pacmanlogPackageName    Normal
 hi def link pacmanlogPackageVersion Comment
 
 let b:current_syntax = "pacmanlog"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/rasi.vim b/runtime/syntax/rasi.vim
index 40c3393fc..c4c4508f1 100644
--- a/runtime/syntax/rasi.vim
+++ b/runtime/syntax/rasi.vim
@@ -2,6 +2,7 @@
 " Language:    rasi (Rofi Advanced Style Information)
 " Maintainer:  Pierrick Guillaume  <piergu...@gmail.com>
 " Last Change: 2024 May 21
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 "
 " Syntax support for rasi config file
 
@@ -12,6 +13,8 @@ if exists('b:current_syntax')
   finish
 endif
 let b:current_syntax = 'rasi'
+let s:cpo_save = &cpo
+set cpo&vim
 
 " String {{{
 syn region rasiString    start=+"+ skip=+\"+ end=+"+ oneline contained
@@ -295,4 +298,7 @@ hi def link rasiInvPropertyId   rasiError
 hi def link rasiInvPropertyVal  rasiError
 " }}}
 
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
 " vim:ts=8
diff --git a/runtime/syntax/tutor.vim b/runtime/syntax/tutor.vim
index 83ca547fd..7d0cd31c1 100644
--- a/runtime/syntax/tutor.vim
+++ b/runtime/syntax/tutor.vim
@@ -1,7 +1,14 @@
+" Language:    Vim Tutor
+" Maintainer:  Vim Project
+" Last Change: 2025 Apr 16
+
 if exists("b:current_syntax")
     finish
 endif
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 syn include @VIM syntax/vim.vim
 unlet b:current_syntax
 syn include @TUTORSHELL syntax/sh.vim
@@ -75,3 +82,5 @@ hi def link tutorInlineX tutorX
 hi def link tutorShellPrompt Delimiter
 
 let b:current_syntax = "tutor"
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/syntax/typst.vim b/runtime/syntax/typst.vim
index b1f05ec85..686f7c3f3 100644
--- a/runtime/syntax/typst.vim
+++ b/runtime/syntax/typst.vim
@@ -1,14 +1,18 @@
 " Vim syntax file
 " Language:    Typst
-" Previous Maintainer:  Gregory Anders
 " Maintainer:  Luca Saccarola <github.e4...@aleeas.com>
+" Previous Maintainer:  Gregory Anders
+" Based On:    https://github.com/kaarmu/typst.vim
 " Last Change: 2024 Dec 09
-" Based on:    https://github.com/kaarmu/typst.vim
+" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
 
 if exists('b:current_syntax')
     finish
 endif
 
+let s:cpo_save = &cpo
+set cpo&vim
+
 syntax sync fromstart
 syntax spell toplevel
 
@@ -470,4 +474,7 @@ highlight default typstMarkupBoldItalic                 
term=bold,italic
 
 let b:current_syntax = 'typst'
 
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
 " }}}1

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1u55eF-006nSq-6R%40256bit.org.

Raspunde prin e-mail lui