diff options
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/autoload/man.vim | 45 | ||||
| -rw-r--r-- | runtime/doc/deprecated.txt | 3 | ||||
| -rw-r--r-- | runtime/doc/eval.txt | 19 | ||||
| -rw-r--r-- | runtime/doc/options.txt | 79 | ||||
| -rw-r--r-- | runtime/doc/syntax.txt | 9 | ||||
| -rw-r--r-- | runtime/doc/vim_diff.txt | 10 |
6 files changed, 55 insertions, 110 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index f5b863a899..361ade59d3 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -1,16 +1,22 @@ " Maintainer: Anmol Sethi <anmol@aubble.com> -let s:man_find_arg = "-w" +let s:find_arg = '-w' +let s:localfile_arg = v:true " Always use -l if possible. #6683 -" TODO(nhooyr) Completion may work on SunOS; I'm not sure if `man -l` displays -" the list of searched directories. -try - if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5' - let s:man_find_arg = '-l' - endif -catch /E145:/ - " Ignore the error in restricted mode -endtry +function! s:init() abort + " TODO(nhooyr): Does `man -l` on SunOS list searched directories? + try + if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5' + let s:find_arg = '-l' + endif + " Check for -l support. + call s:get_page(s:get_path('', 'man')[0:-2]) + catch /E145:/ + " Ignore the error in restricted mode + catch /command error .*/ + let s:localfile_arg = v:false + endtry +endfunction function! man#open_page(count, count1, mods, ...) abort if a:0 > 2 @@ -88,10 +94,8 @@ endfunction " Handler for s:system() function. function! s:system_handler(jobid, data, event) dict abort - if a:event == 'stdout' - let self.stdout .= join(a:data, "\n") - elseif a:event == 'stderr' - let self.stderr .= join(a:data, "\n") + if a:event is# 'stdout' || a:event is# 'stderr' + let self[a:event] .= join(a:data, "\n") else let self.exit_code = a:data endif @@ -118,7 +122,7 @@ function! s:system(cmd, ...) abort try call jobstop(jobid) throw printf('command timed out: %s', join(a:cmd)) - catch /^Vim\%((\a\+)\)\=:E900/ + catch /^Vim(call):E900:/ endtry elseif res[0] == -2 throw printf('command interrupted: %s', join(a:cmd)) @@ -136,8 +140,7 @@ function! s:get_page(path) abort " Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db). " http://comments.gmane.org/gmane.editors.vim.devel/29085 let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man'] - " Use -l everywhere except macOS. #6683 - return s:system(cmd + (has('mac') ? [a:path] : ['-l', a:path])) + return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path])) endfunction function! s:put_page(page) abort @@ -201,14 +204,14 @@ endfunction function! s:get_path(sect, name) abort if empty(a:sect) - return s:system(['man', s:man_find_arg, a:name]) + return s:system(['man', s:find_arg, a:name]) endif " '-s' flag handles: " - tokens like 'printf(echo)' " - sections starting with '-' " - 3pcap section (found on macOS) " - commas between sections (for section priority) - return s:system(['man', s:man_find_arg, '-s', a:sect, a:name]) + return s:system(['man', s:find_arg, '-s', a:sect, a:name]) endfunction function! s:verify_exists(sect, name) abort @@ -333,7 +336,7 @@ endfunction function! s:complete(sect, psect, name) abort try - let mandirs = join(split(s:system(['man', s:man_find_arg]), ':\|\n'), ',') + let mandirs = join(split(s:system(['man', s:find_arg]), ':\|\n'), ',') catch call s:error(v:exception) return @@ -375,3 +378,5 @@ function! man#init_pager() abort endtry execute 'silent file man://'.fnameescape(ref) endfunction + +call s:init() diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index e77d20172e..26cd5b24cc 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -26,9 +26,6 @@ Events ~ *EncodingChanged* Never fired; 'encoding' is always "utf-8". *FileEncoding* Never fired; equivalent to |EncodingChanged|. -Highlight groups ~ -*hl-VisualNOS* Obsolete. |vim-differences| {Nvim} - Keycodes ~ *<MouseDown>* Use <ScrollWheelUp> instead. *<MouseUp>* Use <ScrollWheelDown> instead. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 911fe43819..44f2b3688c 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1749,9 +1749,7 @@ v:profiling Normally zero. Set to one after using ":profile start". See |profiling|. *v:progname* *progname-variable* -v:progname Contains the name (with path removed) with which Nvim was - invoked. Allows you to do special initialisations for any - name you might symlink to Nvim. +v:progname The name by which Nvim was invoked (with path removed). Read-only. *v:progpath* *progpath-variable* @@ -4665,10 +4663,23 @@ index({list}, {expr} [, {start} [, {ic}]]) *index()* input({prompt} [, {text} [, {completion}]]) *input()* +input({opts}) The result is a String, which is whatever the user typed on the command-line. The {prompt} argument is either a prompt string, or a blank string (for no prompt). A '\n' can be used in the prompt to start a new line. + + In the second form it accepts a single dictionary with the + following keys, any of which may be omitted: + + Key Default Description ~ + prompt "" Same as {prompt} in the first form. + default "" Same as {text} in the first form. + completion nothing Same as {completion} in the first form. + cancelreturn "" Same as {cancelreturn} from + |inputdialog()|. Also works with + input(). + The highlighting set with |:echohl| is used for the prompt. The input is entered just like a command-line, with the same editing commands and mappings. There is a separate history @@ -4710,6 +4721,7 @@ input({prompt} [, {text} [, {completion}]]) *input()* :endfunction inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* +inputdialog({opts}) Like |input()|, but when the GUI is running and text dialogs are supported, a dialog window pops up to input the text. Example: > @@ -4721,7 +4733,6 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* omitted an empty string is returned. Hitting <Enter> works like pressing the OK button. Hitting <Esc> works like pressing the Cancel button. - NOTE: Command-line completion is not supported. inputlist({textlist}) *inputlist()* {textlist} must be a |List| of strings. This |List| is diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index afc7c20ed5..8949d27dd6 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3120,82 +3120,9 @@ A jump table for the options with a short description can be found at |Q_op|. Think twice when using ":q!" or ":qa!". *'highlight'* *'hl'* -'highlight' 'hl' string (default: string of "c:group,..." pairs) - global - This option can be used to set highlighting mode for various - occasions. It is a comma separated list of character pairs. The - first character in a pair gives the occasion, the second the mode to - use for that occasion. The occasions are: - |hl-SpecialKey| 8 Meta and special keys listed with ":map" - |hl-Whitespace| 0 - |hl-EndOfBuffer| ~ lines after the last line in the buffer - |hl-NormalNC| I non-current ("inactive") window - |hl-TermCursor| z Cursor in a focused terminal - |hl-TermCursorNC| Z Cursor in an unfocused terminal - |hl-NonText| @ '@' at the end of the window and - characters from 'showbreak' - |hl-Directory| d directories in CTRL-D listing and other special - things in listings - |hl-ErrorMsg| e error messages - |hl-IncSearch| i 'incsearch' highlighting - |hl-Search| l last search pattern highlighting (see 'hlsearch') - |hl-MoreMsg| m |more-prompt| - |hl-ModeMsg| M Mode (e.g., "-- INSERT --") - |hl-LineNr| n line number for ":number" and ":#" commands, and - when 'number' or 'relativenumber' option is set. - |hl-CursorLineNr| N like n for when 'cursorline' or 'relativenumber' is - set. - |hl-Question| r |hit-enter| prompt and yes/no questions - |hl-StatusLine| s status line of current window |status-line| - |hl-StatusLineNC| S status lines of not-current windows - |hl-Title| t Titles for output from ":set all", ":autocmd" etc. - |hl-VertSplit| c column used to separate vertically split windows - |hl-Visual| v Visual mode - |hl-WarningMsg| w warning messages - |hl-WildMenu| W wildcard matches displayed for 'wildmenu' - |hl-Folded| f line used for closed folds - |hl-FoldColumn| F 'foldcolumn' - |hl-DiffAdd| A added line in diff mode - |hl-DiffChange| C changed line in diff mode - |hl-DiffDelete| D deleted line in diff mode - |hl-DiffText| T inserted text in diff mode - |hl-SignColumn| > column used for |signs| - |hl-SpellBad| B misspelled word |spell| - |hl-SpellCap| P word that should start with capital |spell| - |hl-SpellRare| R rare word |spell| - |hl-SpellLocal| L word from other region |spell| - |hl-Conceal| - the placeholders used for concealed characters - (see 'conceallevel') - |hl-Pmenu| + popup menu normal line - |hl-PmenuSel| = popup menu normal line - |hl-PmenuSbar| x popup menu scrollbar - |hl-PmenuThumb| X popup menu scrollbar thumb - - |hl-TabLine| * - |hl-TabLineFill| _ - |hl-TabLineSel| # - - |hl-ColorColumn| o - |hl-CursorColumn| ! - |hl-CursorLine| . - |hl-QuickFixLine| q - - The display modes are: - r reverse (termcap entry "mr" and "me") - i italic (termcap entry "ZH" and "ZR") - b bold (termcap entry "md" and "me") - s standout (termcap entry "so" and "se") - u underline (termcap entry "us" and "ue") - c undercurl (termcap entry "Cs" and "Ce") - n no highlighting - - no highlighting - : use a highlight group - The default is used for occasions that are not included. - When using the ':' display mode, this must be followed by the name of - a highlight group. A highlight group can be used to define any type - of highlighting, including using color. See |:highlight| on how to - define one. The default uses a different group for each occasion. - See |highlight-default| for the default highlight groups. +'highlight' 'hl' Removed. |vim-differences| + global + The builtin |highlight-groups| cannot be changed. *'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'* 'hlsearch' 'hls' boolean (default on) diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 18920d81e3..d711aa6a29 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -4849,10 +4849,9 @@ guisp={color-name} *highlight-guisp* :highlight Comment guifg=#11f0c3 guibg=#ff00ff < *highlight-groups* *highlight-default* -These are the default highlighting groups. These groups are used by the -'highlight' option default. Note that the highlighting depends on the value -of 'background'. You can see the current settings with the ":highlight" -command. +These are the builtin highlighting groups. Note that the highlighting depends +on the value of 'background'. You can see the current settings with the +":highlight" command. *hl-ColorColumn* ColorColumn used for the columns set with 'colorcolumn' *hl-Conceal* @@ -4973,6 +4972,8 @@ TabLineSel tab pages line, active tab page label Title titles for output from ":set all", ":autocmd" etc. *hl-Visual* Visual Visual mode selection + *hl-VisualNOS* +VisualNOS Visual mode selection when vim is "Not Owning the Selection". *hl-WarningMsg* WarningMsg warning messages *hl-Whitespace* diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index aba4420ebe..9a7789c0f5 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -107,8 +107,10 @@ Options: 'cpoptions' flags: |cpo-_| 'guicursor' works in the terminal 'inccommand' shows interactive results for |:substitute|-like commands + 'scrollback' 'statusline' supports unlimited alignment sections 'tabline' %@Func@foo%X can call any function on mouse-click + 'winhighlight' window-local highlights Variables: |v:event| @@ -244,6 +246,10 @@ Lua interface (|if_lua.txt|): - Lua has direct access to Nvim |API| via `vim.api`. - Currently, most legacy Vim features are missing. +|input()| and |inputdialog()| gained support for each other’s features (return +on cancel and completion respectively) via dictionary argument (replaces all +other arguments if used). + ============================================================================== 5. Missing legacy features *nvim-features-missing* @@ -287,9 +293,6 @@ MS-DOS support: 'bioskey' 'conskey' -Highlight groups: - |hl-VisualNOS| - Test functions: test_alloc_fail() test_autochdir() @@ -310,6 +313,7 @@ Other options: 'esckeys' 'guioptions' "t" flag was removed *'guipty'* (Nvim uses pipes and PTYs consistently on all platforms.) + 'highlight' (the builtin |highlight-groups| cannot be changed) *'imactivatefunc'* *'imaf'* *'imactivatekey'* *'imak'* *'imstatusfunc'* *'imsf'* |