Skip to content

Commit

Permalink
Merge remote-tracking branch 'vim/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ychin committed Sep 11, 2024
2 parents f9ccb28 + d657d3d commit 5f7e2bb
Show file tree
Hide file tree
Showing 33 changed files with 684 additions and 311 deletions.
2 changes: 2 additions & 0 deletions .github/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ runtime/compiler/gawk.vim @dkearns
runtime/compiler/gjs.vim @dkearns
runtime/compiler/gm2.vim @dkearns
runtime/compiler/go.vim @dbarnett
runtime/compiler/groff.vim @Konfekt
runtime/compiler/haml.vim @tpope
runtime/compiler/hare.vim @selenebun
runtime/compiler/icon.vim @dkearns
Expand All @@ -75,6 +76,7 @@ runtime/compiler/jshint.vim @dkearns
runtime/compiler/jsonlint.vim @dkearns
runtime/compiler/jq.vim @vito-c
runtime/compiler/lazbuild.vim @dkearns
runtime/compiler/pandoc.vim @Konfekt
runtime/compiler/perl.vim @petdance @heptite
runtime/compiler/perlcritic.vim @petdance @dkearns
runtime/compiler/php.vim @dkearns
Expand Down
2 changes: 2 additions & 0 deletions runtime/compiler/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ They are used with the ":compiler" command.
These scripts usually set options, for example 'errorformat'.
See ":help write-compiler-plugin".

To undo the effect of a compiler plugin, use the make compiler plugin.

If you want to write your own compiler plugin, have a look at the other files
for how to do it, the format is simple.

Expand Down
45 changes: 45 additions & 0 deletions runtime/compiler/groff.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
" Vim compiler file
" Compiler: Groff
" Maintainer: Konfekt
" Last Change: 2024 Sep 8
"
" Expects output file extension, say `:make html` or `:make pdf`.
" Supported devices as of Sept 2024 are: (x)html, pdf, ps, dvi, lj4, lbp ...
" Adjust command-line flags, language, encoding by buffer-local/global variables
" groff_compiler_args, groff_compiler_lang, and groff_compiler_encoding,
" which default to '', &spelllang and 'utf8'.

if exists("current_compiler")
finish
endif

let s:keepcpo = &cpo
set cpo&vim

let current_compiler = 'groff'

silent! function s:groff_compiler_lang()
let lang = get(b:, 'groff_compiler_lang',
\ &spell ? matchstr(&spelllang, '^\a\a') : '')
if lang ==# 'en' | let lang = '' | endif
return empty(lang) ? '' : '-m'..lang
endfunction

" Requires output format (= device) to be set by user after :make.
execute 'CompilerSet makeprg=groff'..escape(
\ ' '..s:groff_compiler_lang()..
\ ' -K'..get(b:, 'groff_compiler_encoding', get(g:, 'groff_compiler_encoding', 'utf8'))..
\ ' '..get(b:, 'groff_compiler_args', get(g:, 'groff_compiler_args', ''))..
\ ' -mom -T$* -- %:S > %:r:S.$*', ' ')
" From Gavin Freeborn's https://github.com/Gavinok/vim-troff under Vim License
" https://github.com/Gavinok/vim-troff/blob/91017b1423caa80aba541c997909a4f810edd275/compiler/troff.vim#L39
CompilerSet errorformat=%o:<standard\ input>\ (%f):%l:%m,
\%o:\ <standard\ input>\ (%f):%l:%m,
\%o:%f:%l:%m,
\%o:\ %f:%l:%m,
\%f:%l:\ macro\ %trror:%m,
\%f:%l:%m,
\%W%tarning:\ file\ '%f'\\,\ around\ line\ %l:,%Z%m

let &cpo = s:keepcpo
unlet s:keepcpo
13 changes: 13 additions & 0 deletions runtime/compiler/make.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
" Vim compiler plugin
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2024 Sep 10
" Original Author: Konfekt
"
" This compiler plugin is used to reset previously set compiler options.

if exists("g:current_compiler") | unlet g:current_compiler | endif
if exists("b:current_compiler") | unlet b:current_compiler | endif

CompilerSet makeprg&
CompilerSet errorformat&
27 changes: 16 additions & 11 deletions runtime/compiler/pandoc.vim
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
" Vim compiler file
" Compiler: Pandoc
" Maintainer: Konfekt
" Last Change: 2024 Aug 20
" Last Change: 2024 Sep 8
"
" Expects output file extension, say `:make html` or `:make pdf`.
" Passes additional arguments to pandoc, say `:make html --self-contained`.
" Adjust command-line flags by buffer-local/global variable
" b/g:pandoc_compiler_args which defaults to empty.

if exists("current_compiler")
finish
Expand Down Expand Up @@ -40,18 +42,21 @@ silent! function s:PandocFiletype(filetype) abort
endif
endfunction

let b:pandoc_compiler_from = get(b:, 'pandoc_compiler_from', s:PandocFiletype(&filetype))
let b:pandoc_compiler_lang = get(b:, 'pandoc_compiler_lang', &spell ? matchstr(&spelllang, '^\a\a') : '')
silent! function s:PandocLang()
let lang = get(b:, 'pandoc_compiler_lang',
\ &spell ? matchstr(&spelllang, '^\a\a') : '')
if lang ==# 'en' | let lang = '' | endif
return empty(lang) ? '' : '--metadata lang='..lang
endfunction

execute 'CompilerSet makeprg=pandoc'..escape(
\ ' --standalone' .
\ (b:pandoc_compiler_from ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s+\S+', 'cnw') > 0)) ?
\ '' : ' --metadata title=%:t:r:S') .
\ (empty(b:pandoc_compiler_lang) ?
\ '' : ' --metadata lang='..b:pandoc_compiler_lang) .
\ ' --from='..b:pandoc_compiler_from .
\ ' '..get(b:, 'pandoc_compiler_args', get(g:, 'pandoc_compiler_args', '')) .
\ ' --output %:r:S.$* -- %:S', ' ')
\ ' --standalone'..
\ (s:PandocFiletype(&filetype) ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s+\S+', 'cnw') > 0)) ?
\ '' : ' --metadata title=%:t:r:S')..
\ ' '..s:PandocLang()..
\ ' --from='..s:PandocFiletype(&filetype)..
\ ' '..get(b:, 'pandoc_compiler_args', get(g:, 'pandoc_compiler_args', ''))..
\ ' --output %:r:S.$* -- %:S', ' ')
CompilerSet errorformat=\"%f\",\ line\ %l:\ %m

let &cpo = s:keepcpo
Expand Down
5 changes: 4 additions & 1 deletion runtime/doc/builtin.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2024 Aug 08
*builtin.txt* For Vim version 9.1. Last change: 2024 Sep 10


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -8965,6 +8965,9 @@ search({pattern} [, {flags} [, {stopline} [, {timeout} [, {skip}]]]])
{timeout} is 500 the search stops after half a second.
The value must not be negative. A zero value is like not
giving the argument.

Note: the timeout is only considered when searching, not
while evaluating the {skip} expression.
{only available when compiled with the |+reltime| feature}

If the {skip} expression is given it is evaluated with the
Expand Down
7 changes: 2 additions & 5 deletions runtime/doc/options.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*options.txt* For Vim version 9.1. Last change: 2024 Sep 07
*options.txt* For Vim version 9.1. Last change: 2024 Sep 10


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -2163,10 +2163,7 @@ A jump table for the options with a short description can be found at |Q_op|.
fuzzy Enable |fuzzy-matching| for completion candidates. This
allows for more flexible and intuitive matching, where
characters can be skipped and matches can be found even
if the exact sequence is not typed. Only makes a
difference how completion candidates are reduced from the
list of alternatives, but not how the candidates are
collected (using different completion types).
if the exact sequence is not typed.

*'completepopup'* *'cpp'*
'completepopup' 'cpp' string (default empty)
Expand Down
26 changes: 21 additions & 5 deletions runtime/doc/quickfix.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 9.1. Last change: 2024 Aug 20
*quickfix.txt* For Vim version 9.1. Last change: 2024 Sep 10


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1276,6 +1276,7 @@ not "b:current_compiler". What the command actually does is the following:

For writing a compiler plugin, see |write-compiler-plugin|.

Use the |compiler-make| plugin to undo the effect of a compiler plugin.

DOTNET *compiler-dotnet*

Expand All @@ -1291,7 +1292,6 @@ Example: limit output to only display errors, and suppress the project name: >
let dotnet_show_project_file = v:false
compiler dotnet
<

GCC *quickfix-gcc* *compiler-gcc*

There's one variable you can set for the GCC compiler:
Expand All @@ -1302,14 +1302,19 @@ g:compiler_gcc_ignore_unmatched_lines
commands run from make are generating false
positives.


JAVAC *compiler-javac*

Commonly used compiler options can be added to 'makeprg' by setting the
g:javac_makeprg_params variable. For example: >
let g:javac_makeprg_params = "-Xlint:all -encoding utf-8"
<
GNU MAKE *compiler-make*

Since the default make program is "make", the compiler plugin for make,
:compiler make, will reset the 'makeprg' and 'errorformat' option to
the default values and unlet any variables that may have been set by a
previous compiler plugin.

MANX AZTEC C *quickfix-manx* *compiler-manx*

Expand All @@ -1335,6 +1340,18 @@ If Vim was started from the compiler, the :sh and some :! commands will not
work, because Vim is then running in the same process as the compiler and
stdin (standard input) will not be interactive.

GROFF *quickfix-groff* *compiler-groff*

The GROFF compiler plugin uses the mom macro set (documented in the groff_mom
manpage) as input and expects that the output file type extension is passed to
make, say :make html or :make pdf.

Additional arguments can be passed to groff by setting them in
`b:groff_compiler_args` or `g:groff_compiler_args`. The `language` argument
passed to groff is set using 'spelllang'; it can be overridden by setting
`b:groff_compiler_lang`. The default enconding is `UTF-8` and can be changed
by setting `b:groff_compiler_encoding` or `g:groff_compiler_encoding`.

PANDOC *quickfix-pandoc* *compiler-pandoc*

The Pandoc compiler plugin expects that an output file type extension is
Expand All @@ -1347,8 +1364,7 @@ Additional arguments can be passed to pandoc:

The `--from` argument is an educated guess using the buffer file type;
it can be overridden by setting `b:pandoc_compiler_from`.
Likewise the `--metadata lang` argument is set using `&spelllang`;
it can be overridden by setting `b:pandoc_compiler_lang`.
The `--metadata lang` argument is set using 'spelllang';
If `--from=markdown` is assumed and no title set in a title header or
YAML block, then the filename (without extension) is used as the title.

Expand Down
3 changes: 3 additions & 0 deletions runtime/doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -6644,8 +6644,10 @@ compiler-decada ft_ada.txt /*compiler-decada*
compiler-dotnet quickfix.txt /*compiler-dotnet*
compiler-gcc quickfix.txt /*compiler-gcc*
compiler-gnat ft_ada.txt /*compiler-gnat*
compiler-groff quickfix.txt /*compiler-groff*
compiler-hpada ft_ada.txt /*compiler-hpada*
compiler-javac quickfix.txt /*compiler-javac*
compiler-make quickfix.txt /*compiler-make*
compiler-manx quickfix.txt /*compiler-manx*
compiler-pandoc quickfix.txt /*compiler-pandoc*
compiler-perl quickfix.txt /*compiler-perl*
Expand Down Expand Up @@ -9806,6 +9808,7 @@ quickfix-directory-stack quickfix.txt /*quickfix-directory-stack*
quickfix-error-lists quickfix.txt /*quickfix-error-lists*
quickfix-functions usr_41.txt /*quickfix-functions*
quickfix-gcc quickfix.txt /*quickfix-gcc*
quickfix-groff quickfix.txt /*quickfix-groff*
quickfix-index quickfix.txt /*quickfix-index*
quickfix-manx quickfix.txt /*quickfix-manx*
quickfix-pandoc quickfix.txt /*quickfix-pandoc*
Expand Down
2 changes: 1 addition & 1 deletion runtime/filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,7 @@ au BufNewFile,BufRead *.sml setf sml
au BufNewFile,BufRead *.cm setf voscm

" Swift
au BufNewFile,BufRead *.swift setf swift
au BufNewFile,BufRead *.swift,*.swiftinterface setf swift
au BufNewFile,BufRead *.swift.gyb setf swiftgyb

" Swift Intermediate Language or SILE
Expand Down
14 changes: 12 additions & 2 deletions runtime/ftplugin/spec.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
" Filename: spec.vim
" Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com
" Former Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> (until March 2014)
" Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko
" Update by Zdenek Dohnal, 2022 May 17
" Last Change: 2015 Jun 01
" Update by Zdenek Dohnal, 2022 May 17
" 2024 Sep 10 by Vim Project: add epoch support for spec changelog, #15537

if exists("b:did_ftplugin")
finish
Expand Down Expand Up @@ -66,9 +67,11 @@ if !exists("*s:SpecChangelog")
endif
let line = 0
let name = ""
let epoch = ""
let ver = ""
let rel = ""
let nameline = -1
let epochline = -1
let verline = -1
let relline = -1
let chgline = -1
Expand All @@ -77,6 +80,9 @@ if !exists("*s:SpecChangelog")
if name == "" && linestr =~? '^Name:'
let nameline = line
let name = substitute(strpart(linestr,5), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
elseif epoch == "" && linestr =~? '^Epoch:'
let epochline = line
let epoch = substitute(strpart(linestr,6), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
elseif ver == "" && linestr =~? '^Version:'
let verline = line
let ver = substitute(strpart(linestr,8), '^[ ]*\([^ ]\+\)[ ]*$','\1','')
Expand All @@ -93,6 +99,7 @@ if !exists("*s:SpecChangelog")
if nameline != -1 && verline != -1 && relline != -1
let include_release_info = exists("g:spec_chglog_release_info")
let name = s:ParseRpmVars(name, nameline)
let epoch = s:ParseRpmVars(epoch, epochline)
let ver = s:ParseRpmVars(ver, verline)
let rel = s:ParseRpmVars(rel, relline)
else
Expand All @@ -117,6 +124,9 @@ if !exists("*s:SpecChangelog")
if chgline != -1
let tmptime = v:lc_time
language time C
if strlen(epoch)
let ver = epoch.":".ver
endif
let parsed_format = "* ".strftime(format)." - ".ver."-".rel
execute "language time" tmptime
let release_info = "+ ".name."-".ver."-".rel
Expand Down
6 changes: 3 additions & 3 deletions runtime/syntax/dosini.vim
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
" Vim syntax file
" Language: Configuration File (ini file) for MSDOS/MS Windows
" Version: 2.3
" Version: 2.4
" Original Author: Sean M. McKee <mckee@misslink.net>
" Previous Maintainer: Nima Talebi <nima@it.net.au>
" Current Maintainer: Hong Xu <hong@topbug.net>
" Homepage: http://www.vim.org/scripts/script.php?script_id=3747
" Repository: https://github.com/xuhdev/syntax-dosini.vim
" Last Change: 2023 Aug 20
" Last Change: 2024 Sept 08


" quit when a syntax file was already loaded
Expand All @@ -27,7 +27,7 @@ syn match dosiniNumber "=\zs\s*\d\+\s*$"
syn match dosiniNumber "=\zs\s*\d*\.\d\+\s*$"
syn match dosiniNumber "=\zs\s*\d\+e[+-]\=\d\+\s*$"
syn region dosiniHeader start="^\s*\[" end="\]"
syn match dosiniComment "^[#;].*$"
syn match dosiniComment "^[#;].*$" contains=@Spell
syn region dosiniSection start="\s*\[.*\]" end="\ze\s*\[.*\]" fold
\ contains=dosiniLabel,dosiniValue,dosiniNumber,dosiniHeader,dosiniComment

Expand Down
13 changes: 7 additions & 6 deletions runtime/syntax/idlang.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
" Interactive Data Language syntax file (IDL, too [:-)]
" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
" Last change: 2011 Apr 11
" Created by: Hermann Rochholz <Hermann.Rochholz AT gmx.de>
" Created By: Hermann Rochholz <Hermann.Rochholz AT gmx.de>
" Last Change: 2011 Apr 11
" 2024 Sep 10 by Vim Project: update syntax script, #15419

" Remove any old syntax stuff hanging around
" quit when a syntax file was already loaded
Expand All @@ -16,7 +17,7 @@ syn match idlangStatement "^\s*function\s"
syn keyword idlangStatement return continue mod do break
syn keyword idlangStatement compile_opt forward_function goto
syn keyword idlangStatement begin common end of
syn keyword idlangStatement inherits on_ioerror begin
syn keyword idlangStatement inherits on_error on_ioerror begin

syn keyword idlangConditional if else then for while case switch
syn keyword idlangConditional endcase endelse endfor endswitch
Expand Down Expand Up @@ -82,7 +83,7 @@ syn keyword idlangRoutine CALL_EXTERNAL CALL_FUNCTION CALL_METHOD
syn keyword idlangRoutine CALL_PROCEDURE CATCH CD CEIL CHEBYSHEV CHECK_MATH
syn keyword idlangRoutine CHISQR_CVF CHISQR_PDF CHOLDC CHOLSOL CINDGEN
syn keyword idlangRoutine CIR_3PNT CLOSE CLUST_WTS CLUSTER COLOR_CONVERT
syn keyword idlangRoutine COLOR_QUAN COLORMAP_APPLICABLE COMFIT COMMON
syn keyword idlangRoutine COLOR_QUAN COLORMAP_APPLICABLE COMFIT
syn keyword idlangRoutine COMPLEX COMPLEXARR COMPLEXROUND
syn keyword idlangRoutine COMPUTE_MESH_NORMALS COND CONGRID CONJ
syn keyword idlangRoutine CONSTRAINED_MIN CONTOUR CONVERT_COORD CONVOL
Expand All @@ -98,7 +99,7 @@ syn keyword idlangRoutine CW_PALETTE_EDITOR_GET CW_PALETTE_EDITOR_SET
syn keyword idlangRoutine CW_PDMENU CW_RGBSLIDER CW_TMPL CW_ZOOM DBLARR
syn keyword idlangRoutine DCINDGEN DCOMPLEX DCOMPLEXARR DEFINE_KEY DEFROI
syn keyword idlangRoutine DEFSYSV DELETE_SYMBOL DELLOG DELVAR DERIV DERIVSIG
syn keyword idlangRoutine DETERM DEVICE DFPMIN DIALOG_MESSAGE
syn keyword idlangRoutine DETERM DEVICE DFPMIN DIAG_MATRIX DIALOG_MESSAGE
syn keyword idlangRoutine DIALOG_PICKFILE DIALOG_PRINTERSETUP
syn keyword idlangRoutine DIALOG_PRINTJOB DIALOG_READ_IMAGE
syn keyword idlangRoutine DIALOG_WRITE_IMAGE DIGITAL_FILTER DILATE DINDGEN
Expand Down Expand Up @@ -155,7 +156,7 @@ syn keyword idlangRoutine MPEG_PUT MPEG_SAVE MSG_CAT_CLOSE MSG_CAT_COMPILE
syn keyword idlangRoutine MSG_CAT_OPEN MULTI N_ELEMENTS N_PARAMS N_TAGS
syn keyword idlangRoutine NEWTON NORM OBJ_CLASS OBJ_DESTROY OBJ_ISA OBJ_NEW
syn keyword idlangRoutine OBJ_VALID OBJARR ON_ERROR ON_IOERROR ONLINE_HELP
syn keyword idlangRoutine OPEN OPENR OPENW OPLOT OPLOTERR P_CORRELATE
syn keyword idlangRoutine OPEN OPENR OPENW OPENU OPLOT OPLOTERR P_CORRELATE
syn keyword idlangRoutine PARTICLE_TRACE PCOMP PLOT PLOT_3DBOX PLOT_FIELD
syn keyword idlangRoutine PLOTERR PLOTS PNT_LINE POINT_LUN POLAR_CONTOUR
syn keyword idlangRoutine POLAR_SURFACE POLY POLY_2D POLY_AREA POLY_FIT
Expand Down
Loading

0 comments on commit 5f7e2bb

Please sign in to comment.