From a2baa73d1d33014adea0fd9567949089ca21a782 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 4 Feb 2022 16:09:54 +0000 Subject: Update runtime files. --- runtime/autoload/dist/ft.vim | 738 ++- runtime/doc/builtin.txt | 23 +- runtime/doc/change.txt | 6 +- runtime/doc/cmdline.txt | 4 +- runtime/doc/editing.txt | 10 +- runtime/doc/eval.txt | 31 +- runtime/doc/filetype.txt | 3 +- runtime/doc/options.txt | 8 +- runtime/doc/pattern.txt | 4 +- runtime/doc/starting.txt | 2 +- runtime/doc/syntax.txt | 13 +- runtime/doc/tabpage.txt | 6 +- runtime/doc/tags | 101 +- runtime/doc/testing.txt | 46 +- runtime/doc/todo.txt | 14 +- runtime/doc/various.txt | 10 +- runtime/doc/version8.txt | 4 +- runtime/doc/vim9.txt | 144 +- runtime/doc/windows.txt | 4 +- runtime/gvim.desktop | 5 +- runtime/syntax/vim.vim | 16 +- runtime/vim.desktop | 5 +- src/po/ga.po | 12650 +++++++++++++++++++++++++---------------- src/po/gvim.desktop.in | 1 - src/po/it.po | 114 +- src/po/vim.desktop.in | 1 - 26 files changed, 8348 insertions(+), 5615 deletions(-) diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 5d8734a625..1b321159d0 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -1,89 +1,83 @@ -" Vim functions for file type detection -" -" Maintainer: Bram Moolenaar -" Last Change: 2022 Jan 31 +vim9script -" These functions are moved here from runtime/filetype.vim to make startup -" faster. +# Vim functions for file type detection +# +# Maintainer: Bram Moolenaar +# Last Change: 2022 Feb 04 -" Line continuation is used here, remove 'C' from 'cpoptions' -let s:cpo_save = &cpo -set cpo&vim +# These functions are moved here from runtime/filetype.vim to make startup +# faster. -func dist#ft#Check_inp() +export def Check_inp() if getline(1) =~ '^\*' setf abaqus else - let n = 1 - if line("$") > 500 - let nmax = 500 - else - let nmax = line("$") - endif + var n = 1 + var nmax = line("$") > 500 ? 500 : line("$") while n <= nmax if getline(n) =~? "^header surface data" setf trasys break endif - let n = n + 1 + n += 1 endwhile endif -endfunc +enddef -" This function checks for the kind of assembly that is wanted by the user, or -" can be detected from the first five lines of the file. -func dist#ft#FTasm() - " make sure b:asmsyntax exists +# This function checks for the kind of assembly that is wanted by the user, or +# can be detected from the first five lines of the file. +export def FTasm() + # make sure b:asmsyntax exists if !exists("b:asmsyntax") - let b:asmsyntax = "" + b:asmsyntax = "" endif if b:asmsyntax == "" - call dist#ft#FTasmsyntax() + FTasmsyntax() endif - " if b:asmsyntax still isn't set, default to asmsyntax or GNU + # if b:asmsyntax still isn't set, default to asmsyntax or GNU if b:asmsyntax == "" if exists("g:asmsyntax") - let b:asmsyntax = g:asmsyntax + b:asmsyntax = g:asmsyntax else - let b:asmsyntax = "asm" + b:asmsyntax = "asm" endif endif - exe "setf " . fnameescape(b:asmsyntax) -endfunc + exe "setf " .. fnameescape(b:asmsyntax) +enddef -func dist#ft#FTasmsyntax() - " see if file contains any asmsyntax=foo overrides. If so, change - " b:asmsyntax appropriately - let head = " ".getline(1)." ".getline(2)." ".getline(3)." ".getline(4). - \" ".getline(5)." " - let match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s') +export def FTasmsyntax() + # see if the file contains any asmsyntax=foo overrides. If so, change + # b:asmsyntax appropriately + var head = " " .. getline(1) .. " " .. getline(2) .. " " + .. getline(3) .. " " .. getline(4) .. " " .. getline(5) .. " " + var match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s') if match != '' - let b:asmsyntax = match + b:asmsyntax = match elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library')) - let b:asmsyntax = "vmasm" + b:asmsyntax = "vmasm" endif -endfunc +enddef -let s:ft_visual_basic_content = '\cVB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)' +var ft_visual_basic_content = '\cVB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)' -" See FTfrm() for Visual Basic form file detection -func dist#ft#FTbas() +# See FTfrm() for Visual Basic form file detection +export def FTbas() if exists("g:filetype_bas") - exe "setf " . g:filetype_bas + exe "setf " .. g:filetype_bas return endif - " most frequent FreeBASIC-specific keywords in distro files - let fb_keywords = '\c^\s*\%(extern\|var\|enum\|private\|scope\|union\|byref\|operator\|constructor\|delete\|namespace\|public\|property\|with\|destructor\|using\)\>\%(\s*[:=(]\)\@!' - let fb_preproc = '\c^\s*\%(#\a\+\|option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\)' - let fb_comment = "^\\s*/'" - " OPTION EXPLICIT, without the leading underscore, is common to many dialects - let qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)' + # most frequent FreeBASIC-specific keywords in distro files + var fb_keywords = '\c^\s*\%(extern\|var\|enum\|private\|scope\|union\|byref\|operator\|constructor\|delete\|namespace\|public\|property\|with\|destructor\|using\)\>\%(\s*[:=(]\)\@!' + var fb_preproc = '\c^\s*\%(#\a\+\|option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\)' + var fb_comment = "^\\s*/'" + # OPTION EXPLICIT, without the leading underscore, is common to many dialects + var qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)' - let lines = getline(1, min([line("$"), 100])) + var lines = getline(1, min([line("$"), 100])) if match(lines, fb_preproc) > -1 || match(lines, fb_comment) > -1 || match(lines, fb_keywords) > -1 setf freebasic @@ -94,39 +88,40 @@ func dist#ft#FTbas() else setf basic endif -endfunc +enddef -func dist#ft#FTbtm() +export def FTbtm() if exists("g:dosbatch_syntax_for_btm") && g:dosbatch_syntax_for_btm setf dosbatch else setf btm endif -endfunc +enddef -func dist#ft#BindzoneCheck(default) - if getline(1).getline(2).getline(3).getline(4) =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA' +export def BindzoneCheck(default = '') + if getline(1) .. getline(2) .. getline(3) .. getline(4) + =~ '^; <<>> DiG [0-9.]\+.* <<>>\|$ORIGIN\|$TTL\|IN\s\+SOA' setf bindzone - elseif a:default != '' - exe 'setf ' . a:default + elseif default != '' + exe 'setf ' .. default endif -endfunc +enddef -func dist#ft#FTlpc() +export def FTlpc() if exists("g:lpc_syntax_for_c") - let lnum = 1 + var lnum = 1 while lnum <= 12 if getline(lnum) =~# '^\(//\|inherit\|private\|protected\|nosave\|string\|object\|mapping\|mixed\)' setf lpc return endif - let lnum = lnum + 1 + lnum += 1 endwhile endif setf c -endfunc +enddef -func dist#ft#FTheader() +export def FTheader() if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 if exists("g:c_syntax_for_h") setf objc @@ -140,15 +135,15 @@ func dist#ft#FTheader() else setf cpp endif -endfunc +enddef -" This function checks if one of the first ten lines start with a '@'. In -" that case it is probably a change file. -" If the first line starts with # or ! it's probably a ch file. -" If a line has "main", "include", "//" or "/*" it's probably ch. -" Otherwise CHILL is assumed. -func dist#ft#FTchange() - let lnum = 1 +# This function checks if one of the first ten lines start with a '@'. In +# that case it is probably a change file. +# If the first line starts with # or ! it's probably a ch file. +# If a line has "main", "include", "//" or "/*" it's probably ch. +# Otherwise CHILL is assumed. +export def FTchange() + var lnum = 1 while lnum <= 10 if getline(lnum)[0] == '@' setf change @@ -166,101 +161,101 @@ func dist#ft#FTchange() setf ch return endif - let lnum = lnum + 1 + lnum += 1 endwhile setf chill -endfunc +enddef -func dist#ft#FTent() - " This function checks for valid cl syntax in the first five lines. - " Look for either an opening comment, '#', or a block start, '{". - " If not found, assume SGML. - let lnum = 1 +export def FTent() + # This function checks for valid cl syntax in the first five lines. + # Look for either an opening comment, '#', or a block start, '{". + # If not found, assume SGML. + var lnum = 1 while lnum < 6 - let line = getline(lnum) + var line = getline(lnum) if line =~ '^\s*[#{]' setf cl return elseif line !~ '^\s*$' - " Not a blank line, not a comment, and not a block start, - " so doesn't look like valid cl code. + # Not a blank line, not a comment, and not a block start, + # so doesn't look like valid cl code. break endif - let lnum = lnum + 1 + lnum += 1 endw setf dtd -endfunc +enddef -func dist#ft#ExCheck() - let lines = getline(1, min([line("$"), 100])) +export def ExCheck() + var lines = getline(1, min([line("$"), 100])) if exists('g:filetype_euphoria') - exe 'setf ' . g:filetype_euphoria + exe 'setf ' .. g:filetype_euphoria elseif match(lines, '^--\|^ifdef\>\|^include\>') > -1 setf euphoria3 else setf elixir endif -endfunc +enddef -func dist#ft#EuphoriaCheck() +export def EuphoriaCheck() if exists('g:filetype_euphoria') - exe 'setf ' . g:filetype_euphoria + exe 'setf ' .. g:filetype_euphoria else setf euphoria3 endif -endfunc +enddef -func dist#ft#DtraceCheck() - let lines = getline(1, min([line("$"), 100])) +export def DtraceCheck() + var lines = getline(1, min([line("$"), 100])) if match(lines, '^module\>\|^import\>') > -1 - " D files often start with a module and/or import statement. + # D files often start with a module and/or import statement. setf d elseif match(lines, '^#!\S\+dtrace\|#pragma\s\+D\s\+option\|:\S\{-}:\S\{-}:') > -1 setf dtrace else setf d endif -endfunc +enddef -func dist#ft#FTe() +export def FTe() if exists('g:filetype_euphoria') - exe 'setf ' . g:filetype_euphoria + exe 'setf ' .. g:filetype_euphoria else - let n = 1 + var n = 1 while n < 100 && n <= line("$") if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" setf specman return endif - let n = n + 1 + n += 1 endwhile setf eiffel endif -endfunc +enddef -func dist#ft#FTfrm() +export def FTfrm() if exists("g:filetype_frm") - exe "setf " . g:filetype_frm + exe "setf " .. g:filetype_frm return endif - let lines = getline(1, min([line("$"), 5])) + var lines = getline(1, min([line("$"), 5])) if match(lines, s:ft_visual_basic_content) > -1 setf vb else setf form endif -endfunc +enddef -" Distinguish between Forth and F#. -" Provided by Doug Kearns. -func dist#ft#FTfs() +# Distinguish between Forth and F#. +# Provided by Doug Kearns. +export def FTfs() if exists("g:filetype_fs") - exe "setf " . g:filetype_fs + exe "setf " .. g:filetype_fs else - let line = getline(nextnonblank(1)) - " comments and colon definitions + var line = getline(nextnonblank(1)) + # comments and colon definitions if line =~ '^\s*\.\=( ' || line =~ '^\s*\\G\= ' || line =~ '^\\$' \ || line =~ '^\s*: \S' setf forth @@ -268,11 +263,11 @@ func dist#ft#FTfs() setf fsharp endif endif -endfunc +enddef -" Distinguish between HTML, XHTML and Django -func dist#ft#FThtml() - let n = 1 +# Distinguish between HTML, XHTML and Django +export def FThtml() + var n = 1 while n < 10 && n <= line("$") if getline(n) =~ '\' || line =~ objc_preprocessor setf objc @@ -344,7 +339,7 @@ func dist#ft#FTm() setf octave return endif - " TODO: could be Matlab or Octave + # TODO: could be Matlab or Octave if line =~ '^\s*%' setf matlab return @@ -357,24 +352,24 @@ func dist#ft#FTm() setf murphi return endif - let n = n + 1 + n += 1 endwhile if saw_comment - " We didn't see anything definitive, but this looks like either Objective C - " or Murphi based on the comment leader. Assume the former as it is more - " common. + # We didn't see anything definitive, but this looks like either Objective C + # or Murphi based on the comment leader. Assume the former as it is more + # common. setf objc else - " Default is Matlab + # Default is Matlab setf matlab endif -endfunc +enddef -func dist#ft#FTmms() - let n = 1 +export def FTmms() + var n = 1 while n < 20 - let line = getline(n) + var line = getline(n) if line =~ '^\s*\(%\|//\)' || line =~ '^\*' setf mmix return @@ -383,78 +378,78 @@ func dist#ft#FTmms() setf make return endif - let n = n + 1 + n += 1 endwhile setf mmix -endfunc +enddef -" This function checks if one of the first five lines start with a dot. In -" that case it is probably an nroff file: 'filetype' is set and 1 is returned. -func dist#ft#FTnroff() - if getline(1)[0] . getline(2)[0] . getline(3)[0] . getline(4)[0] . getline(5)[0] =~ '\.' +# This function checks if one of the first five lines start with a dot. In +# that case it is probably an nroff file: 'filetype' is set and 1 is returned. +export def FTnroff(): number + if getline(1)[0] .. getline(2)[0] .. getline(3)[0] + .. getline(4)[0] .. getline(5)[0] =~ '\.' setf nroff return 1 endif return 0 -endfunc +enddef -func dist#ft#FTmm() - let n = 1 +export def FTmm() + var n = 1 while n < 20 - let line = getline(n) - if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' + if getline(n) =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' setf objcpp return endif - let n = n + 1 + n += 1 endwhile setf nroff -endfunc +enddef -func dist#ft#FTpl() +export def FTpl() if exists("g:filetype_pl") - exe "setf " . g:filetype_pl + exe "setf " .. g:filetype_pl else - " recognize Prolog by specific text in the first non-empty line - " require a blank after the '%' because Perl uses "%list" and "%translate" - let l = getline(nextnonblank(1)) + # recognize Prolog by specific text in the first non-empty line + # require a blank after the '%' because Perl uses "%list" and "%translate" + var l = getline(nextnonblank(1)) if l =~ '\' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-' setf prolog else setf perl endif endif -endfunc +enddef -func dist#ft#FTinc() +export def FTinc() if exists("g:filetype_inc") - exe "setf " . g:filetype_inc + exe "setf " .. g:filetype_inc else - let lines = getline(1).getline(2).getline(3) + var lines = getline(1) .. getline(2) .. getline(3) if lines =~? "perlscript" setf aspperl elseif lines =~ "<%" setf aspvbs elseif lines =~ "' +var ft_pascal_comments = '^\s*\%({\|(\*\|//\)' +var ft_pascal_keywords = '^\s*\%(program\|unit\|library\|uses\|begin\|procedure\|function\|const\|type\|var\)\>' -func dist#ft#FTprogress_pascal() +export def FTprogress_pascal() if exists("g:filetype_p") - exe "setf " . g:filetype_p + exe "setf " .. g:filetype_p return endif - " This function checks for valid Pascal syntax in the first ten lines. - " Look for either an opening comment or a program start. - " If not found, assume Progress. - let lnum = 1 + # This function checks for valid Pascal syntax in the first ten lines. + # Look for either an opening comment or a program start. + # If not found, assume Progress. + var lnum = 1 while lnum <= 10 && lnum < line('$') - let line = getline(lnum) + var line = getline(lnum) if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords setf pascal return elseif line !~ '^\s*$' || line =~ '^/\*' - " Not an empty line: Doesn't look like valid Pascal code. - " Or it looks like a Progress /* comment + # Not an empty line: Doesn't look like valid Pascal code. + # Or it looks like a Progress /* comment break endif - let lnum = lnum + 1 + lnum += 1 endw setf progress -endfunc +enddef -func dist#ft#FTpp() +export def FTpp() if exists("g:filetype_pp") - exe "setf " . g:filetype_pp + exe "setf " .. g:filetype_pp else - let line = getline(nextnonblank(1)) + var line = getline(nextnonblank(1)) if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords setf pascal else setf puppet endif endif -endfunc +enddef -func dist#ft#FTr() - let max = line("$") > 50 ? 50 : line("$") +export def FTr() + var max = line("$") > 50 ? 50 : line("$") for n in range(1, max) - " Rebol is easy to recognize, check for that first + # Rebol is easy to recognize, check for that first if getline(n) =~? '\' setf rebol return @@ -539,82 +534,82 @@ func dist#ft#FTr() endfor for n in range(1, max) - " R has # comments + # R has # comments if getline(n) =~ '^\s*#' setf r return endif - " Rexx has /* comments */ + # Rexx has /* comments */ if getline(n) =~ '^\s*/\*' setf rexx return endif endfor - " Nothing recognized, use user default or assume Rexx + # Nothing recognized, use user default or assume Rexx if exists("g:filetype_r") - exe "setf " . g:filetype_r + exe "setf " .. g:filetype_r else - " Rexx used to be the default, but R appears to be much more popular. + # Rexx used to be the default, but R appears to be much more popular. setf r endif -endfunc +enddef -func dist#ft#McSetf() - " Rely on the file to start with a comment. - " MS message text files use ';', Sendmail files use '#' or 'dnl' +export def McSetf() + # Rely on the file to start with a comment. + # MS message text files use ';', Sendmail files use '#' or 'dnl' for lnum in range(1, min([line("$"), 20])) - let line = getline(lnum) + var line = getline(lnum) if line =~ '^\s*\(#\|dnl\)' - setf m4 " Sendmail .mc file + setf m4 # Sendmail .mc file return elseif line =~ '^\s*;' - setf msmessages " MS Message text file + setf msmessages # MS Message text file return endif endfor setf m4 " Default: Sendmail .mc file -endfunc +enddef -" Called from filetype.vim and scripts.vim. -func dist#ft#SetFileTypeSH(name) +# Called from filetype.vim and scripts.vim. +export def SetFileTypeSH(name: string) if did_filetype() - " Filetype was already detected + # Filetype was already detected return endif if expand("") =~ g:ft_ignore_pat return endif - if a:name =~ '\' - " Some .sh scripts contain #!/bin/csh. - call dist#ft#SetFileTypeShell("csh") + if name =~ '\' + # Some .sh scripts contain #!/bin/csh. + SetFileTypeShell("csh") return - elseif a:name =~ '\' - " Some .sh scripts contain #!/bin/tcsh. - call dist#ft#SetFileTypeShell("tcsh") + elseif name =~ '\' + # Some .sh scripts contain #!/bin/tcsh. + SetFileTypeShell("tcsh") return - elseif a:name =~ '\' - " Some .sh scripts contain #!/bin/zsh. - call dist#ft#SetFileTypeShell("zsh") + elseif name =~ '\' + # Some .sh scripts contain #!/bin/zsh. + SetFileTypeShell("zsh") return - elseif a:name =~ '\' - let b:is_kornshell = 1 + elseif name =~ '\' + b:is_kornshell = 1 if exists("b:is_bash") unlet b:is_bash endif if exists("b:is_sh") unlet b:is_sh endif - elseif exists("g:bash_is_sh") || a:name =~ '\' || a:name =~ '\' - let b:is_bash = 1 + elseif exists("g:bash_is_sh") || name =~ '\' || name =~ '\' + b:is_bash = 1 if exists("b:is_kornshell") unlet b:is_kornshell endif if exists("b:is_sh") unlet b:is_sh endif - elseif a:name =~ '\' - let b:is_sh = 1 + elseif name =~ '\' + b:is_sh = 1 if exists("b:is_kornshell") unlet b:is_kornshell endif @@ -622,75 +617,76 @@ func dist#ft#SetFileTypeSH(name) unlet b:is_bash endif endif - call dist#ft#SetFileTypeShell("sh") -endfunc + SetFileTypeShell("sh") +enddef -" For shell-like file types, check for an "exec" command hidden in a comment, -" as used for Tcl. -" Also called from scripts.vim, thus can't be local to this script. -func dist#ft#SetFileTypeShell(name) +# For shell-like file types, check for an "exec" command hidden in a comment, +# as used for Tcl. +# Also called from scripts.vim, thus can't be local to this script. +export def SetFileTypeShell(name: string) if did_filetype() - " Filetype was already detected + # Filetype was already detected return endif if expand("") =~ g:ft_ignore_pat return endif - let l = 2 + var l = 2 while l < 20 && l < line("$") && getline(l) =~ '^\s*\(#\|$\)' - " Skip empty and comment lines. - let l = l + 1 + # Skip empty and comment lines. + l += 1 endwhile if l < line("$") && getline(l) =~ '\s*exec\s' && getline(l - 1) =~ '^\s*#.*\\$' - " Found an "exec" line after a comment with continuation - let n = substitute(getline(l),'\s*exec\s\+\([^ ]*/\)\=', '', '') + # Found an "exec" line after a comment with continuation + var n = substitute(getline(l), '\s*exec\s\+\([^ ]*/\)\=', '', '') if n =~ '\:p') +var ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*' +export def FTRules() + var path = expand(':p') if path =~ '/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|\%(usr/\)\=lib/udev/\%(rules\.d/\)\=.*\.rules\)$' setf udevrules return endif if path =~ '^/etc/ufw/' - setf conf " Better than hog + setf conf # Better than hog return endif if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d' setf javascript return endif + var config_lines: list try - let config_lines = readfile('/etc/udev/udev.conf') + config_lines = readfile('/etc/udev/udev.conf') catch /^Vim\%((\a\+)\)\=:E484/ setf hog return endtry - let dir = expand(':p:h') + var dir = expand(':p:h') for line in config_lines if line =~ s:ft_rules_udev_rules_pattern - let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "") + var udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "") if dir == udev_rules setf udevrules endif @@ -698,24 +694,24 @@ func dist#ft#FTRules() endif endfor setf hog -endfunc +enddef -func dist#ft#SQL() +export def SQL() if exists("g:filetype_sql") - exe "setf " . g:filetype_sql + exe "setf " .. g:filetype_sql else setf sql endif -endfunc +enddef -" If the file has an extension of 't' and is in a directory 't' or 'xt' then -" it is almost certainly a Perl test file. -" If the first line starts with '#' and contains 'perl' it's probably a Perl -" file. -" (Slow test) If a file contains a 'use' statement then it is almost certainly -" a Perl file. -func dist#ft#FTperl() - let dirname = expand("%:p:h:t") +# If the file has an extension of 't' and is in a directory 't' or 'xt' then +# it is almost certainly a Perl test file. +# If the first line starts with '#' and contains 'perl' it's probably a Perl +# file. +# (Slow test) If a file contains a 'use' statement then it is almost certainly +# a Perl file. +export def FTperl(): number + var dirname = expand("%:p:h:t") if expand("%:e") == 't' && (dirname == 't' || dirname == 'xt') setf perl return 1 @@ -724,86 +720,87 @@ func dist#ft#FTperl() setf perl return 1 endif - let save_cursor = getpos('.') - call cursor(1,1) - let has_use = search('^use\s\s*\k', 'c', 30) + var save_cursor = getpos('.') + call cursor(1, 1) + var has_use = search('^use\s\s*\k', 'c', 30) call setpos('.', save_cursor) if has_use setf perl return 1 endif return 0 -endfunc - -" Choose context, plaintex, or tex (LaTeX) based on these rules: -" 1. Check the first line of the file for "%&". -" 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. -" 3. Default to "plain" or to g:tex_flavor, can be set in user's vimrc. -func dist#ft#FTtex() - let firstline = getline(1) +enddef + +# Choose context, plaintex, or tex (LaTeX) based on these rules: +# 1. Check the first line of the file for "%&". +# 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. +# 3. Default to "plain" or to g:tex_flavor, can be set in user's vimrc. +export def FTtex() + var firstline = getline(1) + var format: string if firstline =~ '^%&\s*\a\+' - let format = tolower(matchstr(firstline, '\a\+')) - let format = substitute(format, 'pdf', '', '') + format = tolower(matchstr(firstline, '\a\+')) + format = substitute(format, 'pdf', '', '') if format == 'tex' - let format = 'latex' + format = 'latex' elseif format == 'plaintex' - let format = 'plain' + format = 'plain' endif elseif expand('%') =~ 'tex/context/.*/.*.tex' - let format = 'context' + format = 'context' else - " Default value, may be changed later: - let format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' - " Save position, go to the top of the file, find first non-comment line. - let save_cursor = getpos('.') - call cursor(1,1) - let firstNC = search('^\s*[^[:space:]%]', 'c', 1000) - if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword. - let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>' - let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>' - let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)', - \ 'cnp', firstNC + 1000) - if kwline == 1 " lpat matched - let format = 'latex' - elseif kwline == 2 " cpat matched - let format = 'context' - endif " If neither matched, keep default set above. - " let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000) - " let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000) - " if cline > 0 - " let format = 'context' - " endif - " if lline > 0 && (cline == 0 || cline > lline) - " let format = 'tex' - " endif - endif " firstNC + # Default value, may be changed later: + format = exists("g:tex_flavor") ? g:tex_flavor : 'plain' + # Save position, go to the top of the file, find first non-comment line. + var save_cursor = getpos('.') + call cursor(1, 1) + var firstNC = search('^\s*[^[:space:]%]', 'c', 1000) + if firstNC # Check the next thousand lines for a LaTeX or ConTeXt keyword. + var lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>' + var cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>' + var kwline = search('^\s*\\\%(' .. lpat .. '\)\|^\s*\\\(' .. cpat .. '\)', + 'cnp', firstNC + 1000) + if kwline == 1 # lpat matched + format = 'latex' + elseif kwline == 2 # cpat matched + format = 'context' + endif # If neither matched, keep default set above. + # let lline = search('^\s*\\\%(' . lpat . '\)', 'cn', firstNC + 1000) + # let cline = search('^\s*\\\%(' . cpat . '\)', 'cn', firstNC + 1000) + # if cline > 0 + # let format = 'context' + # endif + # if lline > 0 && (cline == 0 || cline > lline) + # let format = 'tex' + # endif + endif # firstNC call setpos('.', save_cursor) - endif " firstline =~ '^%&\s*\a\+' + endif # firstline =~ '^%&\s*\a\+' - " Translation from formats to file types. TODO: add AMSTeX, RevTex, others? + # Translation from formats to file types. TODO: add AMSTeX, RevTex, others? if format == 'plain' setf plaintex elseif format == 'context' setf context - else " probably LaTeX + else # probably LaTeX setf tex endif return -endfunc +enddef -func dist#ft#FTxml() - let n = 1 +export def FTxml() + var n = 1 while n < 100 && n <= line("$") - let line = getline(n) - " DocBook 4 or DocBook 5. - let is_docbook4 = line =~ ' call digraph_setlist([['aa', 'あ'], ['ii', 'い']]) < @@ -2531,7 +2532,7 @@ flatten({list} [, {maxdepth}]) *flatten()* The {list} is changed in place, use |flattennew()| if you do not want that. In Vim9 script flatten() cannot be used, you must always use - |flattennew()|. *E1158* + |flattennew()|. *E900* {maxdepth} means how deep in nested lists changes are made. {list} is not modified when {maxdepth} is 0. @@ -3751,7 +3752,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* :let cliptext = getreg('*') < When register {regname} was not set the result is an empty string. - The {regname} argument must be a string. + The {regname} argument must be a string. *E1162* getreg('=') returns the last evaluated value of the expression register. (For use in maps.) @@ -4783,7 +4784,7 @@ json_encode({expr}) *json_encode()* Encode {expr} as JSON and return this as a string. The encoding is specified in: https://tools.ietf.org/html/rfc7159.html - Vim values are converted as follows: + Vim values are converted as follows: *E1161* |Number| decimal number |Float| floating point number Float nan "NaN" @@ -4897,7 +4898,7 @@ libcallnr({libname}, {funcname}, {argument}) line({expr} [, {winid}]) *line()* The result is a Number, which is the line number of the file position given with {expr}. The {expr} argument is a string. - The accepted positions are: + The accepted positions are: *E1209* . the cursor position $ the last line in the current buffer 'x position of mark x (if the mark is not set, 0 is @@ -7644,10 +7645,12 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()* module name of a module; if given it will be used in quickfix error window instead of the filename. lnum line number in the file + end_lnum end of lines, if the item spans multiple lines pattern search pattern used to locate the error col column number vcol when non-zero: "col" is visual column when zero: "col" is byte index + end_col end column, if the item spans multiple columns nr error number text description of the error type single-character error type, 'E', 'W', etc. diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 7e1030bb91..d72e689ca3 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 8.2. Last change: 2022 Jan 28 +*change.txt* For Vim version 8.2. Last change: 2022 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -782,7 +782,7 @@ This deletes "TESTING" from all lines, but only one per line. For compatibility with Vi these two exceptions are allowed: "\/{string}/" and "\?{string}?" do the same as "//{string}/r". "\&{string}&" does the same as "//{string}/". - *pattern-delimiter* *E146* + *pattern-delimiter* *E146* *E1241* *E1242* Instead of the '/' which surrounds the pattern and replacement string, you can use another single-byte character. This is useful if you want to include a '/' in the search pattern or replacement string. Example: > @@ -1076,7 +1076,7 @@ inside of strings can change! Also see 'softtabstop' option. > in [range] (default: current line |cmdline-ranges|), [into register x]. - *p* *put* *E353* + *p* *put* *E353* *E1240* ["x]p Put the text [from register x] after the cursor [count] times. diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index c68c1619c3..ad862bfbe4 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 8.2. Last change: 2022 Jan 08 +*cmdline.txt* For Vim version 8.2. Last change: 2022 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -730,7 +730,7 @@ If more line specifiers are given than required for the command, the first one(s) will be ignored. Line numbers may be specified with: *:range* *{address}* - {number} an absolute line number + {number} an absolute line number *E1247* . the current line *:.* $ the last line in the file *:$* % equal to 1,$ (the entire file) *:%* diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 00deef1765..371450f4ec 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 8.2. Last change: 2022 Jan 21 +*editing.txt* For Vim version 8.2. Last change: 2022 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -633,7 +633,7 @@ list of the current window. Also see |++opt| and |+cmd|. :[count]arga[dd] {name} .. *:arga* *:argadd* *E479* -:[count]arga[dd] +:[count]arga[dd] *E1156* Add the {name}s to the argument list. When {name} is omitted add the current buffer name to the argument list. @@ -1772,10 +1772,8 @@ There are three different types of searching: /u/user_x/include < Note: If your 'path' setting includes a non-existing directory, Vim will - skip the non-existing directory, but continues searching in the parent of - the non-existing directory if upwards searching is used. E.g. when - searching "../include" and that doesn't exist, and upward searching is - used, also searches in "..". + skip the non-existing directory, and also does not search in the parent of + the non-existing directory if upwards searching is used. 3) Combined up/downward search: If Vim's current path is /u/user_x/work/release and you do > diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 258d0a11e5..9e1425b824 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2022 Jan 24 +*eval.txt* For Vim version 8.2. Last change: 2022 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -181,7 +181,7 @@ You will not get an error if you try to change the type of a variable. 1.2 Function references ~ - *Funcref* *E695* *E718* *E1086* + *Funcref* *E695* *E718* *E1086* *E1192* A Funcref variable is obtained with the |function()| function, the |funcref()| function or created with the lambda expression |expr-lambda|. It can be used in an expression in the place of a function name, before the parenthesis @@ -765,7 +765,7 @@ length minus one is used: > Blob modification ~ - *blob-modification* + *blob-modification* *E1182* *E1184* To change a specific byte of a blob use |:let| this way: > :let blob[4] = 0x44 @@ -1018,7 +1018,7 @@ This is valid whether "b" has been defined or not. The second clause will only be evaluated if "b" has been defined. -expr4 *expr4* +expr4 *expr4* *E1153* ----- expr5 {cmp} expr5 @@ -1176,6 +1176,7 @@ When dividing a Number by zero the result depends on the value: >0 / 0 = 0x7fffffff (like positive infinity) <0 / 0 = -0x7fffffff (like negative infinity) (before Vim 7.2 it was always 0x7fffffff) +In |Vim9| script dividing a number by zero is an error. *E1154* When 64-bit Number support is enabled: 0 / 0 = -0x8000000000000000 (like NaN for Float) @@ -1243,7 +1244,7 @@ recognize multibyte encodings, see `byteidx()` for an alternative, or use byte under the cursor: > :let c = getline(".")[col(".") - 1] -In |Vim9| script: +In |Vim9| script: *E1147* *E1148* If expr9 is a String this results in a String that contains the expr1'th single character (including any composing characters) from expr9. To use byte indexes use |strpart()|. @@ -1323,7 +1324,7 @@ for a sublist: > expr9.name entry in a |Dictionary| *expr-entry* - + *E1203* *E1229* If expr9 is a |Dictionary| and it is followed by a dot, then the following name will be used as a key in the |Dictionary|. This is just like: expr9[name]. @@ -1350,7 +1351,7 @@ When expr9 is a |Funcref| type variable, invoke the function it refers to. expr9->name([args]) method call *method* *->* expr9->{lambda}([args]) - *E260* *E276* + *E260* *E276* *E1265* For methods that are also available as global functions this is the same as: > name(expr9 [, args]) There can also be methods specifically for the type of "expr9". @@ -1550,7 +1551,7 @@ When using the '=' register you get the expression itself, not what it evaluates to. Use |eval()| to evaluate it. -nesting *expr-nesting* *E110* +nesting *expr-nesting* *E110* ------- (expr1) nested expression @@ -2694,7 +2695,7 @@ See |:verbose-cmd| for more information. implies that the effect of |:nohlsearch| is undone when the function returns. - *:endf* *:endfunction* *E126* *E193* *W22* + *:endf* *:endfunction* *E126* *E193* *W22* *E1151* :endf[unction] [argument] The end of a function definition. Best is to put it on a line by its own, without [argument]. @@ -3074,7 +3075,7 @@ declarations and assignments do not use a command. |vim9-declaration| length of the blob, in which case one byte is appended. - *E711* *E719* + *E711* *E719* *E1165* *E1166* *E1183* :let {var-name}[{idx1}:{idx2}] = {expr1} *E708* *E709* *E710* Set a sequence of items in a |List| to the result of the expression {expr1}, which must be a list with the @@ -3410,7 +3411,7 @@ text... See |deepcopy()|. -:unlo[ckvar][!] [depth] {name} ... *:unlockvar* *:unlo* +:unlo[ckvar][!] [depth] {name} ... *:unlockvar* *:unlo* *E1246* Unlock the internal variable {name}. Does the opposite of |:lockvar|. @@ -3471,7 +3472,7 @@ text... :endfo[r] *:endfo* *:endfor* Repeat the commands between ":for" and ":endfor" for each item in {object}. {object} can be a |List| or - a |Blob|. + a |Blob|. *E1177* Variable {var} is set to the value of each item. In |Vim9| script the loop variable must not have been @@ -3725,6 +3726,9 @@ text... the `append()` call appends the List with text to the buffer. This is similar to `:call` but works with any expression. + In |Vim9| script an expression without an effect will + result in error *E1207* . This should help noticing + mistakes. The command can be shortened to `:ev` or `:eva`, but these are hard to recognize and therefore not to be @@ -4892,6 +4896,9 @@ explicit the |:scriptversion| command can be used. When a Vim script is not compatible with older versions of Vim this will give an explicit error, instead of failing in mysterious ways. +When using a legacy function, defined with `:function`, in |Vim9| script then +scriptversion 4 is used. + *scriptversion-1* > :scriptversion 1 < This is the original Vim script, same as not using a |:scriptversion| diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 9a614e21e9..d52103e0f2 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -142,7 +142,8 @@ variables can be used to overrule the filetype used for certain extensions: *.asm g:asmsyntax |ft-asm-syntax| *.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax| *.bas g:filetype_bas |ft-basic-syntax| - *.fs g:filetype_fs |ft-forth-syntax| + *.frm g:filetype_frm |ft-form-syntax| + *.fs g:filetype_fs |ft-forth-syntax| *.i g:filetype_i |ft-progress-syntax| *.inc g:filetype_inc *.m g:filetype_m |ft-mathematica-syntax| diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 8c9ff3d43f..732e5a74dd 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 8.2. Last change: 2022 Jan 29 +*options.txt* For Vim version 8.2. Last change: 2022 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -800,6 +800,7 @@ A jump table for the options with a short description can be found at |Q_op|. need proper setting-up, so whenever the shell's pwd changes an OSC 7 escape sequence will be emitted. For example, on Linux, you can source /etc/profile.d/vte.sh in your shell profile if you use bash or zsh. + When the parsing of the OSC sequence fails you get *E1179* . *'arabic'* *'arab'* *'noarabic'* *'noarab'* 'arabic' 'arab' boolean (default off) @@ -2476,7 +2477,7 @@ A jump table for the options with a short description can be found at |Q_op|. you write the file the encrypted bytes will be different. The whole undo file is encrypted, not just the pieces of text. - *E1193* *E1194* *E1195* *E1196* + *E1193* *E1194* *E1195* *E1196* *E1230* *E1197* *E1198* *E1199* *E1200* *E1201* xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication Code. Medium strong till strong encryption. @@ -6723,6 +6724,9 @@ A jump table for the options with a short description can be found at |Q_op|. See |option-backslash| about including spaces and backslashes. Environment variables are expanded |:set_env|. + In |restricted-mode| shell commands will not be possible. This mode + is used if the value of $SHELL ends in "false" or "nologin". + If the name of the shell contains a space, you need to enclose it in quotes and escape the space. Example with quotes: > :set shell=\"c:\program\ files\unix\sh.exe\"\ -f diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index ce1d0f49bc..819975d573 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 8.2. Last change: 2022 Jan 08 +*pattern.txt* For Vim version 8.2. Last change: 2022 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -925,7 +925,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): becomes invalid. Vim doesn't automatically update the matches. Similar to moving the cursor for "\%#" |/\%#|. - */\%l* */\%>l* */\%l* */\%23l Matches below a specific line (higher line number). diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index bca2f97042..84f3a75812 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 8.2. Last change: 2022 Jan 20 +*starting.txt* For Vim version 8.2. Last change: 2022 Feb 01 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 6b114a75ab..a23ac881e7 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 8.2. Last change: 2021 Nov 20 +*syntax.txt* For Vim version 8.2. Last change: 2022 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -215,7 +215,8 @@ A syntax group name doesn't specify any color or attributes itself. The name for a highlight or syntax group must consist of ASCII letters, digits and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give -an error when using other characters. +an error when using other characters. The maxium length of a group name is +about 200 bytes. *E1249* To be able to allow each user to pick their favorite set of colors, there must be preferred names for highlight groups that are common for many languages. @@ -1536,6 +1537,14 @@ The enhanced mode also takes advantage of additional color features for a dark gvim display. Here, statements are colored LightYellow instead of Yellow, and conditionals are LightBlue for better distinction. +Both Visual Basic and FORM use the extension ".frm". To detect which one +should be used, Vim checks for the string "VB_Name" in the first five lines of +the file. If it is found, filetype will be "vb", otherwise "form". + +If the automatic detection doesn't work for you or you only edit, for +example, FORM files, use this in your startup vimrc: > + :let filetype_frm = "form" + FORTH *forth.vim* *ft-forth-syntax* diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index 7512d0c29d..cb2f7ad72c 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -1,4 +1,4 @@ -*tabpage.txt* For Vim version 8.2. Last change: 2020 Oct 14 +*tabpage.txt* For Vim version 8.2. Last change: 2022 Feb 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -143,7 +143,9 @@ something else. :tabclose 3 " close the third tab page :tabclose $ " close the last tab page :tabclose # " close the last accessed tab page -< + +When a tab is closed the next tab page will become the current one. + *:tabo* *:tabonly* :tabo[nly][!] Close all other tab pages. When the 'hidden' option is set, all buffers in closed windows diff --git a/runtime/doc/tags b/runtime/doc/tags index 001664396b..a15371e7f9 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -4041,6 +4041,7 @@ E1089 eval.txt /*E1089* E109 eval.txt /*E109* E1090 eval.txt /*E1090* E1091 vim9.txt /*E1091* +E1092 various.txt /*E1092* E1093 eval.txt /*E1093* E1094 vim9.txt /*E1094* E1095 eval.txt /*E1095* @@ -4096,19 +4097,62 @@ E1139 vim9.txt /*E1139* E114 eval.txt /*E114* E1140 eval.txt /*E1140* E1141 eval.txt /*E1141* +E1142 testing.txt /*E1142* E1143 eval.txt /*E1143* E1144 vim9.txt /*E1144* E1145 eval.txt /*E1145* +E1146 vim9.txt /*E1146* +E1147 eval.txt /*E1147* +E1148 eval.txt /*E1148* +E1149 vim9.txt /*E1149* E115 eval.txt /*E115* +E1150 vim9.txt /*E1150* +E1151 eval.txt /*E1151* +E1152 vim9.txt /*E1152* +E1153 eval.txt /*E1153* +E1154 eval.txt /*E1154* E1155 autocmd.txt /*E1155* -E1158 builtin.txt /*E1158* +E1156 editing.txt /*E1156* +E1157 vim9.txt /*E1157* +E1158 vim9.txt /*E1158* +E1159 windows.txt /*E1159* E116 eval.txt /*E116* +E1160 vim9.txt /*E1160* +E1161 builtin.txt /*E1161* +E1162 builtin.txt /*E1162* +E1163 vim9.txt /*E1163* +E1164 vim9.txt /*E1164* +E1165 eval.txt /*E1165* +E1166 eval.txt /*E1166* +E1167 vim9.txt /*E1167* +E1168 vim9.txt /*E1168* E1169 eval.txt /*E1169* E117 eval.txt /*E117* +E1170 vim9.txt /*E1170* +E1171 vim9.txt /*E1171* +E1172 vim9.txt /*E1172* +E1173 vim9.txt /*E1173* +E1174 vim9.txt /*E1174* +E1175 vim9.txt /*E1175* +E1176 vim9.txt /*E1176* +E1177 eval.txt /*E1177* +E1178 vim9.txt /*E1178* +E1179 options.txt /*E1179* E118 eval.txt /*E118* +E1180 vim9.txt /*E1180* +E1181 vim9.txt /*E1181* +E1182 eval.txt /*E1182* +E1183 eval.txt /*E1183* +E1184 eval.txt /*E1184* +E1185 various.txt /*E1185* +E1186 vim9.txt /*E1186* E1187 starting.txt /*E1187* E1188 cmdline.txt /*E1188* +E1189 vim9.txt /*E1189* E119 eval.txt /*E119* +E1190 vim9.txt /*E1190* +E1191 vim9.txt /*E1191* +E1192 eval.txt /*E1192* E1193 options.txt /*E1193* E1194 options.txt /*E1194* E1195 options.txt /*E1195* @@ -4120,25 +4164,76 @@ E12 message.txt /*E12* E120 eval.txt /*E120* E1200 options.txt /*E1200* E1201 options.txt /*E1201* -E1205 builtin.txt /*E1205* +E1202 vim9.txt /*E1202* +E1203 eval.txt /*E1203* +E1204 pattern.txt /*E1204* +E1205 vim9.txt /*E1205* +E1206 vim9.txt /*E1206* +E1207 eval.txt /*E1207* E1208 map.txt /*E1208* +E1209 builtin.txt /*E1209* E121 eval.txt /*E121* +E1210 vim9.txt /*E1210* +E1211 vim9.txt /*E1211* +E1212 vim9.txt /*E1212* +E1213 vim9.txt /*E1213* E1214 builtin.txt /*E1214* +E1215 builtin.txt /*E1215* +E1216 builtin.txt /*E1216* +E1217 vim9.txt /*E1217* +E1218 vim9.txt /*E1218* +E1219 vim9.txt /*E1219* E122 eval.txt /*E122* +E1220 vim9.txt /*E1220* +E1221 vim9.txt /*E1221* +E1222 vim9.txt /*E1222* +E1223 vim9.txt /*E1223* +E1224 vim9.txt /*E1224* +E1225 vim9.txt /*E1225* +E1226 vim9.txt /*E1226* +E1227 vim9.txt /*E1227* +E1228 vim9.txt /*E1228* +E1229 eval.txt /*E1229* E123 eval.txt /*E123* +E1230 options.txt /*E1230* E1231 map.txt /*E1231* E1232 builtin.txt /*E1232* E1233 builtin.txt /*E1233* +E1234 vim9.txt /*E1234* +E1235 vim9.txt /*E1235* +E1236 vim9.txt /*E1236* E1237 map.txt /*E1237* +E1238 vim9.txt /*E1238* E1239 builtin.txt /*E1239* E124 eval.txt /*E124* +E1240 change.txt /*E1240* +E1241 change.txt /*E1241* +E1242 change.txt /*E1242* E1243 options.txt /*E1243* E1244 message.txt /*E1244* E1245 cmdline.txt /*E1245* +E1246 eval.txt /*E1246* +E1247 cmdline.txt /*E1247* +E1248 vim9.txt /*E1248* +E1249 syntax.txt /*E1249* E125 eval.txt /*E125* +E1250 vim9.txt /*E1250* +E1251 vim9.txt /*E1251* +E1252 vim9.txt /*E1252* +E1253 vim9.txt /*E1253* +E1254 vim9.txt /*E1254* E1255 map.txt /*E1255* +E1256 vim9.txt /*E1256* +E1257 vim9.txt /*E1257* +E1258 vim9.txt /*E1258* +E1259 vim9.txt /*E1259* E126 eval.txt /*E126* +E1260 vim9.txt /*E1260* +E1261 vim9.txt /*E1261* +E1262 vim9.txt /*E1262* E1263 eval.txt /*E1263* +E1264 vim9.txt /*E1264* +E1265 eval.txt /*E1265* E127 eval.txt /*E127* E128 eval.txt /*E128* E129 eval.txt /*E129* @@ -6125,6 +6220,7 @@ conversion-server mbyte.txt /*conversion-server* convert-to-HTML syntax.txt /*convert-to-HTML* convert-to-XHTML syntax.txt /*convert-to-XHTML* convert-to-XML syntax.txt /*convert-to-XML* +convert_legacy_function_to_vim9 vim9.txt /*convert_legacy_function_to_vim9* copy() builtin.txt /*copy()* copy-diffs diff.txt /*copy-diffs* copy-move change.txt /*copy-move* @@ -9931,7 +10027,6 @@ test_null_string() testing.txt /*test_null_string()* test_option_not_set() testing.txt /*test_option_not_set()* test_override() testing.txt /*test_override()* test_refcount() testing.txt /*test_refcount()* -test_scrollbar() testing.txt /*test_scrollbar()* test_setmouse() testing.txt /*test_setmouse()* test_settime() testing.txt /*test_settime()* test_srand_seed() testing.txt /*test_srand_seed()* diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt index 8bd3cc919d..c77d59480f 100644 --- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -1,4 +1,4 @@ -*testing.txt* For Vim version 8.2. Last change: 2022 Jan 23 +*testing.txt* For Vim version 8.2. Last change: 2022 Feb 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -65,8 +65,9 @@ test_garbagecollect_now() *test_garbagecollect_now()* Like garbagecollect(), but executed right away. This must only be called directly to avoid any structure to exist internally, and |v:testing| must have been set before calling - any function. This will not work when called from a :def - function, because variables on the stack will be freed. + any function. *E1142* + This will not work when called from a :def function, because + variables on the stack will be freed. test_garbagecollect_soon() *test_garbagecollect_soon()* @@ -92,6 +93,7 @@ test_gui_event({event}, {args}) "dropfiles" drop one or more files in a window. "findrepl" search and replace text "mouse" mouse button click event. + "scrollbar" move or drag the scrollbar "tabline" select a tab page by mouse click. "tabmenu" select a tabline menu entry. @@ -113,6 +115,7 @@ test_gui_event({event}, {args}) |drop_file| feature is present. "findrepl": + {only available when the GUI has a find/replace dialog} Perform a search and replace of text. The supported items in {args} are: find_text: string to find. @@ -149,6 +152,22 @@ test_gui_event({event}, {args}) 8 alt is pressed 16 ctrl is pressed + "scrollbar": + Set or drag the left, right or horizontal scrollbar. Only + works when the scrollbar actually exists. The supported + items in {args} are: + which: scrollbar. The supported values are: + left Left scrollbar of the current window + right Right scrollbar of the current window + hor Horizontal scrollbar + value: amount to scroll. For the vertical scrollbars + the value can be 1 to the line-count of the + buffer. For the horizontal scrollbar the + value can be between 1 and the maximum line + length, assuming 'wrap' is not set. + dragging: 1 to drag the scrollbar and 0 to click in the + scrollbar. + "tabline": Inject a mouse click event on the tabline to select a tabpage. The supported items in {args} are: @@ -284,27 +303,6 @@ test_refcount({expr}) *test_refcount()* GetVarname()->test_refcount() -test_scrollbar({which}, {value}, {dragging}) *test_scrollbar()* - Pretend using scrollbar {which} to move it to position - {value}. {which} can be: - left Left scrollbar of the current window - right Right scrollbar of the current window - hor Horizontal scrollbar - - For the vertical scrollbars {value} can be 1 to the - line-count of the buffer. For the horizontal scrollbar the - {value} can be between 1 and the maximum line length, assuming - 'wrap' is not set. - - When {dragging} is non-zero it's like dragging the scrollbar, - otherwise it's like clicking in the scrollbar. - Only works when the {which} scrollbar actually exists, - obviously only when using the GUI. - - Can also be used as a |method|: > - GetValue()->test_scrollbar('right', 0) - - test_setmouse({row}, {col}) *test_setmouse()* Set the mouse position to be used for the next mouse action. {row} and {col} are one based. diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 5861fa8806..c74bce6713 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/tod