diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-01 14:23:09 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-01 22:29:02 -0400 |
commit | 330500a5bfb1207e0c9eb79ac27fb8244da93ce0 (patch) | |
tree | bf830508b9063636dbbb064175ade5f2b7996bf9 /runtime/optwin.vim | |
parent | b16c7c515c34d2f695a595527594325abc6a640b (diff) | |
download | rneovim-330500a5bfb1207e0c9eb79ac27fb8244da93ce0.tar.gz rneovim-330500a5bfb1207e0c9eb79ac27fb8244da93ce0.tar.bz2 rneovim-330500a5bfb1207e0c9eb79ac27fb8244da93ce0.zip |
vim-patch:cb80aa2d53e5
Update runtime files.
https://github.com/vim/vim/commit/cb80aa2d53e56d3aba3b3c439fb467f29a750c5e
Omit runtime/doc/tabpage.txt.
Patch v8.2.1401 is not ported yet.
Port optwin.vim changes without gettext().
Patch v8.2.1544 is not ported yet.
Diffstat (limited to 'runtime/optwin.vim')
-rw-r--r-- | runtime/optwin.vim | 75 |
1 files changed, 44 insertions, 31 deletions
diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 3472ad6e28..9644223ba1 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2020 Jun 10 +" Last Change: 2020 Oct 23 " If there already is an option window, jump to that one. let buf = bufnr('option-window') @@ -69,6 +69,10 @@ fun! <SID>Space() endif endfun +let s:local_to_window = '(local to window)' +let s:local_to_buffer = '(local to buffer)' +let s:global_or_local = '(global or local to buffer)' + " find the window in which the option applies " returns 0 for global option, 1 for local option, -1 for error fun! <SID>Find(lnum) @@ -155,6 +159,16 @@ call append(6, '" Hit <Space> on a "set" line to refresh it.') " These functions are called often below. Keep them fast! +" Add an option name and explanation. The text can contain "\n" characters +" where a line break is to be inserted. +func <SID>AddOption(name, text) + let lines = split(a:text, "\n") + call append("$", a:name .. "\t" .. lines[0]) + for line in lines[1:] + call append("$", "\t" .. line) + endfor +endfunc + " Init a local binary option fun! <SID>BinOptionL(name) let val = getwinvar(winnr('#'), '&' . a:name) @@ -725,19 +739,19 @@ call <SID>OptionG("udir", &udir) call append("$", "undoreload\tmaximum number lines to save for undo on a buffer reload") call append("$", " \tset ur=" . &ur) call append("$", "modified\tchanges have been made and not written to a file") -call append("$", "\t(local to buffer)") +call append("$", "\t" .. s:local_to_buffer) call <SID>BinOptionL("mod") call append("$", "readonly\tbuffer is not to be written") -call append("$", "\t(local to buffer)") +call append("$", "\t" .. s:local_to_buffer) call <SID>BinOptionL("ro") -call append("$", "modifiable\tchanges to the text are not possible") -call append("$", "\t(local to buffer)") +call <SID>AddOption("modifiable", "changes to the text are possible") +call append("$", "\t" .. s:local_to_buffer) call <SID>BinOptionL("ma") call append("$", "textwidth\tline length above which to break a line") -call append("$", "\t(local to buffer)") +call append("$", "\t" .. s:local_to_buffer) call <SID>OptionL("tw") call append("$", "wrapmargin\tmargin from the right in which to break a line") -call append("$", "\t(local to buffer)") +call append("$", "\t" .. s:local_to_buffer) call <SID>OptionL("wm") call append("$", "backspace\tspecifies what <BS>, CTRL-W, etc. can do in Insert mode") call append("$", " \tset bs=" . &bs) @@ -789,20 +803,19 @@ if has("digraphs") endif call append("$", "tildeop\tthe \"~\" command behaves like an operator") call <SID>BinOptionG("top", &top) -call append("$", "operatorfunc\tfunction called for the\"g@\" operator") +call <SID>AddOption("operatorfunc", "function called for the \"g@\" operator") call <SID>OptionG("opfunc", &opfunc) call append("$", "showmatch\twhen inserting a bracket, briefly jump to its match") call <SID>BinOptionG("sm", &sm) call append("$", "matchtime\ttenth of a second to show a match for 'showmatch'") call append("$", " \tset mat=" . &mat) call append("$", "matchpairs\tlist of pairs that match for the \"%\" command") -call append("$", "\t(local to buffer)") +call append("$", "\t" .. s:local_to_buffer) call <SID>OptionL("mps") call append("$", "joinspaces\tuse two spaces after '.' when joining a line") call <SID>BinOptionG("js", &js) -call append("$", "nrformats\t\"alpha\", \"octal\" and/or \"hex\"; number formats recognized for") -call append("$", "\tCTRL-A and CTRL-X commands") -call append("$", "\t(local to buffer)") +call <SID>AddOption("nrformats", "\"alpha\", \"octal\", \"hex\", \"bin\" and/or \"unsigned\"; number formats\nrecognized for CTRL-A and CTRL-X commands") +call append("$", "\t" .. s:local_to_buffer) call <SID>OptionL("nf") @@ -876,11 +889,11 @@ endif if has("folding") call <SID>Header("folding") - call append("$", "foldenable\tset to display all folds open") - call append("$", "\t(local to window)") + call <SID>AddOption("foldenable", "unset to display all folds open") + call append("$", "\t" .. s:local_to_window) call <SID>BinOptionL("fen") call append("$", "foldlevel\tfolds with a level higher than this number will be closed") - call append("$", "\t(local to window)") + call append("$", "\t" .. s:local_to_window) call <SID>OptionL("fdl") call append("$", "foldlevelstart\tvalue for 'foldlevel' when starting to edit a file") call append("$", " \tset fdls=" . &fdls) @@ -899,20 +912,20 @@ if has("folding") call <SID>OptionL("fml") call append("$", "commentstring\ttemplate for comments; used to put the marker in") call <SID>OptionL("cms") - call append("$", "foldmethod\tfolding type: \"manual\", \"indent\", \"expr\", \"marker\" or \"syntax\"") - call append("$", "\t(local to window)") + call <SID>AddOption("foldmethod", "folding type: \"manual\", \"indent\", \"expr\", \"marker\",\n\"syntax\" or \"diff\"") + call append("$", "\t" .. s:local_to_window) call <SID>OptionL("fdm") call append("$", "foldexpr\texpression used when 'foldmethod' is \"expr\"") - call append("$", "\t(local to window)") + call append("$", "\t" .. s:local_to_window) call <SID>OptionL("fde") call append("$", "foldignore\tused to ignore lines when 'foldmethod' is \"indent\"") - call append("$", "\t(local to window)") + call append("$", "\t" .. s:local_to_window) call <SID>OptionL("fdi") call append("$", "foldmarker\tmarkers used when 'foldmethod' is \"marker\"") - call append("$", "\t(local to window)") + call append("$", "\t" .. s:local_to_window) call <SID>OptionL("fmr") call append("$", "foldnestmax\tmaximum fold depth for when 'foldmethod' is \"indent\" or \"syntax\"") - call append("$", "\t(local to window)") + call append("$", "\t" .. s:local_to_window) call <SID>OptionL("fdn") endif @@ -1017,7 +1030,7 @@ call append("$", " \tset ut=" . &ut) call <SID>Header("command line editing") -call append("$", "history\thow many command lines are remembered ") +call <SID>AddOption("history", "how many command lines are remembered") call append("$", " \tset hi=" . &hi) call append("$", "wildchar\tkey that triggers command-line expansion") call append("$", " \tset wc=" . &wc) @@ -1105,12 +1118,12 @@ if has("quickfix") endif -if has("msdos") || has("win16") || has("win32") +if has("win32") call <SID>Header("system specific") - if has("msdos") || has("win16") || has("win32") - call append("$", "shellslash\tuse forward slashes in file names; for Unix-like shells") - call <SID>BinOptionG("ssl", &ssl) - endif + call <SID>AddOption("shellslash", "use forward slashes in file names; for Unix-like shells") + call <SID>BinOptionG("ssl", &ssl) + call <SID>AddOption("completeslash", "specifies slash/backslash used for completion") + call <SID>OptionG("csl", &csl) endif @@ -1214,7 +1227,7 @@ endif call <SID>Header("various") -call append("$", "virtualedit\twhen to use virtual editing: \"block\", \"insert\" and/or \"all\"") +call <SID>AddOption("virtualedit", "when to use virtual editing: \"block\", \"insert\", \"all\"\nand/or \"onemore\"") call <SID>OptionG("ve", &ve) call append("$", "eventignore\tlist of autocommand events which are to be ignored") call <SID>OptionG("ei", &ei) @@ -1248,10 +1261,10 @@ if has("shada") endif if has("quickfix") call append("$", "bufhidden\twhat happens with a buffer when it's no longer in a window") - call append("$", "\t(local to buffer)") + call append("$", "\t" .. s:local_to_buffer) call <SID>OptionL("bh") - call append("$", "buftype\t\"\", \"nofile\", \"nowrite\" or \"quickfix\": type of buffer") - call append("$", "\t(local to buffer)") + call <SID>AddOption("buftype", "empty, \"nofile\", \"nowrite\", \"quickfix\", etc.: type of buffer") + call append("$", "\t" .. s:local_to_buffer) call <SID>OptionL("bt") endif call append("$", "buflisted\twhether the buffer shows up in the buffer list") |