diff options
216 files changed, 3104 insertions, 10851 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a47869a3c6..cb5cb09595 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,9 +143,9 @@ set(NVIM_VERSION_PATCH 0) set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers # API level -set(NVIM_API_LEVEL 10) # Bump this after any API change. +set(NVIM_API_LEVEL 11) # Bump this after any API change. set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change. -set(NVIM_API_PRERELEASE false) +set(NVIM_API_PRERELEASE true) set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}") # NVIM_VERSION_CFLAGS set further below. @@ -498,34 +498,30 @@ if(MSGPACK_HAS_FLOAT32) add_definitions(-DNVIM_MSGPACK_HAS_FLOAT32) endif() -option(FEAT_TUI "Enable the Terminal UI" ON) - -if(FEAT_TUI) - find_package(UNIBILIUM 2.0 REQUIRED) - include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS}) - - list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}") - list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}") - check_c_source_compiles(" - #include <unibilium.h> - - int - main(void) - { - unibi_str_from_var(unibi_var_from_str(\"\")); - return unibi_num_from_var(unibi_var_from_num(0)); - } - " UNIBI_HAS_VAR_FROM) - list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}") - list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}") - if(UNIBI_HAS_VAR_FROM) - add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM) - endif() +find_package(UNIBILIUM 2.0 REQUIRED) +include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS}) + +list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}") +list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}") +check_c_source_compiles(" +#include <unibilium.h> - find_package(LibTermkey 0.22 REQUIRED) - include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS}) +int +main(void) +{ + unibi_str_from_var(unibi_var_from_str(\"\")); + return unibi_num_from_var(unibi_var_from_num(0)); +} +" UNIBI_HAS_VAR_FROM) +list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}") +list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}") +if(UNIBI_HAS_VAR_FROM) + add_definitions(-DNVIM_UNIBI_HAS_VAR_FROM) endif() +find_package(LibTermkey 0.22 REQUIRED) +include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS}) + find_package(LIBVTERM 0.3 REQUIRED) include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS}) @@ -1,22 +1,19 @@ <h1 align="center"> <img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim"> -</h1> -[Documentation](https://neovim.io/doc/) | -[Chat](https://app.element.io/#/room/#neovim:matrix.org) | -[Twitter](https://twitter.com/Neovim) + <a href="https://neovim.io/doc/">Documentation</a> | + <a href="https://app.element.io/#/room/#neovim:matrix.org">Chat</a> +</h1> -[](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush) +[](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush) [](https://scan.coverity.com/projects/2227) [](https://neovim.io/doc/reports/clang) [](https://neovim.io/doc/reports/pvs/PVS-studio.html.d) - [](https://repology.org/metapackage/neovim) [](https://buildd.debian.org/neovim) [](https://github.com/neovim/neovim/releases/) -[](https://snapcraft.io/nvim) -Neovim is a project that seeks to aggressively refactor Vim in order to: +Neovim is a project that seeks to aggressively refactor [Vim](https://www.vim.org/) in order to: - Simplify maintenance and encourage [contributions](CONTRIBUTING.md) - Split the work between multiple developers diff --git a/cmake.config/CMakeLists.txt b/cmake.config/CMakeLists.txt index b11ee2d969..183954b889 100644 --- a/cmake.config/CMakeLists.txt +++ b/cmake.config/CMakeLists.txt @@ -46,6 +46,26 @@ check_function_exists(strcasecmp HAVE_STRCASECMP) check_function_exists(strncasecmp HAVE_STRNCASECMP) check_function_exists(strptime HAVE_STRPTIME) +check_c_source_compiles(" +#include <sys/types.h> +#include <dirent.h> +int main(void) +{ + DIR *dir = opendir(\"dirname\"); + dirfd(dir); + return 0; +} +" HAVE_DIRFD) + +check_c_source_compiles(" +#include <sys/file.h> +int main(void) +{ + flock(10, LOCK_SH); + return 0; +} +" HAVE_FLOCK) + if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") check_c_source_compiles(" #include <termios.h> diff --git a/cmake.config/config.h.in b/cmake.config/config.h.in index 59be83fb5e..f946fa6124 100644 --- a/cmake.config/config.h.in +++ b/cmake.config/config.h.in @@ -54,10 +54,10 @@ # undef HAVE_SYS_UIO_H # endif #endif +#cmakedefine HAVE_DIRFD +#cmakedefine HAVE_FLOCK #cmakedefine HAVE_FORKPTY -#cmakedefine FEAT_TUI - #ifndef UNIT_TESTING #cmakedefine LOG_LIST_ACTIONS #endif diff --git a/cmake.config/iwyu/mapping.imp b/cmake.config/iwyu/mapping.imp index 47f4274265..592c60b756 100644 --- a/cmake.config/iwyu/mapping.imp +++ b/cmake.config/iwyu/mapping.imp @@ -69,7 +69,6 @@ { include: [ '"garray.h.generated.h"', private, '"nvim/garray.h"', public ] }, { include: [ '"getchar.h.generated.h"', private, '"nvim/getchar.h"', public ] }, { include: [ '"grid.h.generated.h"', private, '"nvim/grid.h"', public ] }, - { include: [ '"hardcopy.h.generated.h"', private, '"nvim/hardcopy.h"', public ] }, { include: [ '"hashtab.h.generated.h"', private, '"nvim/hashtab.h"', public ] }, { include: [ '"help.h.generated.h"', private, '"nvim/help.h"', public ] }, { include: [ '"highlight.h.generated.h"', private, '"nvim/highlight.h"', public ] }, @@ -121,7 +120,6 @@ { include: [ '"os/shell.h.generated.h"', private, '"nvim/os/shell.h"', public ] }, { include: [ '"os/signal.h.generated.h"', private, '"nvim/os/signal.h"', public ] }, { include: [ '"os/time.h.generated.h"', private, '"nvim/os/time.h"', public ] }, - { include: [ '"os_unix.h.generated.h"', private, '"nvim/os_unix.h"', public ] }, { include: [ '"path.h.generated.h"', private, '"nvim/path.h"', public ] }, { include: [ '"plines.h.generated.h"', private, '"nvim/plines.h"', public ] }, { include: [ '"popupmenu.h.generated.h"', private, '"nvim/popupmenu.h"', public ] }, diff --git a/contrib/flake.nix b/contrib/flake.nix index e4242586fc..0898c943d7 100644 --- a/contrib/flake.nix +++ b/contrib/flake.nix @@ -10,9 +10,12 @@ { overlay = final: prev: { - neovim = final.neovim-unwrapped.overrideAttrs (oa: { - version = "master"; + neovim = final.neovim-unwrapped.overrideAttrs (oa: rec { + version = self.shortRev or "dirty"; src = ../.; + preConfigure = '' + sed -i cmake.config/versiondef.h.in -e 's/@NVIM_VERSION_PRERELEASE@/-dev-${version}/' + ''; }); # a development binary to help debug issues diff --git a/contrib/luarc.json b/contrib/luarc.json index 68d1d5800a..ebad0581b9 100644 --- a/contrib/luarc.json +++ b/contrib/luarc.json @@ -11,6 +11,7 @@ "after_each", "setup", "teardown", + "finally", "lfs" ] }, diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 9aa0c5eac0..581a4545db 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -63,7 +63,7 @@ foreach(DF ${DOCFILES}) endforeach() add_custom_command(OUTPUT ${GENERATED_HELP_TAGS} - COMMAND ${CMAKE_COMMAND} -E remove doc/* + COMMAND ${CMAKE_COMMAND} -E remove_directory doc COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/runtime/doc doc COMMAND "${PROJECT_BINARY_DIR}/bin/nvim" diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 24d2cfc460..2fcf0b32c7 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -6446,7 +6446,6 @@ fun! s:NetrwMaps(islocal) " if !hasmapto('<Plug>NetrwMarkFileGrep') |nmap <buffer> <silent> <nowait> mg <Plug>NetrwMarkFileGrep|endif " if !hasmapto('<Plug>NetrwMarkHideSfx') |nmap <buffer> <silent> <nowait> mh <Plug>NetrwMarkHideSfx|endif " if !hasmapto('<Plug>NetrwMarkFileMove') |nmap <buffer> <silent> <nowait> mm <Plug>NetrwMarkFileMove|endif -" if !hasmapto('<Plug>NetrwMarkFilePrint') |nmap <buffer> <silent> <nowait> mp <Plug>NetrwMarkFilePrint|endif " if !hasmapto('<Plug>NetrwMarkFileRegexp') |nmap <buffer> <silent> <nowait> mr <Plug>NetrwMarkFileRegexp|endif " if !hasmapto('<Plug>NetrwMarkFileSource') |nmap <buffer> <silent> <nowait> ms <Plug>NetrwMarkFileSource|endif " if !hasmapto('<Plug>NetrwMarkFileTag') |nmap <buffer> <silent> <nowait> mT <Plug>NetrwMarkFileTag|endif @@ -6509,7 +6508,6 @@ fun! s:NetrwMaps(islocal) nnoremap <buffer> <silent> <nowait> mg :<c-u>call <SID>NetrwMarkFileGrep(1)<cr> nnoremap <buffer> <silent> <nowait> mh :<c-u>call <SID>NetrwMarkHideSfx(1)<cr> nnoremap <buffer> <silent> <nowait> mm :<c-u>call <SID>NetrwMarkFileMove(1)<cr> - nnoremap <buffer> <silent> <nowait> mp :<c-u>call <SID>NetrwMarkFilePrint(1)<cr> nnoremap <buffer> <silent> <nowait> mr :<c-u>call <SID>NetrwMarkFileRegexp(1)<cr> nnoremap <buffer> <silent> <nowait> ms :<c-u>call <SID>NetrwMarkFileSource(1)<cr> nnoremap <buffer> <silent> <nowait> mT :<c-u>call <SID>NetrwMarkFileTag(1)<cr> @@ -6622,7 +6620,6 @@ fun! s:NetrwMaps(islocal) nnoremap <buffer> <silent> <nowait> mg :<c-u>call <SID>NetrwMarkFileGrep(0)<cr> nnoremap <buffer> <silent> <nowait> mh :<c-u>call <SID>NetrwMarkHideSfx(0)<cr> nnoremap <buffer> <silent> <nowait> mm :<c-u>call <SID>NetrwMarkFileMove(0)<cr> - nnoremap <buffer> <silent> <nowait> mp :<c-u>call <SID>NetrwMarkFilePrint(0)<cr> nnoremap <buffer> <silent> <nowait> mr :<c-u>call <SID>NetrwMarkFileRegexp(0)<cr> nnoremap <buffer> <silent> <nowait> ms :<c-u>call <SID>NetrwMarkFileSource(0)<cr> nnoremap <buffer> <silent> <nowait> mT :<c-u>call <SID>NetrwMarkFileTag(0)<cr> @@ -7840,46 +7837,6 @@ fun! s:NetrwMarkFileMove(islocal) endfun " --------------------------------------------------------------------- -" s:NetrwMarkFilePrint: (invoked by mp) This function prints marked files {{{2 -" using the hardcopy command. Local marked-file list only. -fun! s:NetrwMarkFilePrint(islocal) -" call Dfunc("s:NetrwMarkFilePrint(islocal=".a:islocal.")") - let curbufnr= bufnr("%") - - " sanity check - if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr}) - NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66) -" call Dret("s:NetrwMarkFilePrint") - return - endif -" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("<slnum>")) - let curdir= s:NetrwGetCurdir(a:islocal) - - if exists("s:netrwmarkfilelist_{curbufnr}") - let netrwmarkfilelist = s:netrwmarkfilelist_{curbufnr} - call s:NetrwUnmarkList(curbufnr,curdir) - for fname in netrwmarkfilelist - if a:islocal - if g:netrw_keepdir - let fname= s:ComposePath(curdir,fname) - endif - else - let fname= curdir.fname - endif - 1split - " the autocmds will handle both local and remote files -" call Decho("exe sil e ".escape(fname,' '),'~'.expand("<slnum>")) - exe "sil NetrwKeepj e ".fnameescape(fname) -" call Decho("hardcopy",'~'.expand("<slnum>")) - hardcopy - q - endfor - 2match none - endif -" call Dret("s:NetrwMarkFilePrint") -endfun - -" --------------------------------------------------------------------- " s:NetrwMarkFileRegexp: (invoked by mr) This function is used to mark {{{2 " files when given a regexp (for which a prompt is " issued) (matches to name of files). diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 3cd4578750..32c7ba67a5 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -2535,8 +2535,8 @@ nvim_buf_get_extmarks({buffer}, {ns_id}, {start}, {end}, {opts}) Region can be given as (row,col) tuples, or valid extmark ids (whose positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1) respectively, thus the following are equivalent: >lua - nvim_buf_get_extmarks(0, my_ns, 0, -1, {}) - nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {}) + vim.api.nvim_buf_get_extmarks(0, my_ns, 0, -1, {}) + vim.api.nvim_buf_get_extmarks(0, my_ns, {0,0}, {-1,-1}, {}) < If `end` is less than `start`, traversal works backwards. (Useful with @@ -3071,8 +3071,8 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()* borders but not horizontal ones. By default, `FloatBorder` highlight is used, which links to `WinSeparator` when not defined. It could also be - specified by character: [ {"+", "MyCorner"}, {"x", - "MyBorder"} ]. + specified by character: [ ["+", "MyCorner"], ["x", + "MyBorder"] ]. • title: Title (optional) in window border, String or list. List is [text, highlight] tuples. if is string the default @@ -3471,6 +3471,12 @@ nvim_ui_pum_set_height({height}) *nvim_ui_pum_set_height()* Parameters: ~ • {height} Popupmenu height, must be greater than zero. +nvim_ui_set_focus({gained}) *nvim_ui_set_focus()* + Tells the nvim server if focus was gained or lost by the GUI. + + Attributes: ~ + |RPC| only + nvim_ui_set_option({name}, {value}) *nvim_ui_set_option()* TODO: Documentation diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index f9917ed035..cc1d1b568d 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -68,8 +68,8 @@ bufnr([{expr} [, {create}]]) Number Number of the buffer {expr} bufwinid({expr}) Number |window-ID| of buffer {expr} bufwinnr({expr}) Number window number of buffer {expr} byte2line({byte}) Number line number at byte count {byte} -byteidx({expr}, {nr}) Number byte index of {nr}'th char in {expr} -byteidxcomp({expr}, {nr}) Number byte index of {nr}'th char in {expr} +byteidx({expr}, {nr}) Number byte index of {nr}th char in {expr} +byteidxcomp({expr}, {nr}) Number byte index of {nr}th char in {expr} call({func}, {arglist} [, {dict}]) any call {func} with arguments {arglist} ceil({expr}) Float round {expr} up @@ -318,9 +318,9 @@ matchfuzzypos({list}, {str} [, {dict}]) matchlist({expr}, {pat} [, {start} [, {count}]]) List match and submatches of {pat} in {expr} matchstr({expr}, {pat} [, {start} [, {count}]]) - String {count}'th match of {pat} in {expr} + String {count}th match of {pat} in {expr} matchstrpos({expr}, {pat} [, {start} [, {count}]]) - List {count}'th match of {pat} in {expr} + List {count}th match of {pat} in {expr} max({expr}) Number maximum value of items in {expr} menu_get({path} [, {modes}]) List description of |menus| matched by {path} menu_info({name} [, {mode}]) Dict get menu item information @@ -956,7 +956,7 @@ byte2line({byte}) *byte2line()* GetOffset()->byte2line() byteidx({expr}, {nr}) *byteidx()* - Return byte index of the {nr}'th character in the String + Return byte index of the {nr}th character in the String {expr}. Use zero for the first character, it then returns zero. If there are no multibyte characters the returned value is @@ -1508,7 +1508,7 @@ debugbreak({pid}) *debugbreak()* Specifically used to interrupt a program being debugged. It will cause process {pid} to get a SIGTRAP. Behavior for other processes is undefined. See |terminal-debug|. - {Sends a SIGINT to a process {pid} other than MS-Windows} + (Sends a SIGINT to a process {pid} other than MS-Windows) Returns |TRUE| if successfully interrupted the program. Otherwise returns |FALSE|. @@ -1597,9 +1597,9 @@ dictwatcheradd({dict}, {pattern}, {callback}) *dictwatcheradd()* call dictwatcheradd(g:, '*', 'OnDictChanged') < For now {pattern} only accepts very simple patterns that can - contain a '*' at the end of the string, in which case it will - match every key that begins with the substring before the '*'. - That means if '*' is not the last character of {pattern}, only + contain a "*" at the end of the string, in which case it will + match every key that begins with the substring before the "*". + That means if "*" is not the last character of {pattern}, only keys that are exactly equal as {pattern} will be matched. The {callback} receives three arguments: @@ -4956,7 +4956,7 @@ match({expr}, {pat} [, {start} [, {count}]]) *match()* If {start} is out of range ({start} > strlen({expr}) for a String or {start} > len({expr}) for a |List|) -1 is returned. - When {count} is given use the {count}'th match. When a match + When {count} is given use the {count}th match. When a match is found in a String the search for the next one starts one character further. Thus this example results in 1: > echo match("testing", "..", 0, 2) @@ -5186,7 +5186,7 @@ matchfuzzy({list}, {str} [, {dict}]) *matchfuzzy()* :let l = readfile("buffer.c")->matchfuzzy("str") < results in a list of lines in "buffer.c" fuzzy matching "str". > :echo ['one two', 'two one']->matchfuzzy('two one') -< results in ['two one', 'one two']. > +< results in `['two one', 'one two']` . > :echo ['one two', 'two one']->matchfuzzy('two one', \ {'matchseq': 1}) < results in ['two one']. @@ -6683,7 +6683,7 @@ searchcount([{options}]) *searchcount()* pos |List| `[lnum, col, off]` value when recomputing the result. this changes "current" result - value. see |cursor()|, |getpos() + value. see |cursor()|, |getpos()| (default: cursor's position) Can also be used as a |method|: > @@ -8147,7 +8147,7 @@ strwidth({string}) *strwidth()* submatch({nr} [, {list}]) *submatch()* *E935* Only for an expression in a |:substitute| command or substitute() function. - Returns the {nr}'th submatch of the matched text. When {nr} + Returns the {nr}th submatch of the matched text. When {nr} is 0 the whole matched text is returned. Note that a NL in the string can stand for a line break of a multi-line match or a NUL character in the text. diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index f38f123393..382d025d3c 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -137,6 +137,10 @@ Otherwise they are set to their default value: 'foldmethod' "manual" 'foldcolumn' 0 +'foldenable' will most-likely be reset to off. That is when 'foldmethod' is +restored to "manual". The folds themselves are not cleared but they should +not show up, resetting 'foldenable' is the best way to do that. + ============================================================================== 2. Viewing diffs *view-diffs* diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 13b953ed60..f77db5fab3 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -345,9 +345,9 @@ escaped with a backslash. Wildcards in {file} are expanded, but as with file completion, 'wildignore' and 'suffixes' apply. Which wildcards are supported depends on the system. These are the common ones: - ? matches one character - * matches anything, including nothing - ** matches anything, including nothing, recurses into directories + `?` matches one character + `*` matches anything, including nothing + `**` matches anything, including nothing, recurses into directories [abc] match 'a', 'b' or 'c' To avoid the special meaning of the wildcards prepend a backslash. However, @@ -406,7 +406,7 @@ external command, by putting an equal sign right after the first backtick, e.g.: > :e `=tempname()` The expression can contain just about anything, thus this can also be used to -avoid the special meaning of '"', '|', '%' and '#'. However, 'wildignore' +avoid the special meaning of '"', "|", '%' and '#'. However, 'wildignore' does apply like to other wildcards. Environment variables in the expression are expanded when evaluating the @@ -894,7 +894,7 @@ changed. This is done for all *.c files. Example: > :args *.[ch] :argdo %s/\<my_foo\>/My_Foo/ge | update -This changes the word "my_foo" to "My_Foo" in all *.c and *.h files. The "e" +This changes the word "my_foo" to "My_Foo" in all "*.c" and "*.h" files. The "e" flag is used for the ":substitute" command to avoid an error for files where "my_foo" isn't used. ":update" writes the file only if changes were made. @@ -1276,8 +1276,8 @@ unmodified. For MS-Windows you can modify the filters that are used in the browse dialog. By setting the g:browsefilter or b:browsefilter variables, you can change the filters globally or locally to the buffer. The variable is set to -a string in the format "{filter label}\t{pattern};{pattern}\n" where {filter -label} is the text that appears in the "Files of Type" comboBox, and {pattern} +a string in the format "{filter label}\t{pattern};{pattern}\n" where "{filter +label}" is the text that appears in the "Files of Type" comboBox, and {pattern} is the pattern which filters the filenames. Several patterns can be given, separated by ';'. @@ -1576,8 +1576,8 @@ which is slightly different. There are three different types of searching: 1) Downward search: *starstar* - Downward search uses the wildcards '*', '**' and possibly others - supported by your operating system. '*' and '**' are handled inside Vim, + Downward search uses the wildcards "*", "**" and possibly others + supported by your operating system. "*" and "**" are handled inside Vim, so they work on all operating systems. Note that "**" only acts as a special wildcard when it is at the start of a name. @@ -1585,12 +1585,12 @@ There are three different types of searching: search pattern this would be ".*". Note that the "." is not used for file searching. - '**' is more sophisticated: + "**" is more sophisticated: - It ONLY matches directories. - It matches up to 30 directories deep by default, so you can use it to search an entire directory tree - The maximum number of levels matched can be given by appending a number - to '**'. + to "**". Thus '/usr/**2' can match: > /usr /usr/include @@ -1601,14 +1601,14 @@ There are three different types of searching: .... < It does NOT match '/usr/include/g++/std' as this would be three levels. - The allowed number range is 0 ('**0' is removed) to 100 + The allowed number range is 0 ("**0" is removed) to 100 If the given number is smaller than 0 it defaults to 30, if it's bigger than 100 then 100 is used. The system also has a limit on the path length, usually 256 or 1024 bytes. - - '**' can only be at the end of the path or be followed by a path + - "**" can only be at the end of the path or be followed by a path separator or by a number and a path separator. - You can combine '*' and '**' in any order: > + You can combine "*" and "**" in any order: > /usr/**/sys/* /usr/*tory/sys/** /usr/**2/sys/* diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 61d540a3dd..151036529d 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -840,8 +840,8 @@ Example: > All expressions within one level are parsed from left to right. +------------------------------------------------------------------------------ expr1 *expr1* *ternary* *E109* ------ expr2 ? expr1 : expr1 @@ -867,8 +867,8 @@ You should always put a space before the ':', otherwise it can be mistaken for use in a variable such as "a:1". +------------------------------------------------------------------------------ expr2 and expr3 *expr2* *expr3* ---------------- expr3 || expr3 .. logical OR *expr-barbar* expr4 && expr4 .. logical AND *expr-&&* @@ -906,8 +906,8 @@ This is valid whether "b" has been defined or not. The second clause will only be evaluated if "b" has been defined. +------------------------------------------------------------------------------ expr4 *expr4* ------ expr5 {cmp} expr5 @@ -1010,8 +1010,9 @@ can be matched like an ordinary character. Examples: "foo\nbar" =~ "\\n" evaluates to 0 +------------------------------------------------------------------------------ expr5 and expr6 *expr5* *expr6* ---------------- + expr6 + expr6 Number addition, |List| or |Blob| concatenation *expr-+* expr6 - expr6 Number subtraction *expr--* expr6 . expr6 String concatenation *expr-.* @@ -1064,8 +1065,9 @@ None of these work for |Funcref|s. . and % do not work for Float. *E804* +------------------------------------------------------------------------------ expr7 *expr7* ------ + ! expr7 logical NOT *expr-!* - expr7 unary minus *expr-unary--* + expr7 unary plus *expr-unary-+* @@ -1082,8 +1084,9 @@ These three can be repeated and mixed. Examples: --9 == 9 +------------------------------------------------------------------------------ expr8 *expr8* ------ + This expression is either |expr9| or a sequence of the alternatives below, in any order. E.g., these are all possible: expr8[expr1].name @@ -1234,8 +1237,9 @@ When using the lambda form there must be no white space between the } and the *expr9* +------------------------------------------------------------------------------ number ------- + number number constant *expr-number* *0x* *hex-number* *0o* *octal-number* *binary-number* @@ -1297,9 +1301,9 @@ function. Example: > < 7.853981633974483e-01 - +------------------------------------------------------------------------------ string *string* *String* *expr-string* *E114* ------- + "string" string constant *expr-quote* Note that double quotes are used. @@ -1338,16 +1342,17 @@ encodings. Use "\u00ff" to store character 255 correctly as UTF-8. Note that "\000" and "\x00" force the end of the string. +------------------------------------------------------------------------------ blob-literal *blob-literal* *E973* ------------- Hexadecimal starting with 0z or 0Z, with an arbitrary number of bytes. The sequence must be an even number of hex characters. Example: > :let b = 0zFF00ED015DAF +------------------------------------------------------------------------------ literal-string *literal-string* *E115* ---------------- + 'string' string constant *expr-'* Note that single quotes are used. @@ -1361,8 +1366,9 @@ to be doubled. These two commands are equivalent: > if a =~ '\s*' +------------------------------------------------------------------------------ option *expr-option* *E112* *E113* ------- + &option option value, local value if possible &g:option global option value &l:option local option value @@ -1376,8 +1382,9 @@ and there is no buffer-local or window-local value, the global value is used anyway. +------------------------------------------------------------------------------ register *expr-register* *@r* --------- + @r contents of register 'r' The result is the contents of the named register, as a single string. @@ -1394,8 +1401,9 @@ nesting *expr-nesting* *E110* (expr1) nested expression +------------------------------------------------------------------------------ environment variable *expr-env* --------------------- + $VAR environment variable The String value of any environment variable. When it is not defined, the @@ -1420,20 +1428,23 @@ The first one probably doesn't echo anything, the second echoes the $shell variable (if your shell supports it). +------------------------------------------------------------------------------ internal variable *expr-variable* ------------------ + variable internal variable See below |internal-variables|. +------------------------------------------------------------------------------ function call *expr-function* *E116* *E118* *E119* *E120* -------------- + function(expr1, ...) function call See below |functions|. +------------------------------------------------------------------------------ lambda expression *expr-lambda* *lambda* ------------------ + {args -> expr1} lambda expression A lambda expression creates a new unnamed function which returns the result of @@ -1524,7 +1535,7 @@ specified by what is prepended: |tabpage-variable| t: Local to the current tab page. |global-variable| g: Global. |local-variable| l: Local to a function. -|script-variable| s: Local to a |:source|'ed Vim script. +|script-variable| s: Local to a |:source|d Vim script. |function-argument| a: Function argument (only inside a function). |vim-variable| v: Global, predefined by Vim. @@ -1707,17 +1718,13 @@ v:charconvert_to Only valid while evaluating the 'charconvert' option. *v:cmdarg* *cmdarg-variable* -v:cmdarg This variable is used for two purposes: - 1. The extra arguments ("++p", "++enc=", "++ff=") given to - a file read/write command. This is set before an - autocommand event for a file read/write command is - triggered. There is a leading space to make it possible to - append this variable directly after the read/write command. - Note: "+cmd" isn't included here, because it will be - executed anyway. - 2. When printing a PostScript file with ":hardcopy" this is - the argument for the ":hardcopy" command. This can be used - in 'printexpr'. +v:cmdarg + The extra arguments ("++p", "++enc=", "++ff=") given to a file + read/write command. This is set before an autocommand event + for a file read/write command is triggered. There is a + leading space to make it possible to append this variable + directly after the read/write command. Note: "+cmd" isn't + included here, because it will be executed anyway. *v:collate* *collate-variable* v:collate The current locale setting for collation order of the runtime @@ -1915,17 +1922,16 @@ v:fname_in The name of the input file. Valid while evaluating: 'charconvert' file to be converted 'diffexpr' original file 'patchexpr' original file - 'printexpr' file to be printed And set to the swap file name for |SwapExists|. *v:fname_out* *fname_out-variable* v:fname_out The name of the output file. Only valid while evaluating: option used for ~ - 'charconvert' resulting converted file (*) + 'charconvert' resulting converted file [1] 'diffexpr' output of diff 'patchexpr' resulting patched file - (*) When doing conversion for a write command (e.g., ":w + [1] When doing conversion for a write command (e.g., ":w file") it will be equal to v:fname_in. When doing conversion for a read command (e.g., ":e file") it will be a temporary file and different from v:fname_in. diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index ccb1499371..21a244e67a 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -37,8 +37,9 @@ The SQL ftplugin provides a number of options to assist with file navigation. +------------------------------------------------------------------------------ 1.1 Matchit *sql-matchit* ------------ + The matchit plugin (https://www.vim.org/scripts/script.php?script_id=39) provides many additional features and can be customized for different languages. The matchit plugin is configured by defining a local @@ -85,8 +86,9 @@ The following keywords are supported: > returns +------------------------------------------------------------------------------ 1.2 Text Object Motions *sql-object-motions* ------------------------ + Vim has a number of predefined keys for working with text |object-motions|. This filetype plugin attempts to translate these keys to maps which make sense for the SQL language. @@ -99,8 +101,9 @@ file): > [] move backwards to the previous 'end' +------------------------------------------------------------------------------ 1.3 Predefined Object Motions *sql-predefined-objects* ------------------------------ + Most relational databases support various standard features, tables, indices, triggers and stored procedures. Each vendor also has a variety of proprietary objects. The next set of maps have been created to help move between these @@ -166,8 +169,9 @@ with comments: > +------------------------------------------------------------------------------ 1.4 Macros *sql-macros* ----------- + Vim's feature to find macro definitions, |'define'|, is supported using this regular expression: > \c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\> @@ -230,8 +234,9 @@ The majority of people work with only one vendor's database product, it would be nice to specify a default in your |init.vim|. +------------------------------------------------------------------------------ 2.1 SQLSetType *sqlsettype* *SQLSetType* --------------- + For the people that work with many different databases, it is nice to be able to flip between the various vendors rules (indent, syntax) on a per buffer basis, at any time. The ftplugin/sql.vim file defines this function: > @@ -259,8 +264,9 @@ of available Vim script names: > :SQL<Tab><space><Tab> +------------------------------------------------------------------------------ 2.2 SQLGetType *sqlgettype* *SQLGetType* --------------- + At anytime you can determine which SQL dialect you are using by calling the SQLGetType command. The ftplugin/sql.vim file defines this function: > SQLGetType @@ -269,8 +275,9 @@ This will echo: > Current SQL dialect in use:sqlanywhere +------------------------------------------------------------------------------ 2.3 SQL Dialect Default *sql-type-default* ------------------------ + As mentioned earlier, the default syntax rules for Vim is based on Oracle (PL/SQL). You can override this default by placing one of the following in your |init.vim|: > @@ -325,8 +332,9 @@ highlight rules. The dynamic mode populates the popups with data retrieved directly from a database. This includes, table lists, column lists, procedures names and more. +------------------------------------------------------------------------------ 4.1 Static Mode *sql-completion-static* ---------------- + The static popups created contain items defined by the active syntax rules while editing a file with a filetype of SQL. The plugin defines (by default) various maps to help the user refine the list of items to be displayed. @@ -399,8 +407,9 @@ Here are some examples of the entries which are pulled from the syntax files: > - Integer, Char, Varchar, Date, DateTime, Timestamp, ... +------------------------------------------------------------------------------ 4.2 Dynamic Mode *sql-completion-dynamic* ----------------- + Dynamic mode populates the popups with data directly from a database. In order for the dynamic feature to be enabled you must have the dbext.vim plugin installed, (https://vim.sourceforge.net/script.php?script_id=356). @@ -448,8 +457,8 @@ necessary to clear the plugins cache. The default map for this is: > imap <buffer> <C-C>R <C-\><C-O>:call sqlcomplete#Map('ResetCache')<CR><C-X><C-O> +------------------------------------------------------------------------------ 4.3 SQL Tutorial *sql-completion-tutorial* ----------------- This tutorial is designed to take you through the common features of the SQL completion plugin so that: > @@ -462,8 +471,8 @@ First, create a new buffer: > :e tutorial.sql -Static features ---------------- +Static features ~ + To take you through the various lists, simply enter insert mode, hit: <C-C>s (show SQL statements) At this point, you can page down through the list until you find "select". @@ -484,8 +493,8 @@ depending on the syntax file you are using. The SQL Anywhere syntax file DECLARE customer_id <C-C>T <-- Choose a type from the list -Dynamic features ----------------- +Dynamic features ~ + To take advantage of the dynamic features you must first install the dbext.vim plugin (https://vim.sourceforge.net/script.php?script_id=356). It also comes with a tutorial. From the SQL completion plugin's perspective, @@ -597,8 +606,8 @@ Similar to the table list, <C-C>v, will display a list of views in the database. +------------------------------------------------------------------------------ 4.4 Completion Customization *sql-completion-customization* ----------------------------- The SQL completion plugin can be customized through various options set in your |init.vim|: > @@ -657,14 +666,14 @@ your |init.vim|: > option. > +------------------------------------------------------------------------------ 4.5 SQL Maps *sql-completion-maps* ------------- The default SQL maps have been described in other sections of this document in greater detail. Here is a list of the maps with a brief description of each. -Static Maps ------------ +Static Maps ~ + These are maps which use populate the completion list using Vim's syntax highlighting rules. > <C-C>a @@ -680,8 +689,8 @@ highlighting rules. > <C-C>s < - Displays all SQL syntax items defined as 'sqlStatement'. > -Dynamic Maps ------------- +Dynamic Maps ~ + These are maps which use populate the completion list using the dbext.vim plugin. > <C-C>t @@ -713,8 +722,8 @@ plugin. > < - This maps removes all cached items and forces the SQL completion to regenerate the list of items. -Customizing Maps ----------------- +Customizing Maps ~ + You can create as many additional key maps as you like. Generally, the maps will be specifying different syntax highlight groups. @@ -733,8 +742,8 @@ chosen since it will work on both Windows and *nix platforms. On the windows platform you can also use <C-Space> or ALT keys. +------------------------------------------------------------------------------ 4.6 Using with other filetypes *sql-completion-filetypes* ------------------------------- Many times SQL can be used with different filetypes. For example Perl, Java, PHP, Javascript can all interact with a database. Often you need both the SQL @@ -746,8 +755,8 @@ This can be enabled easily with the following steps (assuming a Perl file): > 2. :set filetype=sql 3. :set ft=perl -Step 1 ------- +Step 1 ~ + Begins by editing a Perl file. Vim automatically sets the filetype to "perl". By default, Vim runs the appropriate filetype file ftplugin/perl.vim. If you are using the syntax completion plugin by following @@ -755,8 +764,8 @@ the directions at |ft-syntax-omni| then the |'omnifunc'| option has been set to "syntax#Complete". Pressing <C-X><C-O> will display the omni popup containing the syntax items for Perl. -Step 2 ------- +Step 2 ~ + Manually setting the filetype to "sql" will also fire the appropriate filetype files ftplugin/sql.vim. This file will define a number of buffer specific maps for SQL completion, see |sql-completion-maps|. Now these maps have @@ -767,8 +776,8 @@ begin with <C-C>, the maps will toggle the |'omnifunc'| when in use. So you can use <C-X><C-O> to continue using the completion for Perl (using the syntax completion plugin) and <C-C> to use the SQL completion features. -Step 3 ------- +Step 3 ~ + Setting the filetype back to Perl sets all the usual "perl" related items back as they were. diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 1fda624fc6..1fce9fa491 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -44,8 +44,8 @@ Scrollbars *gui-scrollbars* There are vertical scrollbars and a horizontal scrollbar. You may configure which ones appear with the 'guioptions' option. -The interface looks like this (with ":set guioptions=mlrb"): - +The interface looks like this (with `:set guioptions=mlrb`): +> +------------------------------+ ` | File Edit Help | <- Menu bar (m) ` +-+--------------------------+-+ ` @@ -66,7 +66,7 @@ The interface looks like this (with ":set guioptions=mlrb"): +-+--------------------------+-+ ` | |< #### >| | <- Bottom ` +-+--------------------------+-+ scrollbar (b) ` - +< Any of the scrollbar or menu components may be turned off by not putting the appropriate letter in the 'guioptions' string. The bottom scrollbar is only useful when 'nowrap' is set. @@ -123,7 +123,7 @@ message). Keep Shift pressed to change to the directory instead. If Vim happens to be editing a command line, the names of the dropped files and directories will be inserted at the cursor. This allows you to use these names with any Ex command. Special characters (space, tab, double quote and -'|'; backslash on non-MS-Windows systems) will be escaped. +"|"; backslash on non-MS-Windows systems) will be escaped. ============================================================================== Menus *menus* @@ -569,14 +569,14 @@ Tooltips & Menu tips See section |42.4| in the user manual. *:tmenu* -:tm[enu] {menupath} {rhs} Define a tip for a menu or tool. {only in - X11 and Win32 GUI} +:tm[enu] {menupath} {rhs} Define a tip for a menu or tool. (only in + X11 and Win32 GUI) -:tm[enu] [menupath] List menu tips. {only in X11 and Win32 GUI} +:tm[enu] [menupath] List menu tips. (only in X11 and Win32 GUI) *:tunmenu* :tu[nmenu] {menupath} Remove a tip for a menu or tool. - {only in X11 and Win32 GUI} + (only in X11 and Win32 GUI) Note: To create menus for terminal mode, use |:tlmenu| instead. diff --git a/runtime/doc/hebrew.txt b/runtime/doc/hebrew.txt index 2f4b137bd3..76266d777f 100644 --- a/runtime/doc/hebrew.txt +++ b/runtime/doc/hebrew.txt @@ -11,8 +11,9 @@ Lottem. <alottem at gmail dot com> Ron Aaron <ron at ronware dot org> is currently helping support these features. +------------------------------------------------------------------------------ Introduction ------------- + Hebrew-specific options are 'hkmap', 'hkmapp' 'keymap'=hebrew and 'aleph'. Hebrew-useful options are 'delcombine', 'allowrevins', 'revins', 'rightleft' and 'rightleftcmd'. @@ -22,8 +23,9 @@ from right to left instead of the usual left to right. This is useful primarily when editing Hebrew or other Middle-Eastern languages. See |rileft.txt| for further details. +------------------------------------------------------------------------------ Details --------------- + + Options: + 'rightleft' ('rl') sets window orientation to right-to-left. This means that the logical text 'ABC' will be displayed as 'CBA', and will start @@ -31,7 +33,7 @@ Details + 'hkmap' ('hk') sets keyboard mapping to Hebrew, in insert/replace modes. + 'aleph' ('al'), numeric, holds the decimal code of Aleph, for keyboard mapping. - + 'hkmapp' ('hkp') sets keyboard mapping to 'phonetic hebrew' + + 'hkmapp' ('hkp') sets keyboard mapping to "phonetic hebrew" NOTE: these three ('hkmap', 'hkmapp' and 'aleph') are obsolete. You should use ":set keymap=hebrewp" instead. @@ -51,7 +53,7 @@ Details ('deco' does nothing if UTF8 encoding is not active). + Vim arguments: - + 'vim -H file' starts editing a Hebrew file, i.e. 'rightleft' and 'hkmap' + + `vim -H file` starts editing a Hebrew file, i.e. 'rightleft' and 'hkmap' are set. + Keyboard: @@ -116,8 +118,9 @@ when exiting 'revins' via CTRL-_, the cursor moves to the end of the typed text (if possible). +------------------------------------------------------------------------------ Pasting when in a rightleft window ----------------------------------- + When cutting text with the mouse and pasting it in a rightleft window the text will be reversed, because the characters come from the cut buffer from the left to the right, while inserted in the file from the right to @@ -125,8 +128,9 @@ the left. In order to avoid it, toggle 'revins' (by typing CTRL-? or CTRL-_) before pasting. +------------------------------------------------------------------------------ Hebrew characters and the 'isprint' variable --------------------------------------------- + Sometimes Hebrew character codes are in the non-printable range defined by the 'isprint' variable. For example in the Linux console, the Hebrew font encoding starts from 128, while the default 'isprint' variable is @,161-255. diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index 9cf0ea69f2..07f898f99c 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -169,11 +169,6 @@ DEVELOPING NVIM |dev-style| Development style guidelines |debug.txt| Debugging Vim itself ------------------------------------------------------------------------------- -OTHER - -|print.txt| For your briefcase and fax machine - *standard-plugin-list* Standard plugins ~ |matchit.txt| Extended |%| matching diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt index 4773059586..da307dd241 100644 --- a/runtime/doc/helphelp.txt +++ b/runtime/doc/helphelp.txt @@ -342,7 +342,7 @@ should begin with the name of the Vim plugin. The tag name is usually right aligned on a line. When referring to an existing help tag and to create a hot-link, place the -name between two bars (|) eg. |help-writing|. +name between two bars ("|") eg. |help-writing|. When referring to a Vim command and to create a hot-link, place the name between two backticks, eg. inside `:filetype`. You will see this is diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt index 2b86300e7f..f3e196b426 100644 --- a/runtime/doc/indent.txt +++ b/runtime/doc/indent.txt @@ -35,7 +35,7 @@ The rest of this section describes the 'cindent' option. Note that 'cindent' indenting does not work for every code scenario. Vim is not a C compiler: it does not recognize all syntax. One requirement is -that toplevel functions have a '{' in the first column. Otherwise they are +that toplevel functions have a "{" in the first column. Otherwise they are easily confused with declarations. These five options control C program indenting: @@ -60,12 +60,12 @@ used instead. The format of 'cinkeys' and 'indentkeys' is equal. The default is "0{,0},0),0],:,0#,!^F,o,O,e" which specifies that indenting occurs as follows: - "0{" if you type '{' as the first character in a line - "0}" if you type '}' as the first character in a line - "0)" if you type ')' as the first character in a line - "0]" if you type ']' as the first character in a line - ":" if you type ':' after a label or case statement - "0#" if you type '#' as the first character in a line + "0{" if you type "{" as the first character in a line + "0}" if you type "}" as the first character in a line + "0)" if you type ")" as the first character in a line + "0]" if you type "]" as the first character in a line + ":" if you type ":" after a label or case statement + "0#" if you type "#" as the first character in a line "!^F" if you type CTRL-F (which is not inserted) "o" if you type a <CR> anywhere or use the "o" command (not in insert mode!) @@ -74,21 +74,21 @@ occurs as follows: line Characters that can precede each key: *i_CTRL-F* -! When a '!' precedes the key, Vim will not insert the key but will +! When a "!" precedes the key, Vim will not insert the key but will instead reindent the current line. This allows you to define a command key for reindenting the current line. CTRL-F is the default key for this. Be careful if you define CTRL-I for this because CTRL-I is the ASCII code for <Tab>. -* When a '*' precedes the key, Vim will reindent the line before +* When a "*" precedes the key, Vim will reindent the line before inserting the key. If 'cinkeys' contains "*<Return>", Vim reindents the current line before opening a new line. -0 When a zero precedes the key (but appears after '!' or '*') Vim will +0 When a zero precedes the key (but appears after "!" or "*") Vim will reindent the line only if the key is the first character you type in the line. When used before "=" Vim will only reindent the line if there is only white space before the word. -When neither '!' nor '*' precedes the key, Vim reindents the line after you -type the key. So ';' sets the indentation of a line which includes the ';'. +When neither "!" nor "*" precedes the key, Vim reindents the line after you +type the key. So ";" sets the indentation of a line which includes the ";". Special key names: <> Angle brackets mean spelled-out names of keys. For example: "<Up>", @@ -154,8 +154,8 @@ The examples below assume a 'shiftwidth' of 4. eN Add N to the prevailing indent inside a set of braces if the opening brace at the End of the line (more precise: is not the first character in a line). This is useful if you want a - different indent when the '{' is at the start of the line from - when '{' is at the end of the line. (default 0). + different indent when the "{" is at the start of the line from + when "{" is at the end of the line. (default 0). cino= cino=e2 cino=e-2 > if (cond) { if (cond) { if (cond) { @@ -169,8 +169,8 @@ The examples below assume a 'shiftwidth' of 4. *cino-n* nN Add N to the prevailing indent for a statement after an "if", "while", etc., if it is NOT inside a set of braces. This is - useful if you want a different indent when there is no '{' - before the statement from when there is a '{' before it. + useful if you want a different indent when there is no "{" + before the statement from when there is a "{" before it. (default 0). cino= cino=n2 cino=n-2 > @@ -193,7 +193,7 @@ The examples below assume a 'shiftwidth' of 4. int foo; int foo; int foo; < *cino-{* - {N Place opening braces N characters from the prevailing indent. + `{N` Place opening braces N characters from the prevailing indent. This applies only for opening braces that are inside other braces. (default 0). @@ -203,7 +203,7 @@ The examples below assume a 'shiftwidth' of 4. foo; foo; foo; < *cino-}* - }N Place closing braces N characters from the matching opening + `}N` Place closing braces N characters from the matching opening brace. (default 0). cino= cino={2,}-0.5s cino=}2 > @@ -846,7 +846,7 @@ own 'formatoptions'): > Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be added, see |fo-table| for more information. -------------- + *PHP_outdentSLComments* To add extra indentation to single-line comments: > @@ -858,7 +858,7 @@ Only single-line comments will be affected such as: > # Comment // Comment /* Comment */ -------------- +< *PHP_default_indenting* To add extra indentation to every PHP lines with N being the number of @@ -878,18 +878,17 @@ For example, with N = 1, this will give: $command_hist = TRUE; ?> (Notice the extra indentation between the PHP container markers and the code) -------------- *PHP_outdentphpescape* To indent PHP escape tags as the surrounding non-PHP code (only affects the PHP escape tags): > :let g:PHP_outdentphpescape = 0 -------------- +< *PHP_removeCRwhenUnix* To automatically remove '\r' characters when the 'fileformat' is set to Unix: > :let g:PHP_removeCRwhenUnix = 1 -------------- +< *PHP_BracesAtCodeLevel* To indent braces at the same level than the code they contain: > @@ -908,7 +907,6 @@ Instead of: > NOTE: Indenting will be a bit slower if this option is used because some optimizations won't be available. -------------- *PHP_vintage_case_default_indent* To indent 'case:' and 'default:' statements in switch() blocks: > @@ -918,7 +916,6 @@ In PHP braces are not required inside 'case/default' blocks therefore 'case:' and 'default:' are indented at the same level than the 'switch()' to avoid meaningless indentation. You can use the above option to return to the traditional way. -------------- *PHP_noArrowMatching* By default the indent script will indent multi-line chained calls by matching @@ -927,17 +924,16 @@ the position of the '->': > $user_name_very_long->name() ->age() ->info(); - +< You can revert to the classic way of indenting by setting this option to 1: > :let g:PHP_noArrowMatching = 1 - +< You will obtain the following result: > $user_name_very_long->name() ->age() ->info(); - -------------- +< *PHP_IndentFunctionCallParameters* Extra indentation levels to add to parameters in multi-line function calls. > @@ -954,14 +950,13 @@ Function call arguments will indent 1 extra level. For two-space indentation: > $and_that ); } - -------------- +< *PHP_IndentFunctionDeclarationParameters* Extra indentation levels to add to arguments in multi-line function definitions. > let g:PHP_IndentFunctionDeclarationParameters = 1 - +< Function arguments in declarations will indent 1 extra level. For two-space indentation: > @@ -974,7 +969,7 @@ indentation: > $and_that ); } - +< PYTHON *ft-python-indent* @@ -1145,7 +1140,6 @@ to the vimrc file, which causes the previous alignment example to change: > ); END ENTITY sync; ----------------------------------------- Alignment of right-hand side assignment "<=" statements are performed by default. This causes the following alignment example: > @@ -1164,7 +1158,6 @@ to the vimrc file, which causes the previous alignment example to change: > (sig_b OR sig_c)) OR (bus_a(0) AND sig_d); ----------------------------------------- Full-line comments (lines that begin with "--") are indented to be aligned with the very previous line's comment, PROVIDED that a whitespace follows after diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 66353e05f3..a6aa036b55 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1310,7 +1310,6 @@ tag command action ~ |:grepadd| :grepa[dd] like :grep, but append to current list |:gui| :gu[i] start the GUI |:gvim| :gv[im] start the GUI -|:hardcopy| :ha[rdcopy] send text to the printer |:help| :h[elp] open a help window |:helpclose| :helpc[lose] close one help window |:helpgrep| :helpg[rep] like ":grep" but searches help files diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index e25f5901ef..e608b431f2 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -257,8 +257,8 @@ CTRL-] Trigger abbreviation, without inserting a character. *i_<Insert>* <Insert> Toggle between Insert and Replace mode. ------------------------------------------------------------------------ +----------------------------------------------------------------------- *i_backspacing* The effect of the <BS>, CTRL-W, and CTRL-U depend on the 'backspace' option (unless 'revins' is set). This is a comma-separated list of items: @@ -378,6 +378,7 @@ CTRL-G u close undo sequence, start new change *i_CTRL-G_u* CTRL-G U don't start a new undo block with the next *i_CTRL-G_U* left/right cursor movement, if the cursor stays within the same line + ----------------------------------------------------------------------- The CTRL-O command sometimes has a side effect: If the cursor was beyond the @@ -1450,13 +1451,13 @@ At the moment (beginning of 2006) there are two main browsers - MS Internet Explorer and Mozilla Firefox. These two applications are covering over 90% of market. Theoretically standards are created by W3C organisation (https://www.w3.org/) but they are not always followed/implemented. - +> IE FF W3C Omni completion ~ +/- +/- + + ~ + + - + ~ + - - - ~ - + - - ~ - +< Regardless from state of implementation in browsers but if element is defined in standards, completion plugin will place element in suggestion list. When both major engines implemented element, even if this is not in standards it diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index 4722982ab5..6bf6850ccf 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -520,12 +520,12 @@ CTRL-O in Insert mode you get a beep but you are still in Insert mode, type TO mode ~ Normal Visual Select Insert Replace Cmd-line Ex ~ FROM mode ~ -Normal v V ^V *4 *1 R gR : / ? ! Q -Visual *2 ^G c C -- : -- -Select *5 ^O ^G *6 -- -- -- +Normal v V ^V `*4` *1 R gR : / ? ! Q +Visual `*2` ^G c C -- : -- +Select `*5` ^O ^G `*6` -- -- -- Insert <Esc> -- -- <Insert> -- -- Replace <Esc> -- -- <Insert> -- -- -Command-line *3 -- -- :start -- -- +Command-line `*3` -- -- :start -- -- Ex :vi -- -- -- -- -- -- not possible @@ -589,26 +589,26 @@ Lines longer than the window width will wrap, unless the 'wrap' option is off If the window has room after the last line of the buffer, Vim will show '~' in the first column of the last lines in the window, like this: - +> +-----------------------+ |some line | |last line | |~ | |~ | +-----------------------+ - +< Thus the '~' lines indicate that the end of the buffer was reached. If the last line in a window doesn't fit, Vim will indicate this with a '@' in the first column of the last lines in the window, like this: - +> +-----------------------+ |first line | |second line | |@ | |@ | +-----------------------+ - +< Thus the '@' lines indicate that there is a line that doesn't fit in the window. @@ -616,14 +616,14 @@ When the "lastline" flag is present in the 'display' option, you will not see '@' characters at the left side of window. If the last line doesn't fit completely, only the part that fits is shown, and the last three characters of the last line are replaced with "@@@", like this: - +> +-----------------------+ |first line | |second line | |a very long line that d| |oesn't fit in the wi@@@| +-----------------------+ - +< If there is a single line that is too long to fit in the window, this is a special situation. Vim will show only part of the line, around where the cursor is. There are no special characters shown, so that you can edit all @@ -704,9 +704,9 @@ Definitions *definitions* *jargon* A screen contains one or more windows, separated by status lines and with the command line at the bottom. - +> +-------------------------------+ -screen | window 1 | window 2 | + screen | window 1 | window 2 | | | | | | | |= status line =|= status line =| @@ -716,7 +716,7 @@ screen | window 1 | window 2 | |==== status line ==============| |command line | +-------------------------------+ - +< The command line is also used for messages. It scrolls up the screen when there is not enough room in the command line. diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index b101740b03..705d7675e5 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1278,6 +1278,13 @@ on_publish_diagnostics({_}, {result}, {ctx}, {config}) ============================================================================== Lua module: vim.lsp.codelens *lsp-codelens* +clear({client_id}, {bufnr}) *vim.lsp.codelens.clear()* + Clear the lenses + + Parameters: ~ + • {client_id} (number|nil) filter by client_id. All clients if nil + • {bufnr} (number|nil) filter by buffer. All buffers if nil + display({lenses}, {bufnr}, {client_id}) *vim.lsp.codelens.display()* Display the lenses using virtual text diff --git a/runtime/doc/lua-guide.txt b/runtime/doc/lua-guide.txt index e96345cda6..b0b2857300 100644 --- a/runtime/doc/lua-guide.txt +++ b/runtime/doc/lua-guide.txt @@ -199,8 +199,8 @@ this allows you to pass multiple commands to a single call of |vim.cmd()|: highlight link Warning Error ]]) < -This is the converse of |lua-heredoc| and allows you to include Lua code in -your `init.vim`. +This is the converse of |lua-heredoc| and allows you to include Vimscript code in +your `init.lua`. If you want to build your Vim command programmatically, the following form can be useful (all these are equivalent to the corresponding line above): diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 25d7fa2f35..074cb863f0 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1502,8 +1502,7 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()* end-inclusive Return: ~ - table<integer, {}> region lua table of the form {linenr = - {startcol,endcol}} + (table) region Table of the form `{linenr = {startcol,endcol}}` schedule_wrap({cb}) *vim.schedule_wrap()* Defers callback `cb` until the Nvim API is safe to call. @@ -1711,8 +1710,7 @@ split({s}, {sep}, {kwargs}) *vim.split()* Parameters: ~ • {s} (string) String to split • {sep} (string) Separator or pattern - • {kwargs} ({plain: boolean, trimempty: boolean}|nil) Keyword - arguments: + • {kwargs} (table|nil) Keyword arguments: • plain: (boolean) If `true` use `sep` literally (passed to string.find) • trimempty: (boolean) If `true` remove empty items from the diff --git a/runtime/doc/luvref.txt b/runtime/doc/luvref.txt index b0d1b6764a..859e75e4af 100644 --- a/runtime/doc/luvref.txt +++ b/runtime/doc/luvref.txt @@ -2626,7 +2626,7 @@ uv.fs_read({fd}, {size} [, {offset} [, {callback}]]) *uv.fs_read()* indicates EOF. If `offset` is nil or omitted, it will default to `-1`, which - indicates 'use and update the current file offset.' + indicates "use and update the current file offset." Note: When `offset` is >= 0, the current file offset will not be updated by the read. @@ -2665,7 +2665,7 @@ uv.fs_write({fd}, {data} [, {offset} [, {callback}]]) *uv.fs_write()* written. If `offset` is nil or omitted, it will default to `-1`, which - indicates 'use and update the current file offset.' + indicates "use and update the current file offset." Note: When `offset` is >= 0, the current file offset will not be updated by the write. diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index b7656211c6..e262b7b82a 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -666,9 +666,9 @@ This is useful to specify a (multibyte) character in a 'keymap' file. Upper and lowercase differences are ignored. *map-comments* -It is not possible to put a comment after these commands, because the '"' +It is not possible to put a comment after these commands, because the `"` character is considered to be part of the {lhs} or {rhs}. However, one can -use |", since this starts a new, empty command with a comment. +use `|"`, since this starts a new, empty command with a comment. *map_bar* *map-bar* Since the '|' character is used to separate a map command from the next diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 72adbe6023..99dfa54218 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -625,7 +625,7 @@ and what the keymaps are to get those characters: glyph encoding keymap ~ Char UTF-8 cp1255 hebrew hebrewp name ~ -א 0x5d0 0xe0 t a 'alef +א 0x5d0 0xe0 t a ´alef ב 0x5d1 0xe1 c b bet ג 0x5d2 0xe2 d g gimel ד 0x5d3 0xe3 s d dalet @@ -706,7 +706,7 @@ Char UTF-8 hebrew name Combining forms: ﬠ 0xfb20 X` Alternative `ayin -ﬡ 0xfb21 X' Alternative 'alef +ﬡ 0xfb21 X' Alternative ´alef ﬢ 0xfb22 X-d Alternative dalet ﬣ 0xfb23 X-h Alternative he ﬤ 0xfb24 X-k Alternative kaf diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index f4127448ec..929efee19f 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -312,7 +312,7 @@ g<Down> [count] display lines downward. |exclusive| motion. `-` <minus> [count] lines upward, on the first non-blank character |linewise|. -+ or *+* +`+` or *+* CTRL-M or *CTRL-M* *<CR>* <CR> [count] lines downward, on the first non-blank character |linewise|. @@ -438,9 +438,9 @@ between Vi and Vim. } [count] |paragraph|s forward. |exclusive| motion. *]]* -]] [count] |section|s forward or to the next '{' in the +]] [count] |section|s forward or to the next "{" in the first column. When used after an operator, then also - stops below a '}' in the first column. |exclusive| + stops below a "}" in the first column. |exclusive| Note that |exclusive-linewise| often applies. *][* @@ -449,12 +449,12 @@ between Vi and Vim. Note that |exclusive-linewise| often applies. *[[* -[[ [count] |section|s backward or to the previous '{' in +[[ [count] |section|s backward or to the previous "{" in the first column. |exclusive| Note that |exclusive-linewise| often applies. *[]* -[] [count] |section|s backward or to the previous '}' in +[] [count] |section|s backward or to the previous "}" in the first column. |exclusive| Note that |exclusive-linewise| often applies. @@ -1004,8 +1004,8 @@ These commands are not marks themselves, but jump to a mark: Note that ":keepjumps" must be used for every command. When invoking a function the commands in that function can still change the jumplist. Also, for - ":keepjumps exe 'command '" the "command" won't keep - jumps. Instead use: ":exe 'keepjumps command'" + `:keepjumps exe 'command '` the "command" won't keep + jumps. Instead use: `:exe 'keepjumps command'` ============================================================================== 8. Jumps *jump-motions* diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index d6f6464f78..ffc8ce2c88 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -34,11 +34,24 @@ The following changes may require adaptations in user config or plugins. See https://github.com/neovim/neovim/pull/20545 for more information. +• `:hardcopy` is now removed (see |hardcopy| and |nvim-features-removed|): + - Commands removed: + - `:hardcopy` + - Options removed: + - `printdevice` + - `printencoding` + - `printexpr` + - `printfont` + - `printheader` + - `printmbcharset` + ============================================================================== NEW FEATURES *news-features* The following new APIs or features were added. +• Added a |vim.lsp.codelens.clear()| function to clear codelenses. + • |vim.inspect_pos()|, |vim.show_pos()| and |:Inspect| allow a user to get or show items at a given buffer postion. Currently this includes treesitter captures, semantic tokens, syntax groups and extmarks. @@ -101,6 +114,11 @@ The following new APIs or features were added. See https://github.com/neovim/neovim/pull/14537. +• |--remote-ui| option was added to connect to a remote instance and display + in it in a |TUI| in the local terminal. This can be used run a headless nvim + instance in the background and display its UI on demand, which previously + only was possible usiing a external UI implementation. + ============================================================================== CHANGED FEATURES *news-changes* @@ -109,6 +127,14 @@ The following changes to existing APIs or features add new behavior. • 'exrc' now supports `.nvim.lua` file. • 'exrc' is no longer marked deprecated. +• The |TUI| is changed to run in a separate process (previously, a separate + thread was used). This is not supposed to be a visible change to the user, + but might be the cause of subtle changes of behavior and bugs. + + Previously, the TUI could be disabled as a build time feature (+tui/-tui), + resulting in a nvim binary which only could be run headless or embedded + in an external process. As of this version, TUI is always avalibale. + ============================================================================== REMOVED FEATURES *news-removed* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index b0c4193927..ee6c14e73f 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -145,7 +145,7 @@ This sets the 'titlestring' option to "hi" and 'iconstring' to "there": > Similarly, the double quote character starts a comment. To include the '"' in the option value, use '\"' instead. This example sets the 'titlestring' -option to 'hi "there"': > +option to "hi "there"": > :set titlestring=hi\ \"there\" For Win32 backslashes in file names are mostly not removed. More precise: For @@ -163,7 +163,7 @@ halved and when you expect the backslashes to be kept. The third gives a result which is probably not what you want. Avoid it. *add-option-flags* *remove-option-flags* - *E539* *E550* *E551* *E552* + *E539* Some options are a list of flags. When you want to add a flag to such an option, without changing the existing ones, you can do it like this: > :set guioptions+=a @@ -1325,7 +1325,7 @@ A jump table for the options with a short description can be found at |Q_op|. These names are recognized: *clipboard-unnamed* - unnamed When included, Vim will use the clipboard register '*' + unnamed When included, Vim will use the clipboard register "*" for all yank, delete, change and put operations which would normally go to the unnamed register. When a register is explicitly specified, it will always be @@ -1336,8 +1336,8 @@ A jump table for the options with a short description can be found at |Q_op|. *clipboard-unnamedplus* unnamedplus A variant of the "unnamed" flag which uses the - clipboard register '+' (|quoteplus|) instead of - register '*' for all yank, delete, change and put + clipboard register "+" (|quoteplus|) instead of + register "*" for all yank, delete, change and put operations which would normally go to the unnamed register. When "unnamed" is also included to the option, yank and delete operations (but not put) @@ -4357,7 +4357,7 @@ A jump table for the options with a short description can be found at |Q_op|. w x updown up-down sizing arrows w x leftright left-right sizing arrows w x busy The system's usual busy pointer - w x no The system's usual 'no input' pointer + w x no The system's usual "no input" pointer x udsizing indicates up-down resizing x lrsizing indicates left-right resizing x crosshair like a big thin + @@ -4434,12 +4434,12 @@ A jump table for the options with a short description can be found at |Q_op|. 'nonu' 'nu' 'nonu' 'nu' 'nornu' 'nornu' 'rnu' 'rnu' - +> |apple | 1 apple | 2 apple | 2 apple |pear | 2 pear | 1 pear | 1 pear |nobody | 3 nobody | 0 nobody |3 nobody |there | 4 there | 1 there | 1 there - +< *'numberwidth'* *'nuw'* 'numberwidth' 'nuw' number (default: 4) local to window @@ -4681,58 +4681,6 @@ A jump table for the options with a short description can be found at |Q_op|. set. It's normally not set directly, but by using one of the commands |:ptag|, |:pedit|, etc. - *'printdevice'* *'pdev'* -'printdevice' 'pdev' string (default empty) - global - The name of the printer to be used for |:hardcopy|. - See |pdev-option|. - This option cannot be set from a |modeline| or in the |sandbox|, for - security reasons. - - *'printencoding'* *'penc'* -'printencoding' 'penc' string (default empty, except for some systems) - global - Sets the character encoding used when printing. - See |penc-option|. - - *'printexpr'* *'pexpr'* -'printexpr' 'pexpr' string (default: see below) - global - Expression used to print the PostScript produced with |:hardcopy|. - See |pexpr-option|. - This option cannot be set from a |modeline| or in the |sandbox|, for - security reasons. - - *'printfont'* *'pfn'* -'printfont' 'pfn' string (default "courier") - global - The name of the font that will be used for |:hardcopy|. - See |pfn-option|. - - *'printheader'* *'pheader'* -'printheader' 'pheader' string (default "%<%f%h%m%=Page %N") - global - The format of the header produced in |:hardcopy| output. - See |pheader-option|. - - *'printmbcharset'* *'pmbcs'* -'printmbcharset' 'pmbcs' string (default "") - global - The CJK character set to be used for CJK output from |:hardcopy|. - See |pmbcs-option|. - - *'printmbfont'* *'pmbfn'* -'printmbfont' 'pmbfn' string (default "") - global - List of font names to be used for CJK output from |:hardcopy|. - See |pmbfn-option|. - - *'printoptions'* *'popt'* -'printoptions' 'popt' string (default "") - global - List of items that control the format of the output of |:hardcopy|. - See |popt-option|. - *'pumblend'* *'pb'* 'pumblend' 'pb' number (default 0) global @@ -5004,7 +4952,6 @@ A jump table for the options with a short description can be found at |Q_op|. pack/ packages |:packadd| parser/ |treesitter| syntax parsers plugin/ plugin scripts |write-plugin| - print/ files for printing |postscript-print-encoding| query/ |treesitter| queries rplugin/ |remote-plugin| scripts spell/ spell checking files |spell| @@ -5573,30 +5520,30 @@ A jump table for the options with a short description can be found at |Q_op|. and "[a]" instead of "appended" for ':w >> file' command x use "[dos]" instead of "[dos format]", "[unix]" *shm-x* instead of "[unix format]" and "[mac]" instead of "[mac - format]". + format]" a all of the above abbreviations *shm-a* o overwrite message for writing a file with subsequent *shm-o* message for reading a file (useful for ":wn" or when 'autowrite' on) - O message for reading a file overwrites any previous *smh-O* - message. Also for quickfix message (e.g., ":cn"). + O message for reading a file overwrites any previous *shm-O* + message; also for quickfix message (e.g., ":cn") s don't give "search hit BOTTOM, continuing at TOP" or *shm-s* "search hit TOP, continuing at BOTTOM" messages; when using the search count do not show "W" after the count message (see S below) t truncate file message at the start if it is too long *shm-t* to fit on the command-line, "<" will appear in the left most - column. Ignored in Ex mode. + column; ignored in Ex mode T truncate other messages in the middle if they are too *shm-T* - long to fit on the command line. "..." will appear in the - middle. Ignored in Ex mode. + long to fit on the command line; "..." will appear in the + middle; ignored in Ex mode W don't give "written" or "[w]" when writing a file *shm-W* A don't give the "ATTENTION" message when an existing *shm-A* - swap file is found. + swap file is found I don't give the intro message when starting Vim, *shm-I* - see |:intro|. - c don't give |ins-completion-menu| messages. For *shm-c* + see |:intro| + c don't give |ins-completion-menu| messages; for *shm-c* example, "-- XXX completion (YYY)", "match 1 of 2", "The only match", "Pattern not found", "Back at original", etc. C don't give messages while scanning for ins-completion *shm-C* @@ -5653,6 +5600,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'showcmdloc'* *'sloc'* 'showcmdloc' 'sloc' string (default "last") + global This option can be used to display the (partially) entered command in another location. Possible values are: last Last line of the screen (default). @@ -5797,11 +5745,11 @@ A jump table for the options with a short description can be found at |Q_op|. alternative. Normally 'autoindent' should also be on when using 'smartindent'. An indent is automatically inserted: - - After a line ending in '{'. + - After a line ending in "{". - After a line starting with a keyword from 'cinwords'. - - Before a line starting with '}' (only with the "O" command). + - Before a line starting with "}" (only with the "O" command). When typing '}' as the first character in a new line, that line is - given the same indent as the matching '{'. + given the same indent as the matching "{". When typing '#' as the first character in a new line, the indent for that line is removed, the '#' is put in the first column. The indent is restored for the next line. If you don't want this, use this @@ -6084,12 +6032,12 @@ A jump table for the options with a short description can be found at |Q_op|. field meaning ~ - Left justify the item. The default is right justified when minwid is larger than the length of the item. - 0 Leading zeroes in numeric items. Overridden by '-'. - minwid Minimum width of the item, padding as set by '-' & '0'. + 0 Leading zeroes in numeric items. Overridden by "-". + minwid Minimum width of the item, padding as set by "-" & "0". Value must be 50 or less. - maxwid Maximum width of the item. Truncation occurs with a '<' + maxwid Maximum width of the item. Truncation occurs with a "<" on the left for text items. Numeric items will be - shifted down to maxwid-2 digits followed by '>'number + shifted down to maxwid-2 digits followed by ">"number where number is the amount of missing digits, much like an exponential notation. item A one letter code as described below. @@ -6125,7 +6073,6 @@ A jump table for the options with a short description can be found at |Q_op|. o N Byte number in file of byte under cursor, first byte is 1. Mnemonic: Offset from start of file (with one added) O N As above, in hexadecimal. - N N Printer page number. (Only works in the 'printheader' option.) l N Line number. L N Number of lines in buffer. c N Column number (byte index). @@ -6138,22 +6085,22 @@ A jump table for the options with a short description can be found at |Q_op|. S S 'showcmd' content, see 'showcmdloc'. a S Argument list status as in default title. ({current} of {max}) Empty if the argument file count is zero or one. - { NF Evaluate expression between '%{' and '}' and substitute result. - Note that there is no '%' before the closing '}'. The - expression cannot contain a '}' character, call a function to + { NF Evaluate expression between "%{" and "}" and substitute result. + Note that there is no "%" before the closing "}". The + expression cannot contain a "}" character, call a function to work around that. See |stl-%{| below. - {% - This is almost same as { except the result of the expression is + `{%` - This is almost same as "{" except the result of the expression is re-evaluated as a statusline format string. Thus if the - return value of expr contains % items they will get expanded. - The expression can contain the } character, the end of - expression is denoted by %}. + return value of expr contains "%" items they will get expanded. + The expression can contain the "}" character, the end of + expression is denoted by "%}". For example: > func! Stl_filename() abort return "%t" endfunc < `stl=%{Stl_filename()}` results in `"%t"` `stl=%{%Stl_filename()%}` results in `"Name of current file"` - %} - End of `{%` expression + %} - End of "{%" expression ( - Start of item group. Can be used for setting the width and alignment of a section. Must be followed by %) somewhere. ) - End of item group. No width fields allowed. @@ -6406,7 +6353,7 @@ A jump table for the options with a short description can be found at |Q_op|. the |:retab| command, and the 'softtabstop' option. Note: Setting 'tabstop' to any other value than 8 can make your file - appear wrong in many places, e.g., when printing it. + appear wrong in many places. The value must be more than 0 and less than 10000. There are four main ways to use tabs in Vim: diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 972c42107c..5167b4baf7 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -2419,15 +2419,6 @@ from the current window (where one does the mf) to the target. Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd| -MARKED FILES: PRINTING *netrw-mp* {{{2 - (See |netrw-mf| and |netrw-mr| for how to mark files) - (uses the local marked file list) - -When "mp" is used, netrw will apply the |:hardcopy| command to marked files. -What netrw does is open each file in a one-line window, execute hardcopy, then -close the one-line window. - - MARKED FILES: SOURCING *netrw-ms* {{{2 (See |netrw-mf| and |netrw-mr| for how to mark files) (uses the local marked file list) @@ -2821,12 +2812,12 @@ your browsing preferences. (see also: |netrw-settings|) function 'netrw_gitignore#Hide() automatically hiding all gitignored files. For more details see |netrw-gitignore|. + default: "" - Examples: - let g:netrw_list_hide= '.*\.swp$' - let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' - default: "" - + Examples: > + let g:netrw_list_hide= '.*\.swp$' + let g:netrw_list_hide= netrw_gitignore#Hide() .. '.*\.swp$' +< *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin =expand("$COMSPEC") Windows Copies marked files (|netrw-mf|) to target @@ -3268,7 +3259,7 @@ If there are marked files: (see |netrw-mf|) mr [query: reply with *.c] R [query: reply with s/^\(.*\)\.c$/\1.cpp/] < - This example will mark all *.c files and then rename them to *.cpp + This example will mark all "*.c" files and then rename them to "*.cpp" files. Netrw will protect you from overwriting local files without confirmation, but not remote ones. @@ -3280,7 +3271,7 @@ If there are marked files: (see |netrw-mf|) <c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any portion of the string preceding the double ctrl-x's. < - WARNING:~ + WARNING: ~ Note that moving files is a dangerous operation; copies are safer. That's because a "move" for remote files is actually a copy + delete -- and if @@ -3776,9 +3767,9 @@ Example: Clear netrw's marked file list via a mapping on gu > < *netrw-P22* P22. I get an error message when I try to copy or move a file: {{{2 - +> **error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work! - +< What's wrong? Netrw uses several system level commands to do things (see @@ -4001,9 +3992,9 @@ netrw: Nov 22, 2016 * (glacambre) reported that files containing spaces weren't being obtained properly via scp. Fix: apparently using single quotes - such as with 'file name' wasn't enough; the + such as with "file name" wasn't enough; the spaces inside the quotes also had to be - escaped (ie. 'file\ name'). + escaped (ie. "file\ name"). * Also fixed obtain (|netrw-O|) to be able to obtain files with spaces in their names Dec 20, 2016 * (xc1427) Reported that using "I" (|netrw-I|) diff --git a/runtime/doc/pi_spec.txt b/runtime/doc/pi_spec.txt index 6d45a0f064..d485d6ad49 100644 --- a/runtime/doc/pi_spec.txt +++ b/runtime/doc/pi_spec.txt @@ -34,8 +34,8 @@ also check if the name, version and release matches. The plugin is smart enough to ask you if it should update the package release, if you have not done so. +------------------------------------------------------------------------------ Setting a map *spec-setting-a-map* -------------- As you should know, you can easily set a map to access any Vim command (or anything, for that matter). If you don't like the default map of @@ -54,8 +54,8 @@ This command will add a map only in the spec file buffers. ============================================================================== 2. Customizing *spec-customizing* +------------------------------------------------------------------------------ The format string *spec_chglog_format* ------------------ You can easily customize how your spec file entry will look like. To do this just set the variable "spec_chglog_format" in your vimrc file like @@ -72,8 +72,8 @@ address once. To discover which format options you can use, take a look at the strftime() function man page. +------------------------------------------------------------------------------ Where to insert new items *spec_chglog_prepend* -------------------------- The plugin will usually insert new %changelog entry items (note that it's not the entry itself) after the existing ones. If you set the @@ -83,8 +83,8 @@ spec_chglog_prepend variable > it will insert new items before the existing ones. +------------------------------------------------------------------------------ Inserting release info *spec_chglog_release_info* ----------------------- If you want, the plugin may automatically insert release information on each changelog entry. One advantage of turning this feature on is diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt deleted file mode 100644 index ef3e47d32c..0000000000 --- a/runtime/doc/print.txt +++ /dev/null @@ -1,629 +0,0 @@ -*print.txt* Nvim - - - VIM REFERENCE MANUAL by Bram Moolenaar - - -Printing *printing* - - Type |gO| to see the table of contents. - -============================================================================== -1. Introduction *print-intro* - -On MS-Windows Vim can print your text on any installed printer. On other -systems a PostScript file is produced. This can be directly sent to a -PostScript printer. For other printers a program like ghostscript needs to be -used. - -Note: If you have problems printing with |:hardcopy|, an alternative is to use -|:TOhtml| and print the resulting html file from a browser. - - *:ha* *:hardcopy* *E237* *E238* *E324* -:[range]ha[rdcopy][!] [arguments] - Send [range] lines (default whole file) to the - printer. - - On MS-Windows a dialog is displayed to allow selection - of printer, paper size etc. To skip the dialog, use - the [!]. In this case the printer defined by - 'printdevice' is used, or, if 'printdevice' is empty, - the system default printer. - - For systems other than MS-Windows, PostScript is - written in a temp file and 'printexpr' is used to - actually print it. Then [arguments] can be used by - 'printexpr' through |v:cmdarg|. Otherwise [arguments] - is ignored. 'printoptions' can be used to specify - paper size, duplex, etc. - Note: If you want PDF, there are tools such as - "ps2pdf" that can convert the PostScript to PDF. - -:[range]ha[rdcopy][!] >{filename} - As above, but write the resulting PostScript in file - {filename}. - Things like "%" are expanded |cmdline-special| - Careful: An existing file is silently overwritten. - On MS-Windows use the "print to file" feature of the - printer driver. - -Progress is displayed during printing as a page number and a percentage. To -abort printing use the interrupt key (CTRL-C or, on MS-systems, CTRL-Break). - -Printer output is controlled by the 'printfont' and 'printoptions' options. -'printheader' specifies the format of a page header. - -The printed file is always limited to the selected margins, irrespective of -the current window's 'wrap' or 'linebreak' settings. The "wrap" item in -'printoptions' can be used to switch wrapping off. -The current highlighting colors are used in the printout, with the following -considerations: -1) The normal background is always rendered as white (i.e. blank paper). -2) White text or the default foreground is rendered as black, so that it shows - up! -3) If 'background' is "dark", then the colours are darkened to compensate for - the fact that otherwise they would be too bright to show up clearly on - white paper. - -============================================================================== -2. Print options *print-options* - -Here are the details for the options that change the way printing is done. -For generic info about setting options see |options.txt|. - - *pdev-option* -'printdevice' 'pdev' string (default empty) - global -This defines the name of the printer to be used when the |:hardcopy| command -is issued with a bang (!) to skip the printer selection dialog. On Win32, it -should be the printer name exactly as it appears in the standard printer -dialog. -If the option is empty, then vim will use the system default printer for -":hardcopy!" - - *penc-option* *E620* -'printencoding' 'penc' String (default empty, except for: - Windows: cp1252, - Macintosh: mac-roman, - HPUX: hp-roman8) - global -Sets the character encoding used when printing. This option tells Vim which -print character encoding file from the "print" directory in 'runtimepath' to -use. - -This option will accept any value from |encoding-names|. Any recognized names -are converted to Vim standard names - see 'encoding' for more details. Names -not recognized by Vim will just be converted to lower case and underscores -replaced with '-' signs. - -If 'printencoding' is empty or Vim cannot find the file then it will use -'encoding' (if it is set an 8-bit encoding) to find the print character -encoding file. If Vim is unable to find a character encoding file then it -will use the "latin1" print character encoding file. - -When 'encoding' is set to a multibyte encoding, Vim will try to convert -characters to the printing encoding for printing (if 'printencoding' is empty -then the conversion will be to latin1). If no conversion is possible then -printing will fail. Any characters that cannot be converted will be replaced -with upside down question marks. - -Two print character encoding files are provided to support default Mac and -HPUX character encodings and are used by default on these platforms. Code page -1252 print character encoding is used by default on the Windows platform. - - *pexpr-option* -'printexpr' 'pexpr' String (default: see below) - global -Expression that is evaluated to print the PostScript produced with -|:hardcopy|. -The file name to be printed is in |v:fname_in|. -The arguments to the ":hardcopy" command are in |v:cmdarg|. -The expression must take care of deleting the file after printing it. -When there is an error, the expression must return a non-zero number. -If there is no error, return zero or an empty string. -The default for non MS-Windows systems is to simply use "lpr" to print the -file: > - - system(['lpr'] - + (empty(&printdevice)?[]:['-P', &printdevice]) - + [v:fname_in]) - .. delete(v:fname_in) - + v:shell_error - -On MS-Dos and MS-Windows machines the default is to copy the file to the -currently specified printdevice: > - - system(['copy', v:fname_in, empty(&printdevice)?'LPT1':&printdevice]) - .. delete(v:fname_in) - -If you change this option, using a function is an easy way to avoid having to -escape all the spaces. Example: > - - :set printexpr=PrintFile(v:fname_in) - :function PrintFile(fname) - : call system("ghostview " .. a:fname) - : call delete(a:fname) - : return v:shell_error - :endfunc - -Be aware that some print programs return control before they have read the -file. If you delete the file too soon it will not be printed. These programs -usually offer an option to have them remove the file when printing is done. - *E365* -If evaluating the expression fails or it results in a non-zero number, you get -an error message. In that case Vim will delete the file. In the default -value for non-MS-Windows a trick is used: Adding "v:shell_error" will result -in a non-zero number when the system() call fails. - -If the expression starts with s: or |<SID>|, then it is replaced with the -script ID (|local-function|). Example: > - set printexpr=s:MyPrintFile() - set printexpr=<SID>SomePrintFile() -< -This option cannot be set from a |modeline| or in the |sandbox|, for security -reasons. - - *pfn-option* *E613* -'printfont' 'pfn' string (default "courier") - global -This is the name of the font that will be used for the |:hardcopy| command's -output. It has the same format as the 'guifont' option, except that only one -font may be named, and the special "guifont=*" syntax is not available. - -In the Win32 GUI version this specifies a font name with its extra attributes, -as with the 'guifont' option. - -For other systems, only ":h11" is recognized, where "11" is the point size of -the font. When omitted, the point size is 10. - - *pheader-option* -'printheader' 'pheader' string (default "%<%f%h%m%=Page %N") - global -This defines the format of the header produced in |:hardcopy| output. The -option is defined in the same way as the 'statusline' option. The same simple -header is used when this option is empty. - - *pmbcs-option* -'printmbcharset' 'pmbcs' string (default "") - global -Sets the CJK character set to be used when generating CJK output from -|:hardcopy|. The following predefined values are currently recognised by Vim: - - Value Description ~ - Chinese GB_2312-80 - (Simplified) GBT_12345-90 - MAC Apple Mac Simplified Chinese - GBT-90_MAC GB/T 12345-90 Apple Mac Simplified - Chinese - GBK GBK (GB 13000.1-93) - ISO10646 ISO 10646-1:1993 - - Chinese CNS_1993 CNS 11643-1993, Planes 1 & 2 - (Traditional) BIG5 - ETEN Big5 with ETen extensions - ISO10646 ISO 10646-1:1993 - - Japanese JIS_C_1978 - JIS_X_1983 - JIS_X_1990 - MSWINDOWS Win3.1/95J (JIS X 1997 + NEC + - IBM extensions) - KANJITALK6 Apple Mac KanjiTalk V6.x - KANJITALK7 Apple Mac KanjiTalk V7.x - - Korean KS_X_1992 - MAC Apple Macintosh Korean - MSWINDOWS KS X 1992 with MS extensions - ISO10646 ISO 10646-1:1993 - -Only certain combinations of the above values and 'printencoding' are -possible. The following tables show the valid combinations: - - euc-cn gbk ucs-2 utf-8 ~ - Chinese GB_2312-80 x - (Simplified) GBT_12345-90 x - MAC x - GBT-90_MAC x - GBK x - ISO10646 x x - - euc-tw big5 ucs-2 utf-8 ~ - Chinese CNS_1993 x - (Traditional) BIG5 x - ETEN x - ISO10646 x x - - euc-jp sjis ucs-2 utf-8 ~ - Japanese JIS_C_1978 x x - JIS_X_1983 x x - JIS_X_1990 x x x - MSWINDOWS x - KANJITALK6 x - KANJITALK7 x - - euc-kr cp949 ucs-2 utf-8 ~ - Korean KS_X_1992 x - MAC x - MSWINDOWS x - ISO10646 x x - -To set up the correct encoding and character set for printing some -Japanese text you would do the following; > - :set printencoding=euc-jp - :set printmbcharset=JIS_X_1983 - -If 'printmbcharset' is not one of the above values then it is assumed to -specify a custom multibyte character set and no check will be made that it is -compatible with the value for 'printencoding'. Vim will look for a file -defining the character set in the "print" directory in 'runtimepath'. - - *pmbfn-option* -'printmbfont' 'pmbfn' string (default "") - global -This is a comma-separated list of fields for font names to be used when -generating CJK output from |:hardcopy|. Each font name has to be preceded -with a letter indicating the style the font is to be used for as follows: - - r:{font-name} font to use for normal characters - b:{font-name} font to use for bold characters - i:{font-name} font to use for italic characters - o:{font-name} font to use for bold-italic characters - -A field with the r: prefix must be specified when doing CJK printing. The -other fontname specifiers are optional. If a specifier is missing then -another font will be used as follows: - - if b: is missing, then use r: - if i: is missing, then use r: - if o: is missing, then use b: - -Some CJK fonts do not contain characters for codes in the ASCII code range. -Also, some characters in the CJK ASCII code ranges differ in a few code points -from traditional ASCII characters. There are two additional fields to control -printing of characters in the ASCII code range. - - c:yes Use Courier font for characters in the ASCII - c:no (default) code range. - - a:yes Use ASCII character set for codes in the ASCII - a:no (default) code range. - -The following is an example of specifying two multibyte fonts, one for normal -and italic printing and one for bold and bold-italic printing, and using -Courier to print codes in the ASCII code range but using the national -character set: > - :set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,c:yes -< - *popt-option* -'printoptions' 'popt' string (default "") - global -This is a comma-separated list of items that control the format of the output -of |:hardcopy|: - - left:{spec} left margin (default: 10pc) - right:{spec} right margin (default: 5pc) - top:{spec} top margin (default: 5pc) - bottom:{spec} bottom margin (default: 5pc) - {spec} is a number followed by "in" for inches, "pt" - for points (1 point is 1/72 of an inch), "mm" for - millimeters or "pc" for a percentage of the media - size. - Weird example: - left:2in,top:30pt,right:16mm,bottom:3pc - If the unit is not recognized there is no error and - the default value is used. - - header:{nr} Number of lines to reserve for the header. - Only the first line is actually filled, thus when {nr} - is 2 there is one empty line. The header is formatted - according to 'printheader'. - header:0 Do not print a header. - header:2 (default) Use two lines for the header - - syntax:n Do not use syntax highlighting. This is faster and - thus useful when printing large files. - syntax:y Do syntax highlighting. - syntax:a (default) Use syntax highlighting if the printer appears to be - able to print color or grey. - - number:y Include line numbers in the printed output. - number:n (default) No line numbers. - - wrap:y (default) Wrap long lines. - wrap:n Truncate long lines. - - duplex:off Print on one side. - duplex:long (default) Print on both sides (when possible), bind on long - side. - duplex:short Print on both sides (when possible), bind on short - side. - - collate:y (default) Collating: 1 2 3, 1 2 3, 1 2 3 - collate:n No collating: 1 1 1, 2 2 2, 3 3 3 - - jobsplit:n (default) Do all copies in one print job - jobsplit:y Do each copy as a separate print job. Useful when - doing N-up postprocessing. - - portrait:y (default) Orientation is portrait. - portrait:n Orientation is landscape. - *a4* *letter* - paper:A4 (default) Paper size: A4 - paper:{name} Paper size from this table: - {name} size in cm size in inch ~ - 10x14 25.4 x 35.57 10 x 14 - A3 29.7 x 42 11.69 x 16.54 - A4 21 x 29.7 8.27 x 11.69 - A5 14.8 x 21 5.83 x 8.27 - B4 25 x 35.3 10.12 x 14.33 - B5 17.6 x 25 7.17 x 10.12 - executive 18.42 x 26.67 7.25 x 10.5 - folio 21 x 33 8.27 x 13 - ledger 43.13 x 27.96 17 x 11 - legal 21.59 x 35.57 8.5 x 14 - letter 21.59 x 27.96 8.5 x 11 - quarto 21.59 x 27.5 8.5 x 10.83 - statement 13.97 x 21.59 5.5 x 8.5 - tabloid 27.96 x 43.13 11 x 17 - - formfeed:n (default) Treat form feed characters (0x0c) as a normal print - character. - formfeed:y When a form feed character is encountered, continue - printing of the current line at the beginning of the - first line on a new page. - -The item indicated with (default) is used when the item is not present. The -values are not always used, especially when using a dialog to select the -printer and options. -Example: > - :set printoptions=paper:letter,duplex:off - -============================================================================== -3. PostScript Printing *postscript-printing* - *E455* *E456* *E457* *E624* -Provided you have enough disk space there should be no problems generating a -PostScript file. You need to have the runtime files correctly installed (if -you can find the help files, they probably are). - -There are currently a number of limitations with PostScript printing: - -- 'printfont' - The font name is ignored (the Courier family is always used - - it should be available on all PostScript printers) but the font size is - used. - -- 'printoptions' - The duplex setting is used when generating PostScript - output, but it is up to the printer to take notice of the setting. If the - printer does not support duplex printing then it should be silently ignored. - Some printers, however, don't print at all. - -- 8-bit support - While a number of 8-bit print character encodings are - supported it is possible that some characters will not print. Whether a - character will print depends on the font in the printer knowing the - character. Missing characters will be replaced with an upside down question - mark, or a space if that character is also not known by the font. It may be - possible to get all the characters in an encoding to print by installing a - new version of the Courier font family. - -- Multi-byte support - Currently Vim will try to convert multibyte characters - to the 8-bit encoding specified by 'printencoding' (or latin1 if it is - empty). Any characters that are not successfully converted are shown as - unknown characters. Printing will fail if Vim cannot convert the multibyte - to the 8-bit encoding. - -============================================================================== -4. Custom 8-bit Print Character Encodings *postscript-print-encoding* - *E618* *E619* -To use your own print character encoding when printing 8-bit character data -you need to define your own PostScript font encoding vector. Details on how -to define a font encoding vector is beyond the scope of this help file, but -you can find details in the PostScript Language Reference Manual, 3rd Edition, -published by Addison-Wesley and available in PDF form at -https://www.adobe.com/. The following describes what you need to do for Vim to -locate and use your print character encoding. - -i. Decide on a unique name for your encoding vector, one that does not clash - with any of the recognized or standard encoding names that Vim uses (see - |encoding-names| for a list), and that no one else is likely to use. -ii. Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your - 'runtimepath' and rename it with your unique name. -iii. Edit your renamed copy of latin1.ps, replacing all occurrences of latin1 - with your unique name (don't forget the line starting %%Title:), and - modify the array of glyph names to define your new encoding vector. The - array must have exactly 256 entries or you will not be able to print! -iv. Within Vim, set 'printencoding' to your unique encoding name and then - print your file. Vim will now use your custom print character encoding. - -Vim will report an error with the resource file if you change the order or -content of the first 3 lines, other than the name of the encoding on the line -starting %%Title: or the version number on the line starting %%Version:. - -[Technical explanation for those that know PostScript - Vim looks for a file -with the same name as the encoding it will use when printing. The file -defines a new PostScript Encoding resource called /VIM-name, where name is the -print character encoding Vim will use.] - -============================================================================== -5. PostScript CJK Printing *postscript-cjk-printing* - *E673* *E674* *E675* - -Vim supports printing of Chinese, Japanese, and Korean files. Setting up Vim -to correctly print CJK files requires setting up a few more options. - -Each of these countries has many standard character sets and encodings which -require that both be specified when printing. In addition, CJK fonts normally -do not have the concept of italic glyphs and use different weight or stroke -style to achieve emphasis when printing. This in turn requires a different -approach to specifying fonts to use when printing. - -The encoding and character set are specified with the 'printencoding' and -'printmbcharset' options. If 'printencoding' is not specified then 'encoding' -is used as normal. If 'printencoding' is specified then characters will be -translated to this encoding for printing. You should ensure that the encoding -is compatible with the character set needed for the file contents or some -characters may not appear when printed. - -The fonts to use for CJK printing are specified with 'printmbfont'. This -option allows you to specify different fonts to use when printing characters -which are syntax highlighted with the font styles normal, italic, bold and -bold-italic. - -Please read your printer documentation on how to install new fonts. - -CJK fonts can be large containing several thousand glyphs, and it is not -uncommon to find that they only contain a subset of a national standard. It -is not unusual to find the fonts to not include characters for codes in the -ASCII code range. If you find half-width Roman characters are not appearing -in your printout then you should configure Vim to use the Courier font the -half-width ASCII characters with 'printmbfont'. If your font does not include -other characters then you will need to find another font that does. - -Another issue with ASCII characters, is that the various national character -sets specify a couple of different glyphs in the ASCII code range. If you -print ASCII text using the national character set you may see some unexpected -characters. If you want true ASCII code printing then you need to configure -Vim to output ASCII characters for the ASCII code range with 'printmbfont'. - -It is possible to define your own multibyte character set although this -should not be attempted lightly. A discussion on the process if beyond the -scope of these help files. You can find details on CMap (character map) files -in the document 'Adobe CMap and CIDFont Files Specification, Version 1.0', -available from https://www.adobe.com as a PDF file. - -============================================================================== -6. PostScript Printing Troubleshooting *postscript-print-trouble* - *E621* -Usually the only sign of a problem when printing with PostScript is that your -printout does not appear. If you are lucky you may get a printed page that -tells you the PostScript operator that generated the error that prevented the -print job completing. - -There are a number of possible causes as to why the printing may have failed: - -- Wrong version of the prolog resource file. The prolog resource file - contains some PostScript that Vim needs to be able to print. Each version - of Vim needs one particular version. Make sure you have correctly installed - the runtime files, and don't have any old versions of a file called prolog - in the print directory in your 'runtimepath' directory. - -- Paper size. Some PostScript printers will abort printing a file if they do - not support the requested paper size. By default Vim uses A4 paper. Find - out what size paper your printer normally uses and set the appropriate paper - size with 'printoptions'. If you cannot find the name of the paper used, - measure a sheet and compare it with the table of supported paper sizes listed - for 'printoptions', using the paper that is closest in both width AND height. - Note: The dimensions of actual paper may vary slightly from the ones listed. - If there is no paper listed close enough, then you may want to try psresize - from PSUtils, discussed below. - -- Two-sided printing (duplex). Normally a PostScript printer that does not - support two-sided printing will ignore any request to do it. However, some - printers may abort the job altogether. Try printing with duplex turned off. - Note: Duplex prints can be achieved manually using PS utils - see below. - -- Collated printing. As with Duplex printing, most PostScript printers that - do not support collating printouts will ignore a request to do so. Some may - not. Try printing with collation turned off. - -- Syntax highlighting. Some print management code may prevent the generated - PostScript file from being printed on a black and white printer when syntax - highlighting is turned on, even if solid black is the only color used. Try - printing with syntax highlighting turned off. - -A safe printoptions setting to try is: > - - :set printoptions=paper:A4,duplex:off,collate:n,syntax:n - -Replace "A4" with the paper size that best matches your printer paper. - -============================================================================== -7. PostScript Utilities *postscript-print-util* - -7.1 Ghostscript - -Ghostscript is a PostScript and PDF interpreter that can be used to display -and print on non-PostScript printers PostScript and PDF files. It can also -generate PDF files from PostScript. - -Ghostscript will run on a wide variety of platforms. Information on -Ghostscript can be found at: - - http://www.ghostscript.com/ - -Support for a number of non PostScript printers is provided in the -distribution as standard, but if you cannot find support for your printer -check the Ghostscript site for other printers not included by default. - - -7.2 Ghostscript Previewers. - -The interface to Ghostscript is very primitive so a number of graphical front -ends have been created. These allow easier PostScript file selection, -previewing at different zoom levels, and printing. Check supplied -documentation for full details. - -ALTERNATE DUPLEX PRINTING - -It is possible to achieve a poor man's version of duplex printing using the PS -utility psselect. This utility has options -e and -o for printing just the -even or odd pages of a PS file respectively. - -First generate a PS file with the ":hardcopy" command, then generate new -files with all the odd and even numbered pages with: > - - psselect -o test.ps odd.ps - psselect -e test.ps even.ps - -Next print odd.ps with your platform's normal print command. Then take the -print output, turn it over and place it back in the paper feeder. Now print -even.ps with your platform's print command. All the even pages should now -appear on the back of the odd pages. - -There are a couple of points to bear in mind: - -1. Position of the first page. If the first page is on top of the printout - when printing the odd pages then you need to reverse the order that the odd - pages are printed. This can be done with the -r option to psselect. This - will ensure page 2 is printed on the back of page 1. - Note: it is better to reverse the odd numbered pages rather than the even - numbered in case there are an odd number of pages in the original PS file. - -2. Paper flipping. When turning over the paper with the odd pages printed on - them you may have to either flip them horizontally (along the long edge) or - vertically (along the short edge), as well as possibly rotating them 180 - degrees. All this depends on the printer - it will be more obvious for - desktop ink jets than for small office laser printers where the paper path - is hidden from view. - - -============================================================================== -8. Formfeed Characters *printing-formfeed* - -By default Vim does not do any special processing of formfeed control -characters. Setting the 'printoptions' formfeed item will make Vim recognize -formfeed characters and continue printing the current line at the beginning -of the first line on a new page. The use of formfeed characters provides -rudimentary print control but there are certain things to be aware of. - -Vim will always start printing a line (including a line number if enabled) -containing a formfeed character, even if it is the first character on the -line. This means if a line starting with a formfeed character is the first -line of a page then Vim will print a blank page. - -Since the line number is printed at the start of printing the line containing -the formfeed character, the remainder of the line printed on the new page -will not have a line number printed for it (in the same way as the wrapped -lines of a long line when wrap in 'printoptions' is enabled). - -If the formfeed character is the last character on a line, then printing will -continue on the second line of the new page, not the first. This is due to -Vim processing the end of the line after the formfeed character and moving -down a line to continue printing. - -Due to the points made above it is recommended that when formfeed character -processing is enabled, printing of line numbers is disabled, and that form -feed characters are not the last character on a line. Even then you may need -to adjust the number of lines before a formfeed character to prevent -accidental blank pages. - -============================================================================== - vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index e79d79ba1b..a30f32b75e 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1585,8 +1585,9 @@ A call of |:clist| writes them accordingly with their correct filenames: Unlike the other prefixes that all match against whole lines, %P, %Q and %O can be used to match several patterns in the same line. Thus it is possible -to parse even nested files like in the following line: +to parse even nested files like in the following line: > {"file1" {"file2" error1} error2 {"file3" error3 {"file4" error4 error5}}} +< The %O then parses over strings that do not contain any push/pop file name information. See |errorformat-LaTeX| for an extended example. @@ -1946,9 +1947,9 @@ by Vim. The default format for the lines displayed in the quickfix window and location list window is: - +> <filename>|<lnum> col <col>|<text> - +< The values displayed in each line correspond to the "bufnr", "lnum", "col" and "text" fields returned by the |getqflist()| function. diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 5f5ca2af2c..d0088f5b9b 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -821,14 +821,6 @@ Short explanation of each option: *option-list* 'previewheight' 'pvh' height of the preview window 'previewpopup' 'pvp' use popup window for preview 'previewwindow' 'pvw' identifies the preview window -'printdevice' 'pdev' name of the printer to be used for :hardcopy -'printencoding' 'penc' encoding to be used for printing -'printexpr' 'pexpr' expression used to print PostScript for :hardcopy -'printfont' 'pfn' name of the font to be used for :hardcopy -'printheader' 'pheader' format of the header used for :hardcopy -'printmbcharset' 'pmbcs' CJK character set to be used for :hardcopy -'printmbfont' 'pmbfn' font names to be used for CJK output of :hardcopy -'printoptions' 'popt' controls the format of :hardcopy output 'pumheight' 'ph' maximum number of items to show in the popup menu 'pumwidth' 'pw' minimum width of the popup menu 'pyxversion' 'pyx' Python version used for pyx* commands @@ -868,7 +860,8 @@ Short explanation of each option: *option-list* 'shiftwidth' 'sw' number of spaces to use for (auto)indent step 'shortmess' 'shm' list of flags, reduce length of messages 'showbreak' 'sbr' string to use at the start of wrapped lines -'showcmd' 'sc' show (partial) command in status line +'showcmd' 'sc' show (partial) command somewhere +'showcmdloc' 'sloc' where to show (partial) command 'showfulltag' 'sft' show full tag pattern when completing tag 'showmatch' 'sm' briefly jump to matching bracket if insert one 'showmode' 'smd' message on status line to show current mode diff --git a/runtime/doc/remote.txt b/runtime/doc/remote.txt index 0c1e3438de..4610088ab0 100644 --- a/runtime/doc/remote.txt +++ b/runtime/doc/remote.txt @@ -52,6 +52,10 @@ The following command line arguments are available: *--remote-expr* --remote-expr {expr} Evaluate {expr} in server and print the result on stdout. + *--remote-ui* + --remote-ui Display the UI of the server in the terminal. + Fully interactive: keyboard and mouse input + are forwarded to the server. *--server* --server {addr} Connect to the named pipe or socket at the given address for executing remote commands. diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt index aa11462595..4f68ab562c 100644 --- a/runtime/doc/rileft.txt +++ b/runtime/doc/rileft.txt @@ -12,8 +12,9 @@ These functions were originally created by Avner Lottem: E-mail: alottem@iil.intel.com Phone: +972-4-8307322 +------------------------------------------------------------------------------ Introduction ------------- + Some languages such as Arabic, Farsi, Hebrew (among others) require the ability to display their text from right-to-left. Files in those languages are stored conventionally and the right-to-left requirement is only a @@ -32,8 +33,9 @@ as this kind of support is out of the scope of a simple addition to an existing editor (and it's not sanctioned by Unicode either). +------------------------------------------------------------------------------ Highlights ----------- + o Editing left-to-right files as in the original Vim, no change. o Viewing and editing files in right-to-left windows. File orientation @@ -56,11 +58,11 @@ o Many languages use and require right-to-left support. These languages current supported languages include - |arabic.txt| and |hebrew.txt|. +------------------------------------------------------------------------------ Of Interest... --------------- o Invocations - ----------- + + 'rightleft' ('rl') sets window orientation to right-to-left. + 'delcombine' ('deco'), boolean, if editing UTF-8 encoded languages, allows one to remove a composing character which gets superimposed @@ -69,7 +71,7 @@ o Invocations (such as search) to be utilized in right-to-left orientation as well. o Typing backwards *ins-reverse* - ---------------- + In lieu of using the full-fledged 'rightleft' option, one can opt for reverse insertion. When the 'revins' (reverse insert) option is set, inserting happens backwards. This can be used to type right-to-left @@ -85,15 +87,16 @@ o Typing backwards *ins-reverse* in the status line when reverse Insert mode is active. o Pasting when in a rightleft window - ---------------------------------- + When cutting text with the mouse and pasting it in a rightleft window the text will be reversed, because the characters come from the cut buffer from the left to the right, while inserted in the file from the right to the left. In order to avoid it, toggle 'revins' before pasting. +------------------------------------------------------------------------------ Bugs ----- + o Does not handle CTRL-A and CTRL-X commands (add and subtract) correctly when in rightleft window. diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index efe0c3390d..d09d0f226f 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -606,9 +606,9 @@ sign_placelist({list}) then a new unique identifier is allocated. Otherwise the specified number is used. See |sign-identifier| for more information. - lnum line number in the buffer {buf} where the - sign is to be placed. For the accepted values, - see |line()|. + lnum line number in the buffer where the sign is to + be placed. For the accepted values, see + |line()|. name name of the sign to place. See |sign_define()| for more information. priority priority of the sign. When multiple signs are diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 1a7b73601e..8b662ab1bf 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -483,13 +483,13 @@ accordingly, proceeding as follows: However, directories in 'runtimepath' ending in "after" are skipped here and only loaded after packages, see below. Loading plugins won't be done when: - - The 'loadplugins' option was reset in a vimrc file. + - The |'loadplugins'| option was reset in a vimrc file. - The |--noplugin| command line argument is used. - The |--clean| command line argument is used. - The "-u NONE" command line argument is used |-u|. - Note that using "-c 'set noloadplugins'" doesn't work, because the + Note that using `-c 'set noloadplugins'` doesn't work, because the commands from the command line have not been executed yet. You can - use "--cmd 'set noloadplugins'" or "--cmd 'set loadplugins'" |--cmd|. + use `--cmd 'set noloadplugins'` or `--cmd 'set loadplugins'` |--cmd|. Packages are loaded. These are plugins, as above, but found in the "start" directory of each entry in 'packpath'. Every plugin directory diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 3cd36f7652..b4afc3f233 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -2475,7 +2475,7 @@ from the rest of the name (like 'PkgName::' in '$PkgName::VarName'): > (In Vim 6.x it was the other way around: "perl_want_scope_in_variables" enabled it.) -If you do not want complex things like '@{${"foo"}}' to be parsed: > +If you do not want complex things like `@{${"foo"}}` to be parsed: > :let perl_no_extended_vars = 1 @@ -4851,7 +4851,7 @@ Note that the ":syntax" command can be abbreviated to ":sy", although ":syn" is mostly used, because it looks better. ============================================================================== -12. Highlight command *:highlight* *:hi* *E28* *E411* *E415* +13. Highlight command *:highlight* *:hi* *E28* *E411* *E415* There are two types of highlight groups: - The built-in |highlight-groups|. @@ -4902,7 +4902,7 @@ in their own color. *highlight-clear* *:hi-clear* :hi[ghlight] clear Reset all highlighting to the defaults. Removes all - highlighting for groups added by the user! + highlighting for groups added by the user. Uses the current value of 'background' to decide which default colors to use. If there was a default link, restore it. |:hi-link| @@ -5042,7 +5042,7 @@ ctermbg={color-nr} *ctermbg* a number instead of a color name. Note that for 16 color ansi style terminals (including xterms), the - numbers in the NR-8 column is used. Here '*' means 'add 8' so that + numbers in the NR-8 column is used. Here "*" means "add 8" so that Blue is 12, DarkGray is 8 etc. Note that for some color terminals these names may result in the wrong @@ -5333,7 +5333,7 @@ Tooltip Current font, background and foreground of the tooltips. Applicable highlight arguments: font, guibg, guifg. ============================================================================== -13. Linking groups *:hi-link* *:highlight-link* *E412* *E413* +14. Linking groups *:hi-link* *:highlight-link* *E412* *E413* When you want to use the same highlighting for several syntax groups, you can do this more easily by linking the groups into one common highlight @@ -5492,7 +5492,7 @@ is loaded into that window or the file is reloaded. When splitting the window, the new window will use the original syntax. ============================================================================== -17. Color xterms *xterm-color* *color-xterm* +18. Color xterms *xterm-color* *color-xterm* *colortest.vim* To test your color setup, a file has been included in the Vim distribution. @@ -5502,7 +5502,7 @@ To use it, execute this command: > Nvim uses 256-color and |true-color| terminal capabilities wherever possible. ============================================================================== -18. When syntax is slow *:syntime* +19. When syntax is slow *:syntime* This is aimed at authors of a syntax file. diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index 539ded07ee..0f785dd1eb 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -59,9 +59,9 @@ CTRL-] Jump to the definition of the keyword under the CTRL-] is the default telnet escape key. When you type CTRL-] to jump to a tag, you will get the telnet prompt instead. Most versions of telnet allow changing or disabling the default escape key. See the telnet man page. You -can 'telnet -E {Hostname}' to disable the escape character, or 'telnet -e -{EscapeCharacter} {Hostname}' to specify another escape character. If -possible, try to use "ssh" instead of "telnet" to avoid this problem. +can `telnet -E {Hostname}` to disable the escape character, or +`telnet -e {EscapeCharacter} {Hostname}` to specify another escape character. +If possible, try to use "ssh" instead of "telnet" to avoid this problem. *tag-priority* When there are multiple matches for a tag, this priority is used: @@ -404,7 +404,7 @@ is added to the command and on the 'autowrite' option: tag in file autowrite ~ current file changed ! option action ~ ------------------------------------------------------------------------------ + --------------------------------------------------------------------------- yes x x x goto tag no no x x read other file, goto tag no yes yes x abandon current file, read other file, goto @@ -412,7 +412,7 @@ current file changed ! option action ~ no yes no on write current file, read other file, goto tag no yes no off fail ------------------------------------------------------------------------------ + --------------------------------------------------------------------------- - If the tag is in the current file, the command will always work. - If the tag is in another file and the current file was not changed, the @@ -561,8 +561,8 @@ ctags). with Vi, it ignores the following fields. Example: APP file /^static int APP;$/;" v When {tagaddress} is not a line number or search pattern, then - {term} must be |;". Here the bar ends the command (excluding - the bar) and ;" is used to have Vi ignore the rest of the + {term} must be `|;"`. Here the bar ends the command (excluding + the bar) and `;"` is used to have Vi ignore the rest of the line. Example: APP file.c call cursor(3, 4)|;" v @@ -848,9 +848,9 @@ Common arguments for the commands above: a comment (even though syntax highlighting does recognize it). Note: Since a macro definition mostly doesn't look like a comment, the [!] makes no difference for ":dlist", ":dsearch" and ":djump". -[/] A pattern can be surrounded by '/'. Without '/' only whole words are - matched, using the pattern "\<pattern\>". Only after the second '/' a - next command can be appended with '|'. Example: > +[/] A pattern can be surrounded by "/". Without "/" only whole words are + matched, using the pattern "\<pattern\>". Only after the second "/" a + next command can be appended with "|". Example: > :isearch /string/ | echo "the last one" < For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern is used as a literal string, not as a search pattern. diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt index 559f31eb2d..5d5e89da77 100644 --- a/runtime/doc/tips.txt +++ b/runtime/doc/tips.txt @@ -297,7 +297,7 @@ be able to give comments to the parts of the mapping. > (<> notation |<>|. Note that this is all typed literally. ^W is "^" "W", not CTRL-W.) -Note that the last comment starts with |", because the ":execute" command +Note that the last comment starts with `|"`, because the ":execute" command doesn't accept a comment directly. You also need to set 'textwidth' to a non-zero value, e.g., > diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 1cffe1f902..a2ae9f22ce 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -56,6 +56,8 @@ with these (optional) keys: - `stdin_fd` Read buffer from `fd` as if it was a stdin pipe This option can only used by |--embed| ui, see |ui-startup-stdin|. + `stdin_tty` Tells if `stdin` is a `tty` or not. + `stdout_tty` Tells if `stdout` is a `tty` or not. Specifying an unknown option is an error; UIs can check the |api-metadata| `ui_options` key for supported options. diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt index 641c95b06e..4d000efc1e 100644 --- a/runtime/doc/userfunc.txt +++ b/runtime/doc/userfunc.txt @@ -343,7 +343,6 @@ is used as a method: > ============================================================================== - 3. Automatically loading functions ~ *autoload-functions* When using many or large functions, it's possible to automatically define them diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index f822e7d4b8..11afe39742 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -33,7 +33,7 @@ On Unix you can type this at any command prompt. If you are running Microsoft Windows, open a Command Prompt and enter the command. In either case, Vim starts editing a file called file.txt. Because this is a new file, you get a blank window. This is what your screen will look like: - +> +---------------------------------------+ |# | |~ | @@ -43,7 +43,7 @@ blank window. This is what your screen will look like: |"file.txt" [New file] | +---------------------------------------+ ('#' is the cursor position.) - +< The tilde (~) lines indicate lines not in the file. In other words, when Vim runs out of file to display, it displays tilde lines. At the bottom of the screen, a message line indicates the file is named file.txt and shows that you @@ -83,7 +83,7 @@ limerick, this is what you type: > After typing "turtle" you press the <Enter> key to start a new line. Finally you press the <Esc> key to stop Insert mode and go back to Normal mode. You now have two lines of text in your Vim window: - +> +---------------------------------------+ |A very intelligent turtle | |Found programming Unix a hurdle | @@ -91,7 +91,7 @@ now have two lines of text in your Vim window: |~ | | | +---------------------------------------+ - +< WHAT IS THE MODE? @@ -105,7 +105,7 @@ with a colon). Finish this command by pressing the <Enter> key (all commands that start with a colon are finished this way). Now, if you type the "i" command Vim will display --INSERT-- at the bottom of the window. This indicates you are in Insert mode. - +> +---------------------------------------+ |A very intelligent turtle | |Found programming Unix a hurdle | @@ -113,7 +113,7 @@ of the window. This indicates you are in Insert mode. |~ | |-- INSERT -- | +---------------------------------------+ - +< If you press <Esc> to go back to Normal mode the last line will be made blank. @@ -182,7 +182,7 @@ throwback to the old days of the typewriter, when you deleted things by typing xxxx over them.) Move the cursor to the beginning of the first line, for example, and type xxxxxxx (seven x's) to delete "A very ". The result should look like this: - +> +---------------------------------------+ |intelligent turtle | |Found programming Unix a hurdle | @@ -190,14 +190,14 @@ look like this: |~ | | | +---------------------------------------+ - +< Now you can insert new text, for example by typing: > iA young <Esc> This begins an insert (the i), inserts the words "A young", and then exits insert mode (the final <Esc>). The result: - +> +---------------------------------------+ |A young intelligent turtle | |Found programming Unix a hurdle | @@ -205,13 +205,13 @@ insert mode (the final <Esc>). The result: |~ | | | +---------------------------------------+ - +< DELETING A LINE To delete a whole line use the "dd" command. The following line will then move up to fill the gap: - +> +---------------------------------------+ |Found programming Unix a hurdle | |~ | @@ -219,7 +219,7 @@ then move up to fill the gap: |~ | | | +---------------------------------------+ - +< DELETING A LINE BREAK diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index 944eb1fc80..24d6185eae 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -107,7 +107,7 @@ Display an incomplete command in the lower right corner of the Vim window, left of the ruler. For example, when you type "2f", Vim is waiting for you to type the character to find and "2f" is displayed. When you press "w" next, the "2fw" command is executed and the displayed "2f" is removed. - +> +-------------------------------------------------+ |text in the Vim window | |~ | @@ -119,7 +119,7 @@ the "2fw" command is executed and the displayed "2f" is removed. > set incsearch - +< Display matches for a search pattern while you type. > diff --git a/runtime/doc/usr_06.txt b/runtime/doc/usr_06.txt index 8eda33b4f0..755e6e816a 100644 --- a/runtime/doc/usr_06.txt +++ b/runtime/doc/usr_06.txt @@ -14,8 +14,7 @@ screen. |06.2| No or wrong colors? |06.3| Different colors |06.4| With colors or without colors -|06.5| Printing with colors -|06.6| Further reading +|06.5| Further reading Next chapter: |usr_07.txt| Editing more than one file Previous chapter: |usr_05.txt| Set your settings @@ -191,59 +190,7 @@ buffer, set the 'syntax' option: > :set syntax=ON < ============================================================================== -*06.5* Printing with colors *syntax-printing* - -In the MS-Windows version you can print the current file with this command: > - - :hardcopy - -You will get the usual printer dialog, where you can select the printer and a -few settings. If you have a color printer, the paper output should look the -same as what you see inside Vim. But when you use a dark background the -colors will be adjusted to look good on white paper. - -There are several options that change the way Vim prints: - 'printdevice' - 'printheader' - 'printfont' - 'printoptions' - -To print only a range of lines, use Visual mode to select the lines and then -type the command: > - - v100j:hardcopy - -"v" starts Visual mode. "100j" moves a hundred lines down, they will be -highlighted. Then ":hardcopy" will print those lines. You can use other -commands to move in Visual mode, of course. - -This also works on Unix, if you have a PostScript printer. Otherwise, you -will have to do a bit more work. You need to convert the text to HTML first, -and then print it from a web browser. - -Convert the current file to HTML with this command: > - - :TOhtml - -In case that doesn't work: > - - :source $VIMRUNTIME/syntax/2html.vim - -You will see it crunching away, this can take quite a while for a large file. -Some time later another window shows the HTML code. Now write this somewhere -(doesn't matter where, you throw it away later): -> - :write main.c.html - -Open this file in your favorite browser and print it from there. If all goes -well, the output should look exactly as it does in Vim. See |2html.vim| for -details. Don't forget to delete the HTML file when you are done with it. - -Instead of printing, you could also put the HTML file on a web server, and let -others look at the colored text. - -============================================================================== -*06.6* Further reading +*06.5* Further reading |usr_44.txt| Your own syntax highlighted. |syntax| All the details. diff --git a/runtime/doc/usr_08.txt b/runtime/doc/usr_08.txt index 1d20913a14..0ba03a4861 100644 --- a/runtime/doc/usr_08.txt +++ b/runtime/doc/usr_08.txt @@ -32,7 +32,7 @@ The easiest way to open a new window is to use the following command: > This command splits the screen into two windows and leaves the cursor in the top one: - +> +----------------------------------+ |/* file one.c */ | |~ | @@ -43,7 +43,7 @@ top one: |one.c=============================| | | +----------------------------------+ - +< What you see here is two windows on the same file. The line with "====" is the status line. It displays information about the window above it. (In practice the status line will be in reverse video.) @@ -87,7 +87,7 @@ The following command opens a second window and starts editing the given file: :split two.c If you were editing one.c, then the result looks like this: - +> +----------------------------------+ |/* file two.c */ | |~ | @@ -98,7 +98,7 @@ If you were editing one.c, then the result looks like this: |one.c=============================| | | +----------------------------------+ - +< To open a window on a new, empty file, use this: > :new @@ -170,7 +170,7 @@ or: > :vsplit two.c The result looks something like this: - +> +--------------------------------------+ |/* file two.c */ |/* file one.c */ | |~ |~ | @@ -179,7 +179,7 @@ The result looks something like this: |two.c===============one.c=============| | | +--------------------------------------+ - +< Actually, the | lines in the middle will be in reverse video. This is called the vertical separator. It separates the two windows left and right of it. @@ -218,7 +218,7 @@ cursor keys can also be used, if you like. You have split a few windows, but now they are in the wrong place. Then you need a command to move the window somewhere else. For example, you have three windows like this: - +> +----------------------------------+ |/* file two.c */ | |~ | @@ -233,7 +233,7 @@ windows like this: |one.c=============================| | | +----------------------------------+ - +< Clearly the last one should be at the top. Go to that window (using CTRL-W w) and then type this command: > @@ -244,7 +244,7 @@ the very top. You will notice that K is again used for moving upwards. When you have vertical splits, CTRL-W K will move the current window to the top and make it occupy the full width of the Vim window. If this is your layout: - +> +-------------------------------------------+ |/* two.c */ |/* three.c */ |/* one.c */ | |~ |~ |~ | @@ -255,9 +255,9 @@ layout: |two.c=========three.c=========one.c========| | | +-------------------------------------------+ - +< Then using CTRL-W K in the middle window (three.c) will result in: - +> +-------------------------------------------+ |/* three.c */ | |~ | @@ -268,7 +268,7 @@ Then using CTRL-W K in the middle window (three.c) will result in: |two.c==================one.c===============| | | +-------------------------------------------+ - +< The other three similar commands (you can probably guess these now): CTRL-W H move window to the far left @@ -316,7 +316,7 @@ To make Vim open a window for each file, start it with the "-o" argument: > vim -o one.txt two.txt three.txt This results in: - +> +-------------------------------+ |file one.txt | |~ | @@ -329,7 +329,7 @@ This results in: |three.txt======================| | | +-------------------------------+ - +< The "-O" argument is used to get vertically split windows. When Vim is already running, the ":all" command opens a window for each file in the argument list. ":vertical all" does it with vertical splits. @@ -347,7 +347,7 @@ Type this command in a shell to start Nvim in diff mode: > Vim will start, with two windows side by side. You will only see the line in which you added characters, and a few lines above and below it. - +> VV VV +-----------------------------------------+ |+ +--123 lines: /* a|+ +--123 lines: /* a| <- fold @@ -366,7 +366,7 @@ in which you added characters, and a few lines above and below it. |main.c~==============main.c==============| | | +-----------------------------------------+ - +< (This picture doesn't show the highlighting, use "nvim -d" for that.) The lines that were not modified have been collapsed into one line. This is @@ -519,7 +519,7 @@ Assume you are editing "thisfile". To create a new tab page use this command: > This will edit the file "thatfile" in a window that occupies the whole Vim window. And you will notice a bar at the top with the two file names: - +> +----------------------------------+ | thisfile | /thatfile/ __________X| (thatfile is bold) |/* thatfile */ | @@ -530,13 +530,13 @@ window. And you will notice a bar at the top with the two file names: |~ | | | +----------------------------------+ - +< You now have two tab pages. The first one has a window for "thisfile" and the second one a window for "thatfile". It's like two pages that are on top of each other, with a tab sticking out of each page showing the file name. Now use the mouse to click on "thisfile" in the top line. The result is - +> +----------------------------------+ | /thisfile/ | thatfile __________X| (thisfile is bold) |/* thisfile */ | @@ -547,7 +547,7 @@ Now use the mouse to click on "thisfile" in the top line. The result is |~ | | | +----------------------------------+ - +< Thus you can switch between tab pages by clicking on the label in the top line. If you don't have a mouse or don't want to use it, you can use the "gt" command. Mnemonic: Goto Tab. @@ -558,7 +558,7 @@ Now let's create another tab page with the command: > This makes a new tab page with one window that is editing the same buffer as the window we were in: - +> +-------------------------------------+ | thisfile | /thisfile/ | thatfile __X| (thisfile is bold) |/* thisfile */ | @@ -569,7 +569,7 @@ the window we were in: |~ | | | +-------------------------------------+ - +< You can put ":tab" before any Ex command that opens a window. The window will be opened in a new tab page. Another example: > diff --git a/runtime/doc/usr_10.txt b/runtime/doc/usr_10.txt index 8844671e01..3e45fda882 100644 --- a/runtime/doc/usr_10.txt +++ b/runtime/doc/usr_10.txt @@ -813,10 +813,10 @@ REDRAWING THE SCREEN If the external command produced an error message, the display may have been messed up. Vim is very efficient and only redraws those parts of the screen that it knows need redrawing. But it can't know about what another program -has written. To tell Vim to redraw the screen: > - +has written. To tell Vim to redraw the screen: +> CTRL-L - +< ============================================================================== Next chapter: |usr_11.txt| Recovering from a crash diff --git a/runtime/doc/usr_20.txt b/runtime/doc/usr_20.txt index 6a8836c8e8..2b69862fe1 100644 --- a/runtime/doc/usr_20.txt +++ b/runtime/doc/usr_20.txt @@ -338,7 +338,7 @@ Open the command line window with this command: > Vim now opens a (small) window at the bottom. It contains the command line history, and an empty line at the end: - +> +-------------------------------------+ |other window | |~ | @@ -353,7 +353,7 @@ history, and an empty line at the end: |command-line=========================| | | +-------------------------------------+ - +< You are now in Normal mode. You can use the "hjkl" keys to move around. For example, move up with "5k" to the ":e config.h.in" line. Type "$h" to go to the "i" of "in" and type "cwout". Now you have changed the line to: diff --git a/runtime/doc/usr_21.txt b/runtime/doc/usr_21.txt index beb09c13df..191d333f3d 100644 --- a/runtime/doc/usr_21.txt +++ b/runtime/doc/usr_21.txt @@ -302,7 +302,7 @@ session file as a starting point. use, and save this in a session. Then you can go back to this layout whenever you want. For example, this is a nice layout to use: - +> +----------------------------------------+ | VIM - main help file | | | @@ -318,7 +318,7 @@ you want. |~/=========|[No File]===================| | | +----------------------------------------+ - +< This has a help window at the top, so that you can read this text. The narrow vertical window on the left contains a file explorer. This is a Vim plugin that lists the contents of a directory. You can select files to edit there. @@ -454,7 +454,7 @@ Use this format for the modeline: The "any-text" indicates that you can put any text before and after the part that Vim will use. This allows making it look like a comment, like what was -done above with /* and */. +done above with "/*" and "*/". The " vim:" part is what makes Vim recognize this line. There must be white space before "vim", or "vim" must be at the start of the line. Thus using something like "gvim:" will not work. diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt index 2efb67e55f..955d2ae5f0 100644 --- a/runtime/doc/usr_25.txt +++ b/runtime/doc/usr_25.txt @@ -325,16 +325,16 @@ Let's attempt to show this with one line of text. The cursor is on the "w" of currently visible. The "window"s below the text indicate the text that is visible after the command left of it. - |<-- current window -->| + `|<-- current window -->|` some long text, part of which is visible in the window ~ - ze |<-- window -->| - zH |<-- window -->| - 4zh |<-- window -->| - zh |<-- window -->| - zl |<-- window -->| - 4zl |<-- window -->| - zL |<-- window -->| - zs |<-- window -->| + ze `|<-- window -->|` + zH `|<-- window -->|` + 4zh `|<-- window -->|` + zh `|<-- window -->|` + zl `|<-- window -->|` + 4zl `|<-- window -->|` + zL `|<-- window -->|` + zs `|<-- window -->|` MOVING WITH WRAP OFF @@ -350,7 +350,7 @@ scroll: gM to middle of the text in this line g$ to last visible character in this line - |<-- window -->| + `|<-- window -->|` some long text, part of which is visible in one line ~ g0 g^ gm gM g$ @@ -365,7 +365,7 @@ broken halfway, which makes them hard to read. 'linebreak' option. Vim then breaks lines at an appropriate place when displaying the line. The text in the file remains unchanged. Without 'linebreak' text might look like this: - +> +---------------------------------+ |letter generation program for a b| |ank. They wanted to send out a s| @@ -373,12 +373,13 @@ displaying the line. The text in the file remains unchanged. |eir richest 1000 customers. Unfo| |rtunately for the programmer, he | +---------------------------------+ +< After: > :set linebreak it looks like this: - +> +---------------------------------+ |letter generation program for a | |bank. They wanted to send out a | @@ -386,7 +387,7 @@ it looks like this: |their richest 1000 customers. | |Unfortunately for the programmer,| +---------------------------------+ - +< Related options: 'breakat' specifies the characters where a break can be inserted. 'showbreak' specifies a string to show at the start of broken line. @@ -425,7 +426,7 @@ That looks complicated. Let's break it up in pieces: into one line. Starting with this text, containing eight lines broken at column 30: - +> +----------------------------------+ |A letter generation program | |for a bank. They wanted to | @@ -436,9 +437,9 @@ Starting with this text, containing eight lines broken at column 30: |customers. Unfortunately for | |the programmer, | +----------------------------------+ - +< You end up with two lines: - +> +----------------------------------+ |A letter generation program for a | |bank. They wanted to send out a s| @@ -446,7 +447,7 @@ You end up with two lines: |To their richest 1000 customers. | |Unfortunately for the programmer, | +----------------------------------+ - +< Note that this doesn't work when the separating line is blank but not empty; when it contains spaces and/or tabs. This command does work with blank lines: > diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt index 87981a8ce0..751cb9a902 100644 --- a/runtime/doc/usr_29.txt +++ b/runtime/doc/usr_29.txt @@ -53,7 +53,7 @@ function. The "write_line" function calls "write_char". You need to figure out what it does. So you position the cursor over the call to "write_char" and press CTRL-]. Now you are at the definition of "write_char". - +> +-------------------------------------+ |void write_block(char **s; int cnt) | |{ | @@ -79,7 +79,7 @@ CTRL-]. Now you are at the definition of "write_char". | putchar((int)(unsigned char)c); | |} | +------------------------------------+ - +< The ":tags" command shows the list of tags that you traversed through: :tags @@ -425,7 +425,7 @@ MOVING IN COMMENTS To move back to the start of a comment use "[/". Move forward to the end of a comment with "]/". This only works for /* - */ comments. - +> +-> +-> /* | [/ | * A comment about --+ [/ | +-- * wonderful life. | ]/ @@ -434,7 +434,7 @@ comment with "]/". This only works for /* - */ comments. +-- foo = bar * 3; --+ | ]/ /* a short comment */ <-+ - +< ============================================================================== *29.4* Finding global identifiers @@ -575,7 +575,7 @@ and jump to the first place where the word under the cursor is used: > Hint: Goto Definition. This command is very useful to find a variable or function that was declared locally ("static", in C terms). Example (cursor on "counter"): - +> +-> static int counter = 0; | | int get_counter(void) @@ -583,7 +583,7 @@ function that was declared locally ("static", in C terms). Example (cursor on | ++counter; +-- return counter; } - +< To restrict the search even further, and look only in the current function, use this command: > @@ -593,7 +593,7 @@ This will go back to the start of the current function and find the first occurrence of the word under the cursor. Actually, it searches backwards to an empty line above a "{" in the first column. From there it searches forward for the identifier. Example (cursor on "idx"): - +> int find_entry(char *name) { +-> int idx; @@ -602,7 +602,7 @@ for the identifier. Example (cursor on "idx"): | if (strcmp(table[idx].name, name) == 0) +-- return idx; } - +< ============================================================================== Next chapter: |usr_30.txt| Editing programs diff --git a/runtime/doc/usr_30.txt b/runtime/doc/usr_30.txt index 98d1780cc4..7e7b3b21f4 100644 --- a/runtime/doc/usr_30.txt +++ b/runtime/doc/usr_30.txt @@ -56,7 +56,7 @@ From this you can see that you have errors in the file "main.c". When you press <Enter>, Vim displays the file "main.c", with the cursor positioned on line 6, the first line with an error. You did not need to specify the file or the line number, Vim knew where to go by looking in the error messages. - +> +---------------------------------------------------+ |int main() | |{ | @@ -69,7 +69,7 @@ the line number, Vim knew where to go by looking in the error messages. | ~ | |(3 of 12): too many arguments to function 'do_sub' | +---------------------------------------------------+ - +< The following command goes to where the next error occurs: > :cnext diff --git a/runtime/doc/usr_32.txt b/runtime/doc/usr_32.txt index 8b489ea1e0..324efccf25 100644 --- a/runtime/doc/usr_32.txt +++ b/runtime/doc/usr_32.txt @@ -169,10 +169,10 @@ To travel forward in time again use the |:later| command: > The arguments are "s", "m" and "h", just like with |:earlier|. If you want even more details, or want to manipulate the information, you can -use the |undotree()| function. To see what it returns: > - +use the |undotree()| function. To see what it returns: +> :echo undotree() - +< ============================================================================== Next chapter: |usr_40.txt| Make new commands diff --git a/runtime/doc/usr_40.txt b/runtime/doc/usr_40.txt index f47c933124..8befb15528 100644 --- a/runtime/doc/usr_40.txt +++ b/runtime/doc/usr_40.txt @@ -226,7 +226,7 @@ When using a space inside a mapping, use <Space> (seven characters): > This makes the spacebar move a blank-separated word forward. It is not possible to put a comment directly after a mapping, because the " -character is considered to be part of the mapping. You can use |", this +character is considered to be part of the mapping. You can use `|"`, this starts a new, empty command with a comment. Example: > :map <Space> W| " Use spacebar to move forward a word @@ -657,10 +657,10 @@ To ignore all events, use the following command: > :set eventignore=all -To set it back to the normal behavior, make 'eventignore' empty: > - +To set it back to the normal behavior, make 'eventignore' empty: +> :set eventignore= - +< ============================================================================== Next chapter: |usr_41.txt| Write a Vim script diff --git a/runtime/doc/usr_42.txt b/runtime/doc/usr_42.txt index 470f4e0fe5..9c5e3db72c 100644 --- a/runtime/doc/usr_42.txt +++ b/runtime/doc/usr_42.txt @@ -81,7 +81,7 @@ the far right. The second number (340) determines the location of the item within the pull-down menu. Lower numbers go on top, higher number on the bottom. These are the priorities in the File menu: - +> +-----------------+ 10.310 |Open... | 10.320 |Split-Open... | @@ -99,7 +99,7 @@ are the priorities in the File menu: 10.610 |Save-Exit | 10.620 |Exit | +-----------------+ - +< Notice that there is room in between the numbers. This is where you can insert your own items, if you really want to (it's often better to leave the standard menus alone and add a new menu for your own items). @@ -168,11 +168,11 @@ inserts a CTRL-C or CTRL-O for you. For example, if you use this command: Then the resulting menu commands will be: - Normal mode: * - Visual mode: CTRL-C * - Operator-pending mode: CTRL-C * - Insert mode: CTRL-O * - Command-line mode: CTRL-C * + Normal mode: `*` + Visual mode: CTRL-C `*` + Operator-pending mode: CTRL-C `*` + Insert mode: CTRL-O `*` + Command-line mode: CTRL-C `*` When in Command-line mode the CTRL-C will abandon the command typed so far. In Visual and Operator-pending mode CTRL-C will stop the mode. The CTRL-O in diff --git a/runtime/doc/usr_toc.txt b/runtime/doc/usr_toc.txt index c61bb55c26..dd0d5784f5 100644 --- a/runtime/doc/usr_toc.txt +++ b/runtime/doc/usr_toc.txt @@ -111,8 +111,7 @@ Read this from start to end to learn the essential commands. |06.2| No or wrong colors? |06.3| Different colors |06.4| With colors or without colors - |06.5| Printing with colors - |06.6| Further reading + |06.5| Further reading |usr_07.txt| Editing more than one file |07.1| Edit another file diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index cd178cfbbb..e13d892fd6 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -102,9 +102,7 @@ g8 Print the hex values of the bytes used in the *:p* *:pr* *:print* *E749* :[range]p[rint] [flags] Print [range] lines (default current line). - Note: If you are looking for a way to print your text - on paper see |:hardcopy|. In the GUI you can use the - File.Print menu entry. + In the GUI you can use the File.Print menu entry. See |ex-flags| for [flags]. The |:filter| command can be used to only show lines matching a pattern. diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index cef2859eb5..afabddb7f9 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -337,10 +337,6 @@ Viminfo. The 'viminfo' option can be set to select which items to store in the .viminfo file. This is off by default. -Printing. |printing| - The |:hardcopy| command sends text to the printer. This can include - syntax highlighting. - Mouse support. |mouse-using| The mouse is supported in the GUI version, in an xterm for Unix, for BSDs with sysmouse, for Linux with gpm, and for Win32. It can be used diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 46d620e461..bb3b670b24 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -549,6 +549,7 @@ Aliases: Commands: :fixdel + :hardcopy :helpfind :mode (no longer accepts an argument) :open @@ -655,6 +656,12 @@ Options: Use |g8| or |ga|. See |mbyte-combining|. *'maxmem'* Nvim delegates memory-management to the OS. *'maxmemtot'* Nvim delegates memory-management to the OS. + *'printdevice'* + *'printencoding'* + *'printexpr'* + *'printfont'* + *'printheader'* + *'printmbcharset'* *'prompt'* *'noprompt'* *'remap'* *'noremap'* *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'* @@ -732,5 +739,10 @@ Cscope: *cscope* Cscope support has been removed in favour of LSP based solutions. +Hardcopy: + *hardcopy* + `:hardcopy` was removed. Instead, use `:TOhtml` and print the resulting HTML + using a web browser or some other HTML viewer. + ============================================================================== vim:tw=78:ts=8:sw=2:et:ft=help:norl: diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index e7c58b00a0..61f5013f47 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -284,8 +284,8 @@ Opens a vertically split, full-height window on the "tags" file at the far left of the Vim window. +------------------------------------------------------------------------------ Closing a window ----------------- :q[uit] :{count}q[uit] *:count_quit* @@ -693,8 +693,8 @@ Note: ":next" is an exception, because it must accept a list of file names for compatibility with Vi. +------------------------------------------------------------------------------ The argument list and multiple windows --------------------------------------- The current position in the argument list can be different for each window. Remember that when doing ":e file", the position in the argument list stays diff --git a/runtime/indent/nginx.vim b/runtime/indent/nginx.vim index 8cef7662e0..65506099f4 100644 --- a/runtime/indent/nginx.vim +++ b/runtime/indent/nginx.vim @@ -1,19 +1,78 @@ " Vim indent file " Language: nginx.conf " Maintainer: Chris Aumann <me@chr4.org> -" Last Change: 2022 Apr 06 +" Last Change: 2022 Dec 01 -if exists("b:did_indent") - finish +" Only load this indent file when no other was loaded. +if exists('b:did_indent') + finish endif let b:did_indent = 1 -setlocal indentexpr= +setlocal indentexpr=GetNginxIndent() -" cindent actually works for nginx' simple file structure -setlocal cindent +setlocal indentkeys=0{,0},0#,!^F,o,O -" Just make sure that the comments are not reset as defs would be. -setlocal cinkeys-=0# +let b:undo_indent = 'setl inde< indk<' -let b:undo_indent = "setl inde< cin< cink<" +" Only define the function once. +if exists('*GetNginxIndent') + finish +endif + +function GetNginxIndent() abort + let plnum = s:PrevNotAsBlank(v:lnum - 1) + + " Hit the start of the file, use zero indent. + if plnum == 0 + return 0 + endif + + let ind = indent(plnum) + + " Add a 'shiftwidth' after '{' + if s:AsEndWith(getline(plnum), '{') + let ind = ind + shiftwidth() + end + + " Subtract a 'shiftwidth' on '}' + " This is the part that requires 'indentkeys'. + if getline(v:lnum) =~ '^\s*}' + let ind = ind - shiftwidth() + endif + + let pplnum = s:PrevNotAsBlank(plnum - 1) + + if s:IsLineContinuation(plnum) + if !s:IsLineContinuation(pplnum) + let ind = ind + shiftwidth() + end + else + if s:IsLineContinuation(pplnum) + let ind = ind - shiftwidth() + end + endif + + return ind +endfunction + +" Find the first line at or above {lnum} that is non-blank and not a comment. +function s:PrevNotAsBlank(lnum) abort + let lnum = prevnonblank(a:lnum) + while lnum > 0 + if getline(lnum) !~ '^\s*#' + break + endif + let lnum = prevnonblank(lnum - 1) + endwhile + return lnum +endfunction + +" Check whether {line} ends with {pat}, ignoring trailing comments. +function s:AsEndWith(line, pat) abort + return a:line =~ a:pat . '\m\s*\%(#.*\)\?$' +endfunction + +function s:IsLineContinuation(lnum) abort + return a:lnum > 0 && !s:AsEndWith(getline(a:lnum), '[;{}]') +endfunction diff --git a/runtime/indent/testdir/vb.in b/runtime/indent/testdir/vb.in new file mode 100644 index 0000000000..1653ae6f80 --- /dev/null +++ b/runtime/indent/testdir/vb.in @@ -0,0 +1,134 @@ +' vim: filetype=vb shiftwidth=4 expandtab +' +' START_INDENT +Public Type GEmployeeRecord ' Create user-defined type. +ID As Integer ' Define elements of data type. +Name As String * 20 +Address As String * 30 +Phone As Long +HireDate As Date +End Type + +Public Enum InterfaceColors +icMistyRose = &HE1E4FF& +icSlateGray = &H908070& +icDodgerBlue = &HFF901E& +icDeepSkyBlue = &HFFBF00& +icSpringGreen = &H7FFF00& +icForestGreen = &H228B22& +icGoldenrod = &H20A5DA& +icFirebrick = &H2222B2& +End Enum + +Enum SecurityLevel +IllegalEntry = -1 +SecurityLevel1 = 0 +SecurityLevel2 = 1 +End Enum + +Public Function TestConditional (number As Integer, ext As String) As Boolean +Dim inRange As Boolean + +Select Case number +Case <= 0 +inRange = False +Case > 10 +inRange = False +Case Else +inRange = True +End Select + +' This is a special case identified in the indent script. +Select Case number +End Select + +If ext = ".xlm" Then +If inRange Then +TestConditional = True +Else +TestConditional = False +End If +ElseIf ext = ".xlsx" Then +If inRange Then +TestConditional = False +Else +TestConditional = True +End If +Else +TestConditional = False +End If +End Function + +Private Sub TestIterators (lLimit As Integer, uLimit As Integer) +Dim a() As Variant +Dim elmt As Variant +Dim found As Boolean +Dim indx As Integer +Const specialValue As Integer = 5 + +If uLimit < lLimit Then +Exit Sub +End If + +ReDim a(lLimit To uLimit) +For indx=lLimit To Ulimit +a(indx) = 2 * indx +Next indx + +found = False +For Each elmt in a +If elmt = specialValue Then +found = True +End If +Next elmt + +If found then +indx = uLimit +Do While indx >= lLimit +indx = indx - 1 +Loop +End If + +End Sub + +Public Sub TestMultiline (cellAddr As String, rowNbr As Long) +Dim rng As Range + +Set rng = Range(cellAddr) +With rng +.Cells(1,1).Value = _ +"Line 1 of multiline string; " & _ +"Line 2 of multiline string; " & _ +"Line 3 of multiline string" +End With + +' The following lines have whitespace after the underscore character +' and therefore do not form a valid multiline statement. The indent +' script correctly treats them as four single line statements contrary +' to the author's obvious indent. +rng..Cells(1,1).Value = _ +"Line 1 of multiline string; " & _ +"Line 2 of multiline string; " & _ +"Line 3 of multiline string" + +End Sub + +Private Sub TestStmtLabel() +GoTo stmtLabel + +' Statement labels are never indented +stmtLabel: + +End Sub + +Sub TestTypeKeyword() +Type EmployeeRecord ' Create user-defined type. +ID As Integer ' Define elements of data type. +Name As String * 20 +Address As String * 30 +Phone As Long +HireDate As Date +End Type +Dim varType As EmployeeRecord +End Sub +' END_INDENT diff --git a/runtime/indent/testdir/vb.ok b/runtime/indent/testdir/vb.ok new file mode 100644 index 0000000000..143c688708 --- /dev/null +++ b/runtime/indent/testdir/vb.ok @@ -0,0 +1,134 @@ +' vim: filetype=vb shiftwidth=4 expandtab +' +' START_INDENT +Public Type GEmployeeRecord ' Create user-defined type. + ID As Integer ' Define elements of data type. + Name As String * 20 + Address As String * 30 + Phone As Long + HireDate As Date +End Type + +Public Enum InterfaceColors + icMistyRose = &HE1E4FF& + icSlateGray = &H908070& + icDodgerBlue = &HFF901E& + icDeepSkyBlue = &HFFBF00& + icSpringGreen = &H7FFF00& + icForestGreen = &H228B22& + icGoldenrod = &H20A5DA& + icFirebrick = &H2222B2& +End Enum + +Enum SecurityLevel + IllegalEntry = -1 + SecurityLevel1 = 0 + SecurityLevel2 = 1 +End Enum + +Public Function TestConditional (number As Integer, ext As String) As Boolean + Dim inRange As Boolean + + Select Case number + Case <= 0 + inRange = False + Case > 10 + inRange = False + Case Else + inRange = True + End Select + + ' This is a special case identified in the indent script. + Select Case number + End Select + + If ext = ".xlm" Then + If inRange Then + TestConditional = True + Else + TestConditional = False + End If + ElseIf ext = ".xlsx" Then + If inRange Then + TestConditional = False + Else + TestConditional = True + End If + Else + TestConditional = False + End If +End Function + +Private Sub TestIterators (lLimit As Integer, uLimit As Integer) + Dim a() As Variant + Dim elmt As Variant + Dim found As Boolean + Dim indx As Integer + Const specialValue As Integer = 5 + + If uLimit < lLimit Then + Exit Sub + End If + + ReDim a(lLimit To uLimit) + For indx=lLimit To Ulimit + a(indx) = 2 * indx + Next indx + + found = False + For Each elmt in a + If elmt = specialValue Then + found = True + End If + Next elmt + + If found then + indx = uLimit + Do While indx >= lLimit + indx = indx - 1 + Loop + End If + +End Sub + +Public Sub TestMultiline (cellAddr As String, rowNbr As Long) + Dim rng As Range + + Set rng = Range(cellAddr) + With rng + .Cells(1,1).Value = _ + "Line 1 of multiline string; " & _ + "Line 2 of multiline string; " & _ + "Line 3 of multiline string" + End With + + ' The following lines have whitespace after the underscore character + ' and therefore do not form a valid multiline statement. The indent + ' script correctly treats them as four single line statements contrary + ' to the author's obvious indent. + rng..Cells(1,1).Value = _ + "Line 1 of multiline string; " & _ + "Line 2 of multiline string; " & _ + "Line 3 of multiline string" + +End Sub + +Private Sub TestStmtLabel() + GoTo stmtLabel + + ' Statement labels are never indented +stmtLabel: + +End Sub + +Sub TestTypeKeyword() + Type EmployeeRecord ' Create user-defined type. + ID As Integer ' Define elements of data type. + Name As String * 20 + Address As String * 30 + Phone As Long + HireDate As Date + End Type + Dim varType As EmployeeRecord +End Sub +' END_INDENT diff --git a/runtime/indent/vb.vim b/runtime/indent/vb.vim index 4d05345565..bc7142f428 100644 --- a/runtime/indent/vb.vim +++ b/runtime/indent/vb.vim @@ -1,8 +1,12 @@ " Vim indent file " Language: VisualBasic (ft=vb) / Basic (ft=basic) / SaxBasic (ft=vb) " Author: Johannes Zellner <johannes@zellner.org> +" Maintainer: Michael Soyka (mssr953@gmail.com) " Last Change: Fri, 18 Jun 2004 07:22:42 CEST " Small update 2010 Jul 28 by Maxim Kim +" 2022/12/15: add support for multiline statements. +" 2022/12/21: move VbGetIndent from global to script-local scope +" 2022/12/26: recognize "Type" keyword if exists("b:did_indent") finish @@ -10,28 +14,33 @@ endif let b:did_indent = 1 setlocal autoindent -setlocal indentexpr=VbGetIndent(v:lnum) +setlocal indentexpr=s:VbGetIndent(v:lnum) setlocal indentkeys& -setlocal indentkeys+==~else,=~elseif,=~end,=~wend,=~case,=~next,=~select,=~loop,<:> +setlocal indentkeys+==~else,=~elseif,=~end,=~wend,=~case,=~next,=~select,=~loop let b:undo_indent = "set ai< indentexpr< indentkeys<" " Only define the function once. -if exists("*VbGetIndent") +if exists("*s:VbGetIndent") finish endif -fun! VbGetIndent(lnum) +function s:VbGetIndent(lnum) + let this_lnum = a:lnum + let this_line = getline(this_lnum) + " labels and preprocessor get zero indent immediately - let this_line = getline(a:lnum) let LABELS_OR_PREPROC = '^\s*\(\<\k\+\>:\s*$\|#.*\)' if this_line =~? LABELS_OR_PREPROC return 0 endif + + " Get the current value of "shiftwidth" + let bShiftwidth = shiftwidth() " Find a non-blank line above the current line. " Skip over labels and preprocessor directives. - let lnum = a:lnum + let lnum = this_lnum while lnum > 0 let lnum = prevnonblank(lnum - 1) let previous_line = getline(lnum) @@ -45,34 +54,102 @@ fun! VbGetIndent(lnum) return 0 endif - let ind = indent(lnum) + " Variable "previous_line" now contains the text in buffer line "lnum". + + " Multi-line statements have the underscore character at end-of-line: + " + " object.method(arguments, _ + " arguments, _ + " arguments) + " + " and require extra logic to determine the correct indentation. + " + " Case 1: Line "lnum" is the first line of a multiline statement. + " Line "lnum" will have a trailing underscore character + " but the preceding non-blank line does not. + " Line "this_lnum" will be indented relative to "lnum". + " + " Case 2: Line "lnum" is the last line of a multiline statement. + " Line "lnum" will not have a trailing underscore character + " but the preceding non-blank line will. + " Line "this_lnum" will have the same indentation as the starting + " line of the multiline statement. + " + " Case 3: Line "lnum" is neither the first nor last line. + " Lines "lnum" and "lnum-1" will have a trailing underscore + " character. + " Line "this_lnum" will have the same indentation as the preceding + " line. + " + " No matter which case it is, the starting line of the statement must be + " found. It will be assumed that multiline statements cannot have + " intermingled comments, statement labels, preprocessor directives or + " blank lines. + " + let lnum_is_continued = (previous_line =~ '_$') + if lnum > 1 + let before_lnum = prevnonblank(lnum-1) + let before_previous_line = getline(before_lnum) + else + let before_lnum = 0 + let before_previous_line = "" + endif + + if before_previous_line !~ '_$' + " Variable "previous_line" contains the start of a statement. + " + let ind = indent(lnum) + if lnum_is_continued + let ind += bShiftwidth + endif + elseif ! lnum_is_continued + " Line "lnum" contains the last line of a multiline statement. + " Need to find where this multiline statement begins + " + while before_lnum > 0 + let before_lnum -= 1 + if getline(before_lnum) !~ '_$' + let before_lnum += 1 + break + endif + endwhile + if before_lnum == 0 + let before_lnum = 1 + endif + let previous_line = getline(before_lnum) + let ind = indent(before_lnum) + else + " Line "lnum" is not the first or last line of a multiline statement. + " + let ind = indent(lnum) + endif " Add - if previous_line =~? '^\s*\<\(begin\|\%(\%(private\|public\|friend\)\s\+\)\=\%(function\|sub\|property\)\|select\|case\|default\|if\|else\|elseif\|do\|for\|while\|enum\|with\)\>' - let ind = ind + shiftwidth() + if previous_line =~? '^\s*\<\(begin\|\%(\%(private\|public\|friend\)\s\+\)\=\%(function\|sub\|property\|enum\|type\)\|select\|case\|default\|if\|else\|elseif\|do\|for\|while\|with\)\>' + let ind = ind + bShiftwidth endif " Subtract if this_line =~? '^\s*\<end\>\s\+\<select\>' if previous_line !~? '^\s*\<select\>' - let ind = ind - 2 * shiftwidth() + let ind = ind - 2 * bShiftwidth else " this case is for an empty 'select' -- 'end select' " (w/o any case statements) like: " " select case readwrite " end select - let ind = ind - shiftwidth() + let ind = ind - bShiftwidth endif elseif this_line =~? '^\s*\<\(end\|else\|elseif\|until\|loop\|next\|wend\)\>' - let ind = ind - shiftwidth() + let ind = ind - bShiftwidth elseif this_line =~? '^\s*\<\(case\|default\)\>' if previous_line !~? '^\s*\<select\>' - let ind = ind - shiftwidth() + let ind = ind - bShiftwidth endif endif return ind -endfun +endfunction " vim:sw=4 diff --git a/runtime/indent/vue.vim b/runtime/indent/vue.vim index 7ff623b3d1..f6fe350a8f 100644 --- a/runtime/indent/vue.vim +++ b/runtime/indent/vue.vim @@ -1,12 +1,14 @@ " Vim indent file placeholder " Language: Vue " Maintainer: None, please volunteer if you have a real Vue indent script +" Last Change: 2022 Dec 24 " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif -let b:did_indent = 1 +" don't set b:did_indent, otherwise html indenting won't be activated +" let b:did_indent = 1 " Html comes closest runtime! indent/html.vim diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index 2913a0ddc6..da8764fbd4 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -391,7 +391,7 @@ end ---@param pos2 integer[] (line, column) tuple marking end of region ---@param regtype string type of selection, see |setreg()| ---@param inclusive boolean indicating whether the selection is end-inclusive ----@return table<integer, {}> region lua table of the form {linenr = {startcol,endcol}} +---@return table region Table of the form `{linenr = {startcol,endcol}}` function vim.region(bufnr, pos1, pos2, regtype, inclusive) if not vim.api.nvim_buf_is_loaded(bufnr) then vim.fn.bufload(bufnr) diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 84a8701ac7..f41f4a9c68 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -429,32 +429,31 @@ local function get_diagnostics(bufnr, opts, clamp) end end + ---@private + local function add_all_diags(buf, diags) + for _, diagnostic in pairs(diags) do + add(buf, diagnostic) + end + end + if namespace == nil and bufnr == nil then for b, t in pairs(diagnostic_cache) do for _, v in pairs(t) do - for _, diagnostic in pairs(v) do - add(b, diagnostic) - end + add_all_diags(b, v) end end elseif namespace == nil then bufnr = get_bufnr(bufnr) for iter_namespace in pairs(diagnostic_cache[bufnr]) do - for _, diagnostic in pairs(diagnostic_cache[bufnr][iter_namespace]) do - add(bufnr, diagnostic) - end + add_all_diags(bufnr, diagnostic_cache[bufnr][iter_namespace]) end elseif bufnr == nil then for b, t in pairs(diagnostic_cache) do - for _, diagnostic in pairs(t[namespace] or {}) do - add(b, diagnostic) - end + add_all_diags(b, t[namespace] or {}) end else bufnr = get_bufnr(bufnr) - for _, diagnostic in pairs(diagnostic_cache[bufnr][namespace] or {}) do - add(bufnr, diagnostic) - end + add_all_diags(bufnr, diagnostic_cache[bufnr][namespace] or {}) end if opts.severity then @@ -484,7 +483,7 @@ local function set_list(loclist, opts) vim.fn.setqflist({}, ' ', { title = title, items = items }) end if open then - api.nvim_command(loclist and 'lopen' or 'botright copen') + api.nvim_command(loclist and 'lwindow' or 'botright cwindow') end end diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua index ee538dc8c7..edffdde9c7 100644 --- a/runtime/lua/vim/filetype/detect.lua +++ b/runtime/lua/vim/filetype/detect.lua @@ -1256,17 +1256,15 @@ end -- 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. function M.tex(path, bufnr) - local format = getlines(bufnr, 1):find('^%%&%s*(%a+)') - if format then + local matched, _, format = getlines(bufnr, 1):find('^%%&%s*(%a+)') + if matched then format = format:lower():gsub('pdf', '', 1) - if format == 'tex' then - return 'tex' - elseif format == 'plaintex' then - return 'plaintex' - end elseif path:lower():find('tex/context/.*/.*%.tex') then return 'context' else + -- Default value, may be changed later: + format = vim.g.tex_flavor or 'plaintex' + local lpat = [[documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>]] local 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\>]] @@ -1275,26 +1273,25 @@ function M.tex(path, bufnr) -- Find first non-comment line if not l:find('^%s*%%%S') then -- Check the next thousand lines for a LaTeX or ConTeXt keyword. - for _, line in ipairs(getlines(bufnr, i + 1, i + 1000)) do - local lpat_match, cpat_match = - matchregex(line, [[\c^\s*\\\%(]] .. lpat .. [[\)\|^\s*\\\(]] .. cpat .. [[\)]]) - if lpat_match then + for _, line in ipairs(getlines(bufnr, i, i + 1000)) do + if matchregex(line, [[\c^\s*\\\%(]] .. lpat .. [[\)]]) then return 'tex' - elseif cpat_match then + elseif matchregex(line, [[\c^\s*\\\%(]] .. cpat .. [[\)]]) then return 'context' end end end end - -- TODO: add AMSTeX, RevTex, others? - if not vim.g.tex_flavor or vim.g.tex_flavor == 'plain' then - return 'plaintex' - elseif vim.g.tex_flavor == 'context' then - return 'context' - else - -- Probably LaTeX - return 'tex' - end + end -- if matched + + -- Translation from formats to file types. TODO: add AMSTeX, RevTex, others? + if format == 'plain' then + return 'plaintex' + elseif format == 'plaintex' or format == 'context' then + return format + else + -- Probably LaTeX + return 'tex' end end diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index dc5008399e..1d99283dd9 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -1822,7 +1822,7 @@ end ---@class vim.lsp.get_active_clients.filter ---@field id number|nil Match clients by id ---@field bufnr number|nil match clients attached to the given buffer ----@field name number|nil match clients by name +---@field name string|nil match clients by name --- Get active clients. --- @@ -1845,7 +1845,8 @@ function lsp.get_active_clients(filter) for client_id in pairs(t) do local client = active_clients[client_id] if - (filter.id == nil or client.id == filter.id) + client + and (filter.id == nil or client.id == filter.id) and (filter.name == nil or client.name == filter.name) then clients[#clients + 1] = client diff --git a/runtime/lua/vim/lsp/codelens.lua b/runtime/lua/vim/lsp/codelens.lua index 71b6bfae30..17489ed84d 100644 --- a/runtime/lua/vim/lsp/codelens.lua +++ b/runtime/lua/vim/lsp/codelens.lua @@ -108,13 +108,36 @@ function M.run() end end +---@private +local function resolve_bufnr(bufnr) + return bufnr == 0 and api.nvim_get_current_buf() or bufnr +end + +--- Clear the lenses +--- +---@param client_id number|nil filter by client_id. All clients if nil +---@param bufnr number|nil filter by buffer. All buffers if nil +function M.clear(client_id, bufnr) + local buffers = bufnr and { resolve_bufnr(bufnr) } or vim.tbl_keys(lens_cache_by_buf) + for _, iter_bufnr in pairs(buffers) do + local client_ids = client_id and { client_id } or vim.tbl_keys(namespaces) + for _, iter_client_id in pairs(client_ids) do + local ns = namespaces[iter_client_id] + lens_cache_by_buf[iter_bufnr][iter_client_id] = {} + api.nvim_buf_clear_namespace(iter_bufnr, ns, 0, -1) + end + end +end + --- Display the lenses using virtual text --- ---@param lenses table of lenses to display (`CodeLens[] | null`) ---@param bufnr number ---@param client_id number function M.display(lenses, bufnr, client_id) + local ns = namespaces[client_id] if not lenses or not next(lenses) then + api.nvim_buf_clear_namespace(bufnr, ns, 0, -1) return end local lenses_by_lnum = {} @@ -126,7 +149,6 @@ function M.display(lenses, bufnr, client_id) end table.insert(line_lenses, lens) end - local ns = namespaces[client_id] local num_lines = api.nvim_buf_line_count(bufnr) for i = 0, num_lines do local line_lenses = lenses_by_lnum[i] or {} diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua index 48190b03e1..849a8a1b67 100644 --- a/runtime/lua/vim/lsp/semantic_tokens.lua +++ b/runtime/lua/vim/lsp/semantic_tokens.lua @@ -408,6 +408,8 @@ function STHighlighter:on_win(topline, botline) hl_group = '@' .. token.type, end_col = token.end_col, priority = vim.highlight.priorities.semantic_tokens, + right_gravity = false, + end_right_gravity = true, strict = false, }) @@ -417,7 +419,9 @@ function STHighlighter:on_win(topline, botline) api.nvim_buf_set_extmark(self.bufnr, state.namespace, token.line, token.start_col, { hl_group = '@' .. modifier, end_col = token.end_col, - priority = vim.highlight.priorities.semantic_tokens, + priority = vim.highlight.priorities.semantic_tokens + 1, + right_gravity = false, + end_right_gravity = true, strict = false, }) end diff --git a/runtime/lua/vim/shared.lua b/runtime/lua/vim/shared.lua index 5ffd11682c..6fc40bb905 100644 --- a/runtime/lua/vim/shared.lua +++ b/runtime/lua/vim/shared.lua @@ -113,7 +113,7 @@ end --- ---@param s string String to split ---@param sep string Separator or pattern ----@param kwargs ({plain: boolean, trimempty: boolean}|nil) Keyword arguments: +---@param kwargs (table|nil) Keyword arguments: --- - plain: (boolean) If `true` use `sep` literally (passed to string.find) --- - trimempty: (boolean) If `true` remove empty items from the front --- and back of the list diff --git a/runtime/menu.vim b/runtime/menu.vim index 87155248f1..2671bb51cb 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -139,12 +139,7 @@ if has("diff") an 10.420 &File.Split\ Patched\ &By\.\.\. :browse vert diffpatch<CR> endif -if has("printer") - an 10.500 &File.-SEP3- <Nop> - an 10.510 &File.&Print :hardcopy<CR> - vunmenu &File.&Print - vnoremenu &File.&Print :hardcopy<CR> -elseif has("unix") +if has("unix") an 10.500 &File.-SEP3- <Nop> an 10.510 &File.&Print :w !lpr<CR> vunmenu &File.&Print @@ -1069,11 +1064,7 @@ if has("toolbar") an <silent> 1.20 ToolBar.Save :if expand("%") == ""<Bar>browse confirm w<Bar>else<Bar>confirm w<Bar>endif<CR> an 1.30 ToolBar.SaveAll :browse confirm wa<CR> - if has("printer") - an 1.40 ToolBar.Print :hardcopy<CR> - vunmenu ToolBar.Print - vnoremenu ToolBar.Print :hardcopy<CR> - elseif has("unix") + if has("unix") an 1.40 ToolBar.Print :w !lpr<CR> vunmenu ToolBar.Print vnoremenu ToolBar.Print :w !lpr<CR> diff --git a/runtime/nvim.appdata.xml b/runtime/nvim.appdata.xml index e8d392ec7d..7411a7190a 100644 --- a/runtime/nvim.appdata.xml +++ b/runtime/nvim.appdata.xml @@ -26,6 +26,8 @@ </screenshots> <releases> + <release date="2022-12-29" version="0.8.2"/> + <release date="2022-11-14" version="0.8.1"/> <release date="2022-09-30" version="0.8.0"/> <release date="2022-04-15" version="0.7.0"/> <release date="2021-12-31" version="0.6.1"/> diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 23562c6830..b29b60e145 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: 2022 Nov 23 +" Last Change: 2022 Dec 16 " If there already is an option window, jump to that one. let buf = bufnr('option-window') @@ -627,39 +627,17 @@ if has("gui") endif endif -if has("printer") - call <SID>Header(gettext("printing")) - call <SID>AddOption("printoptions", gettext("list of items that control the format of :hardcopy output")) - call <SID>OptionG("popt", &popt) - call <SID>AddOption("printdevice", gettext("name of the printer to be used for :hardcopy")) - call <SID>OptionG("pdev", &pdev) - if has("postscript") - call <SID>AddOption("printexpr", gettext("expression used to print the PostScript file for :hardcopy")) - call <SID>OptionG("pexpr", &pexpr) - endif - call <SID>AddOption("printfont", gettext("name of the font to be used for :hardcopy")) - call <SID>OptionG("pfn", &pfn) - call <SID>AddOption("printheader", gettext("format of the header used for :hardcopy")) - call <SID>OptionG("pheader", &pheader) - if has("postscript") - call <SID>AddOption("printencoding", gettext("encoding used to print the PostScript file for :hardcopy")) - call <SID>OptionG("penc", &penc) - endif - call <SID>AddOption("printmbcharset", gettext("the CJK character set to be used for CJK output from :hardcopy")) - call <SID>OptionG("pmbcs", &pmbcs) - call <SID>AddOption("printmbfont", gettext("list of font names to be used for CJK output from :hardcopy")) - call <SID>OptionG("pmbfn", &pmbfn) -endif - call <SID>Header(gettext("messages and info")) call <SID>AddOption("terse", gettext("add 's' flag in 'shortmess' (don't show search message)")) call <SID>BinOptionG("terse", &terse) call <SID>AddOption("shortmess", gettext("list of flags to make messages shorter")) call <SID>OptionG("shm", &shm) -call <SID>AddOption("showcmd", gettext("show (partial) command keys in the status line")) +call <SID>AddOption("showcmd", gettext("show (partial) command keys in location given by 'showcmdloc'")) let &sc = s:old_sc call <SID>BinOptionG("sc", &sc) set nosc +call <SID>AddOption("showcmdloc", gettext("location where to show the (partial) command keys for 'showcmd'")) + call <SID>OptionG("sloc", &sloc) call <SID>AddOption("showmode", gettext("display the current mode in the status line")) call <SID>BinOptionG("smd", &smd) call <SID>AddOption("ruler", gettext("show cursor position below each window")) diff --git a/runtime/print/ascii.ps b/runtime/print/ascii.ps deleted file mode 100644 index 5fcffb655f..0000000000 --- a/runtime/print/ascii.ps +++ /dev/null @@ -1,22 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-ascii -%%Version: 1.0 0 -%%EndComments -/VIM-ascii[ -32{/.notdef}repeat -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -128{/.notdef}repeat] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/cidfont.ps b/runtime/print/cidfont.ps deleted file mode 100644 index a06ebc8c4c..0000000000 --- a/runtime/print/cidfont.ps +++ /dev/null @@ -1,26 +0,0 @@ -%!PS-Adobe-3.0 Resource-ProcSet -%%Title: VIM-CIDFont -%%Version: 1.0 0 -%%EndComments -% Editing of this file is NOT RECOMMENDED. You run a very good risk of causing -% all PostScript printing from VIM failing if you do. PostScript is not called -% a write-only language for nothing! -/CP currentpacking d T setpacking -/SB 256 string d -/CIDN? systemdict/composefont known d /GS? systemdict/.makeoperator known d -CIDN?{ -GS?{/vim_findresource{2 copy resourcestatus not{1 index SB cvs runlibfile}{ -pop pop}ifelse findresource}bd/vim_composefont{0 get/CIDFont vim_findresource -exch/CMap vim_findresource exch[exch]composefont pop}bd}{/vim_findresource -/findresource ld/vim_composefont{composefont pop}bd}ifelse -}{ -/vim_fontname{0 get SB cvs length dup SB exch(-)putinterval 1 add dup SB exch -dup 256 exch sub getinterval 3 -1 roll exch cvs length add SB exch 0 exch -getinterval cvn}bd/vim_composefont{vim_fontname findfont d}bd -} ifelse -/cfs{exch scalefont d}bd -/sffs{findfont 3 1 roll 1 index mul exch 2 index/FontMatrix get matrix copy -scale makefont d}bd -CP setpacking -% vim:ff=unix: -%%EOF diff --git a/runtime/print/cns_roman.ps b/runtime/print/cns_roman.ps deleted file mode 100644 index dba385cae0..0000000000 --- a/runtime/print/cns_roman.ps +++ /dev/null @@ -1,23 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-cns_roman -%%Version: 1.0 0 -%%EndComments -% Different to ASCII at code point 126 -/VIM-cns_roman[ -32{/.notdef}repeat -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /overline /.notdef -128{/.notdef}repeat] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/cp1250.ps b/runtime/print/cp1250.ps deleted file mode 100644 index 9e733cc760..0000000000 --- a/runtime/print/cp1250.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-cp1250 -%%Version: 1.0 0 -%%EndComments -/VIM-cp1250[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /tilde /.notdef -/Euro /.notdef /quotesinglbase /.notdef /quotedblbase /ellipsis /dagger /daggerdbl -/.notdef /perthousand /Scaron /guilsinglleft /Sacute /Tcaron /Zcaron /Zacute -/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash -/.notdef /trademark /scaron /guilsinglright /sacute /tcaron /zcaron /zacute -/space /caron /breve /Lslash /currency /Aogonek /brokenbar /section -/dieresis /copyright /Scedilla /guillemotleft /logicalnot /hyphen /registered /Zdotaccent -/degree /plusminus /ogonek /lslash /acute /mu /paragraph /periodcentered -/cedilla /aogonek /scedilla /guillemotright /Lcaron /hungarumlaut /lcaron /zdotaccent -/Racute /Aacute /Acircumflex /Abreve /Adieresis /Lacute /Cacute /Ccedilla -/Ccaron /Eacute /Eogonek /Edieresis /Ecaron /Iacute /Icircumflex /Dcaron -/Dcroat /Nacute /Ncaron /Oacute /Ocircumflex /Ohungarumlaut /Odieresis /multiply -/Rcaron /Uring /Uacute /Uhungarumlaut /Udieresis /Yacute /Tcedilla /germandbls -/racute /aacute /acircumflex /abreve /adieresis /lacute /cacute /ccedilla -/ccaron /eacute /eogonek /edieresis /ecaron /iacute /icircumflex /dcaron -/dcroat /nacute /ncaron /oacute /ocircumflex /ohungarumlaut /odieresis /divide -/rcaron /uring /uacute /uhungarumlaut /udieresis /yacute /tcedilla /dotaccent] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/cp1251.ps b/runtime/print/cp1251.ps deleted file mode 100644 index 7137504e7a..0000000000 --- a/runtime/print/cp1251.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-cp1251 -%%Version: 1.0 0 -%%EndComments -/VIM-cp1251[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/afii10051 /afii10052 /quotesinglbase /afii10100 /quotedblbase /ellipsis /dagger /daggerdbl -/Euro /perthousand /afii10058 /guilsinglleft /afii10059 /afii10061 /afii10060 /afii10145 -/afii10099 /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash -/.notdef /trademark /afii10106 /guilsinglright /afii10107 /afii10109 /afii10108 /afii10193 -/space /afii10062 /afii10110 /afii10057 /currency /afii10050 /brokenbar /section -/afii10023 /copyright /afii10053 /guillemotleft /logicalnot /hyphen /registered /afii10056 -/degree /plusminus /afii10055 /afii10103 /afii10098 /mu /paragraph /periodcentered -/afii10071 /afii61352 /afii10101 /guillemotright /afii10105 /afii10054 /afii10102 /afii10104 -/afii10017 /afii10018 /afii10019 /afii10020 /afii10021 /afii10022 /afii10024 /afii10025 -/afii10026 /afii10027 /afii10028 /afii10029 /afii10030 /afii10031 /afii10032 /afii10033 -/afii10034 /afii10035 /afii10036 /afii10037 /afii10038 /afii10039 /afii10040 /afii10041 -/afii10042 /afii10043 /afii10044 /afii10045 /afii10046 /afii10047 /afii10048 /afii10049 -/afii10065 /afii10066 /afii10067 /afii10068 /afii10069 /afii10070 /afii10072 /afii10073 -/afii10074 /afii10075 /afii10076 /afii10077 /afii10078 /afii10079 /afii10080 /afii10081 -/afii10082 /afii10083 /afii10084 /afii10085 /afii10086 /afii10087 /afii10088 /afii10089 -/afii10090 /afii10091 /afii10092 /afii10093 /afii10094 /afii10095 /afii10096 /afii10097] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/cp1252.ps b/runtime/print/cp1252.ps deleted file mode 100644 index a4dd7e675f..0000000000 --- a/runtime/print/cp1252.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-cp1252 -%%Version: 1.0 0 -%%EndComments -/VIM-cp1252[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/Euro /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl -/circumflex /perthousand /Scaron /guilsinglleft /OE /.notdef /Zcaron /.notdef -/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash -/tilde /trademark /scaron /guilsinglright /oe /.notdef /zcaron /Ydieresis -/space /exclamdown /cent /sterling /currency /yen /brokenbar /section -/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron -/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered -/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown -/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis -/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply -/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls -/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla -/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide -/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/cp1253.ps b/runtime/print/cp1253.ps deleted file mode 100644 index 0482232af1..0000000000 --- a/runtime/print/cp1253.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-cp1253 -%%Version: 1.0 0 -%%EndComments -/VIM-cp1253[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl -/.notdef /perthousand /.notdef /guilsinglleft /.notdef /.notdef /.notdef /.notdef -/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash -/.notdef /trademark /.notdef /guilsinglright /.notdef /.notdef /.notdef /.notdef -/space /dieresistonos /Alphatonos /sterling /currency /yen /brokenbar /section -/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /emdash -/degree /plusminus /twosuperior /threesuperior /tonos /mu /paragraph /periodcentered -/Epsilontonos /Etatonos /Iotatonos /guillemotright /Omicrontonos /onehalf /Upsilontonos /Omegatonos -/iotadieresistonos /Alpha /Beta /Gamma /Delta /Epsilon /Zeta /Eta -/Theta /Iota /Kappa /Lambda /Mu /Nu /Xi /Omicron -/Pi /Rho /.notdef /Sigma /Tau /Upsilon /Phi /Chi -/Psi /Omega /Iotadieresis /Upsilondieresis /alphatonos /epsilontonos /etatonos /iotatonos -/upsilondieresistonos /alpha /beta /gamma /delta /epsilon /zeta /eta -/theta /iota /kappa /lambda /mu /nu /xi /omicron -/pi /rho /sigma1 /sigma /tau /upsilon /phi /chi -/psi /omega /iotadieresis /upsilondieresis /omicrontonos /upsilontonos /omegatonos /.notdef] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/cp1254.ps b/runtime/print/cp1254.ps deleted file mode 100644 index 9fe7e47710..0000000000 --- a/runtime/print/cp1254.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-cp1254 -%%Version: 1.0 0 -%%EndComments -/VIM-cp1254[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/Euro /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl -/circumflex /perthousand /Scaron /guilsinglleft /OE /.notdef /Zcaron /.notdef -/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash -/tilde /trademark /scaron /guilsinglright /oe /.notdef /zcaron /Ydieresis -/space /exclamdown /cent /sterling /currency /yen /brokenbar /section -/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron -/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered -/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown -/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis -/Gbreve /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply -/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Idotaccent /Scedilla /germandbls -/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla -/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/gbreve /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide -/oslash /ugrave /uacute /ucircumflex /udieresis /dotlessi /scedilla /ydieresis] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/cp1255.ps b/runtime/print/cp1255.ps deleted file mode 100644 index cd82f46a0e..0000000000 --- a/runtime/print/cp1255.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-cp1255 -%%Version: 1.0 0 -%%EndComments -/VIM-cp1255[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl -/circumflex /perthousand /.notdef /guilsinglleft /.notdef /.notdef /.notdef /.notdef -/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash -/tilde /trademark /.notdef /guilsinglright /.notdef /.notdef /.notdef /.notdef -/space /.notdef /cent /sterling /newsheqelsign /yen /brokenbar /section -/dieresis /copyright /.notdef /guillemotleft /logicalnot /hyphen /registered /macron -/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered -/.notdef /onesuperior /.notdef /guillemotright /onequarter /onehalf /threequarters /.notdef -/sheva /hatafsegol /hatafpatah /hatafqamats /hiriq /tsere /segol /patah -/qamats /holam /.notdef /qubuts /dagesh /meteg /maqaf /rafe -/paseq /shindot /sindot /sofpasuq /doublevav /vavyod /doubleyod /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/alef /bet /gimel /dalet /he /vav /zayin /het -/tet /yod /finalkaf /kaf /lamed /finalmem /mem /finalnun -/nun /samekh /ayin /finalpe /pe /finaltsadi /tsadi /qof -/resh /shin /tav /.notdef /.notdef /.notdef /.notdef /.notdef] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/cp1257.ps b/runtime/print/cp1257.ps deleted file mode 100644 index 2e5d7a7b2d..0000000000 --- a/runtime/print/cp1257.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-cp1257 -%%Version: 1.0 0 -%%EndComments -/VIM-cp1257[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /quotesinglbase /.notdef /quotedblbase /ellipsis /dagger /daggerdbl -/.notdef /perthousand /.notdef /guilsinglleft /.notdef /.notdef /.notdef /.notdef -/.notdef /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash -/.notdef /trademark /.notdef /guilsinglright /.notdef /.notdef /.notdef /.notdef -/space /caron /breve /sterling /currency /.notdef /brokenbar /section -/dieresis /copyright /Rcedilla /guillemotleft /logicalnot /hyphen /registered /AE -/degree /plusminus /ogonek /threesuperior /acute /mu /paragraph /periodcentered -/cedilla /onesuperior /rcedilla /guillemotright /onequarter /onehalf /threequarters /ae -/Aogonek /Iogonek /Amacron /Cacute /Adieresis /Aring /Eogonek /Emacron -/Ccaron /Eacute /Zacute /Edot /Gcedilla /Kcedilla /Imacron /Lcedilla -/Scaron /Nacute /Ncedilla /Oacute /Omacron /Otilde /Odieresis /multiply -/Uogonek /Lslash /Sacute /Umacron /Udieresis /Zdotaccent /Zcaron /germandbls -/aogonek /iogonek /amacron /cacute /adieresis /aring /eogonek /emacron -/ccaron /eacute /zacute /edot /gcedilla /kcedilla /imacron /lcedilla -/scaron /nacute /ncedilla /oacute /omacron /otilde /odieresis /divide -/uogonek /lslash /sacute /umacron /udieresis /zdotaccent /zcaron /dotaccent] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/gb_roman.ps b/runtime/print/gb_roman.ps deleted file mode 100644 index fa78dbf5d6..0000000000 --- a/runtime/print/gb_roman.ps +++ /dev/null @@ -1,23 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-gb_roman -%%Version: 1.0 0 -%%EndComments -% Different to ASCII at code points 36 and 126 -/VIM-gb_roman[ -32{/.notdef}repeat -/space /exclam /quotedbl /numbersign /yuan /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /overline /.notdef -128{/.notdef}repeat] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/hp-roman8.ps b/runtime/print/hp-roman8.ps deleted file mode 100644 index d71b876db1..0000000000 --- a/runtime/print/hp-roman8.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-hp-roman8 -%%Version: 1.0 0 -%%EndComments -/VIM-hp-roman8[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /Agrave /Acircumflex /Egrave /Ecircumflex /Edieresis /Icircumflex /Idieresis -/acute /grave /circumflex /dieresis /tilde /Ugrave /Ucircumflex /lira -/macron /Yacute /yacute /degree /Ccedilla /ccedilla /Ntilde /ntilde -/exclamdown /questiondown /currency /sterling /yen /section /florin /cent -/acircumflex /ecircumflex /ocircumflex /ucircumflex /aacute /eacute /oacute /uacute -/agrave /egrave /ograve /ugrave /adieresis /edieresis /odieresis /udieresis -/Aring /icircumflex /Oslash /AE /aring /iacute /oslash /ae -/Adieresis /igrave /Odieresis /Udieresis /Eacute /idieresis /germandbls /Ocircumflex -/Aacute /Atilde /atilde /Eth /eth /Iacute /Igrave /Oacute -/Ograve /Otilde /otilde /Scaron /scaron /Uacute /Ydieresis /ydieresis -/Thorn /thorn /periodcentered /mu /paragraph /threequarters /hyphen /onequarter -/onehalf /ordfeminine /ordmasculine /guillemotleft /filledbox /guillemotright /plusminus /.notdef] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-10.ps b/runtime/print/iso-8859-10.ps deleted file mode 100644 index 7d8e2a0f96..0000000000 --- a/runtime/print/iso-8859-10.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-10 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-10[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /Aogonek /Emacron /Gcedilla /Imacron /Itilde /Kcedilla /section -/Lcedilla /Dcroat /Scaron /Tbar /Zcaron /endash /Umacron /Eng -/degree /aogonek /emacron /gcedilla /imacron /itilde /kcedilla /periodcentered -/lcedilla /dcroat /scaron /tbar /zcaron /emdash /umacron /eng -/Amacron /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Iogonek -/Ccaron /Eacute /Eogonek /Edieresis /Edot /Iacute /Icircumflex /Idieresis -/Eth /Ncedilla /Omacron /Oacute /Ocircumflex /Otilde /Odieresis /Utilde -/Oslash /Uogonek /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls -/amacron /aacute /acircumflex /atilde /adieresis /aring /ae /iogonek -/ccaron /eacute /eogonek /edieresis /edot /iacute /icircumflex /idieresis -/eth /ncedilla /omacron /oacute /ocircumflex /otilde /odieresis /utilde -/oslash /uogonek /uacute /ucircumflex /udieresis /yacute /thorn /kgreenlandic] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-11.ps b/runtime/print/iso-8859-11.ps deleted file mode 100644 index 78f775befc..0000000000 --- a/runtime/print/iso-8859-11.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-11 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-11[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /uni0E01 /uni0E02 /uni0E03 /uni0E04 /uni0E05 /uni0E06 /uni0E07 -/uni0E08 /uni0E09 /uni0E0A /uni0E0B /uni0E0C /uni0E0D /uni0E0E /uni0E0F -/uni0E10 /uni0E11 /uni0E12 /uni0E13 /uni0E14 /uni0E15 /uni0E16 /uni0E17 -/uni0E18 /uni0E19 /uni0E1A /uni0E1B /uni0E1C /uni0E1D /uni0E1E /uni0E1F -/uni0E20 /uni0E21 /uni0E22 /uni0E23 /uni0E24 /uni0E25 /uni0E26 /uni0E27 -/uni0E28 /uni0E29 /uni0E2A /uni0E2B /uni0E2C /uni0E2D /uni0E2E /uni0E2F -/uni0E30 /uni0E31 /uni0E32 /uni0E33 /uni0E34 /uni0E35 /uni0E36 /uni0E37 -/uni0E38 /uni0E39 /uni0E3A /.notdef /space /.notdef /.notdef /uni0E3F -/uni0E40 /uni0E41 /uni0E42 /uni0E43 /uni0E44 /uni0E45 /uni0E46 /uni0E47 -/uni0E48 /uni0E49 /uni0E4A /uni0E4B /uni0E4C /uni0E4D /uni0E4E /uni0E4F -/uni0E50 /uni0E51 /uni0E52 /uni0E53 /uni0E54 /uni0E55 /uni0E56 /uni0E57 - /uni0E58 /uni0E59 /uni0E5A /.notdef /.notdef /.notdef /.notdef /.notdef] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-13.ps b/runtime/print/iso-8859-13.ps deleted file mode 100644 index b4348f6619..0000000000 --- a/runtime/print/iso-8859-13.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-13 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-13[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /quotedblright /cent /sterling /currency /quotedblbase /brokenbar /section -/Oslash /copyright /Rcedilla /guillemotleft /logicalnot /hyphen /registered /AE -/degree /plusminus /twosuperior /threesuperior /quotedblleft /mu /paragraph /periodcentered -/oslash /onesuperior /rcedilla /guillemotright /onequarter /onehalf /threequarters /ae -/Aogonek /Iogonek /Amacron /Cacute /Adieresis /Aring /Eogonek /Emacron -/Ccaron /Eacute /Zacute /Edot /Gcedilla /Kcedilla /Imacron /Lcedilla -/Scaron /Nacute /Ncedilla /Oacute /Omacron /Otilde /Odieresis /multiply -/Uogonek /Lslash /Sacute /Umacron /Udieresis /Zdotaccent /Zcaron /germandbls -/aogonek /iogonek /amacron /cacute /adieresis /aring /eogonek /emacron -/ccaron /eacute /zacute /edot /gcedilla /kcedilla /imacron /lcedilla -/scaron /nacute /ncedilla /oacute /omacron /otilde /odieresis /divide -/uogonek /lslash /sacute /umacron /udieresis /zdotaccent /zcaron /quoteright] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-14.ps b/runtime/print/iso-8859-14.ps deleted file mode 100644 index cdfe04268a..0000000000 --- a/runtime/print/iso-8859-14.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-14 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-14[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /uni1E02 /uni1E03 /sterling /Cdotaccent /cdotaccent /uni1E0A /section -/Wgrave /copyright /Wacute /uni1E0B /Ygrave /hyphen /registered /Ydieresis -/uni1E1E /uni1E1F /Gdotaccent /gdotaccent /uni1E40 /uni1E41 /paragraph /uni1E56 -/wgrave /uni1E57 /wacute /uni1E60 /ygrave /Wdieresis /wdieresis /uni1E61 -/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis -/Wcircumflex /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /uni1E6A -/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Ycircumflex /germandbls -/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla -/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/wcircumflex /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /uni1E6B -/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /ycircumflex /ydieresis] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-15.ps b/runtime/print/iso-8859-15.ps deleted file mode 100644 index 46ea691ff1..0000000000 --- a/runtime/print/iso-8859-15.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-15 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-15[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclamdown /cent /sterling /Euro /yen /Scaron /section -/scaron /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron -/degree /plusminus /twosuperior /threesuperior /Zcaron /mu /paragraph /periodcentered -/zcaron /onesuperior /ordmasculine /guillemotright /OE /oe /Ydieresis /questiondown -/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis -/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply -/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls -/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla -/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide -/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-2.ps b/runtime/print/iso-8859-2.ps deleted file mode 100644 index f6e1933be7..0000000000 --- a/runtime/print/iso-8859-2.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-2 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-2[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /Aogonek /breve /Lslash /currency /Lcaron /Sacute /section -/dieresis /Scaron /Scedilla /Tcaron /Zacute /hyphen /Zcaron /Zdotaccent -/degree /aogonek /ogonek /lslash /acute /lcaron /sacute /caron -/cedilla /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent -/Racute /Aacute /Acircumflex /Abreve /Adieresis /Lacute /Cacute /Ccedilla -/Ccaron /Eacute /Eogonek /Edieresis /Ecaron /Iacute /Icircumflex /Dcaron -/Dcroat /Nacute /Ncaron /Oacute /Ocircumflex /Ohungarumlaut /Odieresis /multiply -/Rcaron /Uring /Uacute /Uhungarumlaut /Udieresis /Yacute /Tcedilla /germandbls -/racute /aacute /acircumflex /abreve /adieresis /lacute /cacute /ccedilla -/ccaron /eacute /eogonek /edieresis /ecaron /iacute /icircumflex /dcaron -/dcroat /nacute /ncaron /oacute /ocircumflex /ohungarumlaut /odieresis /divide -/rcaron /uring /uacute /uhungarumlaut /udieresis /yacute /tcedilla /dotaccent] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-3.ps b/runtime/print/iso-8859-3.ps deleted file mode 100644 index b5a3474fb3..0000000000 --- a/runtime/print/iso-8859-3.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-3 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-3[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /Hbar /breve /sterling /currency /.notdef /Hcircumflex /section -/dieresis /Idot /Scedilla /Gbreve /Jcircumflex /hyphen /.notdef /Zdotaccent -/degree /hbar /twosuperior /threesuperior /acute /mu /hcircumflex /periodcentered -/cedilla /dotlessi /scedilla /gbreve /jcircumflex /onehalf /.notdef /zdotaccent -/Agrave /Aacute /Acircumflex /.notdef /Adieresis /Cdotaccent /Ccircumflex /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis -/.notdef /Ntilde /Ograve /Oacute /Ocircumflex /Gdotaccent /Odieresis /multiply -/Gcircumflex /Ugrave /Uacute /Ucircumflex /Udieresis /Ubreve /Scircumflex /germandbls -/agrave /aacute /acircumflex /.notdef /adieresis /cdotaccent /ccircumflex /ccedilla -/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/.notdef /ntilde /ograve /oacute /ocircumflex /gdotaccent /odieresis /divide -/gcircumflex /ugrave /uacute /ucircumflex /udieresis /ubreve /scircumflex /dotaccent] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-4.ps b/runtime/print/iso-8859-4.ps deleted file mode 100644 index c917d1ff37..0000000000 --- a/runtime/print/iso-8859-4.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-4 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-4[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /Aogonek /kgreenlandic /Rcedilla /currency /Itilde /Lcedilla /section -/dieresis /Scaron /Emacron /Gcedilla /Tbar /.notdef /Zcaron /macron -/degree /aogonek /ogonek /rcedilla /acute /itilde /lcedilla /caron -/cedilla /scaron /emacron /gcedilla /tbar /Eng /zcaron /eng -/Amacron /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Iogonek -/Ccaron /Eacute /Eogonek /Edieresis /Edot /Iacute /Icircumflex /Imacron -/Dcroat /Ncedilla /Omacron /Kcedilla /Ocircumflex /Otilde /Odieresis /multiply -/Oslash /Uogonek /Uacute /Ucircumflex /Udieresis /Utilde /Umacron /germandbls -/amacron /aacute /acircumflex /atilde /adieresis /aring /ae /iogonek -/ccaron /eacute /eogonek /edieresis /edot /iacute /icircumflex /imacron -/dcroat /ncedilla /omacron /kcedilla /ocircumflex /otilde /odieresis /divide -/oslash /uogonek /uacute /ucircumflex /udieresis /utilde /umacron /dotaccent] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-5.ps b/runtime/print/iso-8859-5.ps deleted file mode 100644 index dbe9628900..0000000000 --- a/runtime/print/iso-8859-5.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-5 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-5[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /afii10023 /afii10051 /afii10052 /afii10053 /afii10054 /afii10055 /afii10056 -/afii10057 /afii10058 /afii10059 /afii10060 /afii10061 /.notdef /afii10062 /afii10145 -/afii10017 /afii10018 /afii10019 /afii10020 /afii10021 /afii10022 /afii10024 /afii10025 -/afii10026 /afii10027 /afii10028 /afii10029 /afii10030 /afii10031 /afii10032 /afii10033 -/afii10034 /afii10035 /afii10036 /afii10037 /afii10038 /afii10039 /afii10040 /afii10041 -/afii10042 /afii10043 /afii10044 /afii10045 /afii10046 /afii10047 /afii10048 /afii10049 -/afii10065 /afii10066 /afii10067 /afii10068 /afii10069 /afii10070 /afii10072 /afii10073 -/afii10074 /afii10075 /afii10076 /afii10077 /afii10078 /afii10079 /afii10080 /afii10081 -/afii10082 /afii10083 /afii10084 /afii10085 /afii10086 /afii10087 /afii10088 /afii10089 -/afii10090 /afii10091 /afii10092 /afii10093 /afii10094 /afii10095 /afii10096 /afii10097 -/afii61352 /afii10071 /afii10099 /afii10100 /afii10101 /afii10102 /afii10103 /afii10104 -/afii10105 /afii10106 /afii10107 /afii10108 /afii10109 /section /afii10110 /afii10193] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-7.ps b/runtime/print/iso-8859-7.ps deleted file mode 100644 index fc16bf1a61..0000000000 --- a/runtime/print/iso-8859-7.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-7 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-7[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /quotereversed /quoteright /sterling /.notdef /.notdef /brokenbar /section -/dieresis /copyright /.notdef /guillemotleft /logicalnot /.notdef /.notdef /emdash -/degree /plusminus /twosuperior /threesuperior /tonos /dieresistonos /Alphatonos /periodcentered -/Epsilontonos /Etatonos /Iotatonos /guillemotright /Omicrontonos /onehalf /Upsilontonos /Omegatonos -/iotadieresistonos /Alpha /Beta /Gamma /Delta /Epsilon /Zeta /Eta -/Theta /Iota /Kappa /Lambda /Mu /Nu /Xi /Omicron -/Pi /Rho /.notdef /Sigma /Tau /Upsilon /Phi /Chi -/Psi /Omega /Iotadieresis /Upsilondieresis /alphatonos /epsilontonos /etatonos /iotatonos -/upsilondieresistonos /alpha /beta /gamma /delta /epsilon /zeta /eta -/theta /iota /kappa /lambda /mu /nu /xi /omicron -/pi /rho /sigma1 /sigma /tau /upsilon /phi /chi -/psi /omega /iotadieresis /upsilondieresis /omicrontonos /upsilontonos /omegatonos /.notdef] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-8.ps b/runtime/print/iso-8859-8.ps deleted file mode 100644 index 15193cc8ea..0000000000 --- a/runtime/print/iso-8859-8.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-8 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-8[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /.notdef /cent /sterling /currency /yen /brokenbar /section -/dieresis /copyright /multiply /guillemotleft /logicalnot /hyphen /registered /macron -/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered -/cedilla /onesuperior /divide /guillemotright /onequarter /onehalf /threequarters /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /underscoredbl -/alef /bet /gimel /dalet /he /vav /zayin /het -/tet /yod /finalkaf /kaf /lamed /finalmem /mem /finalnun -/nun /samekh /ayin /finalpe /pe /finaltsadi /tsadi /qof -/resh /shin /tav /.notdef /.notdef /.notdef /.notdef /.notdef] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/iso-8859-9.ps b/runtime/print/iso-8859-9.ps deleted file mode 100644 index d40f6e9864..0000000000 --- a/runtime/print/iso-8859-9.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-iso-8859-9 -%%Version: 1.0 0 -%%EndComments -/VIM-iso-8859-9[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclamdown /cent /sterling /currency /yen /brokenbar /section -/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron -/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered -/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown -/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis -/Gbreve /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply -/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Idotaccent /Scedilla /germandbls -/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla -/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/gbreve /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide -/oslash /ugrave /uacute /ucircumflex /udieresis /dotlessi /scedilla /ydieresis] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/jis_roman.ps b/runtime/print/jis_roman.ps deleted file mode 100644 index f24a8069a3..0000000000 --- a/runtime/print/jis_roman.ps +++ /dev/null @@ -1,23 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-jis_roman -%%Version: 1.0 0 -%%EndComments -% Different to ASCII at code points 92 and 126 -/VIM-jis_roman[ -32{/.notdef}repeat -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /yen /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /overline /.notdef -128{/.notdef}repeat] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/koi8-r.ps b/runtime/print/koi8-r.ps deleted file mode 100644 index d42daabb49..0000000000 --- a/runtime/print/koi8-r.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-koi8-r -%%Version: 1.0 0 -%%EndComments -/VIM-koi8-r[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/SF100000 /SF110000 /SF010000 /SF030000 /SF020000 /SF040000 /SF080000 /SF090000 -/SF060000 /SF070000 /SF050000 /upblock /dnblock /block /lfblock /rtblock -/ltshade /shade /dkshade /integraltp /filledbox /bullet /radical /approxequal -/lessequal /greaterequal /space /integralbt /degree /twosuperior /periodcentered /divide -/SF430000 /SF240000 /SF510000 /afii10071 /SF520000 /SF390000 /SF220000 /SF210000 -/SF250000 /SF500000 /SF490000 /SF380000 /SF280000 /SF270000 /SF260000 /SF360000 -/SF370000 /SF420000 /SF190000 /afii10023 /SF200000 /SF230000 /SF470000 /SF480000 -/SF410000 /SF450000 /SF460000 /SF400000 /SF540000 /SF530000 /SF440000 /copyright -/afii10096 /afii10065 /afii10066 /afii10088 /afii10069 /afii10070 /afii10086 /afii10068 -/afii10087 /afii10074 /afii10075 /afii10076 /afii10077 /afii10078 /afii10079 /afii10080 -/afii10081 /afii10097 /afii10082 /afii10083 /afii10084 /afii10085 /afii10072 /afii10067 -/afii10094 /afii10093 /afii10073 /afii10090 /afii10095 /afii10091 /afii10089 /afii10092 -/afii10048 /afii10017 /afii10018 /afii10040 /afii10021 /afii10022 /afii10038 /afii10020 -/afii10039 /afii10026 /afii10027 /afii10028 /afii10029 /afii10030 /afii10031 /afii10032 -/afii10033 /afii10049 /afii10034 /afii10035 /afii10036 /afii10037 /afii10024 /afii10019 -/afii10046 /afii10045 /afii10025 /afii10042 /afii10047 /afii10043 /afii10041 /afii10044] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/koi8-u.ps b/runtime/print/koi8-u.ps deleted file mode 100644 index 53631049fe..0000000000 --- a/runtime/print/koi8-u.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-koi8-u -%%Version: 1.0 0 -%%EndComments -/VIM-koi8-u[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/SF100000 /SF110000 /SF010000 /SF030000 /SF020000 /SF040000 /SF080000 /SF090000 -/SF060000 /SF070000 /SF050000 /upblock /dnblock /block /lfblock /rtblock -/ltshade /shade /dkshade /integraltp /filledbox /bullet /radical /approxequal -/lessequal /greaterequal /space /integralbt /degree /twosuperior /periodcentered /divide -/SF430000 /SF240000 /SF510000 /afii10071 /afii10101 /SF390000 /afii10103 /afii10104 -/SF250000 /SF500000 /SF490000 /SF380000 /SF280000 /afii10098 /SF260000 /SF360000 -/SF370000 /SF420000 /SF190000 /afii10023 /afii10053 /SF230000 /afii10055 /afii10056 -/SF410000 /SF450000 /SF460000 /SF400000 /SF540000 /afii10050 /SF440000 /copyright -/afii10096 /afii10065 /afii10066 /afii10088 /afii10069 /afii10070 /afii10086 /afii10068 -/afii10087 /afii10074 /afii10075 /afii10076 /afii10077 /afii10078 /afii10079 /afii10080 -/afii10081 /afii10097 /afii10082 /afii10083 /afii10084 /afii10085 /afii10072 /afii10067 -/afii10094 /afii10093 /afii10073 /afii10090 /afii10095 /afii10091 /afii10089 /afii10092 -/afii10048 /afii10017 /afii10018 /afii10040 /afii10021 /afii10022 /afii10038 /afii10020 -/afii10039 /afii10026 /afii10027 /afii10028 /afii10029 /afii10030 /afii10031 /afii10032 -/afii10033 /afii10049 /afii10034 /afii10035 /afii10036 /afii10037 /afii10024 /afii10019 -/afii10046 /afii10045 /afii10025 /afii10042 /afii10047 /afii10043 /afii10041 /afii10044] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/ks_roman.ps b/runtime/print/ks_roman.ps deleted file mode 100644 index b688550a65..0000000000 --- a/runtime/print/ks_roman.ps +++ /dev/null @@ -1,23 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-ks_roman -%%Version: 1.0 0 -%%EndComments -% Different to ASCII at code points 96 and 126 -/VIM-ks_roman[ -32{/.notdef}repeat -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /won /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /overline /.notdef -128{/.notdef}repeat] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/latin1.ps b/runtime/print/latin1.ps deleted file mode 100644 index 569db9bfe0..0000000000 --- a/runtime/print/latin1.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-latin1 -%%Version: 1.0 0 -%%EndComments -/VIM-latin1[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclamdown /cent /sterling /currency /yen /brokenbar /section -/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron -/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered -/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown -/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla -/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis -/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply -/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls -/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla -/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis -/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide -/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/mac-roman.ps b/runtime/print/mac-roman.ps deleted file mode 100644 index b0941be650..0000000000 --- a/runtime/print/mac-roman.ps +++ /dev/null @@ -1,40 +0,0 @@ -%!PS-Adobe-3.0 Resource-Encoding -%%Title: VIM-mac-roman -%%Version: 1.0 0 -%%EndComments -/VIM-mac-roman[ -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef -/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle -/parenleft /parenright /asterisk /plus /comma /minus /period /slash -/zero /one /two /three /four /five /six /seven -/eight /nine /colon /semicolon /less /equal /greater /question -/at /A /B /C /D /E /F /G -/H /I /J /K /L /M /N /O -/P /Q /R /S /T /U /V /W -/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore -/grave /a /b /c /d /e /f /g -/h /i /j /k /l /m /n /o -/p /q /r /s /t /u /v /w -/x /y /z /braceleft /bar /braceright /asciitilde /.notdef -/Adieresis /Aring /Ccedilla /Eacute /Ntilde /Odieresis /Udieresis /aacute -/agrave /acircumflex /adieresis /atilde /aring /ccedilla /eacute /egrave -/ecircumflex /edieresis /iacute /igrave /icircumflex /idieresis /ntilde /oacute -/ograve /ocircumflex /odieresis /otilde /uacute /ugrave /ucircumflex /udieresis -/dagger /degree /cent /sterling /section /bullet /paragraph /germandbls -/registered /copyright /trademark /acute /dieresis /notequal /AE /Oslash -/infinity /plusminus /lessequal /greaterequal /yen /mu /partialdiff /summation -/Pi /pi /integral /ordfeminine /ordmasculine /Omega /ae /oslash -/questiondown /exclamdown /logicalnot /radical /florin /approxequal /delta /guillemotleft -/guillemotright /ellipsis /space /Agrave /Atilde /Otilde /OE /oe -/endash /emdash /quotedblleft /quotedblright /quoteleft /quoteright /divide /lozenge -/ydieresis /Ydieresis /fraction /currency /guilsinglleft /guilsinglright /fi /fl -/daggerdbl /periodcentered /quotesinglbase /quotedblbase /perthousand /Acircumflex /Ecircumflex /Aacute -/Edieresis /Egrave /Iacute /Icircumflex /Idieresis /Igrave /Oacute /Ocircumflex -/heart /Ograve /Uacute /Ucircumflex /Ugrave /dotlessi /circumflex /tilde -/macron /breve /dotaccent /ring /cedilla /hungarumlaut /ogonek /caron] -/Encoding defineresource pop -% vim:ff=unix: -%%EOF diff --git a/runtime/print/prolog.ps b/runtime/print/prolog.ps deleted file mode 100644 index 620856999f..0000000000 --- a/runtime/print/prolog.ps +++ /dev/null @@ -1,44 +0,0 @@ -%!PS-Adobe-3.0 Resource-ProcSet -%%Title: VIM-Prolog -%%Version: 1.4 1 -%%EndComments -% Editing of this file is NOT RECOMMENDED. You run a very good risk of causing -% all PostScript printing from VIM failing if you do. PostScript is not called -% a write-only language for nothing! -/packedarray where not{userdict begin/setpacking/pop load def/currentpacking -false def end}{pop}ifelse/CP currentpacking def true setpacking -/bd{bind def}bind def/ld{load def}bd/ed{exch def}bd/d/def ld -/db{dict begin}bd/cde{currentdict end}bd -/T true d/F false d -/SO null d/sv{/SO save d}bd/re{SO restore}bd -/L2 systemdict/languagelevel 2 copy known{get exec}{pop pop 1}ifelse 2 ge d -/m/moveto ld/s/show ld /ms{m s}bd /g/setgray ld/r/setrgbcolor ld/sp{showpage}bd -/gs/gsave ld/gr/grestore ld/cp/currentpoint ld -/ul{gs UW setlinewidth cp UO add 2 copy newpath m 3 1 roll add exch lineto -stroke gr}bd -/bg{gs r cp BO add 4 -2 roll rectfill gr}bd -/sl{90 rotate 0 exch translate}bd -L2{ -/sspd{mark exch{setpagedevice}stopped cleartomark}bd -/nc{1 db/NumCopies ed cde sspd}bd -/sps{3 db/Orientation ed[3 1 roll]/PageSize ed/ImagingBBox null d cde sspd}bd -/dt{2 db/Tumble ed/Duplex ed cde sspd}bd -/c{1 db/Collate ed cde sspd}bd -}{ -/nc{/#copies ed}bd -/sps{statusdict/setpage get exec}bd -/dt{statusdict/settumble 2 copy known{get exec}{pop pop pop}ifelse -statusdict/setduplexmode 2 copy known{get exec}{pop pop pop}ifelse}bd -/c{pop}bd -}ifelse -/ffs{findfont exch scalefont d}bd/sf{setfont}bd -/ref{1 db findfont dup maxlength dict/NFD ed{exch dup/FID ne{exch NFD 3 1 roll -put}{pop pop}ifelse}forall/Encoding findresource dup length 256 eq{NFD/Encoding -3 -1 roll put}{pop}ifelse NFD dup/FontType get 3 ne{/CharStrings}{/CharProcs} -ifelse 2 copy known{2 copy get dup maxlength dict copy[/questiondown/space]{2 -copy known{2 copy get 2 index/.notdef 3 -1 roll put pop exit}if pop}forall put -}{pop pop}ifelse dup NFD/FontName 3 -1 roll put NFD definefont pop end}bd -CP setpacking -(\004)cvn{}bd -% vim:ff=unix: -%%EOF diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim index 76f3ef7589..ce6797deaa 100644 --- a/runtime/syntax/2html.vim +++ b/runtime/syntax/2html.vim @@ -1,6 +1,6 @@ " Vim syntax support file " Maintainer: Ben Fritz <fritzophrenic@gmail.com> -" Last Change: 2020 Jan 05 +" Last Change: 2022 Dec 26 " " Additional contributors: " @@ -1881,7 +1881,7 @@ if s:settings.use_css && !s:settings.no_doc endif endif -if !s:settings.use_css && !s:settings_no_doc +if !s:settings.use_css && !s:settings.no_doc " For Netscape 4, set <body> attributes too, though, strictly speaking, it's " incorrect. execute '%s:<body\([^>]*\):<body bgcolor="' . s:bgc . '" text="' . s:fgc . '"\1>\r<font face="'. s:htmlfont .'"' diff --git a/runtime/syntax/fstab.vim b/runtime/syntax/fstab.vim index 6a3c375b94..7e18c267f7 100644 --- a/runtime/syntax/fstab.vim +++ b/runtime/syntax/fstab.vim @@ -2,8 +2,8 @@ " Language: fstab file " Maintainer: Radu Dineiu <radu.dineiu@gmail.com> " URL: https://raw.github.com/rid9/vim-fstab/master/syntax/fstab.vim -" Last Change: 2022 Dec 10 -" Version: 1.5 +" Last Change: 2022 Dec 11 +" Version: 1.6.2 " " Credits: " David Necas (Yeti) <yeti@physics.muni.cz> @@ -56,7 +56,7 @@ syn keyword fsMountPointKeyword contained none swap " Type syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown syn match fsTypeUnknown /\s\+\zs\w\+/ contained -syn keyword fsTypeKeyword contained adfs ados affs anon_inodefs atfs audiofs auto autofs bdev befs bfs btrfs binfmt_misc cd9660 ceph cfs cgroup cifs coda coherent configfs cpuset cramfs debugfs devfs devpts devtmpfs dlmfs e2compr ecryptfs efivarfs efs erofs exfat ext2 ext2fs ext3 ext4 f2fs fdesc ffs filecore fuse fuseblk fusectl gfs2 hfs hfsplus hpfs hugetlbfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix mqueue msdos ncpfs nfs nfs4 nfsd nilfs2 none ntfs ntfs3 null nwfs ocfs2 omfs overlay ovlfs pipefs portal proc procfs pstore ptyfs pvfs2 qnx4 qnx6 reiserfs ramfs romfs securityfs shm smbfs spufs squashfs sockfs sshfs std subfs swap sysfs sysv tcfs tmpfs ubifs udf ufs umap umsdos union usbfs userfs v9fs vfat virtiofs vs3fs vxfs wrapfs wvfs xenfs xenix xfs zisofs zonefs +syn keyword fsTypeKeyword contained adfs ados affs anon_inodefs atfs audiofs auto autofs bdev befs bfs btrfs binfmt_misc cd9660 ceph cfs cgroup cifs coda coherent configfs cpuset cramfs debugfs devfs devpts devtmpfs dlmfs e2compr ecryptfs efivarfs efs erofs exfat ext2 ext2fs ext3 ext4 f2fs fdesc ffs filecore fuse fuseblk fusectl gfs2 hfs hfsplus hpfs hugetlbfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix mqueue msdos ncpfs nfs nfs4 nfsd nilfs2 none ntfs ntfs3 null nwfs ocfs2 omfs overlay ovlfs pipefs portal proc procfs pstore ptyfs pvfs2 qnx4 qnx6 reiserfs ramfs romfs rpc_pipefs securityfs shm smbfs spufs squashfs sockfs sshfs std subfs swap sysfs sysv tcfs tmpfs ubifs udf ufs umap umsdos union usbfs userfs v9fs vfat virtiofs vs3fs vxfs wrapfs wvfs xenfs xenix xfs zisofs zonefs " Options " ------- @@ -72,9 +72,13 @@ syn keyword fsOptionsYN y n syn keyword fsOptions01 0 1 syn cluster fsOptionsCheckCluster contains=fsOptionsExt2Check,fsOptionsFatCheck syn keyword fsOptionsSize 512 1024 2048 -syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail failok +syn keyword fsOptionsGeneral async atime auto bind current defaults dev devgid devmode devmtime devuid dirsync exec force fstab kudzu loop managed mand move noatime noauto noclusterr noclusterw nodev nodevmtime nodiratime noexec nomand norelatime nosuid nosymfollow nouser owner pamconsole rbind rdonly relatime remount ro rq rw suid suiddir supermount sw sync union update user users wxallowed xx nofail failok lazytime syn match fsOptionsGeneral /_netdev/ +syn match fsOptionsKeywords contained /\<x-systemd\.\%(requires\|before\|after\|wanted-by\|required-by\|requires-mounts-for\|idle-timeout\|device-timeout\|mount-timeout\)=/ nextgroup=fsOptionsString +syn match fsOptionsKeywords contained /\<x-systemd\.\%(device-bound\|automount\|makefs\|growfs\|rw-only\)/ +syn match fsOptionsKeywords contained /\<x-initrd\.mount/ + syn match fsOptionsKeywords contained /\<cache=/ nextgroup=fsOptionsCache syn keyword fsOptionsCache yes no none strict loose fscache mmap diff --git a/runtime/syntax/hgcommit.vim b/runtime/syntax/hgcommit.vim index 37fe9db8bf..e9f31bef61 100644 --- a/runtime/syntax/hgcommit.vim +++ b/runtime/syntax/hgcommit.vim @@ -1,8 +1,8 @@ " Vim syntax file -" Language: hg (Mercurial) commit file +" Language: hg/sl (Mercurial / Sapling) commit file " Maintainer: Ken Takata <kentkt at csc dot jp> -" Last Change: 2012 Aug 23 -" Filenames: hg-editor-*.txt +" Max Coplan <mchcopl@gmail.com> +" Last Change: 2022-12-08 " License: VIM License " URL: https://github.com/k-takata/hg-vim @@ -10,12 +10,15 @@ if exists("b:current_syntax") finish endif -syn match hgcommitComment "^HG:.*$" contains=@NoSpell -syn match hgcommitUser "^HG: user: \zs.*$" contains=@NoSpell contained containedin=hgcommitComment -syn match hgcommitBranch "^HG: branch \zs.*$" contains=@NoSpell contained containedin=hgcommitComment -syn match hgcommitAdded "^HG: \zsadded .*$" contains=@NoSpell contained containedin=hgcommitComment -syn match hgcommitChanged "^HG: \zschanged .*$" contains=@NoSpell contained containedin=hgcommitComment -syn match hgcommitRemoved "^HG: \zsremoved .*$" contains=@NoSpell contained containedin=hgcommitComment +syn match hgcommitComment "^\%(SL\|HG\): .*$" contains=@NoSpell +syn match hgcommitUser "^\%(SL\|HG\): user: \zs.*$" contains=@NoSpell contained containedin=hgcommitComment +syn match hgcommitBranch "^\%(SL\|HG\): branch \zs.*$" contains=@NoSpell contained containedin=hgcommitComment +syn match hgcommitAdded "^\%(SL\|HG\): \zsadded .*$" contains=@NoSpell contained containedin=hgcommitComment +syn match hgcommitChanged "^\%(SL\|HG\): \zschanged .*$" contains=@NoSpell contained containedin=hgcommitComment +syn match hgcommitRemoved "^\%(SL\|HG\): \zsremoved .*$" contains=@NoSpell contained containedin=hgcommitComment + +syn region hgcommitDiff start=/\%(^\(SL\|HG\): diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|@@\@!\|[^[:alnum:]\ +-]\S\@!\)\@=/ fold contains=@hgcommitDiff +syn include @hgcommitDiff syntax/shared/hgcommitDiff.vim hi def link hgcommitComment Comment hi def link hgcommitUser String diff --git a/runtime/syntax/shared/hgcommitDiff.vim b/runtime/syntax/shared/hgcommitDiff.vim new file mode 100644 index 0000000000..949cdf0b1c --- /dev/null +++ b/runtime/syntax/shared/hgcommitDiff.vim @@ -0,0 +1,390 @@ +" Vim syntax file +" Language: Sapling / Mecurial Diff (context or unified) +" Maintainer: Max Coplan <mchcopl@gmail.com> +" Translations by Jakson Alves de Aquino. +" Last Change: 2022-12-08 +" Copied from: runtime/syntax/diff.vim + +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif +scriptencoding utf-8 + +syn match hgDiffOnly "^\%(SL\|HG\): Only in .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Files .* and .* are identical$" +syn match hgDiffDiffer "^\%(SL\|HG\): Files .* and .* differ$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binary files .* and .* differ$" +syn match hgDiffIsA "^\%(SL\|HG\): File .* is a .* while file .* is a .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ No newline at end of file .*" +syn match hgDiffCommon "^\%(SL\|HG\): Common subdirectories: .*" + +" Disable the translations by setting diff_translations to zero. +if !exists("diff_translations") || diff_translations + +" ca +syn match hgDiffOnly "^\%(SL\|HG\): Només a .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Els fitxers .* i .* són idèntics$" +syn match hgDiffDiffer "^\%(SL\|HG\): Els fitxers .* i .* difereixen$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Els fitxers .* i .* difereixen$" +syn match hgDiffIsA "^\%(SL\|HG\): El fitxer .* és un .* mentre que el fitxer .* és un .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ No hi ha cap caràcter de salt de línia al final del fitxer" +syn match hgDiffCommon "^\%(SL\|HG\): Subdirectoris comuns: .* i .*" + +" cs +syn match hgDiffOnly "^\%(SL\|HG\): Pouze v .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Soubory .* a .* jsou identické$" +syn match hgDiffDiffer "^\%(SL\|HG\): Soubory .* a .* jsou různé$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binární soubory .* a .* jsou rozdílné$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Soubory .* a .* jsou různé$" +syn match hgDiffIsA "^\%(SL\|HG\): Soubor .* je .* pokud soubor .* je .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Chybí znak konce řádku na konci souboru" +syn match hgDiffCommon "^\%(SL\|HG\): Společné podadresáře: .* a .*" + +" da +syn match hgDiffOnly "^\%(SL\|HG\): Kun i .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Filerne .* og .* er identiske$" +syn match hgDiffDiffer "^\%(SL\|HG\): Filerne .* og .* er forskellige$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binære filer .* og .* er forskellige$" +syn match hgDiffIsA "^\%(SL\|HG\): Filen .* er en .* mens filen .* er en .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Intet linjeskift ved filafslutning" +syn match hgDiffCommon "^\%(SL\|HG\): Identiske underkataloger: .* og .*" + +" de +syn match hgDiffOnly "^\%(SL\|HG\): Nur in .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Dateien .* und .* sind identisch.$" +syn match hgDiffDiffer "^\%(SL\|HG\): Dateien .* und .* sind verschieden.$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binärdateien .* and .* sind verschieden.$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binärdateien .* und .* sind verschieden.$" +syn match hgDiffIsA "^\%(SL\|HG\): Datei .* ist ein .* während Datei .* ein .* ist.$" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Kein Zeilenumbruch am Dateiende." +syn match hgDiffCommon "^\%(SL\|HG\): Gemeinsame Unterverzeichnisse: .* und .*.$" + +" el +syn match hgDiffOnly "^\%(SL\|HG\): Μόνο στο .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Τα αρχεία .* καί .* είναι πανομοιότυπα$" +syn match hgDiffDiffer "^\%(SL\|HG\): Τα αρχεία .* και .* διαφέρουν$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Τα αρχεία .* και .* διαφέρουν$" +syn match hgDiffIsA "^\%(SL\|HG\): Το αρχείο .* είναι .* ενώ το αρχείο .* είναι .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Δεν υπάρχει χαρακτήρας νέας γραμμής στο τέλος του αρχείου" +syn match hgDiffCommon "^\%(SL\|HG\): Οι υποκατάλογοι .* και .* είναι ταυτόσημοι$" + +" eo +syn match hgDiffOnly "^\%(SL\|HG\): Nur en .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Dosieroj .* kaj .* estas samaj$" +syn match hgDiffDiffer "^\%(SL\|HG\): Dosieroj .* kaj .* estas malsamaj$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Dosieroj .* kaj .* estas malsamaj$" +syn match hgDiffIsA "^\%(SL\|HG\): Dosiero .* estas .*, dum dosiero .* estas .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Mankas linifino ĉe fino de dosiero" +syn match hgDiffCommon "^\%(SL\|HG\): Komunaj subdosierujoj: .* kaj .*" + +" es +syn match hgDiffOnly "^\%(SL\|HG\): Sólo en .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Los ficheros .* y .* son idénticos$" +syn match hgDiffDiffer "^\%(SL\|HG\): Los ficheros .* y .* son distintos$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Los ficheros binarios .* y .* son distintos$" +syn match hgDiffIsA "^\%(SL\|HG\): El fichero .* es un .* mientras que el .* es un .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ No hay ningún carácter de nueva línea al final del fichero" +syn match hgDiffCommon "^\%(SL\|HG\): Subdirectorios comunes: .* y .*" + +" fi +syn match hgDiffOnly "^\%(SL\|HG\): Vain hakemistossa .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Tiedostot .* ja .* ovat identtiset$" +syn match hgDiffDiffer "^\%(SL\|HG\): Tiedostot .* ja .* eroavat$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binääritiedostot .* ja .* eroavat$" +syn match hgDiffIsA "^\%(SL\|HG\): Tiedosto .* on .*, kun taas tiedosto .* on .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Ei rivinvaihtoa tiedoston lopussa" +syn match hgDiffCommon "^\%(SL\|HG\): Yhteiset alihakemistot: .* ja .*" + +" fr +syn match hgDiffOnly "^\%(SL\|HG\): Seulement dans .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Les fichiers .* et .* sont identiques.*" +syn match hgDiffDiffer "^\%(SL\|HG\): Les fichiers .* et .* sont différents.*" +syn match hgDiffBDiffer "^\%(SL\|HG\): Les fichiers binaires .* et .* sont différents.*" +syn match hgDiffIsA "^\%(SL\|HG\): Le fichier .* est un .* alors que le fichier .* est un .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Pas de fin de ligne à la fin du fichier.*" +syn match hgDiffCommon "^\%(SL\|HG\): Les sous-répertoires .* et .* sont identiques.*" + +" ga +syn match hgDiffOnly "^\%(SL\|HG\): I .* amháin: .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Is comhionann iad na comhaid .* agus .*" +syn match hgDiffDiffer "^\%(SL\|HG\): Tá difríocht idir na comhaid .* agus .*" +syn match hgDiffBDiffer "^\%(SL\|HG\): Tá difríocht idir na comhaid .* agus .*" +syn match hgDiffIsA "^\%(SL\|HG\): Tá comhad .* ina .* ach tá comhad .* ina .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Gan líne nua ag an chomhadchríoch" +syn match hgDiffCommon "^\%(SL\|HG\): Fochomhadlanna i gcoitianta: .* agus .*" + +" gl +syn match hgDiffOnly "^\%(SL\|HG\): Só en .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Os ficheiros .* e .* son idénticos$" +syn match hgDiffDiffer "^\%(SL\|HG\): Os ficheiros .* e .* son diferentes$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Os ficheiros binarios .* e .* son diferentes$" +syn match hgDiffIsA "^\%(SL\|HG\): O ficheiro .* é un .* mentres que o ficheiro .* é un .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Non hai un salto de liña na fin da liña" +syn match hgDiffCommon "^\%(SL\|HG\): Subdirectorios comúns: .* e .*" + +" he +" ^\%(SL\|HG\): .* are expansive patterns for long lines, so disabled unless we can match +" some specific hebrew chars +if search('\%u05d5\|\%u05d1', 'nw', '', 100) + syn match hgDiffOnly "^\%(SL\|HG\): .*-ב קר אצמנ .*" + syn match hgDiffIdentical "^\%(SL\|HG\): םיהז םניה .*-ו .* םיצבקה$" + syn match hgDiffDiffer "^\%(SL\|HG\): הזמ הז םינוש `.*'-ו `.*' םיצבקה$" + syn match hgDiffBDiffer "^\%(SL\|HG\): הזמ הז םינוש `.*'-ו `.*' םיירניב םיצבק$" + syn match hgDiffIsA "^\%(SL\|HG\): .* .*-ל .* .* תוושהל ןתינ אל$" + syn match hgDiffNoEOL "^\%(SL\|HG\): \\ ץבוקה ףוסב השד.-הרוש ות רס." + syn match hgDiffCommon "^\%(SL\|HG\): .*-ו .* :תוהז תויקית-תת$" +endif + +" hr +syn match hgDiffOnly "^\%(SL\|HG\): Samo u .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Datoteke .* i .* su identične$" +syn match hgDiffDiffer "^\%(SL\|HG\): Datoteke .* i .* se razlikuju$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binarne datoteke .* i .* se razlikuju$" +syn match hgDiffIsA "^\%(SL\|HG\): Datoteka .* je .*, a datoteka .* je .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Nema novog retka na kraju datoteke" +syn match hgDiffCommon "^\%(SL\|HG\): Uobičajeni poddirektoriji: .* i .*" + +" hu +syn match hgDiffOnly "^\%(SL\|HG\): Csak .* -ben: .*" +syn match hgDiffIdentical "^\%(SL\|HG\): .* és .* fájlok azonosak$" +syn match hgDiffDiffer "^\%(SL\|HG\): A(z) .* és a(z) .* fájlok különböznek$" +syn match hgDiffBDiffer "^\%(SL\|HG\): A(z) .* és a(z) .* fájlok különböznek$" +syn match hgDiffIsA "^\%(SL\|HG\): A(z) .* fájl egy .*, viszont a(z) .* fájl egy .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Nincs újsor a fájl végén" +syn match hgDiffCommon "^\%(SL\|HG\): Közös alkönyvtárak: .* és .*" + +" id +syn match hgDiffOnly "^\%(SL\|HG\): Hanya dalam .*" +syn match hgDiffIdentical "^\%(SL\|HG\): File .* dan .* identik$" +syn match hgDiffDiffer "^\%(SL\|HG\): Berkas .* dan .* berbeda$" +syn match hgDiffBDiffer "^\%(SL\|HG\): File biner .* dan .* berbeda$" +syn match hgDiffIsA "^\%(SL\|HG\): File .* adalah .* sementara file .* adalah .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Tidak ada baris-baru di akhir dari berkas" +syn match hgDiffCommon "^\%(SL\|HG\): Subdirektori sama: .* dan .*" + +" it +syn match hgDiffOnly "^\%(SL\|HG\): Solo in .*" +syn match hgDiffIdentical "^\%(SL\|HG\): I file .* e .* sono identici$" +syn match hgDiffDiffer "^\%(SL\|HG\): I file .* e .* sono diversi$" +syn match hgDiffBDiffer "^\%(SL\|HG\): I file .* e .* sono diversi$" +syn match hgDiffBDiffer "^\%(SL\|HG\): I file binari .* e .* sono diversi$" +syn match hgDiffIsA "^\%(SL\|HG\): File .* è un .* mentre file .* è un .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Manca newline alla fine del file" +syn match hgDiffCommon "^\%(SL\|HG\): Sottodirectory in comune: .* e .*" + +" ja +syn match hgDiffOnly "^\%(SL\|HG\): .*だけに発見: .*" +syn match hgDiffIdentical "^\%(SL\|HG\): ファイル.*と.*は同一$" +syn match hgDiffDiffer "^\%(SL\|HG\): ファイル.*と.*は違います$" +syn match hgDiffBDiffer "^\%(SL\|HG\): バイナリー・ファイル.*と.*は違います$" +syn match hgDiffIsA "^\%(SL\|HG\): ファイル.*は.*、ファイル.*は.*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ ファイル末尾に改行がありません" +syn match hgDiffCommon "^\%(SL\|HG\): 共通の下位ディレクトリー: .*と.*" + +" ja DiffUtils 3.3 +syn match hgDiffOnly "^\%(SL\|HG\): .* のみに存在: .*" +syn match hgDiffIdentical "^\%(SL\|HG\): ファイル .* と .* は同一です$" +syn match hgDiffDiffer "^\%(SL\|HG\): ファイル .* と .* は異なります$" +syn match hgDiffBDiffer "^\%(SL\|HG\): バイナリーファイル .* と.* は異なります$" +syn match hgDiffIsA "^\%(SL\|HG\): ファイル .* は .* です。一方、ファイル .* は .* です$" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ ファイル末尾に改行がありません" +syn match hgDiffCommon "^\%(SL\|HG\): 共通のサブディレクトリー: .* と .*" + +" lv +syn match hgDiffOnly "^\%(SL\|HG\): Tikai iekš .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Fails .* un .* ir identiski$" +syn match hgDiffDiffer "^\%(SL\|HG\): Faili .* un .* atšķiras$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Faili .* un .* atšķiras$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binārie faili .* un .* atšķiras$" +syn match hgDiffIsA "^\%(SL\|HG\): Fails .* ir .* kamēr fails .* ir .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Nav jaunu rindu faila beigās" +syn match hgDiffCommon "^\%(SL\|HG\): Kopējās apakšdirektorijas: .* un .*" + +" ms +syn match hgDiffOnly "^\%(SL\|HG\): Hanya dalam .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Fail .* dan .* adalah serupa$" +syn match hgDiffDiffer "^\%(SL\|HG\): Fail .* dan .* berbeza$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Fail .* dan .* berbeza$" +syn match hgDiffIsA "^\%(SL\|HG\): Fail .* adalah .* manakala fail .* adalah .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Tiada baris baru pada penghujung fail" +syn match hgDiffCommon "^\%(SL\|HG\): Subdirektori umum: .* dan .*" + +" nl +syn match hgDiffOnly "^\%(SL\|HG\): Alleen in .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Bestanden .* en .* zijn identiek$" +syn match hgDiffDiffer "^\%(SL\|HG\): Bestanden .* en .* zijn verschillend$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Bestanden .* en .* zijn verschillend$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binaire bestanden .* en .* zijn verschillend$" +syn match hgDiffIsA "^\%(SL\|HG\): Bestand .* is een .* terwijl bestand .* een .* is$" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Geen regeleindeteken (LF) aan einde van bestand" +syn match hgDiffCommon "^\%(SL\|HG\): Gemeenschappelijke submappen: .* en .*" + +" pl +syn match hgDiffOnly "^\%(SL\|HG\): Tylko w .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Pliki .* i .* są identyczne$" +syn match hgDiffDiffer "^\%(SL\|HG\): Pliki .* i .* różnią się$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Pliki .* i .* różnią się$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Binarne pliki .* i .* różnią się$" +syn match hgDiffIsA "^\%(SL\|HG\): Plik .* jest .*, podczas gdy plik .* jest .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Brak znaku nowej linii na końcu pliku" +syn match hgDiffCommon "^\%(SL\|HG\): Wspólne podkatalogi: .* i .*" + +" pt_BR +syn match hgDiffOnly "^\%(SL\|HG\): Somente em .*" +syn match hgDiffOnly "^\%(SL\|HG\): Apenas em .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Os aquivos .* e .* são idênticos$" +syn match hgDiffDiffer "^\%(SL\|HG\): Os arquivos .* e .* são diferentes$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Os arquivos binários .* e .* são diferentes$" +syn match hgDiffIsA "^\%(SL\|HG\): O arquivo .* é .* enquanto o arquivo .* é .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Falta o caracter nova linha no final do arquivo" +syn match hgDiffCommon "^\%(SL\|HG\): Subdiretórios idênticos: .* e .*" + +" ro +syn match hgDiffOnly "^\%(SL\|HG\): Doar în .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Fişierele .* şi .* sunt identice$" +syn match hgDiffDiffer "^\%(SL\|HG\): Fişierele .* şi .* diferă$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Fişierele binare .* şi .* diferă$" +syn match hgDiffIsA "^\%(SL\|HG\): Fişierul .* este un .* pe când fişierul .* este un .*.$" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Nici un element de linie nouă la sfârşitul fişierului" +syn match hgDiffCommon "^\%(SL\|HG\): Subdirectoare comune: .* şi .*.$" + +" ru +syn match hgDiffOnly "^\%(SL\|HG\): Только в .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Файлы .* и .* идентичны$" +syn match hgDiffDiffer "^\%(SL\|HG\): Файлы .* и .* различаются$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Файлы .* и .* различаются$" +syn match hgDiffIsA "^\%(SL\|HG\): Файл .* это .*, тогда как файл .* -- .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ В конце файла нет новой строки" +syn match hgDiffCommon "^\%(SL\|HG\): Общие подкаталоги: .* и .*" + +" sr +syn match hgDiffOnly "^\%(SL\|HG\): Само у .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Датотеке „.*“ и „.*“ се подударају$" +syn match hgDiffDiffer "^\%(SL\|HG\): Датотеке .* и .* различите$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Бинарне датотеке .* и .* различите$" +syn match hgDiffIsA "^\%(SL\|HG\): Датотека „.*“ је „.*“ док је датотека „.*“ „.*“$" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Без новог реда на крају датотеке" +syn match hgDiffCommon "^\%(SL\|HG\): Заједнички поддиректоријуми: .* и .*" + +" sv +syn match hgDiffOnly "^\%(SL\|HG\): Endast i .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Filerna .* och .* är lika$" +syn match hgDiffDiffer "^\%(SL\|HG\): Filerna .* och .* skiljer$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Filerna .* och .* skiljer$" +syn match hgDiffIsA "^\%(SL\|HG\): Fil .* är en .* medan fil .* är en .*" +syn match hgDiffBDiffer "^\%(SL\|HG\): De binära filerna .* och .* skiljer$" +syn match hgDiffIsA "^\%(SL\|HG\): Filen .* är .* medan filen .* är .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Ingen nyrad vid filslut" +syn match hgDiffCommon "^\%(SL\|HG\): Lika underkataloger: .* och .*" + +" tr +syn match hgDiffOnly "^\%(SL\|HG\): Yalnızca .*'da: .*" +syn match hgDiffIdentical "^\%(SL\|HG\): .* ve .* dosyaları birbirinin aynı$" +syn match hgDiffDiffer "^\%(SL\|HG\): .* ve .* dosyaları birbirinden farklı$" +syn match hgDiffBDiffer "^\%(SL\|HG\): .* ve .* dosyaları birbirinden farklı$" +syn match hgDiffBDiffer "^\%(SL\|HG\): İkili .* ve .* birbirinden farklı$" +syn match hgDiffIsA "^\%(SL\|HG\): .* dosyası, bir .*, halbuki .* dosyası bir .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Dosya sonunda yenisatır yok." +syn match hgDiffCommon "^\%(SL\|HG\): Ortak alt dizinler: .* ve .*" + +" uk +syn match hgDiffOnly "^\%(SL\|HG\): Лише у .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Файли .* та .* ідентичні$" +syn match hgDiffDiffer "^\%(SL\|HG\): Файли .* та .* відрізняються$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Файли .* та .* відрізняються$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Двійкові файли .* та .* відрізняються$" +syn match hgDiffIsA "^\%(SL\|HG\): Файл .* це .*, тоді як файл .* -- .*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Наприкінці файлу немає нового рядка" +syn match hgDiffCommon "^\%(SL\|HG\): Спільні підкаталоги: .* та .*" + +" vi +syn match hgDiffOnly "^\%(SL\|HG\): Chỉ trong .*" +syn match hgDiffIdentical "^\%(SL\|HG\): Hai tập tin .* và .* là bằng nhau.$" +syn match hgDiffIdentical "^\%(SL\|HG\): Cả .* và .* là cùng một tập tin$" +syn match hgDiffDiffer "^\%(SL\|HG\): Hai tập tin .* và .* là khác nhau.$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Hai tập tin nhị phân .* và .* khác nhau$" +syn match hgDiffIsA "^\%(SL\|HG\): Tập tin .* là một .* trong khi tập tin .* là một .*.$" +syn match hgDiffBDiffer "^\%(SL\|HG\): Hai tập tin .* và .* là khác nhau.$" +syn match hgDiffIsA "^\%(SL\|HG\): Tập tin .* là một .* còn tập tin .* là một .*.$" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ Không có ký tự dòng mới tại kêt thức tập tin." +syn match hgDiffCommon "^\%(SL\|HG\): Thư mục con chung: .* và .*" + +" zh_CN +syn match hgDiffOnly "^\%(SL\|HG\): 只在 .* 存在:.*" +syn match hgDiffIdentical "^\%(SL\|HG\): 檔案 .* 和 .* 相同$" +syn match hgDiffDiffer "^\%(SL\|HG\): 文件 .* 和 .* 不同$" +syn match hgDiffBDiffer "^\%(SL\|HG\): 文件 .* 和 .* 不同$" +syn match hgDiffIsA "^\%(SL\|HG\): 文件 .* 是.*而文件 .* 是.*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ 文件尾没有 newline 字符" +syn match hgDiffCommon "^\%(SL\|HG\): .* 和 .* 有共同的子目录$" + +" zh_TW +syn match hgDiffOnly "^\%(SL\|HG\): 只在 .* 存在:.*" +syn match hgDiffIdentical "^\%(SL\|HG\): 檔案 .* 和 .* 相同$" +syn match hgDiffDiffer "^\%(SL\|HG\): 檔案 .* 與 .* 不同$" +syn match hgDiffBDiffer "^\%(SL\|HG\): 二元碼檔 .* 與 .* 不同$" +syn match hgDiffIsA "^\%(SL\|HG\): 檔案 .* 是.*而檔案 .* 是.*" +syn match hgDiffNoEOL "^\%(SL\|HG\): \\ 檔案末沒有 newline 字元" +syn match hgDiffCommon "^\%(SL\|HG\): .* 和 .* 有共同的副目錄$" + +endif + + +syn match hgDiffRemoved "^\%(SL\|HG\): -.*" +syn match hgDiffRemoved "^\%(SL\|HG\): <.*" +syn match hgDiffAdded "^\%(SL\|HG\): +.*" +syn match hgDiffAdded "^\%(SL\|HG\): >.*" +syn match hgDiffChanged "^\%(SL\|HG\): ! .*" + +syn match hgDiffSubname " @@..*"ms=s+3 contained +syn match hgDiffLine "^\%(SL\|HG\): @.*" contains=hgDiffSubname +syn match hgDiffLine "^\%(SL\|HG\): \<\d\+\>.*" +syn match hgDiffLine "^\%(SL\|HG\): \*\*\*\*.*" +syn match hgDiffLine "^\%(SL\|HG\): ---$" + +" Some versions of diff have lines like "#c#" and "#d#" (where # is a number) +syn match hgDiffLine "^\%(SL\|HG\): \d\+\(,\d\+\)\=[cda]\d\+\>.*" + +syn match hgDiffFile "^\%(SL\|HG\): diff\>.*" +syn match hgDiffFile "^\%(SL\|HG\): Index: .*" +syn match hgDiffFile "^\%(SL\|HG\): ==== .*" + +if search('^\%(SL\|HG\): @@ -\S\+ +\S\+ @@', 'nw', '', 100) + " unified + syn match hgDiffOldFile "^\%(SL\|HG\): --- .*" + syn match hgDiffNewFile "^\%(SL\|HG\): +++ .*" +else + " context / old style + syn match hgDiffOldFile "^\%(SL\|HG\): \*\*\* .*" + syn match hgDiffNewFile "^\%(SL\|HG\): --- .*" +endif + +" Used by git +syn match hgDiffIndexLine "^\%(SL\|HG\): index \x\x\x\x.*" + +syn match hgDiffComment "^\%(SL\|HG\): #.*" + +" Define the default highlighting. +" Only used when an item doesn't have highlighting yet +hi def link hgDiffOldFile hgDiffFile +hi def link hgDiffNewFile hgDiffFile +hi def link hgDiffIndexLine PreProc +hi def link hgDiffFile Type +hi def link hgDiffOnly Constant +hi def link hgDiffIdentical Constant +hi def link hgDiffDiffer Constant +hi def link hgDiffBDiffer Constant +hi def link hgDiffIsA Constant +hi def link hgDiffNoEOL Constant +hi def link hgDiffCommon Constant +hi def link hgDiffRemoved Special +hi def link hgDiffChanged PreProc +hi def link hgDiffAdded Identifier +hi def link hgDiffLine Statement +hi def link hgDiffSubname PreProc +hi def link hgDiffComment Comment + +let b:current_syntax = "hgcommitDiff" + +" vim: ts=8 sw=2 diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 26c0e9343c..a1c39e4dcf 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -451,7 +451,7 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror") syn match vimBufnrWarn /\<bufnr\s*(\s*["']\.['"]\s*)/ endif -syn match vimNotFunc "\<if\>\|\<el\%[seif]\>\|\<return\>\|\<while\>" skipwhite nextgroup=vimOper,vimOperParen,vimVar,vimFunc,vimNotation +syn match vimNotFunc "\<if\>\|\<el\%[seif]\>\|\<retu\%[rn]\>\|\<while\>" skipwhite nextgroup=vimOper,vimOperParen,vimVar,vimFunc,vimNotation " Norm: {{{2 " ==== diff --git a/scripts/cliff.toml b/scripts/cliff.toml new file mode 100644 index 0000000000..3fc10e5d16 --- /dev/null +++ b/scripts/cliff.toml @@ -0,0 +1,73 @@ +# configuration file for git-cliff (0.1.0) + +[changelog] +# changelog header +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" +# template for the changelog body +# https://tera.netlify.app/docs/#introduction +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | upper_first }} + {% for commit in commits%}\ + {% if not commit.scope %}\ + - {{ commit.message | upper_first }} + {% endif %}\ + {% endfor %}\ + {% for group, commits in commits | group_by(attribute="scope") %}\ + {% for commit in commits %}\ + - **{{commit.scope}}**: {{ commit.message | upper_first }} + {% endfor %}\ + {% endfor %} +{% endfor %}\n +""" +# remove the leading and trailing whitespace from the template +trim = true +# changelog footer +footer = """ +<!-- generated by git-cliff --> +""" + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = true +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [ +# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/neovim/neovim/issues/${2}))"}, +] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "!:", group = "Breaking"}, + { message = "^feat", group = "Features"}, + { message = "^fix", group = "Bug Fixes"}, + { message = "^doc", group = "Documentation"}, + { message = "^perf", group = "Performance"}, + { message = "^refactor", group = "Refactor"}, + { message = "^test", group = "Testing"}, + { message = "^chore", group = "Miscellaneous Tasks"}, + { message = "^build", group = "Build System"}, + { message = "^Revert", group = "Reverted Changes"}, +] +# filter out the commits that are not matched by commit parsers +filter_commits = true +# glob pattern for matching git tags +tag_pattern = "v[0-9]*" +# regex for skipping tags +skip_tags = "v0.1.0-beta.1" +# regex for ignoring tags +ignore_tags = "" +# sort the tags chronologically +date_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "oldest" diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua index 78fb917764..4f42633c57 100644 --- a/scripts/gen_help_html.lua +++ b/scripts/gen_help_html.lua @@ -88,7 +88,6 @@ local exclude_invalid_urls = { ["http://papp.plan9.de"] = "syntax.txt", ["http://wiki.services.openoffice.org/wiki/Dictionaries"] = "spell.txt", ["http://www.adapower.com"] = "ft_ada.txt", - ["http://www.ghostscript.com/"] = "print.txt", ["http://www.jclark.com/"] = "quickfix.txt", } diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index e676705560..f9f7330097 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -193,15 +193,15 @@ preprocess_patch() { 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/\<\%('"${na_files}"'\)\>@norm! d/\v(^diff)|%$
' +w +q "$file" # Remove *.proto, Make*, INSTALL*, gui_*, beval.*, some if_*, gvim, libvterm, tee, VisVim, xpm, xxd - local na_src='auto\|configure.*\|GvimExt\|libvterm\|proto\|tee\|VisVim\|xpm\|xxd\|Make.*\|INSTALL.*\|beval.*\|gui.*\|if_cscop\|if_lua\|if_mzsch\|if_olepp\|if_ole\|if_perl\|if_py\|if_ruby\|if_tcl\|if_xcmdsrv' + local na_src='auto\|configure.*\|GvimExt\|hardcopy.*\|libvterm\|proto\|tee\|VisVim\|xpm\|xxd\|Make.*\|INSTALL.*\|beval.*\|gui.*\|if_cscop\|if_lua\|if_mzsch\|if_olepp\|if_ole\|if_perl\|if_py\|if_ruby\|if_tcl\|if_xcmdsrv' 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/\S*\<\%(testdir/\)\@<!\%('"${na_src}"'\)\>@norm! d/\v(^diff)|%$
' +w +q "$file" # Remove runtime files ported to Lua. - local na_rt='filetype\.vim\|scripts\.vim\|autoload\/ft\/dist\.vim' + local na_rt='filetype\.vim\|scripts\.vim\|autoload\/ft\/dist\.vim\|print\/.*' 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/\<\%('"${na_rt}"'\)\>@norm! d/\v(^diff)|%$
' +w +q "$file" # Remove unwanted Vim doc files. - local na_doc='channel\.txt\|if_cscop\.txt\|netbeans\.txt\|os_\w\+\.txt\|term\.txt\|todo\.txt\|version\d\.txt\|vim9\.txt\|sponsor\.txt\|intro\.txt\|tags' + local na_doc='channel\.txt\|if_cscop\.txt\|netbeans\.txt\|os_\w\+\.txt\|print\.txt\|term\.txt\|todo\.txt\|version\d\.txt\|vim9\.txt\|sponsor\.txt\|intro\.txt\|tags' 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/\<\%('"${na_doc}"'\)\>@norm! d/\v(^diff)|%$
' +w +q "$file" # Remove "Last change ..." changes in doc files. @@ -212,7 +212,7 @@ preprocess_patch() { 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/\<\%('"${na_src_testdir}"'\)\>@norm! d/\v(^diff)|%$
' +w +q "$file" # Remove testdir/test_*.vim files - local na_src_testdir='balloon.*\|channel.*\|crypt\.vim\|cscope\.vim\|gui.*\|job_fails\.vim\|json\.vim\|mzscheme\.vim\|netbeans.*\|paste\.vim\|popupwin.*\|restricted\.vim\|shortpathname\.vim\|tcl\.vim\|terminal.*\|xxd\.vim' + local na_src_testdir='balloon.*\|channel.*\|crypt\.vim\|cscope\.vim\|gui.*\|hardcopy\.vim\|job_fails\.vim\|json\.vim\|mzscheme\.vim\|netbeans.*\|paste\.vim\|popupwin.*\|restricted\.vim\|shortpathname\.vim\|tcl\.vim\|terminal.*\|xxd\.vim' 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/\<test_\%('"${na_src_testdir}"'\)\>@norm! d/\v(^diff)|%$
' +w +q "$file" # Remove version.c #7555 diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 5a64128bcb..6b92d0caa8 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -39,7 +39,6 @@ set(GENERATED_FUNCS_METADATA ${GENERATED_DIR}/api/private/funcs_metadata.generat set(GENERATED_UI_EVENTS ${GENERATED_DIR}/ui_events.generated.h) set(GENERATED_UI_EVENTS_CALL ${GENERATED_DIR}/ui_events_call.generated.h) set(GENERATED_UI_EVENTS_REMOTE ${GENERATED_DIR}/ui_events_remote.generated.h) -set(GENERATED_UI_EVENTS_BRIDGE ${GENERATED_DIR}/ui_events_bridge.generated.h) set(GENERATED_UI_EVENTS_CLIENT ${GENERATED_DIR}/ui_events_client.generated.h) set(GENERATED_UI_EVENTS_METADATA ${GENERATED_DIR}/api/private/ui_events_metadata.generated.h) set(GENERATED_EX_CMDS_ENUM ${GENERATED_INCLUDES_DIR}/ex_cmds_enum.generated.h) @@ -111,9 +110,6 @@ foreach(subdir viml viml/parser ) - if(${subdir} MATCHES "tui" AND NOT FEAT_TUI) - continue() - endif() file(MAKE_DIRECTORY ${GENERATED_DIR}/${subdir}) file(MAKE_DIRECTORY ${GENERATED_INCLUDES_DIR}/${subdir}) @@ -220,7 +216,6 @@ foreach(sfile ${NVIM_SOURCES} ${GENERATED_API_DISPATCH} "${GENERATED_UI_EVENTS_CALL}" "${GENERATED_UI_EVENTS_REMOTE}" - "${GENERATED_UI_EVENTS_BRIDGE}" "${GENERATED_KEYSETS}" "${GENERATED_UI_EVENTS_CLIENT}" ) @@ -318,7 +313,6 @@ add_custom_command( OUTPUT ${GENERATED_UI_EVENTS} ${GENERATED_UI_EVENTS_CALL} ${GENERATED_UI_EVENTS_REMOTE} - ${GENERATED_UI_EVENTS_BRIDGE} ${GENERATED_UI_EVENTS_METADATA} ${GENERATED_UI_EVENTS_CLIENT} COMMAND ${LUA_PRG} ${API_UI_EVENTS_GENERATOR} ${CMAKE_CURRENT_LIST_DIR} @@ -326,7 +320,6 @@ add_custom_command( ${GENERATED_UI_EVENTS} ${GENERATED_UI_EVENTS_CALL} ${GENERATED_UI_EVENTS_REMOTE} - ${GENERATED_UI_EVENTS_BRIDGE} ${GENERATED_UI_EVENTS_METADATA} ${GENERATED_UI_EVENTS_CLIENT} DEPENDS diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c index f7c6b398d5..992c134a0f 100644 --- a/src/nvim/api/extmark.c +++ b/src/nvim/api/extmark.c @@ -256,8 +256,8 @@ ArrayOf(Integer) nvim_buf_get_extmark_by_id(Buffer buffer, Integer ns_id, /// positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1) /// respectively, thus the following are equivalent: /// <pre>lua -/// nvim_buf_get_extmarks(0, my_ns, 0, -1, {}) -/// nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {}) +/// vim.api.nvim_buf_get_extmarks(0, my_ns, 0, -1, {}) +/// vim.api.nvim_buf_get_extmarks(0, my_ns, {0,0}, {-1,-1}, {}) /// </pre> /// /// If `end` is less than `start`, traversal works backwards. (Useful diff --git a/src/nvim/api/keysets.lua b/src/nvim/api/keysets.lua index 8ded9cfa5d..8f909e937f 100644 --- a/src/nvim/api/keysets.lua +++ b/src/nvim/api/keysets.lua @@ -126,6 +126,8 @@ return { "global_link"; "fallback"; "blend"; + "fg_indexed"; + "bg_indexed"; }; highlight_cterm = { "bold"; diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index aeccddb9ea..e4134133ac 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -14,9 +14,6 @@ #include "nvim/api/private/helpers.h" #include "nvim/api/ui.h" #include "nvim/channel.h" -#include "nvim/event/loop.h" -#include "nvim/event/wstream.h" -#include "nvim/globals.h" #include "nvim/grid.h" #include "nvim/highlight.h" #include "nvim/main.h" @@ -30,6 +27,7 @@ #include "nvim/types.h" #include "nvim/ui.h" #include "nvim/vim.h" +#include "nvim/window.h" typedef struct { uint64_t channel_id; @@ -285,6 +283,19 @@ void ui_attach(uint64_t channel_id, Integer width, Integer height, Boolean enabl api_free_dictionary(opts); } +/// Tells the nvim server if focus was gained or lost by the GUI +void nvim_ui_set_focus(uint64_t channel_id, Boolean gained, Error *error) + FUNC_API_SINCE(11) FUNC_API_REMOTE_ONLY +{ + if (!pmap_has(uint64_t)(&connected_uis, channel_id)) { + api_set_error(error, kErrorTypeException, + "UI not attached to channel: %" PRId64, channel_id); + return; + } + + do_autocmd_focusgained((bool)gained); +} + /// Deactivates UI events on the channel. /// /// Removes the client from the list of UIs. |nvim_list_uis()| @@ -404,6 +415,24 @@ static void ui_set_option(UI *ui, bool init, String name, Object value, Error *e return; } + if (strequal(name.data, "stdin_tty")) { + if (value.type != kObjectTypeBoolean) { + api_set_error(error, kErrorTypeValidation, "stdin_tty must be a Boolean"); + return; + } + stdin_isatty = value.data.boolean; + return; + } + + if (strequal(name.data, "stdout_tty")) { + if (value.type != kObjectTypeBoolean) { + api_set_error(error, kErrorTypeValidation, "stdout_tty must be a Boolean"); + return; + } + stdout_isatty = value.data.boolean; + return; + } + // LEGACY: Deprecated option, use `ext_cmdline` instead. bool is_popupmenu = strequal(name.data, "popupmenu_external"); diff --git a/src/nvim/api/ui_events.in.h b/src/nvim/api/ui_events.in.h index 21400862b9..d5c79272b7 100644 --- a/src/nvim/api/ui_events.in.h +++ b/src/nvim/api/ui_events.in.h @@ -31,7 +31,7 @@ void visual_bell(void) void flush(void) FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL; void suspend(void) - FUNC_API_SINCE(3) FUNC_API_BRIDGE_IMPL; + FUNC_API_SINCE(3); void set_title(String title) FUNC_API_SINCE(3); void set_icon(String icon) @@ -39,7 +39,7 @@ void set_icon(String icon) void screenshot(String path) FUNC_API_SINCE(7) FUNC_API_REMOTE_IMPL; void option_set(String name, Object value) - FUNC_API_SINCE(4) FUNC_API_BRIDGE_IMPL; + FUNC_API_SINCE(4); // Stop event is not exported as such, represented by EOF in the msgpack stream. void stop(void) FUNC_API_NOEXPORT; @@ -73,9 +73,9 @@ void default_colors_set(Integer rgb_fg, Integer rgb_bg, Integer rgb_sp, Integer Integer cterm_bg) FUNC_API_SINCE(4) FUNC_API_REMOTE_IMPL; void hl_attr_define(Integer id, HlAttrs rgb_attrs, HlAttrs cterm_attrs, Array info) - FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL FUNC_API_BRIDGE_IMPL; + FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL; void hl_group_set(String name, Integer id) - FUNC_API_SINCE(6) FUNC_API_BRIDGE_IMPL; + FUNC_API_SINCE(6); void grid_resize(Integer grid, Integer width, Integer height) FUNC_API_SINCE(5) FUNC_API_REMOTE_IMPL FUNC_API_COMPOSITOR_IMPL FUNC_API_CLIENT_IMPL; void grid_clear(Integer grid) @@ -112,8 +112,9 @@ void win_hide(Integer grid) FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY; void win_close(Integer grid) FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY; + void msg_set_pos(Integer grid, Integer row, Boolean scrolled, String sep_char) - FUNC_API_SINCE(6) FUNC_API_BRIDGE_IMPL FUNC_API_COMPOSITOR_IMPL; + FUNC_API_SINCE(6) FUNC_API_COMPOSITOR_IMPL; void win_viewport(Integer grid, Window win, Integer topline, Integer botline, Integer curline, Integer curcol, Integer line_count) @@ -149,11 +150,11 @@ void cmdline_block_hide(void) FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; void wildmenu_show(Array items) - FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL FUNC_API_BRIDGE_IMPL; + FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL; void wildmenu_select(Integer selected) - FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL FUNC_API_BRIDGE_IMPL; + FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL; void wildmenu_hide(void) - FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL FUNC_API_BRIDGE_IMPL; + FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL; void msg_show(String kind, Array content, Boolean replace_last) FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY; diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c index 828ef2f0eb..56d5f8fb16 100644 --- a/src/nvim/api/win_config.c +++ b/src/nvim/api/win_config.c @@ -141,7 +141,7 @@ /// will only make vertical borders but not horizontal ones. /// By default, `FloatBorder` highlight is used, which links to `WinSeparator` /// when not defined. It could also be specified by character: -/// [ {"+", "MyCorner"}, {"x", "MyBorder"} ]. +/// [ ["+", "MyCorner"], ["x", "MyBorder"] ]. /// - title: Title (optional) in window border, String or list. /// List is [text, highlight] tuples. if is string the default /// highlight group is `FloatTitle`. diff --git a/src/nvim/arglist.c b/src/nvim/arglist.c index 64d77a7ecc..c6a4be7e13 100644 --- a/src/nvim/arglist.c +++ b/src/nvim/arglist.c @@ -631,50 +631,52 @@ void do_argfile(exarg_T *eap, int argn) } else { emsg(_("E165: Cannot go beyond last file")); } - } else { - setpcmark(); - // split window or create new tab page first - if (*eap->cmd == 's' || cmdmod.cmod_tab != 0) { - if (win_split(0, 0) == FAIL) { - return; - } - RESET_BINDING(curwin); - } else { - // if 'hidden' set, only check for changed file when re-editing - // the same buffer - other = true; - if (buf_hide(curbuf)) { - p = fix_fname(alist_name(&ARGLIST[argn])); - other = otherfile(p); - xfree(p); - } - if ((!buf_hide(curbuf) || !other) - && check_changed(curbuf, CCGD_AW - | (other ? 0 : CCGD_MULTWIN) - | (eap->forceit ? CCGD_FORCEIT : 0) - | CCGD_EXCMD)) { - return; - } - } + return; + } - curwin->w_arg_idx = argn; - if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist) { - arg_had_last = true; - } + setpcmark(); - // Edit the file; always use the last known line number. - // When it fails (e.g. Abort for already edited file) restore the - // argument index. - if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, - eap, ECMD_LAST, - (buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0) - + (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL) { - curwin->w_arg_idx = old_arg_idx; - } else if (eap->cmdidx != CMD_argdo) { - // like Vi: set the mark where the cursor is in the file. - setmark('\''); + // split window or create new tab page first + if (*eap->cmd == 's' || cmdmod.cmod_tab != 0) { + if (win_split(0, 0) == FAIL) { + return; + } + RESET_BINDING(curwin); + } else { + // if 'hidden' set, only check for changed file when re-editing + // the same buffer + other = true; + if (buf_hide(curbuf)) { + p = fix_fname(alist_name(&ARGLIST[argn])); + other = otherfile(p); + xfree(p); } + if ((!buf_hide(curbuf) || !other) + && check_changed(curbuf, CCGD_AW + | (other ? 0 : CCGD_MULTWIN) + | (eap->forceit ? CCGD_FORCEIT : 0) + | CCGD_EXCMD)) { + return; + } + } + + curwin->w_arg_idx = argn; + if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist) { + arg_had_last = true; + } + + // Edit the file; always use the last known line number. + // When it fails (e.g. Abort for already edited file) restore the + // argument index. + if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, + eap, ECMD_LAST, + (buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0) + + (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL) { + curwin->w_arg_idx = old_arg_idx; + } else if (eap->cmdidx != CMD_argdo) { + // like Vi: set the mark where the cursor is in the file. + setmark('\''); } } diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index ab6c22ff6c..3ed3f7edf2 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -2732,22 +2732,7 @@ void do_autocmd_uienter(uint64_t chanid, bool attached) // FocusGained -static void focusgained_event(void **argv) -{ - bool *gainedp = argv[0]; - do_autocmd_focusgained(*gainedp); - xfree(gainedp); -} - -void autocmd_schedule_focusgained(bool gained) -{ - bool *gainedp = xmalloc(sizeof(*gainedp)); - *gainedp = gained; - loop_schedule_deferred(&main_loop, - event_create(focusgained_event, 1, gainedp)); -} - -static void do_autocmd_focusgained(bool gained) +void do_autocmd_focusgained(bool gained) { static bool recursive = false; static Timestamp last_time = (time_t)0; diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 0c74ccf0f4..239f2aa8ba 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -178,15 +178,17 @@ static int read_buffer(int read_stdin, exarg_T *eap, int flags) /// Ensure buffer "buf" is loaded. Does not trigger the swap-exists action. void buffer_ensure_loaded(buf_T *buf) { - if (buf->b_ml.ml_mfp == NULL) { - aco_save_T aco; - - // Make sure the buffer is in a window. - aucmd_prepbuf(&aco, buf); - swap_exists_action = SEA_NONE; - open_buffer(false, NULL, 0); - aucmd_restbuf(&aco); + if (buf->b_ml.ml_mfp != NULL) { + return; } + + aco_save_T aco; + + // Make sure the buffer is in a window. + aucmd_prepbuf(&aco, buf); + swap_exists_action = SEA_NONE; + open_buffer(false, NULL, 0); + aucmd_restbuf(&aco); } /// Open current buffer, that is: open the memfile and read the file into @@ -2903,18 +2905,20 @@ int setfname(buf_T *buf, char *ffname_arg, char *sfname_arg, bool message) void buf_set_name(int fnum, char *name) { buf_T *buf = buflist_findnr(fnum); - if (buf != NULL) { - if (buf->b_sfname != buf->b_ffname) { - xfree(buf->b_sfname); - } - xfree(buf->b_ffname); - buf->b_ffname = xstrdup(name); - buf->b_sfname = NULL; - // Allocate ffname and expand into full path. Also resolves .lnk - // files on Win32. - fname_expand(buf, &buf->b_ffname, &buf->b_sfname); - buf->b_fname = buf->b_sfname; + if (buf == NULL) { + return; } + + if (buf->b_sfname != buf->b_ffname) { + xfree(buf->b_sfname); + } + xfree(buf->b_ffname); + buf->b_ffname = xstrdup(name); + buf->b_sfname = NULL; + // Allocate ffname and expand into full path. Also resolves .lnk + // files on Win32. + fname_expand(buf, &buf->b_ffname, &buf->b_sfname); + buf->b_fname = buf->b_sfname; } /// Take care of what needs to be done when the name of buffer "buf" has changed. @@ -4138,13 +4142,15 @@ char *buf_get_fname(const buf_T *buf) /// Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed. void set_buflisted(int on) { - if (on != curbuf->b_p_bl) { - curbuf->b_p_bl = on; - if (on) { - apply_autocmds(EVENT_BUFADD, NULL, NULL, false, curbuf); - } else { - apply_autocmds(EVENT_BUFDELETE, NULL, NULL, false, curbuf); - } + if (on == curbuf->b_p_bl) { + return; + } + + curbuf->b_p_bl = on; + if (on) { + apply_autocmds(EVENT_BUFADD, NULL, NULL, false, curbuf); + } else { + apply_autocmds(EVENT_BUFDELETE, NULL, NULL, false, curbuf); } } diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 90fdaf9d3b..df4ebdffc0 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -903,7 +903,8 @@ struct tabpage_S { win_T *tp_firstwin; ///< first window in this Tab page win_T *tp_lastwin; ///< last window in this Tab page long tp_old_Rows_avail; ///< ROWS_AVAIL when Tab page was left - long tp_old_Columns; ///< Columns when Tab page was left + long tp_old_Columns; ///< Columns when Tab page was left, -1 when + ///< calling win_new_screen_cols() postponed long tp_ch_used; ///< value of 'cmdheight' when frame size was set diff_T *tp_first_diff; diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 7bae8dff00..8cb4a723e7 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -672,25 +672,6 @@ int eval_charconvert(const char *const enc_from, const char *const enc_to, return OK; } -int eval_printexpr(const char *const fname, const char *const args) -{ - bool err = false; - - set_vim_var_string(VV_FNAME_IN, fname, -1); - set_vim_var_string(VV_CMDARG, args, -1); - if (eval_to_bool(p_pexpr, &err, NULL, false)) { - err = true; - } - set_vim_var_string(VV_FNAME_IN, NULL, -1); - set_vim_var_string(VV_CMDARG, NULL, -1); - - if (err) { - os_remove(fname); - return FAIL; - } - return OK; -} - void eval_diff(const char *const origfile, const char *const newfile, const char *const outfile) { bool err = false; @@ -1018,13 +999,15 @@ void prepare_vimvar(int idx, typval_T *save_tv) void restore_vimvar(int idx, typval_T *save_tv) { vimvars[idx].vv_tv = *save_tv; - if (vimvars[idx].vv_type == VAR_UNKNOWN) { - hashitem_T *hi = hash_find(&vimvarht, (char *)vimvars[idx].vv_di.di_key); - if (HASHITEM_EMPTY(hi)) { - internal_error("restore_vimvar()"); - } else { - hash_remove(&vimvarht, hi); - } + if (vimvars[idx].vv_type != VAR_UNKNOWN) { + return; + } + + hashitem_T *hi = hash_find(&vimvarht, (char *)vimvars[idx].vv_di.di_key); + if (HASHITEM_EMPTY(hi)) { + internal_error("restore_vimvar()"); + } else { + hash_remove(&vimvarht, hi); } } @@ -6685,12 +6668,13 @@ void set_vim_var_dict(const VimVarIndex idx, dict_T *const val) tv_clear(&vimvars[idx].vv_di.di_tv); vimvars[idx].vv_type = VAR_DICT; vimvars[idx].vv_dict = val; - - if (val != NULL) { - val->dv_refcount++; - // Set readonly - tv_dict_set_keys_readonly(val); + if (val == NULL) { + return; } + + val->dv_refcount++; + // Set readonly + tv_dict_set_keys_readonly(val); } /// Set the v:argv list. diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 94c9ac7e6c..77e8e23ab6 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -1216,19 +1216,21 @@ static void f_debugbreak(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) int pid = (int)tv_get_number(&argvars[0]); if (pid == 0) { emsg(_(e_invarg)); - } else { + return; + } + #ifdef MSWIN - HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); + HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); + if (hProcess == NULL) { + return; + } - if (hProcess != NULL) { - DebugBreakProcess(hProcess); - CloseHandle(hProcess); - rettv->vval.v_number = OK; - } + DebugBreakProcess(hProcess); + CloseHandle(hProcess); + rettv->vval.v_number = OK; #else - uv_kill(pid, SIGINT); + uv_kill(pid, SIGINT); #endif - } } /// "deepcopy()" function @@ -2099,14 +2101,16 @@ static void f_float2nr(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) { float_T f; - if (tv_get_float_chk(argvars, &f)) { - if (f <= (float_T) - VARNUMBER_MAX + DBL_EPSILON) { - rettv->vval.v_number = -VARNUMBER_MAX; - } else if (f >= (float_T)VARNUMBER_MAX - DBL_EPSILON) { - rettv->vval.v_number = VARNUMBER_MAX; - } else { - rettv->vval.v_number = (varnumber_T)f; - } + if (!tv_get_float_chk(argvars, &f)) { + return; + } + + if (f <= (float_T) - VARNUMBER_MAX + DBL_EPSILON) { + rettv->vval.v_number = -VARNUMBER_MAX; + } else if (f >= (float_T)VARNUMBER_MAX - DBL_EPSILON) { + rettv->vval.v_number = VARNUMBER_MAX; + } else { + rettv->vval.v_number = (varnumber_T)f; } } @@ -3109,8 +3113,6 @@ static void f_has(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) "packages", "path_extra", "persistent_undo", - "postscript", - "printer", "profile", "pythonx", "reltime", @@ -3435,33 +3437,36 @@ static void f_index(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) emsg(_(e_listblobreq)); return; } + list_T *const l = argvars[0].vval.v_list; - if (l != NULL) { - listitem_T *item = tv_list_first(l); - if (argvars[2].v_type != VAR_UNKNOWN) { - bool error = false; + if (l == NULL) { + return; + } - // Start at specified item. - idx = tv_list_uidx(l, (int)tv_get_number_chk(&argvars[2], &error)); - if (error || idx == -1) { + listitem_T *item = tv_list_first(l); + if (argvars[2].v_type != VAR_UNKNOWN) { + bool error = false; + + // Start at specified item. + idx = tv_list_uidx(l, (int)tv_get_number_chk(&argvars[2], &error)); + if (error || idx == -1) { + item = NULL; + } else { + item = tv_list_find(l, (int)idx); + assert(item != NULL); + } + if (argvars[3].v_type != VAR_UNKNOWN) { + ic = !!tv_get_number_chk(&argvars[3], &error); + if (error) { item = NULL; - } else { - item = tv_list_find(l, (int)idx); - assert(item != NULL); - } - if (argvars[3].v_type != VAR_UNKNOWN) { - ic = !!tv_get_number_chk(&argvars[3], &error); - if (error) { - item = NULL; - } } } + } - for (; item != NULL; item = TV_LIST_ITEM_NEXT(l, item), idx++) { - if (tv_equal(TV_LIST_ITEM_TV(item), &argvars[1], ic, false)) { - rettv->vval.v_number = idx; - break; - } + for (; item != NULL; item = TV_LIST_ITEM_NEXT(l, item), idx++) { + if (tv_equal(TV_LIST_ITEM_TV(item), &argvars[1], ic, false)) { + rettv->vval.v_number = idx; + break; } } } @@ -5311,13 +5316,16 @@ static void f_range(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) } if (stride == 0) { emsg(_("E726: Stride is zero")); - } else if (stride > 0 ? end + 1 < start : end - 1 > start) { + return; + } + if (stride > 0 ? end + 1 < start : end - 1 > start) { emsg(_("E727: Start past end")); - } else { - tv_list_alloc_ret(rettv, (end - start) / stride); - for (varnumber_T i = start; stride > 0 ? i <= end : i >= end; i += stride) { - tv_list_append_number(rettv->vval.v_list, i); - } + return; + } + + tv_list_alloc_ret(rettv, (end - start) / stride); + for (varnumber_T i = start; stride > 0 ? i <= end : i >= end; i += stride) { + tv_list_append_number(rettv->vval.v_list, i); } } @@ -7009,31 +7017,35 @@ static void set_position(typval_T *argvars, typval_T *rettv, bool charpos) rettv->vval.v_number = -1; const char *const name = tv_get_string_chk(argvars); - if (name != NULL) { - pos_T pos; - int fnum; - if (list2fpos(&argvars[1], &pos, &fnum, &curswant, charpos) == OK) { - if (pos.col != MAXCOL && --pos.col < 0) { - pos.col = 0; - } - if (name[0] == '.' && name[1] == NUL) { - // set cursor; "fnum" is ignored - curwin->w_cursor = pos; - if (curswant >= 0) { - curwin->w_curswant = curswant - 1; - curwin->w_set_curswant = false; - } - check_cursor(); - rettv->vval.v_number = 0; - } else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL) { - // set mark - if (setmark_pos((uint8_t)name[1], &pos, fnum, NULL) == OK) { - rettv->vval.v_number = 0; - } - } else { - emsg(_(e_invarg)); - } + if (name == NULL) { + return; + } + + pos_T pos; + int fnum; + if (list2fpos(&argvars[1], &pos, &fnum, &curswant, charpos) != OK) { + return; + } + + if (pos.col != MAXCOL && --pos.col < 0) { + pos.col = 0; + } + if (name[0] == '.' && name[1] == NUL) { + // set cursor; "fnum" is ignored + curwin->w_cursor = pos; + if (curswant >= 0) { + curwin->w_curswant = curswant - 1; + curwin->w_set_curswant = false; + } + check_cursor(); + rettv->vval.v_number = 0; + } else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL) { + // set mark + if (setmark_pos((uint8_t)name[1], &pos, fnum, NULL) == OK) { + rettv->vval.v_number = 0; } + } else { + emsg(_(e_invarg)); } } @@ -7051,23 +7063,25 @@ static void f_setcharsearch(typval_T *argvars, typval_T *rettv, EvalFuncData fpt } dict_T *d = argvars[0].vval.v_dict; - if (d != NULL) { - char_u *const csearch = (char_u *)tv_dict_get_string(d, "char", false); - if (csearch != NULL) { - int pcc[MAX_MCO]; - const int c = utfc_ptr2char((char *)csearch, pcc); - set_last_csearch(c, csearch, utfc_ptr2len((char *)csearch)); - } + if (d == NULL) { + return; + } - dictitem_T *di = tv_dict_find(d, S_LEN("forward")); - if (di != NULL) { - set_csearch_direction(tv_get_number(&di->di_tv) ? FORWARD : BACKWARD); - } + char_u *const csearch = (char_u *)tv_dict_get_string(d, "char", false); + if (csearch != NULL) { + int pcc[MAX_MCO]; + const int c = utfc_ptr2char((char *)csearch, pcc); + set_last_csearch(c, csearch, utfc_ptr2len((char *)csearch)); + } - di = tv_dict_find(d, S_LEN("until")); - if (di != NULL) { - set_csearch_until(!!tv_get_number(&di->di_tv)); - } + dictitem_T *di = tv_dict_find(d, S_LEN("forward")); + if (di != NULL) { + set_csearch_direction(tv_get_number(&di->di_tv) ? FORWARD : BACKWARD); + } + + di = tv_dict_find(d, S_LEN("until")); + if (di != NULL) { + set_csearch_until(!!tv_get_number(&di->di_tv)); } } diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index d37631af8c..62138221e6 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -1654,25 +1654,27 @@ static void setwinvar(typval_T *argvars, typval_T *rettv, int off) const char *varname = tv_get_string_chk(&argvars[off + 1]); typval_T *varp = &argvars[off + 2]; - if (win != NULL && varname != NULL && varp != NULL) { - bool need_switch_win = !(tp == curtab && win == curwin); - switchwin_T switchwin; - if (!need_switch_win || switch_win(&switchwin, win, tp, true) == OK) { - if (*varname == '&') { - set_option_from_tv(varname + 1, varp); - } else { - const size_t varname_len = strlen(varname); - char *const winvarname = xmalloc(varname_len + 3); - memcpy(winvarname, "w:", 2); - memcpy(winvarname + 2, varname, varname_len + 1); - set_var(winvarname, varname_len + 2, varp, true); - xfree(winvarname); - } - } - if (need_switch_win) { - restore_win(&switchwin, true); + if (win == NULL || varname == NULL) { + return; + } + + bool need_switch_win = !(tp == curtab && win == curwin); + switchwin_T switchwin; + if (!need_switch_win || switch_win(&switchwin, win, tp, true) == OK) { + if (*varname == '&') { + set_option_from_tv(varname + 1, varp); + } else { + const size_t varname_len = strlen(varname); + char *const winvarname = xmalloc(varname_len + 3); + memcpy(winvarname, "w:", 2); + memcpy(winvarname + 2, varname, varname_len + 1); + set_var(winvarname, varname_len + 2, varp, true); + xfree(winvarname); } } + if (need_switch_win) { + restore_win(&switchwin, true); + } } bool var_exists(const char *var) @@ -1755,21 +1757,23 @@ void f_settabvar(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) const char *const varname = tv_get_string_chk(&argvars[1]); typval_T *const varp = &argvars[2]; - if (varname != NULL && tp != NULL) { - tabpage_T *const save_curtab = curtab; - goto_tabpage_tp(tp, false, false); + if (varname == NULL || tp == NULL) { + return; + } - const size_t varname_len = strlen(varname); - char *const tabvarname = xmalloc(varname_len + 3); - memcpy(tabvarname, "t:", 2); - memcpy(tabvarname + 2, varname, varname_len + 1); - set_var(tabvarname, varname_len + 2, varp, true); - xfree(tabvarname); - - // Restore current tabpage. - if (valid_tabpage(save_curtab)) { - goto_tabpage_tp(save_curtab, false, false); - } + tabpage_T *const save_curtab = curtab; + goto_tabpage_tp(tp, false, false); + + const size_t varname_len = strlen(varname); + char *const tabvarname = xmalloc(varname_len + 3); + memcpy(tabvarname, "t:", 2); + memcpy(tabvarname + 2, varname, varname_len + 1); + set_var(tabvarname, varname_len + 2, varp, true); + xfree(tabvarname); + + // Restore current tabpage. + if (valid_tabpage(save_curtab)) { + goto_tabpage_tp(save_curtab, false, false); } } @@ -1796,27 +1800,29 @@ void f_setbufvar(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) buf_T *const buf = tv_get_buf(&argvars[0], false); typval_T *varp = &argvars[2]; - if (buf != NULL && varname != NULL) { - if (*varname == '&') { - aco_save_T aco; + if (buf == NULL || varname == NULL) { + return; + } - // Set curbuf to be our buf, temporarily. - aucmd_prepbuf(&aco, buf); + if (*varname == '&') { + aco_save_T aco; - set_option_from_tv(varname + 1, varp); + // Set curbuf to be our buf, temporarily. + aucmd_prepbuf(&aco, buf); - // reset notion of buffer - aucmd_restbuf(&aco); - } else { - const size_t varname_len = strlen(varname); - char *const bufvarname = xmalloc(varname_len + 3); - buf_T *const save_curbuf = curbuf; - curbuf = buf; - memcpy(bufvarname, "b:", 2); - memcpy(bufvarname + 2, varname, varname_len + 1); - set_var(bufvarname, varname_len + 2, varp, true); - xfree(bufvarname); - curbuf = save_curbuf; - } + set_option_from_tv(varname + 1, varp); + + // reset notion of buffer + aucmd_restbuf(&aco); + } else { + const size_t varname_len = strlen(varname); + char *const bufvarname = xmalloc(varname_len + 3); + buf_T *const save_curbuf = curbuf; + curbuf = buf; + memcpy(bufvarname, "b:", 2); + memcpy(bufvarname + 2, varname, varname_len + 1); + set_var(bufvarname, varname_len + 2, varp, true); + xfree(bufvarname); + curbuf = save_curbuf; } } diff --git a/src/nvim/eval/window.c b/src/nvim/eval/window.c index 7cb346216d..14b3d7c909 100644 --- a/src/nvim/eval/window.c +++ b/src/nvim/eval/window.c @@ -486,9 +486,11 @@ void f_win_execute(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) int id = (int)tv_get_number(argvars); tabpage_T *tp; win_T *wp = win_id2wp_tp(id, &tp); - if (wp != NULL && tp != NULL) { - WIN_EXECUTE(wp, tp, execute_common(argvars, rettv, 1)); + if (wp == NULL || tp == NULL) { + return; } + + WIN_EXECUTE(wp, tp, execute_common(argvars, rettv, 1)); } /// "win_findbuf()" function diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c index c5d3b94c95..811d96ff93 100644 --- a/src/nvim/event/libuv_process.c +++ b/src/nvim/event/libuv_process.c @@ -40,11 +40,19 @@ int libuv_process_spawn(LibuvProcess *uvproc) #endif uvproc->uvopts.exit_cb = exit_cb; uvproc->uvopts.cwd = proc->cwd; + uvproc->uvopts.stdio = uvproc->uvstdio; uvproc->uvopts.stdio_count = 3; uvproc->uvstdio[0].flags = UV_IGNORE; uvproc->uvstdio[1].flags = UV_IGNORE; uvproc->uvstdio[2].flags = UV_IGNORE; + + if (ui_client_forward_stdin) { + assert(UI_CLIENT_STDIN_FD == 3); + uvproc->uvopts.stdio_count = 4; + uvproc->uvstdio[3].data.fd = 0; + uvproc->uvstdio[3].flags = UV_INHERIT_FD; + } uvproc->uv.data = proc; if (proc->env) { diff --git a/src/nvim/event/libuv_process.h b/src/nvim/event/libuv_process.h index 8f987847d8..4472839944 100644 --- a/src/nvim/event/libuv_process.h +++ b/src/nvim/event/libuv_process.h @@ -10,7 +10,7 @@ typedef struct libuv_process { Process process; uv_process_t uv; uv_process_options_t uvopts; - uv_stdio_container_t uvstdio[3]; + uv_stdio_container_t uvstdio[4]; } LibuvProcess; static inline LibuvProcess libuv_process_init(Loop *loop, void *data) diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c index 934f5fc69a..ab2524c1a9 100644 --- a/src/nvim/event/loop.c +++ b/src/nvim/event/loop.c @@ -43,7 +43,7 @@ void loop_init(Loop *loop, void *data) /// @param once true: process at most one `Loop.uv` event. /// false: process until `ms` timeout (only has effect if `ms` > 0). /// @return true if `ms` > 0 and was reached -bool loop_uv_run(Loop *loop, int ms, bool once) +bool loop_uv_run(Loop *loop, int64_t ms, bool once) { if (loop->recursive++) { abort(); // Should not re-enter uv_run @@ -82,7 +82,7 @@ bool loop_uv_run(Loop *loop, int ms, bool once) /// > 0: timeout after `ms`. /// < 0: wait forever. /// @return true if `ms` > 0 and was reached -bool loop_poll_events(Loop *loop, int ms) +bool loop_poll_events(Loop *loop, int64_t ms) { bool timeout_expired = loop_uv_run(loop, ms, true); multiqueue_process_events(loop->fast_events); diff --git a/src/nvim/event/loop.h b/src/nvim/event/loop.h index c0bcda40ce..b2265a726d 100644 --- a/src/nvim/event/loop.h +++ b/src/nvim/event/loop.h @@ -58,7 +58,7 @@ typedef struct loop { // Poll for events until a condition or timeout #define LOOP_PROCESS_EVENTS_UNTIL(loop, multiqueue, timeout, condition) \ do { \ - int remaining = timeout; \ + int64_t remaining = timeout; \ uint64_t before = (remaining > 0) ? os_hrtime() : 0; \ while (!(condition)) { \ LOOP_PROCESS_EVENTS(loop, multiqueue, remaining); \ @@ -66,7 +66,7 @@ typedef struct loop { break; \ } else if (remaining > 0) { \ uint64_t now = os_hrtime(); \ - remaining -= (int)((now - before) / 1000000); \ + remaining -= (int64_t)((now - before) / 1000000); \ before = now; \ if (remaining <= 0) { \ break; \ diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c index e74e95669d..2fa789ac9a 100644 --- a/src/nvim/event/process.c +++ b/src/nvim/event/process.c @@ -14,6 +14,7 @@ #include "nvim/globals.h" #include "nvim/log.h" #include "nvim/macros.h" +#include "nvim/main.h" #include "nvim/os/process.h" #include "nvim/os/pty_process.h" #include "nvim/os/shell.h" @@ -35,6 +36,9 @@ void __gcov_flush(void); static bool process_is_tearing_down = false; +// Delay exit until handles are closed, to avoid deadlocks +static int exit_need_delay = 0; + /// @returns zero on success, or negative error code int process_spawn(Process *proc, bool in, bool out, bool err) FUNC_ATTR_NONNULL_ALL @@ -398,12 +402,41 @@ static void process_close_handles(void **argv) exit_need_delay--; } +static void exit_delay_cb(uv_timer_t *handle) +{ + uv_timer_stop(&main_loop.exit_delay_timer); + multiqueue_put(main_loop.fast_events, exit_event, 1, main_loop.exit_delay_timer.data); +} + +static void exit_event(void **argv) +{ + int status = (int)(intptr_t)argv[0]; + if (exit_need_delay) { + main_loop.exit_delay_timer.data = argv[0]; + uv_timer_start(&main_loop.exit_delay_timer, exit_delay_cb, 0, 0); + return; + } + + if (!exiting) { + os_exit(status); + } +} + +void exit_from_channel(int status) +{ + multiqueue_put(main_loop.fast_events, exit_event, 1, status); +} + static void on_process_exit(Process *proc) { Loop *loop = proc->loop; ILOG("exited: pid=%d status=%d stoptime=%" PRIu64, proc->pid, proc->status, proc->stopped_time); + if (ui_client_channel_id) { + exit_from_channel(proc->status); + } + // Process has terminated, but there could still be data to be read from the // OS. We are still in the libuv loop, so we cannot call code that polls for // more data directly. Instead delay the reading after the libuv loop by diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 4167d1d182..68e70f9c69 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4743,45 +4743,46 @@ void ex_oldfiles(exarg_T *eap) if (l == NULL) { msg(_("No old files")); - } else { - msg_start(); - msg_scroll = true; - TV_LIST_ITER(l, li, { - if (got_int) { - break; - } - nr++; - const char *fname = tv_get_string(TV_LIST_ITEM_TV(li)); - if (!message_filtered((char *)fname)) { - msg_outnum(nr); - msg_puts(": "); - msg_outtrans((char *)tv_get_string(TV_LIST_ITEM_TV(li))); - msg_clr_eos(); - msg_putchar('\n'); - os_breakcheck(); - } - }); - - // Assume "got_int" was set to truncate the listing. - got_int = false; - - // File selection prompt on ":browse oldfiles" - if (cmdmod.cmod_flags & CMOD_BROWSE) { - quit_more = false; - nr = prompt_for_number(false); - msg_starthere(); - if (nr > 0 && nr <= tv_list_len(l)) { - const char *const p = tv_list_find_str(l, (int)nr - 1); - if (p == NULL) { - return; - } - char *const s = expand_env_save((char *)p); - eap->arg = s; - eap->cmdidx = CMD_edit; - cmdmod.cmod_flags &= ~CMOD_BROWSE; - do_exedit(eap, NULL); - xfree(s); + return; + } + + msg_start(); + msg_scroll = true; + TV_LIST_ITER(l, li, { + if (got_int) { + break; + } + nr++; + const char *fname = tv_get_string(TV_LIST_ITEM_TV(li)); + if (!message_filtered((char *)fname)) { + msg_outnum(nr); + msg_puts(": "); + msg_outtrans((char *)tv_get_string(TV_LIST_ITEM_TV(li))); + msg_clr_eos(); + msg_putchar('\n'); + os_breakcheck(); + } + }); + + // Assume "got_int" was set to truncate the listing. + got_int = false; + + // File selection prompt on ":browse oldfiles" + if (cmdmod.cmod_flags & CMOD_BROWSE) { + quit_more = false; + nr = prompt_for_number(false); + msg_starthere(); + if (nr > 0 && nr <= tv_list_len(l)) { + const char *const p = tv_list_find_str(l, (int)nr - 1); + if (p == NULL) { + return; } + char *const s = expand_env_save((char *)p); + eap->arg = s; + eap->cmdidx = CMD_edit; + cmdmod.cmod_flags &= ~CMOD_BROWSE; + do_exedit(eap, NULL); + xfree(s); } } } diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index 6911d318cc..68db03bd7d 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -1105,12 +1105,6 @@ module.cmds = { func='ex_helptags', }, { - command='hardcopy', - flags=bit.bor(RANGE, COUNT, EXTRA, TRLBAR, DFLALL, BANG), - addr_type='ADDR_LINES', - func='ex_hardcopy', - }, - { command='highlight', flags=bit.bor(BANG, EXTRA, TRLBAR, SBOXOK, CMDWIN, LOCK_OK), addr_type='ADDR_NONE', diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index b6489e97b2..7020747cf6 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -705,54 +705,56 @@ void ex_compiler(exarg_T *eap) // List all compiler scripts. do_cmdline_cmd("echo globpath(&rtp, 'compiler/*.vim')"); // NOLINT do_cmdline_cmd("echo globpath(&rtp, 'compiler/*.lua')"); // NOLINT + return; + } + + size_t bufsize = strlen(eap->arg) + 14; + buf = xmalloc(bufsize); + + if (eap->forceit) { + // ":compiler! {name}" sets global options + do_cmdline_cmd("command -nargs=* CompilerSet set <args>"); } else { - size_t bufsize = strlen(eap->arg) + 14; - buf = xmalloc(bufsize); - if (eap->forceit) { - // ":compiler! {name}" sets global options - do_cmdline_cmd("command -nargs=* CompilerSet set <args>"); - } else { - // ":compiler! {name}" sets local options. - // To remain backwards compatible "current_compiler" is always - // used. A user's compiler plugin may set it, the distributed - // plugin will then skip the settings. Afterwards set - // "b:current_compiler" and restore "current_compiler". - // Explicitly prepend "g:" to make it work in a function. - old_cur_comp = (char *)get_var_value("g:current_compiler"); - if (old_cur_comp != NULL) { - old_cur_comp = xstrdup(old_cur_comp); - } - do_cmdline_cmd("command -nargs=* -keepscript CompilerSet setlocal <args>"); + // ":compiler! {name}" sets local options. + // To remain backwards compatible "current_compiler" is always + // used. A user's compiler plugin may set it, the distributed + // plugin will then skip the settings. Afterwards set + // "b:current_compiler" and restore "current_compiler". + // Explicitly prepend "g:" to make it work in a function. + old_cur_comp = (char *)get_var_value("g:current_compiler"); + if (old_cur_comp != NULL) { + old_cur_comp = xstrdup(old_cur_comp); } - do_unlet(S_LEN("g:current_compiler"), true); - do_unlet(S_LEN("b:current_compiler"), true); + do_cmdline_cmd("command -nargs=* -keepscript CompilerSet setlocal <args>"); + } + do_unlet(S_LEN("g:current_compiler"), true); + do_unlet(S_LEN("b:current_compiler"), true); - snprintf(buf, bufsize, "compiler/%s.vim", eap->arg); + snprintf(buf, bufsize, "compiler/%s.vim", eap->arg); + if (source_runtime(buf, DIP_ALL) == FAIL) { + // Try lua compiler + snprintf(buf, bufsize, "compiler/%s.lua", eap->arg); if (source_runtime(buf, DIP_ALL) == FAIL) { - // Try lua compiler - snprintf(buf, bufsize, "compiler/%s.lua", eap->arg); - if (source_runtime(buf, DIP_ALL) == FAIL) { - semsg(_("E666: compiler not supported: %s"), eap->arg); - } + semsg(_("E666: compiler not supported: %s"), eap->arg); } - xfree(buf); + } + xfree(buf); - do_cmdline_cmd(":delcommand CompilerSet"); + do_cmdline_cmd(":delcommand CompilerSet"); - // Set "b:current_compiler" from "current_compiler". - p = (char *)get_var_value("g:current_compiler"); - if (p != NULL) { - set_internal_string_var("b:current_compiler", p); - } + // Set "b:current_compiler" from "current_compiler". + p = (char *)get_var_value("g:current_compiler"); + if (p != NULL) { + set_internal_string_var("b:current_compiler", p); + } - // Restore "current_compiler" for ":compiler {name}". - if (!eap->forceit) { - if (old_cur_comp != NULL) { - set_internal_string_var("g:current_compiler", old_cur_comp); - xfree(old_cur_comp); - } else { - do_unlet(S_LEN("g:current_compiler"), true); - } + // Restore "current_compiler" for ":compiler {name}". + if (!eap->forceit) { + if (old_cur_comp != NULL) { + set_internal_string_var("g:current_compiler", old_cur_comp); + xfree(old_cur_comp); + } else { + do_unlet(S_LEN("g:current_compiler"), true); } } } @@ -847,45 +849,46 @@ void ex_drop(exarg_T *eap) // edited in a window yet. It's like ":tab all" but without closing // windows or tabs. ex_all(eap); - } else { - // ":drop file ...": Edit the first argument. Jump to an existing - // window if possible, edit in current window if the current buffer - // can be abandoned, otherwise open a new window. - buf = buflist_findnr(ARGLIST[0].ae_fnum); + return; + } - FOR_ALL_TAB_WINDOWS(tp, wp) { - if (wp->w_buffer == buf) { - goto_tabpage_win(tp, wp); - curwin->w_arg_idx = 0; - if (!bufIsChanged(curbuf)) { - const int save_ar = curbuf->b_p_ar; - - // reload the file if it is newer - curbuf->b_p_ar = 1; - buf_check_timestamp(curbuf); - curbuf->b_p_ar = save_ar; - } - return; + // ":drop file ...": Edit the first argument. Jump to an existing + // window if possible, edit in current window if the current buffer + // can be abandoned, otherwise open a new window. + buf = buflist_findnr(ARGLIST[0].ae_fnum); + + FOR_ALL_TAB_WINDOWS(tp, wp) { + if (wp->w_buffer == buf) { + goto_tabpage_win(tp, wp); + curwin->w_arg_idx = 0; + if (!bufIsChanged(curbuf)) { + const int save_ar = curbuf->b_p_ar; + + // reload the file if it is newer + curbuf->b_p_ar = 1; + buf_check_timestamp(curbuf); + curbuf->b_p_ar = save_ar; } + return; } + } - // Check whether the current buffer is changed. If so, we will need - // to split the current window or data could be lost. - // Skip the check if the 'hidden' option is set, as in this case the - // buffer won't be lost. - if (!buf_hide(curbuf)) { - emsg_off++; - split = check_changed(curbuf, CCGD_AW | CCGD_EXCMD); - emsg_off--; - } + // Check whether the current buffer is changed. If so, we will need + // to split the current window or data could be lost. + // Skip the check if the 'hidden' option is set, as in this case the + // buffer won't be lost. + if (!buf_hide(curbuf)) { + emsg_off++; + split = check_changed(curbuf, CCGD_AW | CCGD_EXCMD); + emsg_off--; + } - // Fake a ":sfirst" or ":first" command edit the first argument. - if (split) { - eap->cmdidx = CMD_sfirst; - eap->cmd[0] = 's'; - } else { - eap->cmdidx = CMD_first; - } - ex_rewind(eap); + // Fake a ":sfirst" or ":first" command edit the first argument. + if (split) { + eap->cmdidx = CMD_sfirst; + eap->cmd[0] = 's'; + } else { + eap->cmdidx = CMD_first; } + ex_rewind(eap); } diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index b99df64a3d..6c38fd962a 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1931,9 +1931,11 @@ static char *do_one_cmd(char **cmdlinep, int flags, cstack_T *cstack, LineGetter profile_cmd(&ea, cstack, fgetline, cookie); - // May go to debug mode. If this happens and the ">quit" debug command is - // used, throw an interrupt exception and skip the next command. - dbg_check_breakpoint(&ea); + if (!exiting) { + // May go to debug mode. If this happens and the ">quit" debug command is + // used, throw an interrupt exception and skip the next command. + dbg_check_breakpoint(&ea); + } if (!ea.skip && got_int) { ea.skip = true; (void)do_intthrow(cstack); @@ -3782,7 +3784,6 @@ int expand_filename(exarg_T *eap, char **cmdlinep, char **errormsgp) && eap->cmdidx != CMD_bang && eap->cmdidx != CMD_grep && eap->cmdidx != CMD_grepadd - && eap->cmdidx != CMD_hardcopy && eap->cmdidx != CMD_lgrep && eap->cmdidx != CMD_lgrepadd && eap->cmdidx != CMD_lmake @@ -4663,23 +4664,29 @@ static void ex_tabclose(exarg_T *eap) { if (cmdwin_type != 0) { cmdwin_result = K_IGNORE; - } else if (first_tabpage->tp_next == NULL) { + return; + } + + if (first_tabpage->tp_next == NULL) { emsg(_("E784: Cannot close last tab page")); - } else { - int tab_number = get_tabpage_arg(eap); - if (eap->errmsg == NULL) { - tabpage_T *tp = find_tabpage(tab_number); - if (tp == NULL) { - beep_flush(); - return; - } - if (tp != curtab) { - tabpage_close_other(tp, eap->forceit); - return; - } else if (!text_locked() && !curbuf_locked()) { - tabpage_close(eap->forceit); - } - } + return; + } + + int tab_number = get_tabpage_arg(eap); + if (eap->errmsg != NULL) { + return; + } + + tabpage_T *tp = find_tabpage(tab_number); + if (tp == NULL) { + beep_flush(); + return; + } + if (tp != curtab) { + tabpage_close_other(tp, eap->forceit); + return; + } else if (!text_locked() && !curbuf_locked()) { + tabpage_close(eap->forceit); } } @@ -4688,32 +4695,38 @@ static void ex_tabonly(exarg_T *eap) { if (cmdwin_type != 0) { cmdwin_result = K_IGNORE; - } else if (first_tabpage->tp_next == NULL) { + return; + } + + if (first_tabpage->tp_next == NULL) { msg(_("Already only one tab page")); - } else { - int tab_number = get_tabpage_arg(eap); - if (eap->errmsg == NULL) { - goto_tabpage(tab_number); - // Repeat this up to a 1000 times, because autocommands may - // mess up the lists. - for (int done = 0; done < 1000; done++) { - FOR_ALL_TABS(tp) { - if (tp->tp_topframe != topframe) { - tabpage_close_other(tp, eap->forceit); - // if we failed to close it quit - if (valid_tabpage(tp)) { - done = 1000; - } - // start over, "tp" is now invalid - break; - } - } - assert(first_tabpage); - if (first_tabpage->tp_next == NULL) { - break; + return; + } + + int tab_number = get_tabpage_arg(eap); + if (eap->errmsg != NULL) { + return; + } + + goto_tabpage(tab_number); + // Repeat this up to a 1000 times, because autocommands may + // mess up the lists. + for (int done = 0; done < 1000; done++) { + FOR_ALL_TABS(tp) { + if (tp->tp_topframe != topframe) { + tabpage_close_other(tp, eap->forceit); + // if we failed to close it quit + if (valid_tabpage(tp)) { + done = 1000; } + // start over, "tp" is now invalid + break; } } + assert(first_tabpage); + if (first_tabpage->tp_next == NULL) { + break; + } } } @@ -4782,25 +4795,27 @@ static void ex_only(exarg_T *eap) static void ex_hide(exarg_T *eap) { // ":hide" or ":hide | cmd": hide current window - if (!eap->skip) { - if (eap->addr_count == 0) { - win_close(curwin, false, eap->forceit); // don't free buffer - } else { - int winnr = 0; - win_T *win = NULL; + if (eap->skip) { + return; + } - FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { - winnr++; - if (winnr == eap->line2) { - win = wp; - break; - } - } - if (win == NULL) { - win = lastwin; + if (eap->addr_count == 0) { + win_close(curwin, false, eap->forceit); // don't free buffer + } else { + int winnr = 0; + win_T *win = NULL; + + FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { + winnr++; + if (winnr == eap->line2) { + win = wp; + break; } - win_close(win, false, eap->forceit); } + if (win == NULL) { + win = lastwin; + } + win_close(win, false, eap->forceit); } } @@ -5155,11 +5170,13 @@ static void ex_find(exarg_T *eap) } } - if (fname != NULL) { - eap->arg = fname; - do_exedit(eap, NULL); - xfree(fname); + if (fname == NULL) { + return; } + + eap->arg = fname; + do_exedit(eap, NULL); + xfree(fname); } /// ":edit", ":badd", ":balt", ":visual". @@ -5384,50 +5401,51 @@ static void ex_read(exarg_T *eap) if (eap->usefilter) { // :r!cmd do_bang(1, eap, false, false, true); - } else { - if (u_save(eap->line2, (linenr_T)(eap->line2 + 1)) == FAIL) { + return; + } + + if (u_save(eap->line2, (linenr_T)(eap->line2 + 1)) == FAIL) { + return; + } + + int i; + if (*eap->arg == NUL) { + if (check_fname() == FAIL) { // check for no file name return; } - int i; - - if (*eap->arg == NUL) { - if (check_fname() == FAIL) { // check for no file name - return; - } - i = readfile(curbuf->b_ffname, curbuf->b_fname, - eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0, false); - } else { - if (vim_strchr(p_cpo, CPO_ALTREAD) != NULL) { - (void)setaltfname(eap->arg, eap->arg, (linenr_T)1); - } - i = readfile(eap->arg, NULL, - eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0, false); + i = readfile(curbuf->b_ffname, curbuf->b_fname, + eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0, false); + } else { + if (vim_strchr(p_cpo, CPO_ALTREAD) != NULL) { + (void)setaltfname(eap->arg, eap->arg, (linenr_T)1); } - if (i != OK) { - if (!aborting()) { - semsg(_(e_notopen), eap->arg); + i = readfile(eap->arg, NULL, + eap->line2, (linenr_T)0, (linenr_T)MAXLNUM, eap, 0, false); + } + if (i != OK) { + if (!aborting()) { + semsg(_(e_notopen), eap->arg); + } + } else { + if (empty && exmode_active) { + // Delete the empty line that remains. Historically ex does + // this but vi doesn't. + linenr_T lnum; + if (eap->line2 == 0) { + lnum = curbuf->b_ml.ml_line_count; + } else { + lnum = 1; } - } else { - if (empty && exmode_active) { - // Delete the empty line that remains. Historically ex does - // this but vi doesn't. - linenr_T lnum; - if (eap->line2 == 0) { - lnum = curbuf->b_ml.ml_line_count; - } else { - lnum = 1; - } - if (*ml_get(lnum) == NUL && u_savedel(lnum, 1L) == OK) { - ml_delete(lnum, false); - if (curwin->w_cursor.lnum > 1 - && curwin->w_cursor.lnum >= lnum) { - curwin->w_cursor.lnum--; - } - deleted_lines_mark(lnum, 1L); + if (*ml_get(lnum) == NUL && u_savedel(lnum, 1L) == OK) { + ml_delete(lnum, false); + if (curwin->w_cursor.lnum > 1 + && curwin->w_cursor.lnum >= lnum) { + curwin->w_cursor.lnum--; } + deleted_lines_mark(lnum, 1L); } - redraw_curbuf_later(UPD_VALID); } + redraw_curbuf_later(UPD_VALID); } } @@ -5584,6 +5602,7 @@ void ex_cd(exarg_T *eap) return; } #endif + CdScope scope = kCdScopeGlobal; switch (eap->cmdidx) { case CMD_tcd: @@ -5658,15 +5677,11 @@ static void ex_sleep(exarg_T *eap) do_sleep(len); } -/// Sleep for "msec" milliseconds, but keep checking for a CTRL-C every second. +/// Sleep for "msec" milliseconds, but return early on CTRL-C. void do_sleep(long msec) { ui_flush(); // flush before waiting - for (long left = msec; !got_int && left > 0; left -= 1000L) { - int next = left > 1000L ? 1000 : (int)left; - LOOP_PROCESS_EVENTS_UNTIL(&main_loop, main_loop.events, (int)next, got_int); - os_breakcheck(); - } + LOOP_PROCESS_EVENTS_UNTIL(&main_loop, main_loop.events, msec, got_int); // If CTRL-C was typed to interrupt the sleep, drop the CTRL-C from the // input buffer, otherwise a following call to input() fails. @@ -5883,20 +5898,21 @@ static void ex_at(exarg_T *eap) // Put the register in the typeahead buffer with the "silent" flag. if (do_execreg(c, true, vim_strchr(p_cpo, CPO_EXECBUF) != NULL, true) == FAIL) { beep_flush(); - } else { - bool save_efr = exec_from_reg; + return; + } - exec_from_reg = true; + const bool save_efr = exec_from_reg; - // Execute from the typeahead buffer. - // Continue until the stuff buffer is empty and all added characters - // have been consumed. - while (!stuff_empty() || typebuf.tb_len > prev_len) { - (void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE); - } + exec_from_reg = true; - exec_from_reg = save_efr; + // Execute from the typeahead buffer. + // Continue until the stuff buffer is empty and all added characters + // have been consumed. + while (!stuff_empty() || typebuf.tb_len > prev_len) { + (void)do_cmdline(NULL, getexline, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE); } + + exec_from_reg = save_efr; } /// ":!". @@ -6226,17 +6242,21 @@ static void ex_mark(exarg_T *eap) { if (*eap->arg == NUL) { // No argument? emsg(_(e_argreq)); - } else if (eap->arg[1] != NUL) { // more than one character? + return; + } + + if (eap->arg[1] != NUL) { // more than one character? semsg(_(e_trailing_arg), eap->arg); - } else { - pos_T pos = curwin->w_cursor; // save curwin->w_cursor - curwin->w_cursor.lnum = eap->line2; - beginline(BL_WHITE | BL_FIX); - if (setmark(*eap->arg) == FAIL) { // set mark - emsg(_("E191: Argument must be a letter or forward/backward quote")); - } - curwin->w_cursor = pos; // restore curwin->w_cursor + return; } + + pos_T pos = curwin->w_cursor; // save curwin->w_cursor + curwin->w_cursor.lnum = eap->line2; + beginline(BL_WHITE | BL_FIX); + if (setmark(*eap->arg) == FAIL) { // set mark + emsg(_("E191: Argument must be a letter or forward/backward quote")); + } + curwin->w_cursor = pos; // restore curwin->w_cursor } /// Update w_topline, w_leftcol and the cursor position. @@ -7150,17 +7170,18 @@ void filetype_maybe_enable(void) /// ":setfiletype [FALLBACK] {name}" static void ex_setfiletype(exarg_T *eap) { - if (!did_filetype) { - char *arg = eap->arg; + if (did_filetype) { + return; + } - if (strncmp(arg, "FALLBACK ", 9) == 0) { - arg += 9; - } + char *arg = eap->arg; + if (strncmp(arg, "FALLBACK ", 9) == 0) { + arg += 9; + } - set_option_value_give_err("filetype", 0L, arg, OPT_LOCAL); - if (arg != eap->arg) { - did_filetype = false; - } + set_option_value_give_err("filetype", 0L, arg, OPT_LOCAL); + if (arg != eap->arg) { + did_filetype = false; } } diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index c94ac409f2..5c0dfaacbb 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -575,32 +575,34 @@ static int may_add_char_to_search(int firstc, int *c, incsearch_state_T *s) static void finish_incsearch_highlighting(int gotesc, incsearch_state_T *s, bool call_update_screen) { - if (s->did_incsearch) { - s->did_incsearch = false; - if (gotesc) { + if (!s->did_incsearch) { + return; + } + + s->did_incsearch = false; + if (gotesc) { + curwin->w_cursor = s->save_cursor; + } else { + if (!equalpos(s->save_cursor, s->search_start)) { + // put the '" mark at the original position curwin->w_cursor = s->save_cursor; - } else { - if (!equalpos(s->save_cursor, s->search_start)) { - // put the '" mark at the original position - curwin->w_cursor = s->save_cursor; - setpcmark(); - } - curwin->w_cursor = s->search_start; // -V519 + setpcmark(); } - restore_viewstate(curwin, &s->old_viewstate); - highlight_match = false; + curwin->w_cursor = s->search_start; // -V519 + } + restore_viewstate(curwin, &s->old_viewstate); + highlight_match = false; - // by default search all lines - search_first_line = 0; - search_last_line = MAXLNUM; + // by default search all lines + search_first_line = 0; + search_last_line = MAXLNUM; - magic_overruled = s->magic_overruled_save; + magic_overruled = s->magic_overruled_save; - validate_cursor(); // needed for TAB - redraw_all_later(UPD_SOME_VALID); - if (call_update_screen) { - update_screen(); - } + validate_cursor(); // needed for TAB + redraw_all_later(UPD_SOME_VALID); + if (call_update_screen) { + update_screen(); } } diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index fdf1973719..841320245b 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -52,7 +52,6 @@ #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/time.h" -#include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/pos.h" #include "nvim/regexp.h" @@ -65,6 +64,11 @@ #include "nvim/undo.h" #include "nvim/vim.h" +#if defined(HAVE_FLOCK) && defined(HAVE_DIRFD) +# include <dirent.h> +# include <sys/file.h> +#endif + #ifdef OPEN_CHR_FILES # include "nvim/charset.h" #endif @@ -2010,11 +2014,13 @@ void set_file_options(int set_options, exarg_T *eap) /// Set forced 'fileencoding'. void set_forced_fenc(exarg_T *eap) { - if (eap->force_enc != 0) { - char *fenc = enc_canonize(eap->cmd + eap->force_enc); - set_string_option_direct("fenc", -1, fenc, OPT_FREE|OPT_LOCAL, 0); - xfree(fenc); + if (eap->force_enc == 0) { + return; } + + char *fenc = enc_canonize(eap->cmd + eap->force_enc); + set_string_option_direct("fenc", -1, fenc, OPT_FREE|OPT_LOCAL, 0); + xfree(fenc); } /// Find next fileencoding to use from 'fileencodings'. @@ -5167,6 +5173,9 @@ void forward_slash(char_u *fname) /// Path to Nvim's own temp dir. Ends in a slash. static char *vim_tempdir = NULL; +#if defined(HAVE_FLOCK) && defined(HAVE_DIRFD) +DIR *vim_tempdir_dp = NULL; ///< File descriptor of temp dir +#endif /// Creates a directory for private use by this instance of Nvim, trying each of /// `TEMP_DIR_NAMES` until one succeeds. @@ -5331,15 +5340,50 @@ int delete_recursive(const char *name) return result; } +#if defined(HAVE_FLOCK) && defined(HAVE_DIRFD) +/// Open temporary directory and take file lock to prevent +/// to be auto-cleaned. +static void vim_opentempdir(void) +{ + if (vim_tempdir_dp != NULL) { + return; + } + + DIR *dp = opendir(vim_tempdir); + if (dp == NULL) { + return; + } + + vim_tempdir_dp = dp; + flock(dirfd(vim_tempdir_dp), LOCK_SH); +} + +/// Close temporary directory - it automatically release file lock. +static void vim_closetempdir(void) +{ + if (vim_tempdir_dp == NULL) { + return; + } + + closedir(vim_tempdir_dp); + vim_tempdir_dp = NULL; +} +#endif + /// Delete the temp directory and all files it contains. void vim_deltempdir(void) { - if (vim_tempdir != NULL) { - // remove the trailing path separator - path_tail(vim_tempdir)[-1] = NUL; - delete_recursive(vim_tempdir); - XFREE_CLEAR(vim_tempdir); + if (vim_tempdir == NULL) { + return; } + +#if defined(HAVE_FLOCK) && defined(HAVE_DIRFD) + vim_closetempdir(); +#endif + // remove the trailing path separator + path_tail(vim_tempdir)[-1] = NUL; + delete_recursive(vim_tempdir); + XFREE_CLEAR(vim_tempdir); } /// Gets path to Nvim's own temp dir (ending with slash). @@ -5364,12 +5408,16 @@ char *vim_gettempdir(void) static bool vim_settempdir(char *tempdir) { char *buf = verbose_try_malloc(MAXPATHL + 2); - if (!buf) { + if (buf == NULL) { return false; } + vim_FullName(tempdir, buf, MAXPATHL, false); add_pathsep(buf); vim_tempdir = xstrdup(buf); +#if defined(HAVE_FLOCK) && defined(HAVE_DIRFD) + vim_opentempdir(); +#endif xfree(buf); return true; } diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 275ddc6912..6d85206d18 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -1523,23 +1523,25 @@ static bool check_closed(win_T *const wp, fold_T *const fp, bool *const use_leve /// @param lnum_off offset for fp->fd_top static void checkSmall(win_T *const wp, fold_T *const fp, const linenr_T lnum_off) { - if (fp->fd_small == kNone) { - // Mark any nested folds to maybe-small - setSmallMaybe(&fp->fd_nested); + if (fp->fd_small != kNone) { + return; + } - if (fp->fd_len > wp->w_p_fml) { - fp->fd_small = kFalse; - } else { - int count = 0; - for (int n = 0; n < fp->fd_len; n++) { - count += plines_win_nofold(wp, fp->fd_top + lnum_off + n); - if (count > wp->w_p_fml) { - fp->fd_small = kFalse; - return; - } + // Mark any nested folds to maybe-small + setSmallMaybe(&fp->fd_nested); + + if (fp->fd_len > wp->w_p_fml) { + fp->fd_small = kFalse; + } else { + int count = 0; + for (int n = 0; n < fp->fd_len; n++) { + count += plines_win_nofold(wp, fp->fd_top + lnum_off + n); + if (count > wp->w_p_fml) { + fp->fd_small = kFalse; + return; } - fp->fd_small = kTrue; } + fp->fd_small = kTrue; } } @@ -1595,26 +1597,28 @@ static void foldAddMarker(buf_T *buf, pos_T pos, const char *marker, size_t mark size_t line_len = strlen(line); size_t added = 0; - if (u_save(lnum - 1, lnum + 1) == OK) { - // Check if the line ends with an unclosed comment - skip_comment(line, false, false, &line_is_comment); - newline = xmalloc(line_len + markerlen + strlen(cms) + 1); - STRCPY(newline, line); - // Append the marker to the end of the line - if (p == NULL || line_is_comment) { - STRLCPY(newline + line_len, marker, markerlen + 1); - added = markerlen; - } else { - STRCPY(newline + line_len, cms); - memcpy(newline + line_len + (p - cms), marker, markerlen); - STRCPY(newline + line_len + (p - cms) + markerlen, p + 2); - added = markerlen + strlen(cms) - 2; - } - ml_replace_buf(buf, lnum, newline, false); - if (added) { - extmark_splice_cols(buf, (int)lnum - 1, (int)line_len, - 0, (int)added, kExtmarkUndo); - } + if (u_save(lnum - 1, lnum + 1) != OK) { + return; + } + + // Check if the line ends with an unclosed comment + skip_comment(line, false, false, &line_is_comment); + newline = xmalloc(line_len + markerlen + strlen(cms) + 1); + STRCPY(newline, line); + // Append the marker to the end of the line + if (p == NULL || line_is_comment) { + STRLCPY(newline + line_len, marker, markerlen + 1); + added = markerlen; + } else { + STRCPY(newline + line_len, cms); + memcpy(newline + line_len + (p - cms), marker, markerlen); + STRCPY(newline + line_len + (p - cms) + markerlen, p + 2); + added = markerlen + strlen(cms) - 2; + } + ml_replace_buf(buf, lnum, newline, false); + if (added) { + extmark_splice_cols(buf, (int)lnum - 1, (int)line_len, + 0, (int)added, kExtmarkUndo); } } diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua index d4fe455f82..55ab9fdf0e 100644 --- a/src/nvim/generators/gen_api_dispatch.lua +++ b/src/nvim/generators/gen_api_dispatch.lua @@ -60,6 +60,12 @@ for i = 6, #arg do if public and not fn.noexport then functions[#functions + 1] = tmp[j] function_names[fn.name] = true + if #fn.parameters >= 2 and fn.parameters[2][1] == 'Array' and fn.parameters[2][2] == 'uidata' then + -- function recieves the "args" as a parameter + fn.receives_array_args = true + -- remove the args parameter + table.remove(fn.parameters, 2) + end if #fn.parameters ~= 0 and fn.parameters[1][2] == 'channel_id' then -- this function should receive the channel id fn.receives_channel_id = true @@ -159,7 +165,7 @@ local exported_attributes = {'name', 'return_type', 'method', 'since', 'deprecated_since'} local exported_functions = {} for _,f in ipairs(functions) do - if not (startswith(f.name, "nvim__") or f.name == "nvim_error_event") then + if not (startswith(f.name, "nvim__") or f.name == "nvim_error_event" or f.name == "redraw") then local f_exported = {} for _,attr in ipairs(exported_attributes) do f_exported[attr] = f[attr] @@ -264,11 +270,13 @@ for i = 1, #functions do output:write('\n '..rt..' '..converted..';') end output:write('\n') - output:write('\n if (args.size != '..#fn.parameters..') {') - output:write('\n api_set_error(error, kErrorTypeException, \ - "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') - output:write('\n goto cleanup;') - output:write('\n }\n') + if not fn.receives_array_args then + output:write('\n if (args.size != '..#fn.parameters..') {') + output:write('\n api_set_error(error, kErrorTypeException, \ + "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') + output:write('\n goto cleanup;') + output:write('\n }\n') + end -- Validation/conversion for each argument for j = 1, #fn.parameters do @@ -350,12 +358,28 @@ for i = 1, #functions do if fn.receives_channel_id then -- if the function receives the channel id, pass it as first argument if #args > 0 or fn.can_fail then - output:write('channel_id, '..call_args) + output:write('channel_id, ') + if fn.receives_array_args then + -- if the function recieves the array args, pass it the second argument + output:write('args, ') + end + output:write(call_args) else output:write('channel_id') + if fn.receives_array_args then + output:write(', args') + end end else - output:write(call_args) + if fn.receives_array_args then + if #args > 0 or fn.call_fail then + output:write('args, '..call_args) + else + output:write('args') + end + else + output:write(call_args) + end end if fn.arena_return then diff --git a/src/nvim/generators/gen_api_ui_events.lua b/src/nvim/generators/gen_api_ui_events.lua index ea66be7ee8..c9a2e3ff66 100755 --- a/src/nvim/generators/gen_api_ui_events.lua +++ b/src/nvim/generators/gen_api_ui_events.lua @@ -3,14 +3,13 @@ local mpack = require('mpack') local nvimdir = arg[1] package.path = nvimdir .. '/?.lua;' .. package.path -assert(#arg == 8) +assert(#arg == 7) local input = io.open(arg[2], 'rb') local proto_output = io.open(arg[3], 'wb') local call_output = io.open(arg[4], 'wb') local remote_output = io.open(arg[5], 'wb') -local bridge_output = io.open(arg[6], 'wb') -local metadata_output = io.open(arg[7], 'wb') -local client_output = io.open(arg[8], 'wb') +local metadata_output = io.open(arg[6], 'wb') +local client_output = io.open(arg[7], 'wb') local c_grammar = require('generators.c_grammar') local events = c_grammar.grammar:match(input:read('*all')) @@ -119,62 +118,6 @@ for i = 1, #events do remote_output:write(' push_call(ui, "'..ev.name..'", args);\n') remote_output:write('}\n\n') end - - if not ev.bridge_impl and not ev.noexport then - local send, argv, recv, recv_argv, recv_cleanup = '', '', '', '', '' - local argc = 1 - for j = 1, #ev.parameters do - local param = ev.parameters[j] - local copy = 'copy_'..param[2] - if param[1] == 'String' then - send = send..' String copy_'..param[2]..' = copy_string('..param[2]..', NULL);\n' - argv = argv..', '..copy..'.data, INT2PTR('..copy..'.size)' - recv = (recv..' String '..param[2].. - ' = (String){.data = argv['..argc..'],'.. - '.size = (size_t)argv['..(argc+1)..']};\n') - recv_argv = recv_argv..', '..param[2] - recv_cleanup = recv_cleanup..' api_free_string('..param[2]..');\n' - argc = argc+2 - elseif param[1] == 'Array' then - send = send..' Array '..copy..' = copy_array('..param[2]..', NULL);\n' - argv = argv..', '..copy..'.items, INT2PTR('..copy..'.size)' - recv = (recv..' Array '..param[2].. - ' = (Array){.items = argv['..argc..'],'.. - '.size = (size_t)argv['..(argc+1)..']};\n') - recv_argv = recv_argv..', '..param[2] - recv_cleanup = recv_cleanup..' api_free_array('..param[2]..');\n' - argc = argc+2 - elseif param[1] == 'Object' then - send = send..' Object *'..copy..' = xmalloc(sizeof(Object));\n' - send = send..' *'..copy..' = copy_object('..param[2]..', NULL);\n' - argv = argv..', '..copy - recv = recv..' Object '..param[2]..' = *(Object *)argv['..argc..'];\n' - recv_argv = recv_argv..', '..param[2] - recv_cleanup = (recv_cleanup..' api_free_object('..param[2]..');\n'.. - ' xfree(argv['..argc..']);\n') - argc = argc+1 - elseif param[1] == 'Integer' or param[1] == 'Boolean' then - argv = argv..', INT2PTR('..param[2]..')' - recv_argv = recv_argv..', PTR2INT(argv['..argc..'])' - argc = argc+1 - else - assert(false) - end - end - bridge_output:write('static void ui_bridge_'..ev.name.. - '_event(void **argv)\n{\n') - bridge_output:write(' UI *ui = UI(argv[0]);\n') - bridge_output:write(recv) - bridge_output:write(' ui->'..ev.name..'(ui'..recv_argv..');\n') - bridge_output:write(recv_cleanup) - bridge_output:write('}\n\n') - - bridge_output:write('static void ui_bridge_'..ev.name) - write_signature(bridge_output, ev, 'UI *ui') - bridge_output:write('\n{\n') - bridge_output:write(send) - bridge_output:write(' UI_BRIDGE_CALL(ui, '..ev.name..', '..argc..', ui'..argv..');\n}\n\n') - end end if not (ev.remote_only and ev.remote_impl) then diff --git a/src/nvim/generators/gen_ex_cmds.lua b/src/nvim/generators/gen_ex_cmds.lua index 3a022d45c8..0c1051b04e 100644 --- a/src/nvim/generators/gen_ex_cmds.lua +++ b/src/nvim/generators/gen_ex_cmds.lua @@ -64,7 +64,6 @@ defsfile:write(string.format([[ #include "nvim/ex_docmd.h" #include "nvim/ex_eval.h" #include "nvim/ex_session.h" -#include "nvim/hardcopy.h" #include "nvim/help.h" #include "nvim/indent.h" #include "nvim/locale.h" diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 52a48a8389..9c4df59819 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -328,9 +328,6 @@ EXTERN sctx_T current_sctx INIT(= { 0, 0, 0 }); // ID of the current channel making a client API call EXTERN uint64_t current_channel_id INIT(= 0); -// ID of the client channel. Used by ui client -EXTERN uint64_t ui_client_channel_id INIT(= 0); - EXTERN bool did_source_packages INIT(= false); // Scope information for the code that indirectly triggered the current @@ -494,9 +491,9 @@ EXTERN bool exiting INIT(= false); // internal value of v:dying EXTERN int v_dying INIT(= 0); // is stdin a terminal? -EXTERN int stdin_isatty INIT(= true); +EXTERN bool stdin_isatty INIT(= true); // is stdout a terminal? -EXTERN int stdout_isatty INIT(= true); +EXTERN bool stdout_isatty INIT(= true); /// filedesc set by embedder for reading first buffer like `cmd | nvim -` EXTERN int stdin_fd INIT(= -1); @@ -844,9 +841,6 @@ EXTERN int stl_syntax INIT(= 0); // don't use 'hlsearch' temporarily EXTERN bool no_hlsearch INIT(= false); -// Page number used for %N in 'pageheader' and 'guitablabel'. -EXTERN linenr_T printer_page_num; - EXTERN bool typebuf_was_filled INIT(= false); // received text from client // or from feedkeys() @@ -1088,8 +1082,6 @@ typedef enum { // Only filled for Win32. EXTERN char windowsVersion[20] INIT(= { 0 }); -EXTERN int exit_need_delay INIT(= 0); - /// While executing a regexp and set to OPTION_MAGIC_ON or OPTION_MAGIC_OFF this /// overrules p_magic. Otherwise set to OPTION_MAGIC_NOT_SET. EXTERN optmagic_T magic_overruled INIT(= OPTION_MAGIC_NOT_SET); diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c deleted file mode 100644 index 0240761483..0000000000 --- a/src/nvim/hardcopy.c +++ /dev/null @@ -1,3077 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - -// hardcopy.c: printing to paper - -#include <assert.h> -#include <ctype.h> -#include <stdbool.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "nvim/ascii.h" -#include "nvim/buffer.h" -#include "nvim/charset.h" -#include "nvim/eval.h" -#include "nvim/ex_cmds_defs.h" -#include "nvim/ex_docmd.h" -#include "nvim/fileio.h" -#include "nvim/garray.h" -#include "nvim/gettext.h" -#include "nvim/globals.h" -#include "nvim/grid.h" -#include "nvim/hardcopy.h" -#include "nvim/highlight_defs.h" -#include "nvim/highlight_group.h" -#include "nvim/indent.h" -#include "nvim/macros.h" -#include "nvim/mbyte.h" -#include "nvim/memline.h" -#include "nvim/memory.h" -#include "nvim/message.h" -#include "nvim/option.h" -#include "nvim/os/input.h" -#include "nvim/os/os.h" -#include "nvim/os/time.h" -#include "nvim/path.h" -#include "nvim/pos.h" -#include "nvim/runtime.h" -#include "nvim/statusline.h" -#include "nvim/strings.h" -#include "nvim/syntax.h" -#include "nvim/ui.h" -#include "nvim/version.h" -#include "nvim/vim.h" - -// To implement printing on a platform, the following functions must be -// defined: -// -// int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit) -// Called once. Code should display printer dialogue (if appropriate) and -// determine printer font and margin settings. Reset has_color if the printer -// doesn't support colors at all. -// Returns FAIL to abort. -// -// int mch_print_begin(prt_settings_T *settings) -// Called to start the print job. -// Return false to abort. -// -// int mch_print_begin_page(char_u *msg) -// Called at the start of each page. -// "msg" indicates the progress of the print job, can be NULL. -// Return false to abort. -// -// int mch_print_end_page() -// Called at the end of each page. -// Return false to abort. -// -// int mch_print_blank_page() -// Called to generate a blank page for collated, duplex, multiple copy -// document. Return false to abort. -// -// void mch_print_end(prt_settings_T *psettings) -// Called at normal end of print job. -// -// void mch_print_cleanup() -// Called if print job ends normally or is abandoned. Free any memory, close -// devices and handles. Also called when mch_print_begin() fails, but not -// when mch_print_init() fails. -// -// void mch_print_set_font(int Bold, int Italic, int Underline); -// Called whenever the font style changes. -// -// void mch_print_set_bg(uint32_t bgcol); -// Called to set the background color for the following text. Parameter is an -// RGB value. -// -// void mch_print_set_fg(uint32_t fgcol); -// Called to set the foreground color for the following text. Parameter is an -// RGB value. -// -// mch_print_start_line(int margin, int page_line) -// Sets the current position at the start of line "page_line". -// If margin is true start in the left margin (for header and line number). -// -// int mch_print_text_out(char_u *p, size_t len); -// Output one character of text p[len] at the current position. -// Return true if there is no room for another character in the same line. -// -// Note that the generic code has no idea of margins. The machine code should -// simply make the page look smaller! The header and the line numbers are -// printed in the margin. - -static option_table_T printer_opts[OPT_PRINT_NUM_OPTIONS] = { - { "top", true, 0, NULL, 0, false }, - { "bottom", true, 0, NULL, 0, false }, - { "left", true, 0, NULL, 0, false }, - { "right", true, 0, NULL, 0, false }, - { "header", true, 0, NULL, 0, false }, - { "syntax", false, 0, NULL, 0, false }, - { "number", false, 0, NULL, 0, false }, - { "wrap", false, 0, NULL, 0, false }, - { "duplex", false, 0, NULL, 0, false }, - { "portrait", false, 0, NULL, 0, false }, - { "paper", false, 0, NULL, 0, false }, - { "collate", false, 0, NULL, 0, false }, - { "jobsplit", false, 0, NULL, 0, false }, - { "formfeed", false, 0, NULL, 0, false }, -}; - -static const uint32_t cterm_color_8[8] = { - 0x000000, 0xff0000, 0x00ff00, 0xffff00, - 0x0000ff, 0xff00ff, 0x00ffff, 0xffffff -}; - -static const uint32_t cterm_color_16[16] = { - 0x000000, 0x0000c0, 0x008000, 0x004080, - 0xc00000, 0xc000c0, 0x808000, 0xc0c0c0, - 0x808080, 0x6060ff, 0x00ff00, 0x00ffff, - 0xff8080, 0xff40ff, 0xffff00, 0xffffff -}; - -static int current_syn_id; - -enum { - PRCOLOR_BLACK = 0, - PRCOLOR_WHITE = 0xffffff, -}; - -static TriState curr_italic; -static TriState curr_bold; -static TriState curr_underline; -static uint32_t curr_bg; -static uint32_t curr_fg; -static int page_count; - -enum { - OPT_MBFONT_USECOURIER = 0, - OPT_MBFONT_ASCII = 1, - OPT_MBFONT_REGULAR = 2, - OPT_MBFONT_BOLD = 3, - OPT_MBFONT_OBLIQUE = 4, - OPT_MBFONT_BOLDOBLIQUE = 5, - OPT_MBFONT_NUM_OPTIONS = 6, -}; - -static option_table_T mbfont_opts[OPT_MBFONT_NUM_OPTIONS] = { - { "c", false, 0, NULL, 0, false }, - { "a", false, 0, NULL, 0, false }, - { "r", false, 0, NULL, 0, false }, - { "b", false, 0, NULL, 0, false }, - { "i", false, 0, NULL, 0, false }, - { "o", false, 0, NULL, 0, false }, -}; - -// These values determine the print position on a page. -typedef struct { - int lead_spaces; // remaining spaces for a TAB - int print_pos; // virtual column for computing TABs - colnr_T column; // byte column - linenr_T file_line; // line nr in the buffer - size_t bytes_printed; // bytes printed so far - int ff; // seen form feed character -} prt_pos_T; - -struct prt_mediasize_S { - char *name; - double width; // width and height in points for portrait - double height; -}; - -// PS font names, must be in Roman, Bold, Italic, Bold-Italic order -struct prt_ps_font_S { - int wx; - int uline_offset; - int uline_width; - int bbox_min_y; - int bbox_max_y; - char *(ps_fontname[4]); -}; - -// Structures to map user named encoding and mapping to PS equivalents for -// building CID font name -struct prt_ps_encoding_S { - char *encoding; - char *cmap_encoding; - int needs_charset; -}; - -struct prt_ps_charset_S { - char *charset; - char *cmap_charset; - int has_charset; -}; - -// Collections of encodings and charsets for multi-byte printing -struct prt_ps_mbfont_S { - int num_encodings; - struct prt_ps_encoding_S *encodings; - int num_charsets; - struct prt_ps_charset_S *charsets; - char *ascii_enc; - char *defcs; -}; - -// Types of PS resource file currently used -typedef enum { - PRT_RESOURCE_TYPE_PROCSET = 0, - PRT_RESOURCE_TYPE_ENCODING = 1, - PRT_RESOURCE_TYPE_CMAP = 2, -} PrtResourceType; - -// String versions of PS resource types -static const char *const prt_resource_types[] = { - [PRT_RESOURCE_TYPE_PROCSET] = "procset", - [PRT_RESOURCE_TYPE_ENCODING] = "encoding", - [PRT_RESOURCE_TYPE_CMAP] = "cmap", -}; - -struct prt_ps_resource_S { - char_u name[64]; - char_u filename[MAXPATHL + 1]; - PrtResourceType type; - char_u title[256]; - char version[256]; -}; - -struct prt_dsc_comment_S { - char *string; - int len; - int type; -}; - -struct prt_dsc_line_S { - int type; - char *string; - int len; -}; - -// Static buffer to read initial comments in a resource file, some can have a -// couple of KB of comments! -#define PRT_FILE_BUFFER_LEN (2048) -struct prt_resfile_buffer_S { - char buffer[PRT_FILE_BUFFER_LEN]; - int len; - int line_start; - int line_end; -}; - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "hardcopy.c.generated.h" -#endif - -// Parse 'printoptions' and set the flags in "printer_opts". -// Returns an error message or NULL; -char *parse_printoptions(void) -{ - return parse_list_options(p_popt, printer_opts, OPT_PRINT_NUM_OPTIONS); -} - -// Parse 'printoptions' and set the flags in "printer_opts". -// Returns an error message or NULL; -char *parse_printmbfont(void) -{ - return parse_list_options(p_pmfn, mbfont_opts, OPT_MBFONT_NUM_OPTIONS); -} - -// Parse a list of options in the form -// option:value,option:value,option:value -// -// "value" can start with a number which is parsed out, e.g. margin:12mm -// -// Returns an error message for an illegal option, NULL otherwise. -// Only used for the printer at the moment... -static char *parse_list_options(char *option_str, option_table_T *table, size_t table_size) -{ - option_table_T *old_opts; - char *ret = NULL; - char *stringp; - char *colonp; - char *commap; - char *p; - size_t idx = 0; // init for GCC - int len; - - // Save the old values, so that they can be restored in case of an error. - old_opts = (option_table_T *)xmalloc(sizeof(option_table_T) * table_size); - - for (idx = 0; idx < table_size; idx++) { - old_opts[idx] = table[idx]; - table[idx].present = false; - } - - // Repeat for all comma separated parts. - stringp = option_str; - while (*stringp) { - colonp = vim_strchr(stringp, ':'); - if (colonp == NULL) { - ret = N_("E550: Missing colon"); - break; - } - commap = vim_strchr(stringp, ','); - if (commap == NULL) { - commap = option_str + strlen(option_str); - } - - len = (int)(colonp - stringp); - - for (idx = 0; idx < table_size; idx++) { - if (STRNICMP(stringp, table[idx].name, len) == 0) { - break; - } - } - - if (idx == table_size) { - ret = N_("E551: Illegal component"); - break; - } - - p = colonp + 1; - table[idx].present = true; - - if (table[idx].hasnum) { - if (!ascii_isdigit(*p)) { - ret = N_("E552: digit expected"); - break; - } - - table[idx].number = getdigits_int(&p, false, 0); - } - - table[idx].string = (char_u *)p; - table[idx].strlen = (int)(commap - p); - - stringp = commap; - if (*stringp == ',') { - stringp++; - } - } - - if (ret != NULL) { - // Restore old options in case of error - for (idx = 0; idx < table_size; idx++) { - table[idx] = old_opts[idx]; - } - } - - xfree(old_opts); - return ret; -} - -// If using a dark background, the colors will probably be too bright to show -// up well on white paper, so reduce their brightness. -static uint32_t darken_rgb(uint32_t rgb) -{ - return ((rgb >> 17) << 16) - + (((rgb & 0xff00) >> 9) << 8) - + ((rgb & 0xff) >> 1); -} - -static uint32_t prt_get_term_color(int colorindex) -{ - // TODO(vim): Should check for xterm with 88 or 256 colors. - if (t_colors > 8) { - return cterm_color_16[colorindex % 16]; - } - return cterm_color_8[colorindex % 8]; -} - -static uint32_t prt_get_color(int hl_id, int modec) -{ - int colorindex; - uint32_t fg_color; - - const char *color = highlight_color(hl_id, "fg#", 'g'); - if (color != NULL) { - RgbValue rgb = name_to_color(color, &colorindex); - if (rgb != -1) { - return (uint32_t)rgb; - } - } - - color = highlight_color(hl_id, "fg", modec); - if (color == NULL) { - colorindex = 0; - } else { - colorindex = atoi(color); - } - - if (colorindex >= 0 && colorindex < t_colors) { - fg_color = prt_get_term_color(colorindex); - } else { - fg_color = PRCOLOR_BLACK; - } - - return fg_color; -} - -static void prt_get_attr(int hl_id, prt_text_attr_T *pattr, int modec) -{ - pattr->bold = (highlight_has_attr(hl_id, HL_BOLD, modec) != NULL); - pattr->italic = (highlight_has_attr(hl_id, HL_ITALIC, modec) != NULL); - pattr->underline = (highlight_has_attr(hl_id, HL_UNDERLINE, modec) != NULL); - pattr->undercurl = (highlight_has_attr(hl_id, HL_UNDERCURL, modec) != NULL); - pattr->underdouble = (highlight_has_attr(hl_id, HL_UNDERDOUBLE, modec) != NULL); - pattr->underdotted = (highlight_has_attr(hl_id, HL_UNDERDOTTED, modec) != NULL); - pattr->underdashed = (highlight_has_attr(hl_id, HL_UNDERDASHED, modec) != NULL); - - uint32_t fg_color = prt_get_color(hl_id, modec); - - if (fg_color == PRCOLOR_WHITE) { - fg_color = PRCOLOR_BLACK; - } else if (*p_bg == 'd') { - fg_color = darken_rgb(fg_color); - } - - pattr->fg_color = fg_color; - pattr->bg_color = PRCOLOR_WHITE; -} - -static void prt_set_fg(uint32_t fg) -{ - if (fg != curr_fg) { - curr_fg = fg; - mch_print_set_fg(fg); - } -} - -static void prt_set_bg(uint32_t bg) -{ - if (bg != curr_bg) { - curr_bg = bg; - mch_print_set_bg(bg); - } -} - -static void prt_set_font(const TriState bold, const TriState italic, const TriState underline) -{ - if (curr_bold != bold - || curr_italic != italic - || curr_underline != underline) { - curr_underline = underline; - curr_italic = italic; - curr_bold = bold; - mch_print_set_font(bold, italic, underline); - } -} - -// Print the line number in the left margin. -static void prt_line_number(prt_settings_T *const psettings, const int page_line, - const linenr_T lnum) -{ - prt_set_fg(psettings->number.fg_color); - prt_set_bg(psettings->number.bg_color); - prt_set_font(psettings->number.bold, psettings->number.italic, - psettings->number.underline); - mch_print_start_line(true, page_line); - - // Leave two spaces between the number and the text; depends on - // PRINT_NUMBER_WIDTH. - char tbuf[20]; - snprintf(tbuf, sizeof(tbuf), "%6ld", (long)lnum); - for (int i = 0; i < 6; i++) { - (void)mch_print_text_out((char_u *)(&tbuf[i]), 1); - } - - if (psettings->do_syntax) { - // Set colors for next character. - current_syn_id = -1; - } else { - // Set colors and font back to normal. - prt_set_fg(PRCOLOR_BLACK); - prt_set_bg(PRCOLOR_WHITE); - prt_set_font(kFalse, kFalse, kFalse); - } -} - -// Get the currently effective header height. -int prt_header_height(void) -{ - if (printer_opts[OPT_PRINT_HEADERHEIGHT].present) { - return printer_opts[OPT_PRINT_HEADERHEIGHT].number; - } - return 2; -} - -// Return true if using a line number for printing. -int prt_use_number(void) -{ - return printer_opts[OPT_PRINT_NUMBER].present - && TOLOWER_ASC(printer_opts[OPT_PRINT_NUMBER].string[0]) == 'y'; -} - -// Return the unit used in a margin item in 'printoptions'. -// Returns PRT_UNIT_NONE if not recognized. -int prt_get_unit(int idx) -{ - int u = PRT_UNIT_NONE; - int i; - static char *(units[4]) = PRT_UNIT_NAMES; - - if (printer_opts[idx].present) { - for (i = 0; i < 4; i++) { - if (STRNICMP(printer_opts[idx].string, units[i], 2) == 0) { - u = i; - break; - } - } - } - return u; -} - -// Print the page header. -static void prt_header(prt_settings_T *const psettings, const int pagenum, const linenr_T lnum) -{ - int width = psettings->chars_per_line; - - // Also use the space for the line number. - if (prt_use_number()) { - width += PRINT_NUMBER_WIDTH; - } - - assert(width >= 0); - const size_t tbuf_size = (size_t)width + IOSIZE; - char_u *tbuf = xmalloc(tbuf_size); - - if (*p_header != NUL) { - linenr_T tmp_lnum, tmp_topline, tmp_botline; - - // Need to (temporarily) set current line number and first/last line - // number on the 'window'. Since we don't know how long the page is, - // set the first and current line number to the top line, and guess - // that the page length is 64. - tmp_lnum = curwin->w_cursor.lnum; - tmp_topline = curwin->w_topline; - tmp_botline = curwin->w_botline; - curwin->w_cursor.lnum = lnum; - curwin->w_topline = lnum; - curwin->w_botline = lnum + 63; - printer_page_num = pagenum; - - build_stl_str_hl(curwin, (char *)tbuf, (size_t)width + IOSIZE, - (char *)p_header, "printheader", 0, - ' ', width, NULL, NULL); - - // Reset line numbers - curwin->w_cursor.lnum = tmp_lnum; - curwin->w_topline = tmp_topline; - curwin->w_botline = tmp_botline; - } else { - snprintf((char *)tbuf, tbuf_size, _("Page %d"), pagenum); - } - - prt_set_fg(PRCOLOR_BLACK); - prt_set_bg(PRCOLOR_WHITE); - prt_set_font(kTrue, kFalse, kFalse); - - // Use a negative line number to indicate printing in the top margin. - int page_line = 0 - prt_header_height(); - mch_print_start_line(true, page_line); - for (char_u *p = tbuf; *p != NUL;) { - const int l = utfc_ptr2len((char *)p); - assert(l >= 0); - if (mch_print_text_out(p, (size_t)l)) { - page_line++; - if (page_line >= 0) { // out of room in header - break; - } - mch_print_start_line(true, page_line); - } - p += l; - } - - xfree(tbuf); - - if (psettings->do_syntax) { - // Set colors for next character. - current_syn_id = -1; - } else { - // Set colors and font back to normal. - prt_set_fg(PRCOLOR_BLACK); - prt_set_bg(PRCOLOR_WHITE); - prt_set_font(kFalse, kFalse, kFalse); - } -} - -// Display a print status message. -static void prt_message(char_u *s) -{ - // TODO(bfredl): delete this - grid_fill(&default_grid, Rows - 1, Rows, 0, Columns, ' ', ' ', 0); - grid_puts(&default_grid, (char *)s, Rows - 1, 0, HL_ATTR(HLF_R)); - ui_flush(); -} - -void ex_hardcopy(exarg_T *eap) -{ - linenr_T lnum; - int collated_copies, uncollated_copies; - prt_settings_T settings; - size_t bytes_to_print = 0; - int page_line; - int jobsplit; - - CLEAR_FIELD(settings); - settings.has_color = true; - - if (*eap->arg == '>') { - char *errormsg = NULL; - - // Expand things like "%.ps". - if (expand_filename(eap, eap->cmdlinep, &errormsg) == FAIL) { - if (errormsg != NULL) { - emsg(errormsg); - } - return; - } - settings.outfile = (char_u *)skipwhite(eap->arg + 1); - } else if (*eap->arg != NUL) { - settings.arguments = (char_u *)eap->arg; - } - - // Initialise for printing. Ask the user for settings, unless forceit is - // set. - // The mch_print_init() code should set up margins if applicable. (It may - // not be a real printer - for example the engine might generate HTML or - // PS.) - if (mch_print_init(&settings, - curbuf->b_fname == NULL ? (char_u *)buf_spname(curbuf) : curbuf->b_sfname == - NULL ? (char_u *)curbuf->b_fname : (char_u *)curbuf->b_sfname, - eap->forceit) == FAIL) { - return; - } - - settings.modec = 'c'; - - if (!syntax_present(curwin)) { - settings.do_syntax = false; - } else if (printer_opts[OPT_PRINT_SYNTAX].present - && TOLOWER_ASC(printer_opts[OPT_PRINT_SYNTAX].string[0]) != 'a') { - settings.do_syntax = - (TOLOWER_ASC(printer_opts[OPT_PRINT_SYNTAX].string[0]) == 'y'); - } else { - settings.do_syntax = settings.has_color; - } - - // Set up printing attributes for line numbers - settings.number.fg_color = PRCOLOR_BLACK; - settings.number.bg_color = PRCOLOR_WHITE; - settings.number.bold = kFalse; - settings.number.italic = kTrue; - settings.number.underline = kFalse; - - // Syntax highlighting of line numbers. - if (prt_use_number() && settings.do_syntax) { - int id = syn_name2id("LineNr"); - if (id > 0) { - id = syn_get_final_id(id); - } - - prt_get_attr(id, &settings.number, settings.modec); - } - - // Estimate the total lines to be printed - for (lnum = eap->line1; lnum <= eap->line2; lnum++) { - bytes_to_print += strlen(skipwhite(ml_get(lnum))); - } - if (bytes_to_print == 0) { - msg(_("No text to be printed")); - goto print_fail_no_begin; - } - - // Set colors and font to normal. - curr_bg = 0xffffffff; - curr_fg = 0xffffffff; - curr_italic = kNone; - curr_bold = kNone; - curr_underline = kNone; - - prt_set_fg(PRCOLOR_BLACK); - prt_set_bg(PRCOLOR_WHITE); - prt_set_font(kFalse, kFalse, kFalse); - current_syn_id = -1; - - jobsplit = (printer_opts[OPT_PRINT_JOBSPLIT].present - && TOLOWER_ASC(printer_opts[OPT_PRINT_JOBSPLIT].string[0]) == 'y'); - - if (!mch_print_begin(&settings)) { - goto print_fail_no_begin; - } - - // Loop over collated copies: 1 2 3, 1 2 3, ... - page_count = 0; - for (collated_copies = 0; - collated_copies < settings.n_collated_copies; - collated_copies++) { - prt_pos_T prtpos; // current print position - prt_pos_T page_prtpos; // print position at page start - int side; - - CLEAR_FIELD(page_prtpos); - page_prtpos.file_line = eap->line1; - prtpos = page_prtpos; - - if (jobsplit && collated_copies > 0) { - // Splitting jobs: Stop a previous job and start a new one. - mch_print_end(&settings); - if (!mch_print_begin(&settings)) { - goto print_fail_no_begin; - } - } - - // Loop over all pages in the print job: 1 2 3 ... - for (page_count = 0; prtpos.file_line <= eap->line2; page_count++) { - // Loop over uncollated copies: 1 1 1, 2 2 2, 3 3 3, ... - // For duplex: 12 12 12 34 34 34, ... - for (uncollated_copies = 0; - uncollated_copies < settings.n_uncollated_copies; - uncollated_copies++) { - // Set the print position to the start of this page. - prtpos = page_prtpos; - - // Do front and rear side of a page. - for (side = 0; side <= settings.duplex; side++) { - // Print one page. - - // Check for interrupt character every page. - os_breakcheck(); - if (got_int || settings.user_abort) { - goto print_fail; - } - - assert(prtpos.bytes_printed <= SIZE_MAX / 100); - sprintf((char *)IObuff, _("Printing page %d (%zu%%)"), // NOLINT(runtime/printf) - page_count + 1 + side, - prtpos.bytes_printed * 100 / bytes_to_print); - if (!mch_print_begin_page((char_u *)IObuff)) { - goto print_fail; - } - - if (settings.n_collated_copies > 1) { - snprintf(IObuff + strlen(IObuff), IOSIZE - strlen(IObuff), - _(" Copy %d of %d"), - collated_copies + 1, - settings.n_collated_copies); - } - prt_message((char_u *)IObuff); - - // Output header if required - if (prt_header_height() > 0) { - prt_header(&settings, page_count + 1 + side, - prtpos.file_line); - } - - for (page_line = 0; page_line < settings.lines_per_page; page_line++) { - prtpos.column = hardcopy_line(&settings, - page_line, &prtpos); - if (prtpos.column == 0) { - // finished a file line - prtpos.bytes_printed += - strlen(skipwhite(ml_get(prtpos.file_line))); - if (++prtpos.file_line > eap->line2) { - break; // reached the end - } - } else if (prtpos.ff) { - // Line had a formfeed in it - start new page but - // stay on the current line - break; - } - } - - if (!mch_print_end_page()) { - goto print_fail; - } - if (prtpos.file_line > eap->line2) { - break; // reached the end - } - } - - // Extra blank page for duplexing with odd number of pages and - // more copies to come. - if (prtpos.file_line > eap->line2 && settings.duplex - && side == 0 - && uncollated_copies + 1 < settings.n_uncollated_copies) { - if (!mch_print_blank_page()) { - goto print_fail; - } - } - } - if (settings.duplex && prtpos.file_line <= eap->line2) { - page_count++; - } - - // Remember the position where the next page starts. - page_prtpos = prtpos; - } - - vim_snprintf((char *)IObuff, IOSIZE, _("Printed: %s"), - settings.jobname); - prt_message((char_u *)IObuff); - } - -print_fail: - if (got_int || settings.user_abort) { - snprintf(IObuff, IOSIZE, "%s", _("Printing aborted")); - prt_message((char_u *)IObuff); - } - mch_print_end(&settings); - -print_fail_no_begin: - mch_print_cleanup(); -} - -// Print one page line. -// Return the next column to print, or zero if the line is finished. -static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T *ppos) -{ - colnr_T col; - char_u *line; - int need_break = false; - int outputlen; - int tab_spaces; - int print_pos; - prt_text_attr_T attr; - int id; - - if (ppos->column == 0 || ppos->ff) { - print_pos = 0; - tab_spaces = 0; - if (!ppos->ff && prt_use_number()) { - prt_line_number(psettings, page_line, ppos->file_line); - } - ppos->ff = false; - } else { - // left over from wrap halfway through a tab - print_pos = ppos->print_pos; - tab_spaces = ppos->lead_spaces; - } - - mch_print_start_line(false, page_line); - line = (char_u *)ml_get(ppos->file_line); - - // Loop over the columns until the end of the file line or right margin. - for (col = ppos->column; line[col] != NUL && !need_break; col += outputlen) { - if ((outputlen = utfc_ptr2len((char *)line + col)) < 1) { - outputlen = 1; - } - // syntax highlighting stuff. - if (psettings->do_syntax) { - id = syn_get_id(curwin, ppos->file_line, col, 1, NULL, false); - if (id > 0) { - id = syn_get_final_id(id); - } else { - id = 0; - } - // Get the line again, a multi-line regexp may invalidate it. - line = (char_u *)ml_get(ppos->file_line); - - if (id != current_syn_id) { - current_syn_id = id; - prt_get_attr(id, &attr, psettings->modec); - prt_set_font(attr.bold, attr.italic, attr.underline); - prt_set_fg(attr.fg_color); - prt_set_bg(attr.bg_color); - } - } - - // Appropriately expand any tabs to spaces. - if (line[col] == TAB || tab_spaces != 0) { - if (tab_spaces == 0) { - tab_spaces = tabstop_padding(print_pos, - curbuf->b_p_ts, - curbuf->b_p_vts_array); - } - - while (tab_spaces > 0) { - need_break = mch_print_text_out((char_u *)" ", 1); - print_pos++; - tab_spaces--; - if (need_break) { - break; - } - } - // Keep the TAB if we didn't finish it. - if (need_break && tab_spaces > 0) { - break; - } - } else if (line[col] == FF - && printer_opts[OPT_PRINT_FORMFEED].present - && TOLOWER_ASC(printer_opts[OPT_PRINT_FORMFEED].string[0]) - == 'y') { - ppos->ff = true; - need_break = 1; - } else { - need_break = mch_print_text_out(line + col, (size_t)outputlen); - print_pos += utf_ptr2cells((char *)line + col); - } - } - - ppos->lead_spaces = tab_spaces; - ppos->print_pos = print_pos; - - // Start next line of file if we clip lines, or have reached end of the - // line, unless we are doing a formfeed. - if (!ppos->ff - && (line[col] == NUL - || (printer_opts[OPT_PRINT_WRAP].present - && TOLOWER_ASC(printer_opts[OPT_PRINT_WRAP].string[0]) - == 'n'))) { - return 0; - } - return col; -} - -// PS printer stuff. -// -// Sources of information to help maintain the PS printing code: -// -// 1. PostScript Language Reference, 3rd Edition, -// Addison-Wesley, 1999, ISBN 0-201-37922-8 -// 2. PostScript Language Program Design, -// Addison-Wesley, 1988, ISBN 0-201-14396-8 -// 3. PostScript Tutorial and Cookbook, -// Addison Wesley, 1985, ISBN 0-201-10179-3 -// 4. PostScript Language Document Structuring Conventions Specification, -// version 3.0, -// Adobe Technote 5001, 25th September 1992 -// 5. PostScript Printer Description File Format Specification, Version 4.3, -// Adobe technote 5003, 9th February 1996 -// 6. Adobe Font Metrics File Format Specification, Version 4.1, -// Adobe Technote 5007, 7th October 1998 -// 7. Adobe CMap and CIDFont Files Specification, Version 1.0, -// Adobe Technote 5014, 8th October 1996 -// 8. Adobe CJKV Character Collections and CMaps for CID-Keyed Fonts, -// Adoboe Technote 5094, 8th September, 2001 -// 9. CJKV Information Processing, 2nd Edition, -// O'Reilly, 2002, ISBN 1-56592-224-7 -// -// Some of these documents can be found in PDF form on Adobe's web site - -// http://www.adobe.com - -enum { - PRT_PS_DEFAULT_DPI = 72, // Default user space resolution - PRT_PS_DEFAULT_FONTSIZE = 10, -}; - -#define PRT_MEDIASIZE_LEN ARRAY_SIZE(prt_mediasize) - -static struct prt_mediasize_S prt_mediasize[] = { - { "A4", 595.0, 842.0 }, - { "letter", 612.0, 792.0 }, - { "10x14", 720.0, 1008.0 }, - { "A3", 842.0, 1191.0 }, - { "A5", 420.0, 595.0 }, - { "B4", 729.0, 1032.0 }, - { "B5", 516.0, 729.0 }, - { "executive", 522.0, 756.0 }, - { "folio", 595.0, 935.0 }, - { "ledger", 1224.0, 792.0 }, // Yes, it is wider than taller! - { "legal", 612.0, 1008.0 }, - { "quarto", 610.0, 780.0 }, - { "statement", 396.0, 612.0 }, - { "tabloid", 792.0, 1224.0 } -}; - -enum { - PRT_PS_FONT_ROMAN = 0, - PRT_PS_FONT_BOLD = 1, - PRT_PS_FONT_OBLIQUE = 2, - PRT_PS_FONT_BOLDOBLIQUE = 3, -}; - -// Standard font metrics for Courier family -static struct prt_ps_font_S prt_ps_courier_font = { - 600, - -100, 50, - -250, 805, - { "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique" } -}; - -// Generic font metrics for multi-byte fonts -static struct prt_ps_font_S prt_ps_mb_font = { - 1000, - -100, 50, - -250, 805, - { NULL, NULL, NULL, NULL } -}; - -// Pointer to current font set being used -static struct prt_ps_font_S *prt_ps_font; - -enum { - CS_JIS_C_1978 = 0x01, - CS_JIS_X_1983 = 0x02, - CS_JIS_X_1990 = 0x04, - CS_NEC = 0x08, - CS_MSWINDOWS = 0x10, - CS_CP932 = 0x20, - CS_KANJITALK6 = 0x40, - CS_KANJITALK7 = 0x80, -}; - -// Japanese encodings and charsets -static struct prt_ps_encoding_S j_encodings[] = { - { "iso-2022-jp", NULL, (CS_JIS_C_1978|CS_JIS_X_1983|CS_JIS_X_1990| - CS_NEC) }, - { "euc-jp", "EUC", (CS_JIS_C_1978|CS_JIS_X_1983|CS_JIS_X_1990) }, - { "sjis", "RKSJ", (CS_JIS_C_1978|CS_JIS_X_1983|CS_MSWINDOWS| - CS_KANJITALK6|CS_KANJITALK7) }, - { "cp932", "RKSJ", CS_JIS_X_1983 }, - { "ucs-2", "UCS2", CS_JIS_X_1990 }, - { "utf-8", "UTF8", CS_JIS_X_1990 } -}; -static struct prt_ps_charset_S j_charsets[] = { - { "JIS_C_1978", "78", CS_JIS_C_1978 }, - { "JIS_X_1983", NULL, CS_JIS_X_1983 }, - { "JIS_X_1990", "Hojo", CS_JIS_X_1990 }, - { "NEC", "Ext", CS_NEC }, - { "MSWINDOWS", "90ms", CS_MSWINDOWS }, - { "CP932", "90ms", CS_JIS_X_1983 }, - { "KANJITALK6", "83pv", CS_KANJITALK6 }, - { "KANJITALK7", "90pv", CS_KANJITALK7 } -}; - -enum { - CS_GB_2312_80 = 0x01, - CS_GBT_12345_90 = 0x02, - CS_GBK2K = 0x04, - CS_SC_MAC = 0x08, - CS_GBT_90_MAC = 0x10, - CS_GBK = 0x20, - CS_SC_ISO10646 = 0x40, -}; - -// Simplified Chinese encodings and charsets -static struct prt_ps_encoding_S sc_encodings[] = { - { "iso-2022", NULL, (CS_GB_2312_80|CS_GBT_12345_90) }, - { "gb18030", NULL, CS_GBK2K }, - { "euc-cn", "EUC", (CS_GB_2312_80|CS_GBT_12345_90|CS_SC_MAC| - CS_GBT_90_MAC) }, - { "gbk", "EUC", CS_GBK }, - { "ucs-2", "UCS2", CS_SC_ISO10646 }, - { "utf-8", "UTF8", CS_SC_ISO10646 } -}; -static struct prt_ps_charset_S sc_charsets[] = { - { "GB_2312-80", "GB", CS_GB_2312_80 }, - { "GBT_12345-90", "GBT", CS_GBT_12345_90 }, - { "MAC", "GBpc", CS_SC_MAC }, - { "GBT-90_MAC", "GBTpc", CS_GBT_90_MAC }, - { "GBK", "GBK", CS_GBK }, - { "GB18030", "GBK2K", CS_GBK2K }, - { "ISO10646", "UniGB", CS_SC_ISO10646 } -}; - -enum { - CS_CNS_PLANE_1 = 0x01, - CS_CNS_PLANE_2 = 0x02, - CS_CNS_PLANE_1_2 = 0x04, - CS_B5 = 0x08, - CS_ETEN = 0x10, - CS_HK_GCCS = 0x20, - CS_HK_SCS = 0x40, - CS_HK_SCS_ETEN = 0x80, - CS_MTHKL = 0x100, - CS_MTHKS = 0x200, - CS_DLHKL = 0x400, - CS_DLHKS = 0x800, - CS_TC_ISO10646 = 0x1000, -}; - -// Traditional Chinese encodings and charsets -static struct prt_ps_encoding_S tc_encodings[] = { - { "iso-2022", NULL, (CS_CNS_PLANE_1|CS_CNS_PLANE_2) }, - { "euc-tw", "EUC", CS_CNS_PLANE_1_2 }, - { "big5", "B5", (CS_B5|CS_ETEN|CS_HK_GCCS|CS_HK_SCS| - CS_HK_SCS_ETEN|CS_MTHKL|CS_MTHKS|CS_DLHKL| - CS_DLHKS) }, - { "cp950", "B5", CS_B5 }, - { "ucs-2", "UCS2", CS_TC_ISO10646 }, - { "utf-8", "UTF8", CS_TC_ISO10646 }, - { "utf-16", "UTF16", CS_TC_ISO10646 }, - { "utf-32", "UTF32", CS_TC_ISO10646 } -}; -static struct prt_ps_charset_S tc_charsets[] = { - { "CNS_1992_1", "CNS1", CS_CNS_PLANE_1 }, - { "CNS_1992_2", "CNS2", CS_CNS_PLANE_2 }, - { "CNS_1993", "CNS", CS_CNS_PLANE_1_2 }, - { "BIG5", NULL, CS_B5 }, - { "CP950", NULL, CS_B5 }, - { "ETEN", "ETen", CS_ETEN }, - { "HK_GCCS", "HKgccs", CS_HK_GCCS }, - { "SCS", "HKscs", CS_HK_SCS }, - { "SCS_ETEN", "ETHK", CS_HK_SCS_ETEN }, - { "MTHKL", "HKm471", CS_MTHKL }, - { "MTHKS", "HKm314", CS_MTHKS }, - { "DLHKL", "HKdla", CS_DLHKL }, - { "DLHKS", "HKdlb", CS_DLHKS }, - { "ISO10646", "UniCNS", CS_TC_ISO10646 } -}; - -enum { - CS_KR_X_1992 = 0x01, - CS_KR_MAC = 0x02, - CS_KR_X_1992_MS = 0x04, - CS_KR_ISO10646 = 0x08, -}; - -// Korean encodings and charsets -static struct prt_ps_encoding_S k_encodings[] = { - { "iso-2022-kr", NULL, CS_KR_X_1992 }, - { "euc-kr", "EUC", (CS_KR_X_1992|CS_KR_MAC) }, - { "johab", "Johab", CS_KR_X_1992 }, - { "cp1361", "Johab", CS_KR_X_1992 }, - { "uhc", "UHC", CS_KR_X_1992_MS }, - { "cp949", "UHC", CS_KR_X_1992_MS }, - { "ucs-2", "UCS2", CS_KR_ISO10646 }, - { "utf-8", "UTF8", CS_KR_ISO10646 } -}; -static struct prt_ps_charset_S k_charsets[] = { - { "KS_X_1992", "KSC", CS_KR_X_1992 }, - { "CP1361", "KSC", CS_KR_X_1992 }, - { "MAC", "KSCpc", CS_KR_MAC }, - { "MSWINDOWS", "KSCms", CS_KR_X_1992_MS }, - { "CP949", "KSCms", CS_KR_X_1992_MS }, - { "WANSUNG", "KSCms", CS_KR_X_1992_MS }, - { "ISO10646", "UniKS", CS_KR_ISO10646 } -}; - -static struct prt_ps_mbfont_S prt_ps_mbfonts[] = { - { - ARRAY_SIZE(j_encodings), - j_encodings, - ARRAY_SIZE(j_charsets), - j_charsets, - "jis_roman", - "JIS_X_1983" - }, - { - ARRAY_SIZE(sc_encodings), - sc_encodings, - ARRAY_SIZE(sc_charsets), - sc_charsets, - "gb_roman", - "GB_2312-80" - }, - { - ARRAY_SIZE(tc_encodings), - tc_encodings, - ARRAY_SIZE(tc_charsets), - tc_charsets, - "cns_roman", - "BIG5" - }, - { - ARRAY_SIZE(k_encodings), - k_encodings, - ARRAY_SIZE(k_charsets), - k_charsets, - "ks_roman", - "KS_X_1992" - } -}; - -// The PS prolog file version number has to match - if the prolog file is -// updated, increment the number in the file and here. Version checking was -// added as of VIM 6.2. -// The CID prolog file version number behaves as per PS prolog. -// Table of VIM and prolog versions: -// -// VIM Prolog CIDProlog -// 6.2 1.3 -// 7.0 1.4 1.0 -#define PRT_PROLOG_VERSION "1.4" -#define PRT_CID_PROLOG_VERSION "1.0" - -// Strings to look for in a PS resource file -#define PRT_RESOURCE_HEADER "%!PS-Adobe-" -#define PRT_RESOURCE_RESOURCE "Resource-" -#define PRT_RESOURCE_PROCSET "ProcSet" -#define PRT_RESOURCE_ENCODING "Encoding" -#define PRT_RESOURCE_CMAP "CMap" - -// Data for table based DSC comment recognition, easy to extend if VIM needs to -// read more comments. -enum { - PRT_DSC_MISC_TYPE = -1, - PRT_DSC_TITLE_TYPE = 1, - PRT_DSC_VERSION_TYPE = 2, - PRT_DSC_ENDCOMMENTS_TYPE = 3, -}; - -#define PRT_DSC_TITLE "%%Title:" -#define PRT_DSC_VERSION "%%Version:" -#define PRT_DSC_ENDCOMMENTS "%%EndComments:" - -#define SIZEOF_CSTR(s) (sizeof(s) - 1) -static struct prt_dsc_comment_S prt_dsc_table[] = { - { PRT_DSC_TITLE, SIZEOF_CSTR(PRT_DSC_TITLE), PRT_DSC_TITLE_TYPE }, - { PRT_DSC_VERSION, SIZEOF_CSTR(PRT_DSC_VERSION), - PRT_DSC_VERSION_TYPE }, - { PRT_DSC_ENDCOMMENTS, SIZEOF_CSTR(PRT_DSC_ENDCOMMENTS), - PRT_DSC_ENDCOMMENTS_TYPE } -}; - -// Variables for the output PostScript file. -static FILE *prt_ps_fd; -static bool prt_file_error; -static char_u *prt_ps_file_name = NULL; - -// Various offsets and dimensions in default PostScript user space (points). -// Used for text positioning calculations -static double prt_page_width; -static double prt_page_height; -static double prt_left_margin; -static double prt_right_margin; -static double prt_top_margin; -static double prt_bottom_margin; -static double prt_line_height; -static double prt_first_line_height; -static double prt_char_width; -static double prt_number_width; -static double prt_bgcol_offset; -static double prt_pos_x_moveto = 0.0; -static double prt_pos_y_moveto = 0.0; - -// Various control variables used to decide when and how to change the -// PostScript graphics state. -static bool prt_need_moveto; -static bool prt_do_moveto; -static bool prt_need_font; -static int prt_font; -static bool prt_need_underline; -static TriState prt_underline; -static TriState prt_do_underline; -static bool prt_need_fgcol; -static uint32_t prt_fgcol; -static bool prt_need_bgcol; -static bool prt_do_bgcol; -static uint32_t prt_bgcol; -static uint32_t prt_new_bgcol; -static bool prt_attribute_change; -static double prt_text_run; -static int prt_page_num; -static int prt_bufsiz; - -// Variables controlling physical printing. -static int prt_media; -static int prt_portrait; -static int prt_num_copies; -static int prt_duplex; -static int prt_tumble; -static int prt_collate; - -// Buffers used when generating PostScript output -static char prt_line_buffer[257]; -static garray_T prt_ps_buffer = GA_EMPTY_INIT_VALUE; - -static int prt_do_conv; -static vimconv_T prt_conv; - -static int prt_out_mbyte; -static int prt_custom_cmap; -static char prt_cmap[80]; -static int prt_use_courier; -static bool prt_in_ascii; -static bool prt_half_width; -static char *prt_ascii_encoding; -static char_u prt_hexchar[] = "0123456789abcdef"; - -static void prt_write_file_raw_len(char_u *buffer, size_t bytes) -{ - if (!prt_file_error - && fwrite(buffer, sizeof(char_u), bytes, prt_ps_fd) != bytes) { - emsg(_("E455: Error writing to PostScript output file")); - prt_file_error = true; - } -} - -static void prt_write_file(char *buffer) -{ - prt_write_file_len((char_u *)buffer, strlen(buffer)); -} - -static void prt_write_file_len(char_u *buffer, size_t bytes) -{ - prt_write_file_raw_len(buffer, bytes); -} - -// Write a string. -static void prt_write_string(char *s) -{ - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), "%s", s); - prt_write_file(prt_line_buffer); -} - -// Write an int and a space. -static void prt_write_int(int i) -{ - snprintf(prt_line_buffer, sizeof(prt_line_buffer), "%d ", i); - prt_write_file(prt_line_buffer); -} - -// Write a boolean and a space. -static void prt_write_boolean(int b) -{ - snprintf(prt_line_buffer, sizeof(prt_line_buffer), "%s ", (b ? "T" : "F")); - prt_write_file(prt_line_buffer); -} - -// Write PostScript to re-encode and define the font. -static void prt_def_font(char *new_name, char *encoding, int height, char *font) -{ - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "/_%s /VIM-%s /%s ref\n", new_name, encoding, font); - prt_write_file(prt_line_buffer); - if (prt_out_mbyte) { - snprintf(prt_line_buffer, sizeof(prt_line_buffer), "/%s %d %f /_%s sffs\n", - new_name, height, 500./prt_ps_courier_font.wx, new_name); - } else { - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "/%s %d /_%s ffs\n", new_name, height, new_name); - } - prt_write_file(prt_line_buffer); -} - -// Write a line to define the CID font. -static void prt_def_cidfont(char *new_name, int height, char *cidfont) -{ - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "/_%s /%s[/%s] vim_composefont\n", new_name, prt_cmap, cidfont); - prt_write_file(prt_line_buffer); - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "/%s %d /_%s ffs\n", new_name, height, new_name); - prt_write_file(prt_line_buffer); -} - -// Write a line to define a duplicate of a CID font -static void prt_dup_cidfont(char *original_name, char *new_name) -{ - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "/%s %s d\n", new_name, original_name); - prt_write_file(prt_line_buffer); -} - -// Convert a real value into an integer and fractional part as integers, with -// the fractional part being in the range [0,10^precision). The fractional part -// is also rounded based on the precision + 1'th fractional digit. -static void prt_real_bits(double real, int precision, int *pinteger, int *pfraction) -{ - int integer = (int)real; - double fraction = real - integer; - if (real < integer) { - fraction = -fraction; - } - for (int i = 0; i < precision; i++) { - fraction *= 10.0; - } - - *pinteger = integer; - *pfraction = (int)(fraction + 0.5); -} - -// Write a real and a space. Save bytes if real value has no fractional part! -// We use prt_real_bits() as %f in sprintf uses the locale setting to decide -// what decimal point character to use, but PS always requires a '.'. -static void prt_write_real(double val, int prec) -{ - int integer; - int fraction; - - prt_real_bits(val, prec, &integer, &fraction); - // Emit integer part - snprintf(prt_line_buffer, sizeof(prt_line_buffer), "%d", integer); - prt_write_file(prt_line_buffer); - // Only emit fraction if necessary - if (fraction != 0) { - // Remove any trailing zeros - while ((fraction % 10) == 0) { - prec--; - fraction /= 10; - } - // Emit fraction left padded with zeros - snprintf(prt_line_buffer, sizeof(prt_line_buffer), ".%0*d", - prec, fraction); - prt_write_file(prt_line_buffer); - } - snprintf(prt_line_buffer, sizeof(prt_line_buffer), " "); - prt_write_file(prt_line_buffer); -} - -// Write a line to define a numeric variable. -static void prt_def_var(char *name, double value, int prec) -{ - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "/%s ", name); - prt_write_file(prt_line_buffer); - prt_write_real(value, prec); - snprintf(prt_line_buffer, sizeof(prt_line_buffer), "d\n"); - prt_write_file(prt_line_buffer); -} - -// Convert size from font space to user space at current font scale -#define PRT_PS_FONT_TO_USER(scale, size) ((size) * ((scale)/1000.0)) - -static void prt_flush_buffer(void) -{ - if (!GA_EMPTY(&prt_ps_buffer)) { - // Any background color must be drawn first - if (prt_do_bgcol && (prt_new_bgcol != PRCOLOR_WHITE)) { - unsigned int r, g, b; - - if (prt_do_moveto) { - prt_write_real(prt_pos_x_moveto, 2); - prt_write_real(prt_pos_y_moveto, 2); - prt_write_string("m\n"); - prt_do_moveto = false; - } - - // Size of rect of background color on which text is printed - prt_write_real(prt_text_run, 2); - prt_write_real(prt_line_height, 2); - - // Lastly add the color of the background - r = (prt_new_bgcol & 0xff0000) >> 16; - g = (prt_new_bgcol & 0xff00) >> 8; - b = prt_new_bgcol & 0xff; - prt_write_real(r / 255.0, 3); - prt_write_real(g / 255.0, 3); - prt_write_real(b / 255.0, 3); - prt_write_string("bg\n"); - } - // Draw underlines before the text as it makes it slightly easier to - // find the starting point. - if (prt_do_underline) { - if (prt_do_moveto) { - prt_write_real(prt_pos_x_moveto, 2); - prt_write_real(prt_pos_y_moveto, 2); - prt_write_string("m\n"); - prt_do_moveto = false; - } - - // Underline length of text run - prt_write_real(prt_text_run, 2); - prt_write_string("ul\n"); - } - // Draw the text - if (prt_out_mbyte) { - prt_write_string("<"); - } else { - prt_write_string("("); - } - assert(prt_ps_buffer.ga_len >= 0); - prt_write_file_raw_len(prt_ps_buffer.ga_data, (size_t)prt_ps_buffer.ga_len); - if (prt_out_mbyte) { - prt_write_string(">"); - } else { - prt_write_string(")"); - } - // Add a moveto if need be and use the appropriate show procedure - if (prt_do_moveto) { - prt_write_real(prt_pos_x_moveto, 2); - prt_write_real(prt_pos_y_moveto, 2); - // moveto and a show - prt_write_string("ms\n"); - prt_do_moveto = false; - } else { // Simple show - prt_write_string("s\n"); - } - ga_clear(&prt_ps_buffer); - ga_init(&prt_ps_buffer, (int)sizeof(char), prt_bufsiz); - } -} - -static void prt_resource_name(char *filename, void *cookie) -{ - char_u *resource_filename = cookie; - - if (strlen(filename) >= MAXPATHL) { - *resource_filename = NUL; - } else { - STRCPY(resource_filename, filename); - } -} - -static int prt_find_resource(char *name, struct prt_ps_resource_S *resource) -{ - char *buffer; - int retval; - - buffer = xmallocz(MAXPATHL); - - STRLCPY(resource->name, name, 64); - // Look for named resource file in runtimepath - STRCPY(buffer, "print"); - add_pathsep(buffer); - xstrlcat(buffer, name, MAXPATHL); - xstrlcat(buffer, ".ps", MAXPATHL); - resource->filename[0] = NUL; - retval = (do_in_runtimepath(buffer, 0, prt_resource_name, resource->filename) - && resource->filename[0] != NUL); - xfree(buffer); - return retval; -} - -// PS CR and LF characters have platform independent values -#define PSLF (0x0a) -#define PSCR (0x0d) - -static struct prt_resfile_buffer_S prt_resfile; - -static int prt_resfile_next_line(void) -{ - int idx; - - // Move to start of next line and then find end of line - idx = prt_resfile.line_end + 1; - while (idx < prt_resfile.len) { - if (prt_resfile.buffer[idx] != PSLF && prt_resfile.buffer[idx] != PSCR) { - break; - } - idx++; - } - prt_resfile.line_start = idx; - - while (idx < prt_resfile.len) { - if (prt_resfile.buffer[idx] == PSLF || prt_resfile.buffer[idx] == PSCR) { - break; - } - idx++; - } - prt_resfile.line_end = idx; - - return idx < prt_resfile.len; -} - -static int prt_resfile_strncmp(int offset, const char *string, int len) - FUNC_ATTR_NONNULL_ALL -{ - // Force not equal if string is longer than remainder of line - if (len > (prt_resfile.line_end - (prt_resfile.line_start + offset))) { - return 1; - } - return strncmp(&prt_resfile.buffer[prt_resfile.line_start + offset], - string, (size_t)len); -} - -static int prt_resfile_skip_nonws(int offset) -{ - int idx; - - idx = prt_resfile.line_start + offset; - while (idx < prt_resfile.line_end) { - if (isspace(prt_resfile.buffer[idx])) { - return idx - prt_resfile.line_start; - } - idx++; - } - return -1; -} - -static int prt_resfile_skip_ws(int offset) -{ - int idx; - - idx = prt_resfile.line_start + offset; - while (idx < prt_resfile.line_end) { - if (!isspace(prt_resfile.buffer[idx])) { - return idx - prt_resfile.line_start; - } - idx++; - } - return -1; -} - -/// Returns detail on next DSC comment line found. -/// -/// @return true if a DSC comment is found, else false -static bool prt_next_dsc(struct prt_dsc_line_S *p_dsc_line) - FUNC_ATTR_NONNULL_ALL -{ - int comment; - int offset; - - // Move to start of next line - if (!prt_resfile_next_line()) { - return false; - } - // DSC comments always start %% - if (prt_resfile_strncmp(0, "%%", 2) != 0) { - return false; - } - // Find type of DSC comment - for (comment = 0; comment < (int)ARRAY_SIZE(prt_dsc_table); comment++) { - if (prt_resfile_strncmp(0, prt_dsc_table[comment].string, - prt_dsc_table[comment].len) == 0) { - break; - } - } - if (comment != ARRAY_SIZE(prt_dsc_table)) { - // Return type of comment - p_dsc_line->type = prt_dsc_table[comment].type; - offset = prt_dsc_table[comment].len; - } else { - // Unrecognised DSC comment, skip to ws after comment leader - p_dsc_line->type = PRT_DSC_MISC_TYPE; - offset = prt_resfile_skip_nonws(0); - if (offset == -1) { - return false; - } - } - - // Skip ws to comment value - offset = prt_resfile_skip_ws(offset); - if (offset == -1) { - return false; - } - p_dsc_line->string = &prt_resfile.buffer[prt_resfile.line_start + offset]; - p_dsc_line->len = prt_resfile.line_end - (prt_resfile.line_start + offset); - - return true; -} - -/// Improved hand crafted parser to get the type, title, and version number of a -/// PS resource file so the file details can be added to the DSC header comments. -static bool prt_open_resource(struct prt_ps_resource_S *resource) - FUNC_ATTR_NONNULL_ALL -{ - struct prt_dsc_line_S dsc_line; - - FILE *fd_resource = os_fopen((char *)resource->filename, READBIN); - if (fd_resource == NULL) { - semsg(_("E624: Can't open file \"%s\""), resource->filename); - return false; - } - CLEAR_FIELD(prt_resfile.buffer); - - // Parse first line to ensure valid resource file - prt_resfile.len = (int)fread((char *)prt_resfile.buffer, sizeof(char_u), - PRT_FILE_BUFFER_LEN, fd_resource); - if (ferror(fd_resource)) { - semsg(_("E457: Can't read PostScript resource file \"%s\""), - resource->filename); - fclose(fd_resource); - return false; - } - fclose(fd_resource); - - prt_resfile.line_end = -1; - prt_resfile.line_start = 0; - if (!prt_resfile_next_line()) { - return false; - } - int offset = 0; - - if (prt_resfile_strncmp(offset, PRT_RESOURCE_HEADER, - (int)strlen(PRT_RESOURCE_HEADER)) != 0) { - semsg(_("E618: file \"%s\" is not a PostScript resource file"), - resource->filename); - return false; - } - - // Skip over any version numbers and following ws - offset += (int)strlen(PRT_RESOURCE_HEADER); - offset = prt_resfile_skip_nonws(offset); - if (offset == -1) { - return false; - } - offset = prt_resfile_skip_ws(offset); - if (offset == -1) { - return false; - } - if (prt_resfile_strncmp(offset, PRT_RESOURCE_RESOURCE, - (int)strlen(PRT_RESOURCE_RESOURCE)) != 0) { - semsg(_("E619: file \"%s\" is not a supported PostScript resource file"), - resource->filename); - return false; - } - offset += (int)strlen(PRT_RESOURCE_RESOURCE); - - // Decide type of resource in the file - if (prt_resfile_strncmp(offset, PRT_RESOURCE_PROCSET, - (int)strlen(PRT_RESOURCE_PROCSET)) == 0) { - resource->type = PRT_RESOURCE_TYPE_PROCSET; - } else if (prt_resfile_strncmp(offset, PRT_RESOURCE_ENCODING, - (int)strlen(PRT_RESOURCE_ENCODING)) == 0) { - resource->type = PRT_RESOURCE_TYPE_ENCODING; - } else if (prt_resfile_strncmp(offset, PRT_RESOURCE_CMAP, - (int)strlen(PRT_RESOURCE_CMAP)) == 0) { - resource->type = PRT_RESOURCE_TYPE_CMAP; - } else { - semsg(_("E619: file \"%s\" is not a supported PostScript resource file"), - resource->filename); - return false; - } - - // Look for title and version of resource - resource->title[0] = '\0'; - resource->version[0] = '\0'; - bool seen_title = false; - bool seen_version = false; - bool seen_all = false; - while (!seen_all && prt_next_dsc(&dsc_line)) { - switch (dsc_line.type) { - case PRT_DSC_TITLE_TYPE: - STRLCPY(resource->title, dsc_line.string, dsc_line.len + 1); - seen_title = true; - if (seen_version) { - seen_all = true; - } - break; - - case PRT_DSC_VERSION_TYPE: - STRLCPY(resource->version, dsc_line.string, dsc_line.len + 1); - seen_version = true; - if (seen_title) { - seen_all = true; - } - break; - - case PRT_DSC_ENDCOMMENTS_TYPE: - // Won't find title or resource after this comment, stop searching - seen_all = true; - break; - - case PRT_DSC_MISC_TYPE: - // Not interested in whatever comment this line had - break; - } - } - - if (!seen_title || !seen_version) { - semsg(_("E619: file \"%s\" is not a supported PostScript resource file"), - resource->filename); - return false; - } - - return true; -} - -static bool prt_check_resource(const struct prt_ps_resource_S *resource, const char *version) - FUNC_ATTR_NONNULL_ALL -{ - // Version number m.n should match, the revision number does not matter - if (strncmp(resource->version, version, strlen(version)) != 0) { - semsg(_("E621: \"%s\" resource file has wrong version"), - resource->name); - return false; - } - - // Other checks to be added as needed - return true; -} - -static void prt_dsc_start(void) -{ - prt_write_string("%!PS-Adobe-3.0\n"); -} - -static void prt_dsc_noarg(char *comment) -{ - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "%%%%%s\n", comment); - prt_write_file(prt_line_buffer); -} - -static void prt_dsc_textline(char *comment, char *text) -{ - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "%%%%%s: %s\n", comment, text); - prt_write_file(prt_line_buffer); -} - -static void prt_dsc_text(char *comment, char *text) -{ - // TODO(vim): - should scan 'text' for any chars needing escaping! - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "%%%%%s: (%s)\n", comment, text); - prt_write_file(prt_line_buffer); -} - -static void prt_dsc_ints(char *comment, int count, int *ints) -{ - int i; - - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "%%%%%s:", comment); - prt_write_file(prt_line_buffer); - - for (i = 0; i < count; i++) { - snprintf(prt_line_buffer, sizeof(prt_line_buffer), " %d", ints[i]); - prt_write_file(prt_line_buffer); - } - - prt_write_string("\n"); -} - -/// @param comment if NULL add to previous -static void prt_dsc_resources(const char *comment, const char *type, const char *string) - FUNC_ATTR_NONNULL_ARG(2, 3) -{ - if (comment != NULL) { - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "%%%%%s: %s", comment, type); - } else { - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "%%%%+ %s", type); - } - prt_write_file(prt_line_buffer); - - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - " %s\n", string); - prt_write_file(prt_line_buffer); -} - -static void prt_dsc_font_resource(char *resource, struct prt_ps_font_S *ps_font) -{ - int i; - - prt_dsc_resources(resource, "font", - ps_font->ps_fontname[PRT_PS_FONT_ROMAN]); - for (i = PRT_PS_FONT_BOLD; i <= PRT_PS_FONT_BOLDOBLIQUE; i++) { - if (ps_font->ps_fontname[i] != NULL) { - prt_dsc_resources(NULL, "font", ps_font->ps_fontname[i]); - } - } -} - -static void prt_dsc_requirements(int duplex, int tumble, int collate, int color, int num_copies) -{ - // Only output the comment if we need to. - // Note: tumble is ignored if we are not duplexing - if (!(duplex || collate || color || (num_copies > 1))) { - return; - } - - snprintf(prt_line_buffer, sizeof(prt_line_buffer), "%%%%Requirements:"); - prt_write_file(prt_line_buffer); - - if (duplex) { - prt_write_string(" duplex"); - if (tumble) { - prt_write_string("(tumble)"); - } - } - if (collate) { - prt_write_string(" collate"); - } - if (color) { - prt_write_string(" color"); - } - if (num_copies > 1) { - prt_write_string(" numcopies("); - // Note: no space wanted so don't use prt_write_int() - snprintf(prt_line_buffer, sizeof(prt_line_buffer), "%d", - num_copies); - prt_write_file(prt_line_buffer); - prt_write_string(")"); - } - prt_write_string("\n"); -} - -static void prt_dsc_docmedia(char *paper_name, double width, double height, double weight, - char *colour, char *type) -{ - vim_snprintf(prt_line_buffer, sizeof(prt_line_buffer), - "%%%%DocumentMedia: %s ", paper_name); - prt_write_file(prt_line_buffer); - prt_write_real(width, 2); - prt_write_real(height, 2); - prt_write_real(weight, 2); - if (colour == NULL) { - prt_write_string("()"); - } else { - prt_write_string(colour); - } - prt_write_string(" "); - if (type == NULL) { - prt_write_string("()"); - } else { - prt_write_string(type); - } - prt_write_string("\n"); -} - -void mch_print_cleanup(void) -{ - if (prt_out_mbyte) { - int i; - - // Free off all CID font names created, but first clear duplicate - // pointers to the same string (when the same font is used for more than - // one style). - for (i = PRT_PS_FONT_ROMAN; i <= PRT_PS_FONT_BOLDOBLIQUE; i++) { - if (prt_ps_mb_font.ps_fontname[i] != NULL) { - xfree(prt_ps_mb_font.ps_fontname[i]); - } - prt_ps_mb_font.ps_fontname[i] = NULL; - } - } - - if (prt_do_conv) { - convert_setup(&prt_conv, NULL, NULL); - prt_do_conv = false; - } - if (prt_ps_fd != NULL) { - fclose(prt_ps_fd); - prt_ps_fd = NULL; - prt_file_error = false; - } - if (prt_ps_file_name != NULL) { - XFREE_CLEAR(prt_ps_file_name); - } -} - -static double to_device_units(int idx, double physsize, int def_number) -{ - double ret; - int nr; - - int u = prt_get_unit(idx); - if (u == PRT_UNIT_NONE) { - u = PRT_UNIT_PERC; - nr = def_number; - } else { - nr = printer_opts[idx].number; - } - - switch (u) { - case PRT_UNIT_INCH: - ret = nr * PRT_PS_DEFAULT_DPI; - break; - case PRT_UNIT_MM: - ret = nr * PRT_PS_DEFAULT_DPI / 25.4; - break; - case PRT_UNIT_POINT: - ret = nr; - break; - case PRT_UNIT_PERC: - default: - ret = physsize * nr / 100; - break; - } - - return ret; -} - -// Calculate margins for given width and height from printoptions settings. -static void prt_page_margins(double width, double height, double *left, double *right, double *top, - double *bottom) -{ - *left = to_device_units(OPT_PRINT_LEFT, width, 10); - *right = width - to_device_units(OPT_PRINT_RIGHT, width, 5); - *top = height - to_device_units(OPT_PRINT_TOP, height, 5); - *bottom = to_device_units(OPT_PRINT_BOT, height, 5); -} - -static void prt_font_metrics(int font_scale) -{ - prt_line_height = (double)font_scale; - prt_char_width = PRT_PS_FONT_TO_USER(font_scale, prt_ps_font->wx); -} - -static int prt_get_cpl(void) -{ - if (prt_use_number()) { - prt_number_width = PRINT_NUMBER_WIDTH * prt_char_width; - // If we are outputting multi-byte characters then line numbers will be - // printed with half width characters - if (prt_out_mbyte) { - prt_number_width /= 2; - } - prt_left_margin += prt_number_width; - } else { - prt_number_width = 0.0; - } - - return (int)((prt_right_margin - prt_left_margin) / prt_char_width); -} - -static void prt_build_cid_fontname(int font, char_u *name, int name_len) -{ - assert(name_len >= 0); - char *fontname = xstrndup((char *)name, (size_t)name_len); - prt_ps_mb_font.ps_fontname[font] = fontname; -} - -// Get number of lines of text that fit on a page (excluding the header). -static int prt_get_lpp(void) -{ - int lpp; - - // Calculate offset to lower left corner of background rect based on actual - // font height (based on its bounding box) and the line height, handling the - // case where the font height can exceed the line height. - prt_bgcol_offset = PRT_PS_FONT_TO_USER(prt_line_height, - prt_ps_font->bbox_min_y); - if ((prt_ps_font->bbox_max_y - prt_ps_font->bbox_min_y) < 1000.0) { - prt_bgcol_offset -= PRT_PS_FONT_TO_USER(prt_line_height, - (1000.0 - (prt_ps_font->bbox_max_y - - prt_ps_font->bbox_min_y)) / 2); - } - - // Get height for topmost line based on background rect offset. - prt_first_line_height = prt_line_height + prt_bgcol_offset; - - // Calculate lpp - lpp = (int)((prt_top_margin - prt_bottom_margin) / prt_line_height); - - // Adjust top margin if there is a header - prt_top_margin -= prt_line_height * prt_header_height(); - - return lpp - prt_header_height(); -} - -static int prt_match_encoding(char *p_encoding, struct prt_ps_mbfont_S *p_cmap, - struct prt_ps_encoding_S **pp_mbenc) -{ - int mbenc; - int enc_len; - struct prt_ps_encoding_S *p_mbenc; - - *pp_mbenc = NULL; - // Look for recognised encoding - enc_len = (int)strlen(p_encoding); - p_mbenc = p_cmap->encodings; - for (mbenc = 0; mbenc < p_cmap->num_encodings; mbenc++) { - if (STRNICMP(p_mbenc->encoding, p_encoding, enc_len) == 0) { - *pp_mbenc = p_mbenc; - return true; - } - p_mbenc++; - } - return false; -} - -static int prt_match_charset(char *p_charset, struct prt_ps_mbfont_S *p_cmap, - struct prt_ps_charset_S **pp_mbchar) -{ - int mbchar; - int char_len; - struct prt_ps_charset_S *p_mbchar; - - // Look for recognised character set, using default if one is not given - if (*p_charset == NUL) { - p_charset = p_cmap->defcs; - } - char_len = (int)strlen(p_charset); - p_mbchar = p_cmap->charsets; - for (mbchar = 0; mbchar < p_cmap->num_charsets; mbchar++) { - if (STRNICMP(p_mbchar->charset, p_charset, char_len) == 0) { - *pp_mbchar = p_mbchar; - return true; - } - p_mbchar++; - } - return false; -} - -int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit) -{ - int i; - char *paper_name; - int paper_strlen; - int fontsize; - char_u *p; - int props; - int cmap = 0; - struct prt_ps_encoding_S *p_mbenc; - struct prt_ps_encoding_S *p_mbenc_first; - struct prt_ps_charset_S *p_mbchar = NULL; - - // Set up font and encoding. - char_u *p_encoding = (char_u *)enc_skip(p_penc); - if (*p_encoding == NUL) { - p_encoding = (char_u *)enc_skip(p_enc); - } - - // Look for a multi-byte font that matches the encoding and character set. - // Only look if multi-byte character set is defined, or using multi-byte - // encoding other than Unicode. This is because a Unicode encoding does not - // uniquely identify a CJK character set to use. - p_mbenc = NULL; - props = enc_canon_props((char *)p_encoding); - if (!(props & ENC_8BIT) && ((*p_pmcs != NUL) || !(props & ENC_UNICODE))) { - p_mbenc_first = NULL; - int effective_cmap = 0; - for (cmap = 0; cmap < (int)ARRAY_SIZE(prt_ps_mbfonts); cmap++) { - if (prt_match_encoding((char *)p_encoding, &prt_ps_mbfonts[cmap], - &p_mbenc)) { - if (p_mbenc_first == NULL) { - p_mbenc_first = p_mbenc; - effective_cmap = cmap; - } - if (prt_match_charset(p_pmcs, &prt_ps_mbfonts[cmap], &p_mbchar)) { - break; - } - } - } - - // Use first encoding matched if no charset matched - if (p_mbenc_first != NULL && p_mbchar == NULL) { - p_mbenc = p_mbenc_first; - cmap = effective_cmap; - } - - assert(p_mbenc == NULL || cmap < (int)ARRAY_SIZE(prt_ps_mbfonts)); - } - - prt_out_mbyte = (p_mbenc != NULL); - if (prt_out_mbyte) { - // Build CMap name - will be same for all multi-byte fonts used - prt_cmap[0] = NUL; - - prt_custom_cmap = (p_mbchar == NULL); - if (!prt_custom_cmap) { - // Check encoding and character set are compatible - if ((p_mbenc->needs_charset & p_mbchar->has_charset) == 0) { - emsg(_("E673: Incompatible multi-byte encoding and character set.")); - return false; - } - - // Add charset name if not empty - if (p_mbchar->cmap_charset != NULL) { - STRLCPY(prt_cmap, p_mbchar->cmap_charset, sizeof(prt_cmap) - 2); - STRCAT(prt_cmap, "-"); - } - } else { - // Add custom CMap character set name - if (*p_pmcs == NUL) { - emsg(_("E674: printmbcharset cannot be empty with multi-byte encoding.")); - return false; - } - STRLCPY(prt_cmap, p_pmcs, sizeof(prt_cmap) - 2); - STRCAT(prt_cmap, "-"); - } - - // CMap name ends with (optional) encoding name and -H for horizontal - if (p_mbenc->cmap_encoding != NULL && strlen(prt_cmap) - + strlen(p_mbenc->cmap_encoding) + 3 < sizeof(prt_cmap)) { - STRCAT(prt_cmap, p_mbenc->cmap_encoding); - STRCAT(prt_cmap, "-"); - } - STRCAT(prt_cmap, "H"); - - if (!mbfont_opts[OPT_MBFONT_REGULAR].present) { - emsg(_("E675: No default font specified for multi-byte printing.")); - return false; - } - - // Derive CID font names with fallbacks if not defined - prt_build_cid_fontname(PRT_PS_FONT_ROMAN, - mbfont_opts[OPT_MBFONT_REGULAR].string, - mbfont_opts[OPT_MBFONT_REGULAR].strlen); - if (mbfont_opts[OPT_MBFONT_BOLD].present) { - prt_build_cid_fontname(PRT_PS_FONT_BOLD, - mbfont_opts[OPT_MBFONT_BOLD].string, - mbfont_opts[OPT_MBFONT_BOLD].strlen); - } - if (mbfont_opts[OPT_MBFONT_OBLIQUE].present) { - prt_build_cid_fontname(PRT_PS_FONT_OBLIQUE, - mbfont_opts[OPT_MBFONT_OBLIQUE].string, - mbfont_opts[OPT_MBFONT_OBLIQUE].strlen); - } - if (mbfont_opts[OPT_MBFONT_BOLDOBLIQUE].present) { - prt_build_cid_fontname(PRT_PS_FONT_BOLDOBLIQUE, - mbfont_opts[OPT_MBFONT_BOLDOBLIQUE].string, - mbfont_opts[OPT_MBFONT_BOLDOBLIQUE].strlen); - } - - // Check if need to use Courier for ASCII code range, and if so pick up - // the encoding to use - prt_use_courier = ( - mbfont_opts[OPT_MBFONT_USECOURIER].present - && (TOLOWER_ASC(mbfont_opts[OPT_MBFONT_USECOURIER].string[0]) == 'y')); - if (prt_use_courier) { - // Use national ASCII variant unless ASCII wanted - if (mbfont_opts[OPT_MBFONT_ASCII].present - && (TOLOWER_ASC(mbfont_opts[OPT_MBFONT_ASCII].string[0]) == 'y')) { - prt_ascii_encoding = "ascii"; - } else { - prt_ascii_encoding = prt_ps_mbfonts[cmap].ascii_enc; - } - } - - prt_ps_font = &prt_ps_mb_font; - } else { - prt_use_courier = false; - prt_ps_font = &prt_ps_courier_font; - } - - // Find the size of the paper and set the margins. - prt_portrait = (!printer_opts[OPT_PRINT_PORTRAIT].present - || TOLOWER_ASC(printer_opts[OPT_PRINT_PORTRAIT].string[0]) == - 'y'); - if (printer_opts[OPT_PRINT_PAPER].present) { - paper_name = (char *)printer_opts[OPT_PRINT_PAPER].string; - paper_strlen = printer_opts[OPT_PRINT_PAPER].strlen; - } else { - paper_name = "A4"; - paper_strlen = 2; - } - for (i = 0; i < (int)PRT_MEDIASIZE_LEN; i++) { - if (strlen(prt_mediasize[i].name) == (unsigned)paper_strlen - && STRNICMP(prt_mediasize[i].name, paper_name, - paper_strlen) == 0) { - break; - } - } - if (i == PRT_MEDIASIZE_LEN) { - i = 0; - } - prt_media = i; - - // Set PS pagesize based on media dimensions and print orientation. - // Note: Media and page sizes have defined meanings in PostScript and should - // be kept distinct. Media is the paper (or transparency, or ...) that is - // printed on, whereas the page size is the area that the PostScript - // interpreter renders into. - if (prt_portrait) { - prt_page_width = prt_mediasize[i].width; - prt_page_height = prt_mediasize[i].height; - } else { - prt_page_width = prt_mediasize[i].height; - prt_page_height = prt_mediasize[i].width; - } - - // Set PS page margins based on the PS pagesize, not the mediasize - this - // needs to be done before the cpl and lpp are calculated. - double left, right, top, bottom; - prt_page_margins(prt_page_width, prt_page_height, &left, &right, &top, - &bottom); - prt_left_margin = left; - prt_right_margin = right; - prt_top_margin = top; - prt_bottom_margin = bottom; - - // Set up the font size. - fontsize = PRT_PS_DEFAULT_FONTSIZE; - for (p = (char_u *)p_pfn; (p = (char_u *)vim_strchr((char *)p, ':')) != NULL; p++) { - if (p[1] == 'h' && ascii_isdigit(p[2])) { - fontsize = atoi((char *)p + 2); - } - } - prt_font_metrics(fontsize); - - // Return the number of characters per line, and lines per page for the - // generic print code. - psettings->chars_per_line = prt_get_cpl(); - psettings->lines_per_page = prt_get_lpp(); - - // Catch margin settings that leave no space for output! - if (psettings->chars_per_line <= 0 || psettings->lines_per_page <= 0) { - return FAIL; - } - - // Sort out the number of copies to be printed. PS by default will do - // uncollated copies for you, so once we know how many uncollated copies are - // wanted cache it away and lie to the generic code that we only want one - // uncollated copy. - psettings->n_collated_copies = 1; - psettings->n_uncollated_copies = 1; - prt_num_copies = 1; - prt_collate = (!printer_opts[OPT_PRINT_COLLATE].present - || TOLOWER_ASC(printer_opts[OPT_PRINT_COLLATE].string[0]) == - 'y'); - if (prt_collate) { - // TODO(vim): Get number of collated copies wanted. - } else { - // TODO(vim): Get number of uncollated copies wanted and update the cached - // count. - } - - psettings->jobname = jobname; - - // Set up printer duplex and tumble based on Duplex option setting - default - // is long sided duplex printing (i.e. no tumble). - prt_duplex = true; - prt_tumble = false; - psettings->duplex = 1; - if (printer_opts[OPT_PRINT_DUPLEX].present) { - if (STRNICMP(printer_opts[OPT_PRINT_DUPLEX].string, "off", 3) == 0) { - prt_duplex = false; - psettings->duplex = 0; - } else if (STRNICMP(printer_opts[OPT_PRINT_DUPLEX].string, "short", 5) - == 0) { - prt_tumble = true; - } - } - - // For now user abort not supported - psettings->user_abort = 0; - - // If the user didn't specify a file name, use a temp file. - if (psettings->outfile == NULL) { - prt_ps_file_name = (char_u *)vim_tempname(); - if (prt_ps_file_name == NULL) { - emsg(_(e_notmp)); - return FAIL; - } - prt_ps_fd = os_fopen((char *)prt_ps_file_name, WRITEBIN); - } else { - p = (char_u *)expand_env_save((char *)psettings->outfile); - if (p != NULL) { - prt_ps_fd = os_fopen((char *)p, WRITEBIN); - xfree(p); - } - } - if (prt_ps_fd == NULL) { - emsg(_("E324: Can't open PostScript output file")); - mch_print_cleanup(); - return FAIL; - } - - prt_bufsiz = psettings->chars_per_line; - if (prt_out_mbyte) { - prt_bufsiz *= 2; - } - ga_init(&prt_ps_buffer, (int)sizeof(char), prt_bufsiz); - - prt_page_num = 0; - - prt_attribute_change = false; - prt_need_moveto = false; - prt_need_font = false; - prt_need_fgcol = false; - prt_need_bgcol = false; - prt_need_underline = false; - - prt_file_error = false; - - return OK; -} - -static bool prt_add_resource(struct prt_ps_resource_S *resource) -{ - FILE *fd_resource; - char_u resource_buffer[512]; - size_t bytes_read; - - fd_resource = os_fopen((char *)resource->filename, READBIN); - if (fd_resource == NULL) { - semsg(_("E456: Can't open file \"%s\""), resource->filename); - return false; - } - switch (resource->type) { - case PRT_RESOURCE_TYPE_PROCSET: - case PRT_RESOURCE_TYPE_ENCODING: - case PRT_RESOURCE_TYPE_CMAP: - prt_dsc_resources("BeginResource", prt_resource_types[resource->type], - (char *)resource->title); - break; - default: - return false; - } - - prt_dsc_textline("BeginDocument", (char *)resource->filename); - - for (;;) { - bytes_read = fread((char *)resource_buffer, sizeof(char_u), - sizeof(resource_buffer), fd_resource); - if (ferror(fd_resource)) { - semsg(_("E457: Can't read PostScript resource file \"%s\""), - resource->filename); - fclose(fd_resource); - return false; - } - if (bytes_read == 0) { - break; - } - prt_write_file_raw_len(resource_buffer, bytes_read); - if (prt_file_error) { - fclose(fd_resource); - return false; - } - } - fclose(fd_resource); - - prt_dsc_noarg("EndDocument"); - - prt_dsc_noarg("EndResource"); - - return true; -} - -bool mch_print_begin(prt_settings_T *psettings) -{ - int bbox[4]; - double left; - double right; - double top; - double bottom; - struct prt_ps_resource_S res_prolog; - struct prt_ps_resource_S res_encoding; - char buffer[256]; - char *p_encoding; - struct prt_ps_resource_S res_cidfont; - struct prt_ps_resource_S res_cmap; - - // PS DSC Header comments - no PS code! - prt_dsc_start(); - prt_dsc_textline("Title", (char *)psettings->jobname); - if (os_get_username(buffer, 256) == FAIL) { - STRCPY(buffer, "Unknown"); - } - prt_dsc_textline("For", buffer); - prt_dsc_textline("Creator", longVersion); - // Note: to ensure Clean8bit I don't think we can use LC_TIME - - char ctime_buf[100]; // hopefully enough for every language - prt_dsc_textline("CreationDate", os_ctime(ctime_buf, sizeof(ctime_buf), false)); - prt_dsc_textline("DocumentData", "Clean8Bit"); - prt_dsc_textline("Orientation", "Portrait"); - prt_dsc_text(("Pages"), "atend"); - prt_dsc_textline("PageOrder", "Ascend"); - // The bbox does not change with orientation - it is always in the default - // user coordinate system! We have to recalculate right and bottom - // coordinates based on the font metrics for the bbox to be accurate. - prt_page_margins(prt_mediasize[prt_media].width, - prt_mediasize[prt_media].height, - &left, &right, &top, &bottom); - bbox[0] = (int)left; - if (prt_portrait) { - // In portrait printing the fixed point is the top left corner so we - // derive the bbox from that point. We have the expected cpl chars - // across the media and lpp lines down the media. - bbox[1] = (int)(top - (psettings->lines_per_page + prt_header_height()) - * prt_line_height); - bbox[2] = (int)(left + psettings->chars_per_line * prt_char_width - + 0.5); - bbox[3] = (int)(top + 0.5); - } else { - // In landscape printing the fixed point is the bottom left corner so we - // derive the bbox from that point. We have lpp chars across the media - // and cpl lines up the media. - bbox[1] = (int)bottom; - bbox[2] = (int)(left + ((psettings->lines_per_page - + prt_header_height()) * prt_line_height) + 0.5); - bbox[3] = (int)(bottom + psettings->chars_per_line * prt_char_width - + 0.5); - } - prt_dsc_ints("BoundingBox", 4, bbox); - // The media width and height does not change with landscape printing! - prt_dsc_docmedia(prt_mediasize[prt_media].name, - prt_mediasize[prt_media].width, - prt_mediasize[prt_media].height, - (double)0, NULL, NULL); - // Define fonts needed - if (!prt_out_mbyte || prt_use_courier) { - prt_dsc_font_resource("DocumentNeededResources", &prt_ps_courier_font); - } - if (prt_out_mbyte) { - prt_dsc_font_resource((prt_use_courier ? NULL : "DocumentNeededResources"), &prt_ps_mb_font); - if (!prt_custom_cmap) { - prt_dsc_resources(NULL, "cmap", prt_cmap); - } - } - - // Search for external resources VIM supplies - if (!prt_find_resource("prolog", &res_prolog)) { - emsg(_("E456: Can't find PostScript resource file \"prolog.ps\"")); - return false; - } - if (!prt_open_resource(&res_prolog)) { - return false; - } - if (!prt_check_resource(&res_prolog, PRT_PROLOG_VERSION)) { - return false; - } - if (prt_out_mbyte) { - // Look for required version of multi-byte printing procset - if (!prt_find_resource("cidfont", &res_cidfont)) { - emsg(_("E456: Can't find PostScript resource file \"cidfont.ps\"")); - return false; - } - if (!prt_open_resource(&res_cidfont)) { - return false; - } - if (!prt_check_resource(&res_cidfont, PRT_CID_PROLOG_VERSION)) { - return false; - } - } - - // Find an encoding to use for printing. - // Check 'printencoding'. If not set or not found, then use 'encoding'. If - // that cannot be found then default to "latin1". - // Note: VIM specific encoding header is always skipped. - if (!prt_out_mbyte) { - p_encoding = enc_skip(p_penc); - if (*p_encoding == NUL - || !prt_find_resource(p_encoding, &res_encoding)) { - // 'printencoding' not set or not supported - find alternate - int props; - - p_encoding = enc_skip(p_enc); - props = enc_canon_props(p_encoding); - if (!(props & ENC_8BIT) - || !prt_find_resource(p_encoding, &res_encoding)) { - // 8-bit 'encoding' is not supported - // Use latin1 as default printing encoding - p_encoding = "latin1"; - if (!prt_find_resource(p_encoding, &res_encoding)) { - semsg(_("E456: Can't find PostScript resource file \"%s.ps\""), - p_encoding); - return false; - } - } - } - if (!prt_open_resource(&res_encoding)) { - return false; - } - // For the moment there are no checks on encoding resource files to - // perform - } else { - p_encoding = enc_skip(p_penc); - if (*p_encoding == NUL) { - p_encoding = enc_skip(p_enc); - } - if (prt_use_courier) { - // Include ASCII range encoding vector - if (!prt_find_resource(prt_ascii_encoding, &res_encoding)) { - semsg(_("E456: Can't find PostScript resource file \"%s.ps\""), - prt_ascii_encoding); - return false; - } - if (!prt_open_resource(&res_encoding)) { - return false; - } - // For the moment there are no checks on encoding resource files to - // perform - } - } - - prt_conv.vc_type = CONV_NONE; - if (!(enc_canon_props(p_enc) & enc_canon_props(p_encoding) & ENC_8BIT)) { - // Set up encoding conversion if required - if (convert_setup(&prt_conv, p_enc, p_encoding) == FAIL) { - semsg(_("E620: Unable to convert to print encoding \"%s\""), - p_encoding); - return false; - } - } - prt_do_conv = prt_conv.vc_type != CONV_NONE; - - if (prt_out_mbyte && prt_custom_cmap) { - // Find user supplied CMap - if (!prt_find_resource(prt_cmap, &res_cmap)) { - semsg(_("E456: Can't find PostScript resource file \"%s.ps\""), - prt_cmap); - return false; - } - if (!prt_open_resource(&res_cmap)) { - return false; - } - } - - // List resources supplied - STRCPY(buffer, res_prolog.title); - STRCAT(buffer, " "); - STRCAT(buffer, res_prolog.version); - prt_dsc_resources("DocumentSuppliedResources", "procset", buffer); - if (prt_out_mbyte) { - STRCPY(buffer, res_cidfont.title); - STRCAT(buffer, " "); - STRCAT(buffer, res_cidfont.version); - prt_dsc_resources(NULL, "procset", buffer); - - if (prt_custom_cmap) { - STRCPY(buffer, res_cmap.title); - STRCAT(buffer, " "); - STRCAT(buffer, res_cmap.version); - prt_dsc_resources(NULL, "cmap", buffer); - } - } - if (!prt_out_mbyte || prt_use_courier) { - STRCPY(buffer, res_encoding.title); - STRCAT(buffer, " "); - STRCAT(buffer, res_encoding.version); - prt_dsc_resources(NULL, "encoding", buffer); - } - prt_dsc_requirements(prt_duplex, prt_tumble, prt_collate, - psettings->do_syntax, - prt_num_copies); - prt_dsc_noarg("EndComments"); - - // PS Document page defaults - prt_dsc_noarg("BeginDefaults"); - - // List font resources most likely common to all pages - if (!prt_out_mbyte || prt_use_courier) { - prt_dsc_font_resource("PageResources", &prt_ps_courier_font); - } - if (prt_out_mbyte) { - prt_dsc_font_resource((prt_use_courier ? NULL : "PageResources"), - &prt_ps_mb_font); - if (!prt_custom_cmap) { - prt_dsc_resources(NULL, "cmap", prt_cmap); - } - } - - // Paper will be used for all pages - prt_dsc_textline("PageMedia", prt_mediasize[prt_media].name); - - prt_dsc_noarg("EndDefaults"); - - // PS Document prolog inclusion - all required procsets. - prt_dsc_noarg("BeginProlog"); - - // Add required procsets - NOTE: order is important! - if (!prt_add_resource(&res_prolog)) { - return false; - } - if (prt_out_mbyte) { - // Add CID font procset, and any user supplied CMap - if (!prt_add_resource(&res_cidfont)) { - return false; - } - if (prt_custom_cmap && !prt_add_resource(&res_cmap)) { - return false; - } - } - - if (!prt_out_mbyte || prt_use_courier) { - // There will be only one Roman font encoding to be included in the PS - // file. - if (!prt_add_resource(&res_encoding)) { - return false; - } - } - - prt_dsc_noarg("EndProlog"); - - // PS Document setup - must appear after the prolog - prt_dsc_noarg("BeginSetup"); - - // Device setup - page size and number of uncollated copies - prt_write_int((int)prt_mediasize[prt_media].width); - prt_write_int((int)prt_mediasize[prt_media].height); - prt_write_int(0); - prt_write_string("sps\n"); - prt_write_int(prt_num_copies); - prt_write_string("nc\n"); - prt_write_boolean(prt_duplex); - prt_write_boolean(prt_tumble); - prt_write_string("dt\n"); - prt_write_boolean(prt_collate); - prt_write_string("c\n"); - - // Font resource inclusion and definition - if (!prt_out_mbyte || prt_use_courier) { - // When using Courier for ASCII range when printing multi-byte, need to - // pick up ASCII encoding to use with it. - if (prt_use_courier) { - p_encoding = prt_ascii_encoding; - } - prt_dsc_resources("IncludeResource", "font", - prt_ps_courier_font.ps_fontname[PRT_PS_FONT_ROMAN]); - prt_def_font("F0", p_encoding, (int)prt_line_height, - prt_ps_courier_font.ps_fontname[PRT_PS_FONT_ROMAN]); - prt_dsc_resources("IncludeResource", "font", - prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLD]); - prt_def_font("F1", p_encoding, (int)prt_line_height, - prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLD]); - prt_dsc_resources("IncludeResource", "font", - prt_ps_courier_font.ps_fontname[PRT_PS_FONT_OBLIQUE]); - prt_def_font("F2", p_encoding, (int)prt_line_height, - prt_ps_courier_font.ps_fontname[PRT_PS_FONT_OBLIQUE]); - prt_dsc_resources("IncludeResource", "font", - prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]); - prt_def_font("F3", p_encoding, (int)prt_line_height, - prt_ps_courier_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]); - } - if (prt_out_mbyte) { - // Define the CID fonts to be used in the job. Typically CJKV fonts do - // not have an italic form being a western style, so where no font is - // defined for these faces VIM falls back to an existing face. - // Note: if using Courier for the ASCII range then the printout will - // have bold/italic/bolditalic regardless of the setting of printmbfont. - prt_dsc_resources("IncludeResource", "font", - prt_ps_mb_font.ps_fontname[PRT_PS_FONT_ROMAN]); - if (!prt_custom_cmap) { - prt_dsc_resources("IncludeResource", "cmap", prt_cmap); - } - prt_def_cidfont("CF0", (int)prt_line_height, - prt_ps_mb_font.ps_fontname[PRT_PS_FONT_ROMAN]); - - if (prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLD] != NULL) { - prt_dsc_resources("IncludeResource", "font", - prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLD]); - if (!prt_custom_cmap) { - prt_dsc_resources("IncludeResource", "cmap", prt_cmap); - } - prt_def_cidfont("CF1", (int)prt_line_height, - prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLD]); - } else { - // Use ROMAN for BOLD - prt_dup_cidfont("CF0", "CF1"); - } - if (prt_ps_mb_font.ps_fontname[PRT_PS_FONT_OBLIQUE] != NULL) { - prt_dsc_resources("IncludeResource", "font", - prt_ps_mb_font.ps_fontname[PRT_PS_FONT_OBLIQUE]); - if (!prt_custom_cmap) { - prt_dsc_resources("IncludeResource", "cmap", prt_cmap); - } - prt_def_cidfont("CF2", (int)prt_line_height, - prt_ps_mb_font.ps_fontname[PRT_PS_FONT_OBLIQUE]); - } else { - // Use ROMAN for OBLIQUE - prt_dup_cidfont("CF0", "CF2"); - } - if (prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE] != NULL) { - prt_dsc_resources("IncludeResource", "font", - prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]); - if (!prt_custom_cmap) { - prt_dsc_resources("IncludeResource", "cmap", prt_cmap); - } - prt_def_cidfont("CF3", (int)prt_line_height, - prt_ps_mb_font.ps_fontname[PRT_PS_FONT_BOLDOBLIQUE]); - } else { - // Use BOLD for BOLDOBLIQUE - prt_dup_cidfont("CF1", "CF3"); - } - } - - // Misc constant vars used for underlining and background rects - prt_def_var("UO", PRT_PS_FONT_TO_USER(prt_line_height, - prt_ps_font->uline_offset), 2); - prt_def_var("UW", PRT_PS_FONT_TO_USER(prt_line_height, - prt_ps_font->uline_width), 2); - prt_def_var("BO", prt_bgcol_offset, 2); - - prt_dsc_noarg("EndSetup"); - - // Fail if any problems writing out to the PS file - return !prt_file_error; -} - -void mch_print_end(prt_settings_T *psettings) -{ - prt_dsc_noarg("Trailer"); - - // Output any info we don't know in toto until we finish - prt_dsc_ints("Pages", 1, &prt_page_num); - - prt_dsc_noarg("EOF"); - - // Write CTRL-D to close serial communication link if used. - // NOTHING MUST BE WRITTEN AFTER THIS! - prt_write_file("\004"); - - if (!prt_file_error && psettings->outfile == NULL - && !got_int && !psettings->user_abort) { - // Close the file first. - if (prt_ps_fd != NULL) { - fclose(prt_ps_fd); - prt_ps_fd = NULL; - } - prt_message((char_u *)_("Sending to printer...")); - - // Not printing to a file: use 'printexpr' to print the file. - if (eval_printexpr((char *)prt_ps_file_name, (char *)psettings->arguments) - == FAIL) { - emsg(_("E365: Failed to print PostScript file")); - } else { - prt_message((char_u *)_("Print job sent.")); - } - } - - mch_print_cleanup(); -} - -int mch_print_end_page(void) -{ - prt_flush_buffer(); - - prt_write_string("re sp\n"); - - prt_dsc_noarg("PageTrailer"); - - return !prt_file_error; -} - -int mch_print_begin_page(char_u *str) -{ - int page_num[2]; - - prt_page_num++; - - page_num[0] = page_num[1] = prt_page_num; - prt_dsc_ints("Page", 2, page_num); - - prt_dsc_noarg("BeginPageSetup"); - - prt_write_string("sv\n0 g\n"); - prt_in_ascii = !prt_out_mbyte; - if (prt_out_mbyte) { - prt_write_string("CF0 sf\n"); - } else { - prt_write_string("F0 sf\n"); - } - prt_fgcol = PRCOLOR_BLACK; - prt_bgcol = PRCOLOR_WHITE; - prt_font = PRT_PS_FONT_ROMAN; - - // Set up page transformation for landscape printing. - if (!prt_portrait) { - prt_write_int(-((int)prt_mediasize[prt_media].width)); - prt_write_string("sl\n"); - } - - prt_dsc_noarg("EndPageSetup"); - - // We have reset the font attributes, force setting them again. - curr_bg = 0xffffffff; - curr_fg = 0xffffffff; - curr_bold = kNone; - - return !prt_file_error; -} - -int mch_print_blank_page(void) -{ - return mch_print_begin_page(NULL) ? (mch_print_end_page()) : false; -} - -static double prt_pos_x = 0; -static double prt_pos_y = 0; - -void mch_print_start_line(const bool margin, const int page_line) -{ - prt_pos_x = prt_left_margin; - if (margin) { - prt_pos_x -= prt_number_width; - } - - prt_pos_y = prt_top_margin - prt_first_line_height - - page_line * prt_line_height; - - prt_attribute_change = true; - prt_need_moveto = true; - prt_half_width = false; -} - -int mch_print_text_out(char_u *const textp, size_t len) -{ - char_u *p = textp; - char_u ch; - char_u ch_buff[8]; - char_u *tofree = NULL; - double char_width = prt_char_width; - - // Ideally VIM would create a rearranged CID font to combine a Roman and - // CJKV font to do what VIM is doing here - use a Roman font for characters - // in the ASCII range, and the original CID font for everything else. - // The problem is that GhostScript still (as of 8.13) does not support - // rearranged fonts even though they have been documented by Adobe for 7 - // years! If they ever do, a lot of this code will disappear. - if (prt_use_courier) { - const bool in_ascii = (len == 1 && *p < 0x80); - if (prt_in_ascii) { - if (!in_ascii) { - // No longer in ASCII range - need to switch font - prt_in_ascii = false; - prt_need_font = true; - prt_attribute_change = true; - } - } else if (in_ascii) { - // Now in ASCII range - need to switch font - prt_in_ascii = true; - prt_need_font = true; - prt_attribute_change = true; - } - } - if (prt_out_mbyte) { - const bool half_width = (utf_ptr2cells((char *)p) == 1); - if (half_width) { - char_width /= 2; - } - if (prt_half_width) { - if (!half_width) { - prt_half_width = false; - prt_pos_x += prt_char_width/4; - prt_need_moveto = true; - prt_attribute_change = true; - } - } else if (half_width) { - prt_half_width = true; - prt_pos_x += prt_char_width/4; - prt_need_moveto = true; - prt_attribute_change = true; - } - } - - // Output any required changes to the graphics state, after flushing any - // text buffered so far. - if (prt_attribute_change) { - prt_flush_buffer(); - // Reset count of number of chars that will be printed - prt_text_run = 0; - - if (prt_need_moveto) { - prt_pos_x_moveto = prt_pos_x; - prt_pos_y_moveto = prt_pos_y; - prt_do_moveto = true; - - prt_need_moveto = false; - } - if (prt_need_font) { - if (!prt_in_ascii) { - prt_write_string("CF"); - } else { - prt_write_string("F"); - } - prt_write_int(prt_font); - prt_write_string("sf\n"); - prt_need_font = false; - } - if (prt_need_fgcol) { - unsigned int r, g, b; - r = (prt_fgcol & 0xff0000) >> 16; - g = (prt_fgcol & 0xff00) >> 8; - b = prt_fgcol & 0xff; - - prt_write_real(r / 255.0, 3); - if (r == g && g == b) { - prt_write_string("g\n"); - } else { - prt_write_real(g / 255.0, 3); - prt_write_real(b / 255.0, 3); - prt_write_string("r\n"); - } - prt_need_fgcol = false; - } - - if (prt_bgcol != PRCOLOR_WHITE) { - prt_new_bgcol = prt_bgcol; - if (prt_need_bgcol) { - prt_do_bgcol = true; - } - } else { - prt_do_bgcol = false; - } - prt_need_bgcol = false; - - if (prt_need_underline) { - prt_do_underline = prt_underline; - } - prt_need_underline = false; - - prt_attribute_change = false; - } - - if (prt_do_conv) { - // Convert from multi-byte to 8-bit encoding - p = (char_u *)string_convert(&prt_conv, (char *)p, &len); - tofree = p; - if (p == NULL) { - p = (char_u *)""; - len = 0; - } - } - - if (prt_out_mbyte) { - // Multi-byte character strings are represented more efficiently as hex - // strings when outputting clean 8 bit PS. - while (len-- > 0) { - ch = prt_hexchar[(unsigned)(*p) >> 4]; - ga_append(&prt_ps_buffer, (char)ch); - ch = prt_hexchar[(*p) & 0xf]; - ga_append(&prt_ps_buffer, (char)ch); - p++; - } - } else { - // Add next character to buffer of characters to output. - // Note: One printed character may require several PS characters to - // represent it, but we only count them as one printed character. - ch = *p; - if (ch < 32 || ch == '(' || ch == ')' || ch == '\\') { - // Convert non-printing characters to either their escape or octal - // sequence, ensures PS sent over a serial line does not interfere - // with the comms protocol. - ga_append(&prt_ps_buffer, '\\'); - switch (ch) { - case BS: - ga_append(&prt_ps_buffer, 'b'); break; - case TAB: - ga_append(&prt_ps_buffer, 't'); break; - case NL: - ga_append(&prt_ps_buffer, 'n'); break; - case FF: - ga_append(&prt_ps_buffer, 'f'); break; - case CAR: - ga_append(&prt_ps_buffer, 'r'); break; - case '(': - ga_append(&prt_ps_buffer, '('); break; - case ')': - ga_append(&prt_ps_buffer, ')'); break; - case '\\': - ga_append(&prt_ps_buffer, '\\'); break; - - default: - sprintf((char *)ch_buff, "%03o", (unsigned int)ch); // NOLINT(runtime/printf) - ga_append(&prt_ps_buffer, (char)ch_buff[0]); - ga_append(&prt_ps_buffer, (char)ch_buff[1]); - ga_append(&prt_ps_buffer, (char)ch_buff[2]); - break; - } - } else { - ga_append(&prt_ps_buffer, (char)ch); - } - } - - // Need to free any translated characters - xfree(tofree); - - prt_text_run += char_width; - prt_pos_x += char_width; - - // The downside of fp - use relative error on right margin check - const double next_pos = prt_pos_x + prt_char_width; - const bool need_break = (next_pos > prt_right_margin) - && ((next_pos - prt_right_margin) > (prt_right_margin * 1e-5)); - - if (need_break) { - prt_flush_buffer(); - } - - return need_break; -} - -void mch_print_set_font(const TriState iBold, const TriState iItalic, const TriState iUnderline) -{ - int font = 0; - - if (iBold) { - font |= 0x01; - } - if (iItalic) { - font |= 0x02; - } - - if (font != prt_font) { - prt_font = font; - prt_attribute_change = true; - prt_need_font = true; - } - if (prt_underline != iUnderline) { - prt_underline = iUnderline; - prt_attribute_change = true; - prt_need_underline = true; - } -} - -void mch_print_set_bg(uint32_t bgcol) -{ - prt_bgcol = bgcol; - prt_attribute_change = true; - prt_need_bgcol = true; -} - -void mch_print_set_fg(uint32_t fgcol) -{ - if (fgcol != prt_fgcol) { - prt_fgcol = fgcol; - prt_attribute_change = true; - prt_need_fgcol = true; - } -} diff --git a/src/nvim/hardcopy.h b/src/nvim/hardcopy.h deleted file mode 100644 index 673d559ecf..0000000000 --- a/src/nvim/hardcopy.h +++ /dev/null @@ -1,80 +0,0 @@ -#ifndef NVIM_HARDCOPY_H -#define NVIM_HARDCOPY_H - -#include <stdint.h> -#include <stdlib.h> - -#include "nvim/ex_cmds_defs.h" -#include "nvim/globals.h" -#include "nvim/types.h" - -// Structure to hold printing color and font attributes. -typedef struct { - uint32_t fg_color; - uint32_t bg_color; - TriState bold; - TriState italic; - TriState underline; - int undercurl; - int underdouble; - int underdotted; - int underdashed; -} prt_text_attr_T; - -// Structure passed back to the generic printer code. -typedef struct { - int n_collated_copies; - int n_uncollated_copies; - int duplex; - int chars_per_line; - int lines_per_page; - int has_color; - prt_text_attr_T number; - int modec; - int do_syntax; - int user_abort; - char_u *jobname; - char_u *outfile; - char_u *arguments; -} prt_settings_T; - -// Generic option table item, only used for printer at the moment. -typedef struct { - const char *name; - int hasnum; - int number; - char_u *string; // points into option string - int strlen; - int present; -} option_table_T; - -#define OPT_PRINT_TOP 0 -#define OPT_PRINT_BOT 1 -#define OPT_PRINT_LEFT 2 -#define OPT_PRINT_RIGHT 3 -#define OPT_PRINT_HEADERHEIGHT 4 -#define OPT_PRINT_SYNTAX 5 -#define OPT_PRINT_NUMBER 6 -#define OPT_PRINT_WRAP 7 -#define OPT_PRINT_DUPLEX 8 -#define OPT_PRINT_PORTRAIT 9 -#define OPT_PRINT_PAPER 10 -#define OPT_PRINT_COLLATE 11 -#define OPT_PRINT_JOBSPLIT 12 -#define OPT_PRINT_FORMFEED 13 -#define OPT_PRINT_NUM_OPTIONS 14 - -// For prt_get_unit(). -#define PRT_UNIT_NONE -1 -#define PRT_UNIT_PERC 0 -#define PRT_UNIT_INCH 1 -#define PRT_UNIT_MM 2 -#define PRT_UNIT_POINT 3 -#define PRT_UNIT_NAMES { "pc", "in", "mm", "pt" } - -#define PRINT_NUMBER_WIDTH 8 - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "hardcopy.h.generated.h" -#endif -#endif // NVIM_HARDCOPY_H diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c index 774551242f..2c55e840f1 100644 --- a/src/nvim/highlight.c +++ b/src/nvim/highlight.c @@ -933,22 +933,26 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e CHECK_FLAG(dict, mask, italic, , HL_ITALIC); CHECK_FLAG(dict, mask, reverse, , HL_INVERSE); CHECK_FLAG(dict, mask, strikethrough, , HL_STRIKETHROUGH); + if (use_rgb) { + CHECK_FLAG(dict, mask, fg_indexed, , HL_FG_INDEXED); + CHECK_FLAG(dict, mask, bg_indexed, , HL_BG_INDEXED); + } CHECK_FLAG(dict, mask, nocombine, , HL_NOCOMBINE); CHECK_FLAG(dict, mask, default, _, HL_DEFAULT); if (HAS_KEY(dict->fg)) { - fg = object_to_color(dict->fg, "fg", true, err); + fg = object_to_color(dict->fg, "fg", use_rgb, err); } else if (HAS_KEY(dict->foreground)) { - fg = object_to_color(dict->foreground, "foreground", true, err); + fg = object_to_color(dict->foreground, "foreground", use_rgb, err); } if (ERROR_SET(err)) { return hlattrs; } if (HAS_KEY(dict->bg)) { - bg = object_to_color(dict->bg, "bg", true, err); + bg = object_to_color(dict->bg, "bg", use_rgb, err); } else if (HAS_KEY(dict->background)) { - bg = object_to_color(dict->background, "background", true, err); + bg = object_to_color(dict->background, "background", use_rgb, err); } if (ERROR_SET(err)) { return hlattrs; @@ -1035,11 +1039,11 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e } } - // apply gui mask as default for cterm mask - if (!cterm_mask_provided) { - cterm_mask = mask; - } if (use_rgb) { + // apply gui mask as default for cterm mask + if (!cterm_mask_provided) { + cterm_mask = mask; + } hlattrs.rgb_ae_attr = mask; hlattrs.rgb_bg_color = bg; hlattrs.rgb_fg_color = fg; @@ -1049,9 +1053,9 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e hlattrs.cterm_fg_color = ctermfg == -1 ? 0 : ctermfg + 1; hlattrs.cterm_ae_attr = cterm_mask; } else { - hlattrs.cterm_bg_color = ctermbg == -1 ? 0 : ctermbg + 1; - hlattrs.cterm_fg_color = ctermfg == -1 ? 0 : ctermfg + 1; - hlattrs.cterm_ae_attr = cterm_mask; + hlattrs.cterm_bg_color = bg == -1 ? 0 : bg + 1; + hlattrs.cterm_fg_color = fg == -1 ? 0 : fg + 1; + hlattrs.cterm_ae_attr = mask; } return hlattrs; diff --git a/src/nvim/main.c b/src/nvim/main.c index 9e14e911ff..b5207f9cf6 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -97,6 +97,7 @@ #include "nvim/msgpack_rpc/helpers.h" #include "nvim/msgpack_rpc/server.h" #include "nvim/os/signal.h" +#include "nvim/tui/tui.h" // values for "window_layout" enum { @@ -278,8 +279,6 @@ int main(int argc, char **argv) // argument list "global_alist". command_line_scan(¶ms); - open_script_files(¶ms); - nlua_init(); TIME_MSG("init lua interpreter"); @@ -291,9 +290,29 @@ int main(int argc, char **argv) } } - server_init(params.listen_addr); + bool use_builtin_ui = (!headless_mode && !embedded_mode && !silent_mode); + + // don't bind the server yet, if we are using builtin ui. + // This will be done when nvim server has been forked from the ui process + if (!use_builtin_ui) { + server_init(params.listen_addr); + } + if (params.remote) { - remote_request(¶ms, params.remote, params.server_addr, argc, argv); + remote_request(¶ms, params.remote, params.server_addr, argc, argv, + use_builtin_ui); + } + + bool remote_ui = (ui_client_channel_id != 0); + + if (use_builtin_ui && !remote_ui) { + ui_client_forward_stdin = !params.input_isatty; + uint64_t rv = ui_client_start_server(params.argc, params.argv); + if (!rv) { + os_errmsg("Failed to start Nvim server!\n"); + getout(1); + } + ui_client_channel_id = rv; } if (GARGCOUNT > 0) { @@ -349,17 +368,16 @@ int main(int argc, char **argv) input_start(STDIN_FILENO); } + if (ui_client_channel_id) { + ui_client_run(remote_ui); // NORETURN + } + // Wait for UIs to set up Nvim or show early messages // and prompts (--cmd, swapfile dialog, …). bool use_remote_ui = (embedded_mode && !headless_mode); - bool use_builtin_ui = (!headless_mode && !embedded_mode && !silent_mode); - if (use_remote_ui || use_builtin_ui) { + if (use_remote_ui) { TIME_MSG("waiting for UI"); - if (use_remote_ui) { - remote_ui_wait_for_attach(); - } else { - ui_builtin_start(); - } + remote_ui_wait_for_attach(); TIME_MSG("done waiting for UI"); firstwin->w_prev_height = firstwin->w_height; // may have changed } @@ -370,12 +388,13 @@ int main(int argc, char **argv) win_new_screensize(); TIME_MSG("clear screen"); - if (ui_client_channel_id) { - ui_client_init(ui_client_channel_id); - ui_client_execute(ui_client_channel_id); - abort(); // unreachable + // Handle "foo | nvim". EDIT_FILE may be overwritten now. #6299 + if (edit_stdin(¶ms)) { + params.edit_type = EDIT_STDIN; } + open_script_files(¶ms); + // Default mappings (incl. menus) Error err = ERROR_INIT; Object o = NLUA_EXEC_STATIC("return vim._init_default_mappings()", @@ -384,6 +403,7 @@ int main(int argc, char **argv) api_clear_error(&err); assert(o.type == kObjectTypeNil); api_free_object(o); + TIME_MSG("init default mappings"); init_default_autocmds(); @@ -483,7 +503,7 @@ int main(int argc, char **argv) // writing end of the pipe doesn't like, e.g., in case stdin and stderr // are the same terminal: "cat | vim -". // Using autocommands here may cause trouble... - if ((params.edit_type == EDIT_STDIN || stdin_fd >= 0) && !recoverymode) { + if (params.edit_type == EDIT_STDIN && !recoverymode) { read_stdin(); } @@ -607,7 +627,9 @@ void os_exit(int r) { exiting = true; - ui_flush(); + if (!ui_client_channel_id) { + ui_flush(); + } ui_call_stop(); ml_close_all(true); // remove all memfiles @@ -837,15 +859,24 @@ static uint64_t server_connect(char *server_addr, const char **errmsg) /// Handle remote subcommands static void remote_request(mparm_T *params, int remote_args, char *server_addr, int argc, - char **argv) + char **argv, bool ui_only) { + bool is_ui = strequal(argv[remote_args], "--remote-ui"); + if (ui_only && !is_ui) { + // TODO(bfredl): this implies always starting the TUI. + // if we be smart we could delay this past should_exit + return; + } + const char *connect_error = NULL; uint64_t chan = server_connect(server_addr, &connect_error); Object rvobj = OBJECT_INIT; - if (strequal(argv[remote_args], "--remote-ui-test")) { + if (is_ui) { if (!chan) { - emsg(connect_error); + os_errmsg("Remote ui failed to start: "); + os_errmsg(connect_error); + os_errmsg("\n"); exit(1); } @@ -925,14 +956,14 @@ static void remote_request(mparm_T *params, int remote_args, char *server_addr, /// Decides whether text (as opposed to commands) will be read from stdin. /// @see EDIT_STDIN -static bool edit_stdin(bool explicit, mparm_T *parmp) +static bool edit_stdin(mparm_T *parmp) { bool implicit = !headless_mode - && !embedded_mode + && !(embedded_mode && stdin_fd <= 0) && (!exmode_active || parmp->input_neverscript) && !parmp->input_isatty && parmp->scriptin == NULL; // `-s -` was not given. - return explicit || implicit; + return parmp->had_stdin_file || implicit; } /// Scan the command line arguments. @@ -941,7 +972,6 @@ static void command_line_scan(mparm_T *parmp) int argc = parmp->argc; char **argv = parmp->argv; int argv_idx; // index in argv[n][] - bool had_stdin_file = false; // found explicit "-" argument bool had_minmin = false; // found "--" argument int want_argument; // option argument with argument long n; @@ -978,7 +1008,7 @@ static void command_line_scan(mparm_T *parmp) && parmp->edit_type != EDIT_STDIN) { mainerr(err_too_many_args, argv[0]); } - had_stdin_file = true; + parmp->had_stdin_file = true; parmp->edit_type = EDIT_STDIN; } argv_idx = -1; // skip to next argument @@ -1345,7 +1375,7 @@ scripterror: path_fix_case(p); #endif - int alist_fnum_flag = edit_stdin(had_stdin_file, parmp) + int alist_fnum_flag = edit_stdin(parmp) ? 1 // add buffer nr after exp. : 2; // add buffer number now and use curbuf alist_add(&global_alist, p, alist_fnum_flag); @@ -1373,11 +1403,6 @@ scripterror: xfree(swcmd); } - // Handle "foo | nvim". EDIT_FILE may be overwritten now. #6299 - if (edit_stdin(had_stdin_file, parmp)) { - parmp->edit_type = EDIT_STDIN; - } - TIME_MSG("parsing arguments"); } @@ -1527,11 +1552,16 @@ static void open_script_files(mparm_T *parmp) if (parmp->scriptin) { int error; if (strequal(parmp->scriptin, "-")) { - const int stdin_dup_fd = os_dup(STDIN_FILENO); + int stdin_dup_fd; + if (stdin_fd > 0) { + stdin_dup_fd = stdin_fd; + } else { + stdin_dup_fd = os_dup(STDIN_FILENO); #ifdef MSWIN - // Replace the original stdin with the console input handle. - os_replace_stdin_to_conin(); + // Replace the original stdin with the console input handle. + os_replace_stdin_to_conin(); #endif + } FileDescriptor *const stdin_dup = file_open_fd_new(&error, stdin_dup_fd, kFileReadOnly|kFileNonBlocking); assert(stdin_dup != NULL); diff --git a/src/nvim/main.h b/src/nvim/main.h index 4cf8dfe026..c39fc1ed4a 100644 --- a/src/nvim/main.h +++ b/src/nvim/main.h @@ -45,6 +45,7 @@ typedef struct { char *scriptin; // -s {filename} char *scriptout; // -w/-W {filename} bool scriptout_append; // append (-w) instead of overwrite (-W) + bool had_stdin_file; // explicit - as a file to edit } mparm_T; #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 516af20fe9..4d011dc079 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -250,8 +250,8 @@ static void parse_msgpack(Channel *channel) ui_client_event_raw_line(p->grid_line_event); } else if (p->ui_handler.fn != NULL && p->result.type == kObjectTypeArray) { p->ui_handler.fn(p->result.data.array); - arena_mem_free(arena_finish(&p->arena)); } + arena_mem_free(arena_finish(&p->arena)); } else if (p->type == kMessageTypeResponse) { ChannelCallFrame *frame = kv_last(channel->rpc.call_stack); if (p->request_id != frame->request_id) { @@ -299,7 +299,7 @@ static void handle_request(Channel *channel, Unpacker *p, Array args) assert(p->type == kMessageTypeRequest || p->type == kMessageTypeNotification); if (!p->handler.fn) { - send_error(channel, p->type, p->request_id, p->unpack_error.msg); + send_error(channel, p->handler, p->type, p->request_id, p->unpack_error.msg); api_clear_error(&p->unpack_error); arena_mem_free(arena_finish(&p->arena)); return; @@ -358,6 +358,7 @@ static void request_event(void **argv) msgpack_packer response; msgpack_packer_init(&response, &out_buffer, msgpack_sbuffer_write); channel_write(channel, serialize_response(channel->id, + e->handler, e->type, e->request_id, &error, @@ -440,11 +441,13 @@ static void internal_read_event(void **argv) wstream_release_wbuffer(buffer); } -static void send_error(Channel *chan, MessageType type, uint32_t id, char *err) +static void send_error(Channel *chan, MsgpackRpcRequestHandler handler, MessageType type, + uint32_t id, char *err) { Error e = ERROR_INIT; api_set_error(&e, kErrorTypeException, "%s", err); channel_write(chan, serialize_response(chan->id, + handler, type, id, &e, @@ -543,26 +546,8 @@ void rpc_close(Channel *channel) channel_decref(channel); if (channel->streamtype == kChannelStreamStdio - || channel->id == ui_client_channel_id) { - multiqueue_put(main_loop.fast_events, exit_event, 0); - } -} - -static void exit_delay_cb(uv_timer_t *handle) -{ - uv_timer_stop(&main_loop.exit_delay_timer); - multiqueue_put(main_loop.fast_events, exit_event, 0); -} - -static void exit_event(void **argv) -{ - if (exit_need_delay) { - uv_timer_start(&main_loop.exit_delay_timer, exit_delay_cb, 0, 0); - return; - } - - if (!exiting) { - os_exit(0); + || (channel->id == ui_client_channel_id && channel->streamtype != kChannelStreamProc)) { + exit_from_channel(0); } } @@ -612,18 +597,27 @@ static WBuffer *serialize_request(uint64_t channel_id, uint32_t request_id, cons return rv; } -static WBuffer *serialize_response(uint64_t channel_id, MessageType type, uint32_t response_id, - Error *err, Object arg, msgpack_sbuffer *sbuffer) +static WBuffer *serialize_response(uint64_t channel_id, MsgpackRpcRequestHandler handler, + MessageType type, uint32_t response_id, Error *err, Object arg, + msgpack_sbuffer *sbuffer) { msgpack_packer pac; msgpack_packer_init(&pac, sbuffer, msgpack_sbuffer_write); if (ERROR_SET(err) && type == kMessageTypeNotification) { - Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ(err->type)); - ADD(args, STRING_OBJ(cstr_to_string(err->msg))); - msgpack_rpc_serialize_request(0, cstr_as_string("nvim_error_event"), - args, &pac); - api_free_array(args); + if (handler.fn == handle_nvim_paste) { + // TODO(bfredl): this is pretty much ad-hoc. maybe TUI and UI:s should be + // allowed to ask nvim to just scream directly in the users face + // instead of sending nvim_error_event, in general. + semsg("paste: %s", err->msg); + api_clear_error(err); + } else { + Array args = ARRAY_DICT_INIT; + ADD(args, INTEGER_OBJ(err->type)); + ADD(args, STRING_OBJ(cstr_to_string(err->msg))); + msgpack_rpc_serialize_request(0, cstr_as_string("nvim_error_event"), + args, &pac); + api_free_array(args); + } } else { msgpack_rpc_serialize_response(response_id, err, arg, &pac); } diff --git a/src/nvim/msgpack_rpc/unpacker.c b/src/nvim/msgpack_rpc/unpacker.c index 897ea1f768..44a16beb48 100644 --- a/src/nvim/msgpack_rpc/unpacker.c +++ b/src/nvim/msgpack_rpc/unpacker.c @@ -298,7 +298,7 @@ error: // // When method is "grid_line", we furthermore decode a cell at a time like: // -// <0>[2, "redraw", <10>[{11}["grid_line", <13>[g, r, c, [<14>[cell], <14>[cell], ...]], ...], <11>[...], ...]] +// <0>[2, "redraw", <10>[{11}["grid_line", <14>[g, r, c, [<15>[cell], <15>[cell], ...]], ...], <11>[...], ...]] // // where [cell] is [char, repeat, attr], where 'repeat' and 'attr' is optional @@ -318,17 +318,19 @@ bool unpacker_advance(Unpacker *p) } } - if (p->state >= 10 && p->state != 12) { + if (p->state >= 10 && p->state != 13) { if (!unpacker_parse_redraw(p)) { return false; } - if (p->state == 14) { + if (p->state == 15) { // grid_line event already unpacked goto done; } else { + assert(p->state == 12); // unpack other ui events using mpack_parse() p->arena = (Arena)ARENA_EMPTY; + p->state = 13; } } @@ -355,11 +357,11 @@ done: case 2: p->state = 0; return true; - case 12: - case 14: + case 13: + case 15: p->ncalls--; if (p->ncalls > 0) { - p->state = (p->state == 14) ? 13 : 12; + p->state = (p->state == 15) ? 14 : 12; } else if (p->nevents > 0) { p->state = 11; } else { @@ -428,14 +430,14 @@ redo: } return true; } else { - p->state = 13; + p->state = 14; p->arena = (Arena)ARENA_EMPTY; p->grid_line_event = arena_alloc(&p->arena, sizeof *p->grid_line_event, true); g = p->grid_line_event; } FALLTHROUGH; - case 13: + case 14: NEXT_TYPE(tok, MPACK_TOKEN_ARRAY); int eventarrsize = (int)tok.length; if (eventarrsize != 4) { @@ -456,10 +458,10 @@ redo: p->read_ptr = data; p->read_size = size; - p->state = 14; + p->state = 15; FALLTHROUGH; - case 14: + case 15: assert(g->icell < g->ncells); NEXT_TYPE(tok, MPACK_TOKEN_ARRAY); @@ -513,6 +515,9 @@ redo: } goto redo; + case 12: + return true; + default: abort(); } diff --git a/src/nvim/option.c b/src/nvim/option.c index 6785529f59..2d59eec91f 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -52,7 +52,6 @@ #include "nvim/gettext.h" #include "nvim/globals.h" #include "nvim/grid_defs.h" -#include "nvim/hardcopy.h" #include "nvim/highlight.h" #include "nvim/highlight_group.h" #include "nvim/indent.h" @@ -287,28 +286,6 @@ void set_init_1(bool clean_arg) } } -#if defined(MSWIN) || defined(MAC) - // Set print encoding on platforms that don't default to latin1 - set_string_default("printencoding", "hp-roman8", false); -#endif - - // 'printexpr' must be allocated to be able to evaluate it. - set_string_default("printexpr", -#ifdef UNIX - "system(['lpr'] " - "+ (empty(&printdevice)?[]:['-P', &printdevice]) " - "+ [v:fname_in])" - ". delete(v:fname_in)" - "+ v:shell_error", -#elif defined(MSWIN) - "system(['copy', v:fname_in, " - "empty(&printdevice)?'LPT1':&printdevice])" - ". delete(v:fname_in)", -#else - "", -#endif - false); - char *backupdir = stdpaths_user_state_subpath("backup", 2, true); const size_t backupdir_len = strlen(backupdir); backupdir = xrealloc(backupdir, backupdir_len + 3); @@ -611,7 +588,6 @@ void set_init_2(bool headless) p_window = Rows - 1; } set_number_default("window", Rows - 1); - (void)parse_printoptions(); // parse 'printoptions' default value } /// Initialize the options, part three: After reading the .vimrc diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 34c1d3a255..699a57c2aa 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -533,14 +533,6 @@ EXTERN char *p_fo; ///< 'formatoptions' EXTERN char_u *p_fp; // 'formatprg' EXTERN int p_fs; // 'fsync' EXTERN int p_gd; // 'gdefault' -EXTERN char_u *p_pdev; // 'printdevice' -EXTERN char *p_penc; // 'printencoding' -EXTERN char *p_pexpr; // 'printexpr' -EXTERN char *p_pmfn; // 'printmbfont' -EXTERN char *p_pmcs; // 'printmbcharset' -EXTERN char *p_pfn; // 'printfont' -EXTERN char *p_popt; // 'printoptions' -EXTERN char_u *p_header; // 'printheader' EXTERN char *p_guicursor; // 'guicursor' EXTERN char_u *p_guifont; // 'guifont' EXTERN char_u *p_guifontwide; // 'guifontwide' diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 232c645eb0..8c7cf94465 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -1740,65 +1740,6 @@ return { defaults={if_true=false} }, { - full_name='printdevice', abbreviation='pdev', - short_desc=N_("name of the printer to be used for :hardcopy"), - type='string', scope={'global'}, - secure=true, - varname='p_pdev', - defaults={if_true=""} - }, - { - full_name='printencoding', abbreviation='penc', - short_desc=N_("encoding to be used for printing"), - type='string', scope={'global'}, - varname='p_penc', - defaults={if_true=""} - }, - { - full_name='printexpr', abbreviation='pexpr', - short_desc=N_("expression used to print PostScript for :hardcopy"), - type='string', scope={'global'}, - secure=true, - varname='p_pexpr', - defaults={if_true=""} - }, - { - full_name='printfont', abbreviation='pfn', - short_desc=N_("name of the font to be used for :hardcopy"), - type='string', scope={'global'}, - varname='p_pfn', - defaults={if_true="courier"} - }, - { - full_name='printheader', abbreviation='pheader', - short_desc=N_("format of the header used for :hardcopy"), - type='string', scope={'global'}, - varname='p_header', - defaults={if_true="%<%f%h%m%=Page %N"} - }, - { - full_name='printmbcharset', abbreviation='pmbcs', - short_desc=N_("CJK character set to be used for :hardcopy"), - type='string', scope={'global'}, - varname='p_pmcs', - defaults={if_true=""} - }, - { - full_name='printmbfont', abbreviation='pmbfn', - short_desc=N_("font names to be used for CJK output of :hardcopy"), - type='string', scope={'global'}, - varname='p_pmfn', - defaults={if_true=""} - }, - { - full_name='printoptions', abbreviation='popt', - short_desc=N_("controls the format of :hardcopy output"), - type='string', list='onecomma', scope={'global'}, - deny_duplicates=true, - varname='p_popt', - defaults={if_true=""} - }, - { full_name='prompt', short_desc=N_("enable prompt in Ex mode"), type='bool', scope={'global'}, diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 106a4fbadf..83bbf0ba33 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -23,7 +23,6 @@ #include "nvim/fold.h" #include "nvim/gettext.h" #include "nvim/globals.h" -#include "nvim/hardcopy.h" #include "nvim/highlight_group.h" #include "nvim/indent.h" #include "nvim/indent_c.h" @@ -860,11 +859,6 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf } } } - } else if (varp == &p_penc) { - // Canonize printencoding if VIM standard one - p = enc_canonize(p_penc); - xfree(p_penc); - p_penc = p; } else if (varp == &curbuf->b_p_keymap) { if (!valid_filetype(*varp)) { errmsg = e_invarg; @@ -1071,10 +1065,6 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf } } else if (varp == &p_guicursor) { // 'guicursor' errmsg = parse_shape_opt(SHAPE_CURSOR); - } else if (varp == &p_popt) { - errmsg = parse_printoptions(); - } else if (varp == &p_pmfn) { - errmsg = parse_printmbfont(); } else if (varp == &p_langmap) { // 'langmap' langmap_set(); } else if (varp == &p_breakat) { // 'breakat' @@ -1492,8 +1482,7 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf || gvarp == &p_fex || gvarp == &p_inex || gvarp == &p_inde - || varp == &p_pex - || varp == &p_pexpr) { // '*expr' options + || varp == &p_pex) { // '*expr' options char **p_opt = NULL; // If the option value starts with <SID> or s:, then replace that with @@ -1520,9 +1509,6 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf if (varp == &p_pex) { // 'patchexpr' p_opt = &p_pex; } - if (varp == &p_pexpr) { // 'printexpr' - p_opt = &p_pexpr; - } if (p_opt != NULL) { char *name = get_scriptlocal_funcname(*p_opt); diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 8c4fee58b1..4906dd0df2 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -779,6 +779,38 @@ int os_setperm(const char *const name, int perm) return (r == kLibuvSuccess ? OK : FAIL); } +#if defined(HAVE_ACL) +# ifdef HAVE_SYS_ACL_H +# include <sys/acl.h> +# endif +# ifdef HAVE_SYS_ACCESS_H +# include <sys/access.h> +# endif + +// Return a pointer to the ACL of file "fname" in allocated memory. +// Return NULL if the ACL is not available for whatever reason. +vim_acl_T os_get_acl(const char_u *fname) +{ + vim_acl_T ret = NULL; + return ret; +} + +// Set the ACL of file "fname" to "acl" (unless it's NULL). +void os_set_acl(const char_u *fname, vim_acl_T aclent) +{ + if (aclent == NULL) { + return; + } +} + +void os_free_acl(vim_acl_T aclent) +{ + if (aclent == NULL) { + return; + } +} +#endif + #ifdef UNIX /// Checks if the current user owns a file. /// diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c deleted file mode 100644 index 074a8b7936..0000000000 --- a/src/nvim/os_unix.c +++ /dev/null @@ -1,42 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - -#include "nvim/os/os_defs.h" -#include "nvim/os_unix.h" -#include "nvim/types.h" - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os_unix.c.generated.h" // IWYU pragma: export -#endif - -#if defined(HAVE_ACL) -# ifdef HAVE_SYS_ACL_H -# include <sys/acl.h> -# endif -# ifdef HAVE_SYS_ACCESS_H -# include <sys/access.h> -# endif - -// Return a pointer to the ACL of file "fname" in allocated memory. -// Return NULL if the ACL is not available for whatever reason. -vim_acl_T os_get_acl(const char_u *fname) -{ - vim_acl_T ret = NULL; - return ret; -} - -// Set the ACL of file "fname" to "acl" (unless it's NULL). -void os_set_acl(const char_u *fname, vim_acl_T aclent) -{ - if (aclent == NULL) { - return; - } -} - -void os_free_acl(vim_acl_T aclent) -{ - if (aclent == NULL) { - return; - } -} -#endif diff --git a/src/nvim/os_unix.h b/src/nvim/os_unix.h deleted file mode 100644 index 31430ee23a..0000000000 --- a/src/nvim/os_unix.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef NVIM_OS_UNIX_H -#define NVIM_OS_UNIX_H - -#include "nvim/os/shell.h" -#include "nvim/types.h" - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os_unix.h.generated.h" -#endif -#endif // NVIM_OS_UNIX_H diff --git a/src/nvim/po/af.po b/src/nvim/po/af.po index d64789660e..92a1a6ca3c 100644 --- a/src/nvim/po/af.po +++ b/src/nvim/po/af.po @@ -2794,101 +2794,6 @@ msgstr "soektog het BO getref, gaan voort van ONDER af" msgid "search hit BOTTOM, continuing at TOP" msgstr "soektog het ONDER getref, gaan voort van BO af" -msgid "E550: Missing colon" -msgstr "E550: Ontbrekende dubbelpunt" - -msgid "E551: Illegal component" -msgstr "E551: Ongeldige komponent" - -msgid "E552: digit expected" -msgstr "E552: syfer verwag" - -#, c-format -msgid "Page %d" -msgstr "Bladsy %d" - -msgid "No text to be printed" -msgstr "Geen teks om te druk nie" - -#, fuzzy, c-format -#~ msgid "Printing page %d (%zu%%)" -#~ msgstr "Druk nou bladsy %d (%d%%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " Kopie %d van %d" - -#, c-format -msgid "Printed: %s" -msgstr "Gedruk: %s" - -msgid "Printing aborted" -msgstr "Drukkery gestaak" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Kan nie na 'PostScript' afvoerler skryf nie" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Kan nie ler \"%s\" oopmaak nie" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Kan nie 'PostScript' hulpbron-ler \"%s\" lees nie" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: Ler \"%s\" is nie 'n 'PostScript' hulpbron-ler nie" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "" -"E619: Ler \"%s\" is nie 'n ondersteunde 'PostScript' hulpbron-ler nie" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" die hulpbron ler het die verkeerde weergawe" - -#~ msgid "E673: Incompatible multi-byte encoding and character set." -#~ msgstr "" - -#~ msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -#~ msgstr "" - -#~ msgid "E675: No default font specified for multi-byte printing." -#~ msgstr "" - -msgid "E324: Can't open PostScript output file" -msgstr "E324: Kan nie 'PostScript' afvoerler oopmaak nie" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Kan nie ler %s oopmaak nie" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Kan nie 'PostScript' hulpbron-ler \"prolog.ps\" lees nie" - -#, fuzzy -#~ msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -#~ msgstr "E456: Kan nie 'PostScript' hulpbron-ler \"%s\" vind nie" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Kan nie 'PostScript' hulpbron-ler \"%s\" vind nie" - -#, fuzzy, c-format -#~ msgid "E620: Unable to convert to print encoding \"%s\"" -#~ msgstr "E620: Kon nie van wye-greep na \"%s\" enkodering verander nie" - -msgid "Sending to printer..." -msgstr "Besig om te stuur na drukker..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: Kon nie 'PostScript' ler druk nie" - -msgid "Print job sent." -msgstr "Druktaak gestuur." - msgid "Add a new database" msgstr "Voeg 'n nuwe databasis by" diff --git a/src/nvim/po/ca.po b/src/nvim/po/ca.po index 5869e6567c..964fcc9325 100644 --- a/src/nvim/po/ca.po +++ b/src/nvim/po/ca.po @@ -3013,128 +3013,6 @@ msgstr "la cerca ha arribat a DALT, es continua a BAIX" msgid "search hit BOTTOM, continuing at TOP" msgstr "la cerca ha arribat a BAIX, es continua a DALT" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Falta un carcter \":\"" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Component illegal" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: S'esperava un dgit" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Pgina %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "No hi ha text per imprimir" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Imprimint la pgina %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Cpia %d de %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "S'ha imprs: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "S'ha avortat la impressi" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Error en escriure el fitxer PostScript" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: No s'ha pogut obrir el fitxer \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: No s'ha pogut llegir el fitxer de recursos PostScript \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: El fitxer \"%s\" no s un fitxer de recursos PostScript" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: El fitxer de recursos PostScript \"%s\" no est suportat" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: La versi del fitxer de recursos \"%s\" no s vlida" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Joc de carcters i codificaci multi-octet no compatibles." - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: printmbcharset no pot estar buit si la codificaci s multi-octet" - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "" -"E675: No heu especificat cap fosa per defecte per a la impressi multi-octet." - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: No s'ha pogut obrir el fitxer PostScript generat" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: No s'ha pogut obrir el fitxer \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: No s'ha trobat el fitxer de recursos PostScript \"prolog.ps\"" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: No s'ha trobat el fitxer de recursos PostScript \"cidfont.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: No s'ha trobat el fitxer de recursos PostScript \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: No s'ha pogut convertir a la codificaci d'impressi \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "S'est enviant a la impressora..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Error en imprimir el fitxer PostScript" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "S'ha enviat la tasca d'impressi." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Afegeix una base de dades nova" diff --git a/src/nvim/po/cs.cp1250.po b/src/nvim/po/cs.cp1250.po index bce5c0fa76..b939139fb5 100644 --- a/src/nvim/po/cs.cp1250.po +++ b/src/nvim/po/cs.cp1250.po @@ -3077,131 +3077,6 @@ msgstr "hledn doshlo zatku, pokraovn od konce" msgid "search hit BOTTOM, continuing at TOP" msgstr "hledn doshlo konce, pokraovn od zatku" -#: ../hardcopy.c:240 -#, fuzzy -msgid "E550: Missing colon" -msgstr "Chyb dvojteka" - -#: ../hardcopy.c:252 -#, fuzzy -msgid "E551: Illegal component" -msgstr "neppustn soust" - -#: ../hardcopy.c:259 -#, fuzzy -msgid "E552: digit expected" -msgstr "oekvna slice" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "dn text k vytitn" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Tisknu stranu %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Kopie %d z %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Vytitno: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Tisk zruen" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Nelze zapisovat do vstupnho PostScriptovho souboru" - -#: ../hardcopy.c:1747 -#, fuzzy, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E456: Nelze otevt soubor \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:1772 -#, fuzzy, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, fuzzy, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "" - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "" - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Nelze otevt vstupn PostScriptov soubor" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Nelze otevt soubor \"%s\"" - -#: ../hardcopy.c:2583 -#, fuzzy -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:2593 -#, fuzzy -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, fuzzy, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Odeslm na tiskrnu..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Selhal tisk PostScriptovho souboru" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Tiskov loha odeslna." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Pidat novou databzi" diff --git a/src/nvim/po/cs.po b/src/nvim/po/cs.po index f4eab3f0d4..f98dc2828e 100644 --- a/src/nvim/po/cs.po +++ b/src/nvim/po/cs.po @@ -3077,131 +3077,6 @@ msgstr "hledn doshlo zatku, pokraovn od konce" msgid "search hit BOTTOM, continuing at TOP" msgstr "hledn doshlo konce, pokraovn od zatku" -#: ../hardcopy.c:240 -#, fuzzy -msgid "E550: Missing colon" -msgstr "Chyb dvojteka" - -#: ../hardcopy.c:252 -#, fuzzy -msgid "E551: Illegal component" -msgstr "neppustn soust" - -#: ../hardcopy.c:259 -#, fuzzy -msgid "E552: digit expected" -msgstr "oekvna slice" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "dn text k vytitn" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Tisknu stranu %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Kopie %d z %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Vytitno: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Tisk zruen" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Nelze zapisovat do vstupnho PostScriptovho souboru" - -#: ../hardcopy.c:1747 -#, fuzzy, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E456: Nelze otevt soubor \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:1772 -#, fuzzy, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, fuzzy, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "" - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "" - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Nelze otevt vstupn PostScriptov soubor" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Nelze otevt soubor \"%s\"" - -#: ../hardcopy.c:2583 -#, fuzzy -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:2593 -#, fuzzy -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, fuzzy, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E457: Nelze st zdrojov PostScriptov soubor \"%s\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Odeslm na tiskrnu..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Selhal tisk PostScriptovho souboru" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Tiskov loha odeslna." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Pidat novou databzi" diff --git a/src/nvim/po/da.po b/src/nvim/po/da.po index 1c3284f867..c55918abc9 100644 --- a/src/nvim/po/da.po +++ b/src/nvim/po/da.po @@ -2384,99 +2384,6 @@ msgstr "Størrelse:" msgid "E256: Hangul automata ERROR" msgstr "E256: FEJL ved Hangul automata" -msgid "E550: Missing colon" -msgstr "E550: Manglende kolon" - -msgid "E551: Illegal component" -msgstr "E551: Ulovlig komponent" - -msgid "E552: digit expected" -msgstr "E552: ciffer ventet" - -#, c-format -msgid "Page %d" -msgstr "Side %d" - -msgid "No text to be printed" -msgstr "Ingen tekst at udskrive" - -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Udskriver side %d (%d%%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " Kopi %d af %d" - -#, c-format -msgid "Printed: %s" -msgstr "Udskrev: %s" - -msgid "Printing aborted" -msgstr "Udskrivning afbrudt" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Fejl ved skrivning til PostScript-output-fil" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Kan ikke åbne filen \"%s\"" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Kan ikke læse PostScript-ressourcefilen \"%s\"" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: filen \"%s\" er ikke en PostScript-ressourcefil" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: filen \"%s\" er ikke en understøttet PostScript-ressourcefil" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\"-ressourcefilen har forkert version" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Inkompatibel multibyte-kodning og -tegnsæt." - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset må ikke være tom med multibyte-kodning." - -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Ingen standardskrifttype angivet for multibyte-udskrivning." - -msgid "E324: Can't open PostScript output file" -msgstr "E324: Kan ikke åbne PostScript-output-fil" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Kan ikke åbne filen \"%s\"" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Kan ikke finde PostScript-ressourcefilen \"prolog.ps\"" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Kan ikke finde PostScript-ressourcefilen \"cidfont.ps\"" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Kan ikke finde PostScript-ressourcefilen \"%s.ps\"" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Kan ikke konvertere til udskrivningskodningen \"%s\"" - -msgid "Sending to printer..." -msgstr "Sender til printer..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: Kunne ikke udskrive PostScript-fil" - -msgid "Print job sent." -msgstr "Udskrivningsjob sendt." - msgid "Add a new database" msgstr "Tilføj en ny database" diff --git a/src/nvim/po/de.po b/src/nvim/po/de.po index ce3fd77ede..efd52d3efe 100644 --- a/src/nvim/po/de.po +++ b/src/nvim/po/de.po @@ -2434,126 +2434,6 @@ msgstr "Suche erreichte den ANFANG und wurde am ENDE fortgesetzt" msgid "search hit BOTTOM, continuing at TOP" msgstr "Suche erreichte das ENDE und wurde am ANFANG fortgesetzt" -#: ../hardcopy.c:296 -msgid "E550: Missing colon" -msgstr "E550: Fehlender Doppelpunkt" - -#: ../hardcopy.c:308 -msgid "E551: Illegal component" -msgstr "E551: Unzulssige Komponente" - -#: ../hardcopy.c:315 -msgid "E552: digit expected" -msgstr "E552: Ziffer erwartet" - -#: ../hardcopy.c:529 -#, c-format -msgid "Page %d" -msgstr "Seite %d" - -#: ../hardcopy.c:653 -msgid "No text to be printed" -msgstr "Kein Text zum Drucken" - -#: ../hardcopy.c:724 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Drucke Seite %d (%d%%)" - -#: ../hardcopy.c:736 -#, c-format -msgid " Copy %d of %d" -msgstr " Kopiere %d von %d" - -#: ../hardcopy.c:789 -#, c-format -msgid "Printed: %s" -msgstr "Gedruckt: %s" - -#: ../hardcopy.c:796 -msgid "Printing aborted" -msgstr "Druck abgebrochen" - -#: ../hardcopy.c:1307 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Fehler beim Schreiben der PostScript-Ausgabedatei" - -#: ../hardcopy.c:1679 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Datei \"%s\" kann nicht geffnet werden" - -#: ../hardcopy.c:1688 ../hardcopy.c:2401 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: PostScript-Ressourcendatei \"%s\" kann nicht gelesen werden" - -#: ../hardcopy.c:1704 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: Datei \"%s\" ist keine PostScript-Ressourcendatei" - -#: ../hardcopy.c:1720 ../hardcopy.c:1737 ../hardcopy.c:1776 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: Datei \"%s\" ist keine untersttzte PostScript-Ressourcendatei" - -#: ../hardcopy.c:1788 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" Ressource-Datei hat die falsche Version" - -#: ../hardcopy.c:2157 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Unzulssiger Multibyte-Zeichensatz" - -#: ../hardcopy.c:2169 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: Bei Multibyte-Zeichensatz darf 'printmbcharset' nicht leer sein." - -#: ../hardcopy.c:2185 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Keine Standardschriftart fr Multibyte-Druck angegeben." - -#: ../hardcopy.c:2357 -msgid "E324: Can't open PostScript output file" -msgstr "E324: PostScript-Ausgabedatei kann nicht geffnet werden" - -#: ../hardcopy.c:2389 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Datei \"%s\" kann nicht geffnet werden" - -#: ../hardcopy.c:2514 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: PostScript-Ressourcendatei \"prolog.ps\" nicht gefunden" - -#: ../hardcopy.c:2524 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: PostScript-Ressourcendatei \"cidfont.ps\" nicht gefunden" - -#: ../hardcopy.c:2553 ../hardcopy.c:2570 ../hardcopy.c:2596 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: PostScript-Ressourcendatei \"%s\" nicht gefunden" - -#: ../hardcopy.c:2585 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Umwandlung zu Drucker-Zeichensatz \"%s\" fehlgeschlagen" - -#: ../hardcopy.c:2808 -msgid "Sending to printer..." -msgstr "Schicke zum Drucker..." - -#: ../hardcopy.c:2812 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Druck der PostScript-Datei fehlgeschlagen" - -#: ../hardcopy.c:2814 -msgid "Print job sent." -msgstr "Druckauftrag abgeschickt" - #: ../if_cscope.c:49 msgid "Add a new database" msgstr "Eine neue Datenbank hinzufgen" diff --git a/src/nvim/po/en_GB.po b/src/nvim/po/en_GB.po index 81ee9ed6a0..1c03b305f9 100644 --- a/src/nvim/po/en_GB.po +++ b/src/nvim/po/en_GB.po @@ -2923,128 +2923,6 @@ msgstr "" msgid "search hit BOTTOM, continuing at TOP" msgstr "" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr "" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "" - -#: ../hardcopy.c:1365 -#, fuzzy -msgid "E455: Error writing to PostScript output file" -msgstr "E324: Cannot open PostScript output file" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Cannot open file \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Cannot read PostScript resource file \"%s\"" - -#: ../hardcopy.c:1772 -#, fuzzy, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E457: Cannot read PostScript resource file \"%s\"" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, fuzzy, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E457: Cannot read PostScript resource file \"%s\"" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "" - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "" - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Cannot open PostScript output file" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Cannot open file \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Cannot find PostScript resource file \"prolog.ps\"" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Cannot find PostScript resource file \"cidfont.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Cannot find PostScript resource file \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "" - -#: ../hardcopy.c:2881 -#, fuzzy -msgid "E365: Failed to print PostScript file" -msgstr "E324: Cannot open PostScript output file" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "" - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "" diff --git a/src/nvim/po/eo.po b/src/nvim/po/eo.po index 263fb61b18..aaa39d6041 100644 --- a/src/nvim/po/eo.po +++ b/src/nvim/po/eo.po @@ -2246,100 +2246,6 @@ msgstr "Stilo:" msgid "Size:" msgstr "Grando:" -msgid "E550: Missing colon" -msgstr "E550: Mankas dupunkto" - -msgid "E551: Illegal component" -msgstr "E551: Nevalida komponento" - -msgid "E552: digit expected" -msgstr "E552: cifero atendita" - -#, c-format -msgid "Page %d" -msgstr "Paĝo %d" - -msgid "No text to be printed" -msgstr "Neniu presenda teksto" - -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Presas paĝon %d (%d%%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " Kopio %d de %d" - -#, c-format -msgid "Printed: %s" -msgstr "Presis: %s" - -msgid "Printing aborted" -msgstr "Presado ĉesigita" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Eraro dum skribo de PostSkripta eliga dosiero" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Ne eblas malfermi dosieron \"%s\"" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Ne eblas legi dosieron de PostSkripta rimedo \"%s\"" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: \"%s\" ne estas dosiero de PostSkripta rimedo" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: \"%s\" ne estas subtenata dosiero de PostSkripta rimedo" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" dosiero de rimedo havas neĝustan version" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Nekongrua plurbajta kodoprezento kaj signaro." - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: printmbcharset ne rajtas esti malplena kun plurbajta kodoprezento." - -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Neniu defaŭlta tiparo specifita por plurbajta presado." - -msgid "E324: Can't open PostScript output file" -msgstr "E324: Ne eblas malfermi eligan PostSkriptan dosieron" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Ne eblas malfermi dosieron \"%s\"" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Dosiero de PostSkripta rimedo \"prolog.ps\" ne troveblas" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Dosiero de PostSkripta rimedo \"cidfont.ps\" ne troveblas" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Dosiero de PostSkripta rimedo \"%s.ps\" ne troveblas" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Ne eblas konverti al la presa kodoprezento \"%s\"" - -msgid "Sending to printer..." -msgstr "Sendas al presilo..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: Presado de PostSkripta dosiero malsukcesis" - -msgid "Print job sent." -msgstr "Laboro de presado sendita." - msgid "Add a new database" msgstr "Aldoni novan datumbazon" diff --git a/src/nvim/po/es.po b/src/nvim/po/es.po index 8a44f6a534..120a29af15 100644 --- a/src/nvim/po/es.po +++ b/src/nvim/po/es.po @@ -3054,129 +3054,6 @@ msgstr "La búsqueda ha llegado al PRINCIPIO, continuando desde el FINAL" msgid "search hit BOTTOM, continuing at TOP" msgstr "La búsqueda ha llegado al FINAL, continuando desde el PRINCIPIO" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Falta un símbolo de dos puntos" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Componente ilegal" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: Se esperaba un dígito" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Página %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "No hay texto que imprimir" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Imprimiendo la página %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr "Copia %d de %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Impreso: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Impresión interrumpida" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Error escribiendo al archivo PostScript de salida" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: No se pudo abrir el archivo \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: No se pudo leer el archivo de recursos de PostScript \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: El archivo \"%s\" no es un archivo de recursos PostScript" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: El archivo \"%s\" no es un recurso PostScript que pueda usar" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: La versión del archivo de recursos \"%s\" es incorrecta" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Codificación y set de caracteres multi-byte incompatibles" - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: \"printmbcharset\" no puede estar vacío en una codificación multi-byte" - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "" -"E675: No se ha definido un tipo de letra predeterminado para impresión " -"multi-byte" - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: No se pudo abrir el archivo PostScript de salida" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: No se pudo abrir el archivo %s" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: No se encontró el archivo de recursos PostScript \"prolog.ps\"" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: No se encontró el archivo de recursos PostScript \"cidfont.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: No se encontró el archivo de recursos PostScript \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: No se pudo convertir a la codificación de impresión \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Enviando a la impresora..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Falló la impresión del archivo PostScript" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Se ha enviado la tarea de impresión." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Añadir una nueva base de datos" diff --git a/src/nvim/po/fi.po b/src/nvim/po/fi.po index 1c0da244ba..c8db9a64b5 100644 --- a/src/nvim/po/fi.po +++ b/src/nvim/po/fi.po @@ -2896,99 +2896,6 @@ msgstr "haku pääsi ALKUUN, jatketaan LOPUSTA" msgid "search hit BOTTOM, continuing at TOP" msgstr "haku pääsi LOPPUUN, jatketaan ALUSTA" -msgid "E550: Missing colon" -msgstr "E550: kaksoispiste puuttuu" - -msgid "E551: Illegal component" -msgstr "E551: Virheellinen komponentti" - -msgid "E552: digit expected" -msgstr "E552: pitäisi olla numero" - -#, c-format -msgid "Page %d" -msgstr "Sivu %d" - -msgid "No text to be printed" -msgstr "Ei tekstiä tulostettavaksi" - -#, fuzzy, c-format -#~ msgid "Printing page %d (%zu%%)" -#~ msgstr "Tulostetaan sivua %d (%d %%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " Kopio %d/%d" - -#, c-format -msgid "Printed: %s" -msgstr "Tulostettu: %s" - -msgid "Printing aborted" -msgstr "Tulostus peruttu" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Virhe kirjoitettaessa PostScriptiä tiedostoon" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Ei voi avata tiedostoa %s" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Ei voi lukea PostScript-resurssitiedostoa %s" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: tiedosto %s ei ole PostScript-resurssitiedosto" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: tiedosto %s ei ole tuettu PostScript-resurssitiedosto" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: resurssitiedoston %s versio on väärä" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Tukematon monitvauinen merkistökoodaus ja merkistö." - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset ei voi olla tyhjä monitavuiselle koodaukselle." - -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Ei oletusfonttia monitavuiseen tulostukseen" - -msgid "E324: Can't open PostScript output file" -msgstr "E324: PostScript-tulostetiedoston avaus ei onnistu" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Tiedoston %s avaus ei onnistu" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: PostScript-resurssitiedostoa prolog.ps ei löydy" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: PostScript-resurssitiedostoa cidfont.ps ei löydy" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Postscript-resurssitiedosta %s.ps ei löydy" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Tulostuskoodaukseen %s muunto ei onnistu" - -msgid "Sending to printer..." -msgstr "Lähetetään tulostimelle..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: PostScript-tiedoston tulostus epäonnistui" - -msgid "Print job sent." -msgstr "Tulostustyö lähetetty." - msgid "Add a new database" msgstr "Lisää uusi tietokanta" diff --git a/src/nvim/po/fr.po b/src/nvim/po/fr.po index be2141cd6d..f4fce68ac5 100644 --- a/src/nvim/po/fr.po +++ b/src/nvim/po/fr.po @@ -1881,103 +1881,6 @@ msgstr "Style :" msgid "Size:" msgstr "Taille :" -msgid "E550: Missing colon" -msgstr "E550: ':' manquant" - -# DB - Il s'agit ici d'un problme lors du parsing d'une option dont le contenu -# est une liste d'lments spars par des virgules. -msgid "E551: Illegal component" -msgstr "E551: lment invalide" - -msgid "E552: digit expected" -msgstr "E552: chiffre attendu" - -#, c-format -msgid "Page %d" -msgstr "Page %d" - -msgid "No text to be printed" -msgstr "Aucun texte imprimer" - -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Impression de la page %d (%d%%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " Copie %d sur %d" - -#, c-format -msgid "Printed: %s" -msgstr "Imprim : %s" - -msgid "Printing aborted" -msgstr "Impression interrompue" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Erreur lors de l'criture du fichier PostScript" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Impossible d'ouvrir le fichier \"%s\"" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Impossible de lire le fichier de ressource PostScript \"%s\"" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: \"%s\" n'est pas un fichier de ressource PostScript" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: \"%s\" n'est pas un fichier de ressource PostScript support" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: La version du fichier de ressource \"%s\" est errone" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Jeu de caractres et encodage multi-octets incompatibles" - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: 'printmbcharset' ne peut pas tre vide avec un encodage multi-octets" - -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Aucune police par dfaut pour l'impression multi-octets" - -msgid "E324: Can't open PostScript output file" -msgstr "E324: Impossible d'ouvrir le fichier PostScript de sortie" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Impossible d'ouvrir le fichier \"%s\"" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Le fichier de ressource PostScript \"prolog.ps\" est introuvable" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "" -"E456: Le fichier de ressource PostScript \"cidfont.ps\" est introuvable" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Le fichier de ressource PostScript \"%s.ps\" est introuvable" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: La conversion pour imprimer dans l'encodage \"%s\" a chou" - -msgid "Sending to printer..." -msgstr "Envoi l'imprimante..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: L'impression du fichier PostScript a chou" - -msgid "Print job sent." -msgstr "Tche d'impression envoye." - msgid "E679: recursive loop loading syncolor.vim" msgstr "E679: boucle rcursive lors du chargement de syncolor.vim" diff --git a/src/nvim/po/ga.po b/src/nvim/po/ga.po index 346f0faa84..5107aed75f 100644 --- a/src/nvim/po/ga.po +++ b/src/nvim/po/ga.po @@ -2385,99 +2385,6 @@ msgstr "Mid:" msgid "E256: Hangul automata ERROR" msgstr "E256: EARRID leis na huathoibrein Hangul" -msgid "E550: Missing colon" -msgstr "E550: Idirstad ar iarraidh" - -msgid "E551: Illegal component" -msgstr "E551: Comhphirt neamhcheadaithe" - -msgid "E552: digit expected" -msgstr "E552: ag sil le digit" - -#, c-format -msgid "Page %d" -msgstr "Leathanach %d" - -msgid "No text to be printed" -msgstr "Nl aon tacs le priontil" - -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Leathanach %d (%d%%) phriontil" - -#, c-format -msgid " Copy %d of %d" -msgstr " Cip %d de %d" - -#, c-format -msgid "Printed: %s" -msgstr "Priontilte: %s" - -msgid "Printing aborted" -msgstr "Priontil tobscortha" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Earrid le linn scrobh chuig aschomhad PostScript" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: N fidir an comhad \"%s\" a oscailt" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: N fidir comhad acmhainne PostScript \"%s\" a lamh" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: Nl comhad \"%s\" ina chomhad acmhainne PostScript" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: T \"%s\" ina chomhad acmhainne PostScript gan tac" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: T an leagan mcheart ar an gcomhad acmhainne \"%s\"" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Ionchd agus tacar carachtar ilbhirt neamh-chomhoirinach." - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: n cheadatear printmbcharset a bheith folamh le hionchd ilbhirt." - -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Nor ramhshocraodh cl le haghaidh priontla ilbhirt." - -msgid "E324: Can't open PostScript output file" -msgstr "E324: N fidir aschomhad PostScript a oscailt" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: N fidir an comhad \"%s\" a oscailt" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Comhad acmhainne PostScript \"prolog.ps\" gan aimsi" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Comhad acmhainne PostScript \"cidfont.ps\" gan aimsi" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Comhad acmhainne PostScript \"%s.ps\" gan aimsi" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: N fidir an t-ionchd priontla \"%s\" a thiont" - -msgid "Sending to printer..." -msgstr " sheoladh chuig an phrintir..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: Theip ar phriontil comhaid PostScript" - -msgid "Print job sent." -msgstr "Seoladh jab priontla." msgid "Add a new database" msgstr "Bunachar sonra nua" diff --git a/src/nvim/po/it.po b/src/nvim/po/it.po index 152ed2cbe3..2191876724 100644 --- a/src/nvim/po/it.po +++ b/src/nvim/po/it.po @@ -3049,126 +3049,6 @@ msgstr "raggiunta la CIMA nella ricerca, continuo dal FONDO" msgid "search hit BOTTOM, continuing at TOP" msgstr "raggiunto il FONDO nella ricerca, continuo dalla CIMA" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Manca ':'" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Componente non valido" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: aspettavo un numero" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Pagina %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "Manca testo da stampare" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Sto stampando pagina %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Copia %d di %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Stampato: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Stampa non completata" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Errore in scrittura a file PostScript di output" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Non riesco ad aprire il file \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Non riesco a leggere file risorse PostScript \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: file \"%s\" non un file di risorse PostScript" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: file \"%s\" non un file di risorse PostScript supportato" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: il file di risorse \"%s\" ha una versione sbagliata" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Codifica e set di caratteri multi-byte non compatibili." - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset non pu essere nullo con codifica multi-byte." - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Font predefinito non specificato per stampa multi-byte." - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Non riesco ad aprire file PostScript di output" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Non riesco ad aprire il file \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Non trovo file risorse PostScript \"prolog.ps\"" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Non trovo file risorse PostScript \"cidfont.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Non trovo file risorse PostScript \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Impossibile convertire a codifica di stampa \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Invio a stampante..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Non riesco ad aprire file PostScript" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Richiesta di stampa inviata." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Aggiungi un nuovo database" diff --git a/src/nvim/po/ja.euc-jp.po b/src/nvim/po/ja.euc-jp.po index d7d0faca80..87b4fc5ccd 100644 --- a/src/nvim/po/ja.euc-jp.po +++ b/src/nvim/po/ja.euc-jp.po @@ -2126,101 +2126,6 @@ msgstr ":" msgid "E256: Hangul automata ERROR" msgstr "E256: ϥ륪ȥޥȥ顼" -msgid "E550: Missing colon" -msgstr "E550: ޤ" - -msgid "E551: Illegal component" -msgstr "E551: ʹʸǤǤ" - -msgid "E552: digit expected" -msgstr "E552: ͤɬפǤ" - -#, c-format -msgid "Page %d" -msgstr "%d ڡ" - -msgid "No text to be printed" -msgstr "ƥȤޤ" - -#, c-format -msgid "Printing page %d (%d%%)" -msgstr ": ڡ %d (%d%%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " ԡ %d ( %d )" - -#, c-format -msgid "Printed: %s" -msgstr "ޤ: %s" - -msgid "Printing aborted" -msgstr "ߤޤ" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: PostScriptϥեνߥ顼Ǥ" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: ե \"%s\" ޤ" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: PostScriptΥե \"%s\" ɹޤ" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: ե \"%s\" PostScript եǤϤޤ" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: ե \"%s\" бƤʤ PostScript եǤ" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: ե \"%s\" ϥСۤʤޤ" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: ߴ̵ޥХȥǥʸåȤǤ" - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: ޥХȥǥǤ printmbcharset ˤǤޤ" - -msgid "E675: No default font specified for multi-byte printing." -msgstr "" -"E675: ޥХʸ뤿ΥǥեȥեȤꤵƤޤ" -"" - -msgid "E324: Can't open PostScript output file" -msgstr "E324: PostScriptѤΥեޤ" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: ե \"%s\" ޤ" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: PostScriptΥե \"prolog.ps\" Ĥޤ" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: PostScriptΥե \"cidfont.ps\" Ĥޤ" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: PostScriptΥե \"%s.ps\" Ĥޤ" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: \"%s\" ѴǤޤ" - -msgid "Sending to printer..." -msgstr "ץ..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: PostScriptեΰ˼Ԥޤ" - -msgid "Print job sent." -msgstr "֤ޤ" #, c-format msgid "E799: Invalid ID: %d (must be greater than or equal to 1)" diff --git a/src/nvim/po/ja.po b/src/nvim/po/ja.po index b56345e066..bdf67933f3 100644 --- a/src/nvim/po/ja.po +++ b/src/nvim/po/ja.po @@ -2126,102 +2126,6 @@ msgstr "サイズ:" msgid "E256: Hangul automata ERROR" msgstr "E256: ハングルオートマトンエラー" -msgid "E550: Missing colon" -msgstr "E550: コロンがありません" - -msgid "E551: Illegal component" -msgstr "E551: 不正な構文要素です" - -msgid "E552: digit expected" -msgstr "E552: 数値が必要です" - -#, c-format -msgid "Page %d" -msgstr "%d ページ" - -msgid "No text to be printed" -msgstr "印刷するテキストがありません" - -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "印刷中: ページ %d (%d%%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " コピー %d (全 %d 中)" - -#, c-format -msgid "Printed: %s" -msgstr "印刷しました: %s" - -msgid "Printing aborted" -msgstr "印刷が中止されました" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: PostScript出力ファイルの書込みエラーです" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: ファイル \"%s\" を開けません" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: PostScriptのリソースファイル \"%s\" を読込めません" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: ファイル \"%s\" は PostScript リソースファイルではありません" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: ファイル \"%s\" は対応していない PostScript リソースファイルです" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: リソースファイル \"%s\" はバージョンが異なります" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: 互換性の無いマルチバイトエンコーディングと文字セットです。" - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: マルチバイトエンコーディングでは printmbcharset を空にできません。" - -msgid "E675: No default font specified for multi-byte printing." -msgstr "" -"E675: マルチバイト文字を印刷するためのデフォルトフォントが指定されていませ" -"ん。" - -msgid "E324: Can't open PostScript output file" -msgstr "E324: PostScript出力用のファイルを開けません" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: ファイル \"%s\" を開けません" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: PostScriptのリソースファイル \"prolog.ps\" が見つかりません" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: PostScriptのリソースファイル \"cidfont.ps\" が見つかりません" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: PostScriptのリソースファイル \"%s.ps\" が見つかりません" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: 印刷エンコード \"%s\" へ変換できません" - -msgid "Sending to printer..." -msgstr "プリンタに送信中..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: PostScriptファイルの印刷に失敗しました" - -msgid "Print job sent." -msgstr "印刷ジョブを送信しました。" - #, c-format msgid "E799: Invalid ID: %d (must be greater than or equal to 1)" msgstr "E799: 無効な ID: %d (1 以上でなければなりません)" diff --git a/src/nvim/po/ko.UTF-8.po b/src/nvim/po/ko.UTF-8.po index 09be710374..8a6b228b18 100644 --- a/src/nvim/po/ko.UTF-8.po +++ b/src/nvim/po/ko.UTF-8.po @@ -2973,126 +2973,6 @@ msgstr "처음까지 찾았음, 끝에서 계속" msgid "search hit BOTTOM, continuing at TOP" msgstr "끝까지 찾았음, 처음부터 계속" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: 콜론이 없습니다" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: 이상한 컴포넌트" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: 숫자가 필요합니다" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "페이지 %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "인쇄될 텍스트가 없습니다" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "페이지 %d 인쇄중 (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " 복사 %d / %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "인쇄됨: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "인쇄가 취소되었습니다." - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: 포스트스크립트 출력파일에 쓸 수 없습니다." - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: \"%s\" 파일을 열 수 없습니다" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: 포스트스크립트 리소스 파일 \"%s\"을(를) 읽을 수 없습니다" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: 파일 \"%s\"은(는) 포스트스크립트 리소스 파일이 아닙니다" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: 파일 \"%s\"은(는) 지원되는 포스트스크립트 리소스 파일이 아닙니다" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" 리소스 파일은 버전이 잘못되었습니다" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: 호환되지 않는 다중문자 인코딩과 문자셋." - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset는 다중문자 인코딩에서 반드시 설정되어야 합니다." - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: 다중문자 인쇄를 위한 글꼴이 설정되어 있지 않습니다" - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: 포스트스크립트 출력파일을 열 수 없습니다" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: \"%s\" 파일을 열 수 없습니다" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: 포스트스크립트 리소스 파일 \"prolog.ps\"를 찾을 수 없습니다" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: 포스트스크립트 리소스 파일 \"cidfont.ps\"를 찾을 수 없습니다" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: 포스트스크립트 리소스 파일 \"%s.ps\"를 찾을 수 없습니다" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: \"%s\" 인쇄 인코딩으로 변환할 수 없습니다" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "프린터로 보내는 중..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: 포스트스크립트 파일을 인쇄할 수 없습니다" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "인쇄작업이 끝났습니다." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "새 데이터베이스 더하기" diff --git a/src/nvim/po/nb.po b/src/nvim/po/nb.po index 9bc730ae71..75f4eb28a3 100644 --- a/src/nvim/po/nb.po +++ b/src/nvim/po/nb.po @@ -2997,126 +2997,6 @@ msgstr "Sket traff TOPPEN, fortsetter fra BUNNEN" msgid "search hit BOTTOM, continuing at TOP" msgstr "Sket traff BUNNEN, fortsetter fra TOPPEN" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Mangler kolon" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Ulovlig komponent" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: Siffer forventet" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Side %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "Ingen tekst for utskrift" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Skriver ut side %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Kopi %d av %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Skrevet ut: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Utskrift avbrutt" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Feil under skriving til Postscript-fil" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Kan ikke pne filen \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Kan ikke lese Postscript-ressursfil \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: Filen \"%s\" er ikke en Postscript-ressursfil" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: Det er ikke sttte for Postscript-ressursfilen \"%s\"" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: Ressursfilen \"%s\" er feil versjon" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Inkompatibel multibytekoding og tegnsett" - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset kan ikke vre tom med multibytekoding" - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Ingen standardfont spesifisert for multibyteutskrift" - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Kan ikke pne Postscript-fil for skriving" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Kan ikke pne filen \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Fant ikke Postscript-ressursfilen \"prolog.ps\"" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Fant ikke Postscript-ressursfilen \"cidfont.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Fant ikke Postscript-ressursfilen \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Klarte ikke konvertere til utskriftskoding \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Sender til skriver..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Feil under utskrift av Postscript-fil" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Skriverjobb sendt." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Legg til en ny database" diff --git a/src/nvim/po/nl.po b/src/nvim/po/nl.po index 4d2e55adc6..d07c566e28 100644 --- a/src/nvim/po/nl.po +++ b/src/nvim/po/nl.po @@ -2985,126 +2985,6 @@ msgstr "zoeken bereikte TOP, verder vanaf BODEM" msgid "search hit BOTTOM, continuing at TOP" msgstr "zoeken bereikte BODEM, verder vanaf TOP" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: dubbelepunt ontbreekt" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: ongeldige component" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: cijfer verwacht" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Pagina %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "Geen tekst om af te drukken" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Afdrukken van pagina %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr "Kopie %d van %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Afgedrukt: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Afdrukken afgebroken" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: wegschrijven Postscript-uitvoerbestand is mislukt" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: openen bestand \"%s\" is mislukt" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: kan 'Postscript resource'-bestand \"%s\" niet lezen" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: bestand \"%s\" is geen 'Postscript resource'-bestand" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: bestand \"%s\" is geen ondersteund 'Postscript resource'-bestand" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: 'resource'-bestand \"%s\" heeft verkeerde versie" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Multi-byte-codering en de tekenverzameling zijn onverenigbaar." - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset mag bij multi-byte-codering niet leeg zijn." - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: geen standaard lettertype opgegeven voor multi-byte-afdrukken." - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: openen van PostScript-uitoverbestand is mislukt" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Bestand \"%s\" kan niet worden geopend" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: 'PostScript resource'-bestand \"prolog.ps\" is niet gevonden" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: 'PostScript resource'-bestand \"cidfont.ps\" is niet gevonden" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: 'PostScript resource'-bestand \"%s.ps\" is niet gevonden" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: omzetten naar afdrukcodering \"%s\" is mislukt" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Naar printer versturen..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Afdrukken van PostScript-bestand is mislukt" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Afdrukopdracht verzonden" - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Nieuwe databank toevoegen" diff --git a/src/nvim/po/no.po b/src/nvim/po/no.po index 9bc730ae71..75f4eb28a3 100644 --- a/src/nvim/po/no.po +++ b/src/nvim/po/no.po @@ -2997,126 +2997,6 @@ msgstr "Sket traff TOPPEN, fortsetter fra BUNNEN" msgid "search hit BOTTOM, continuing at TOP" msgstr "Sket traff BUNNEN, fortsetter fra TOPPEN" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Mangler kolon" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Ulovlig komponent" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: Siffer forventet" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Side %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "Ingen tekst for utskrift" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Skriver ut side %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Kopi %d av %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Skrevet ut: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Utskrift avbrutt" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Feil under skriving til Postscript-fil" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Kan ikke pne filen \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Kan ikke lese Postscript-ressursfil \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: Filen \"%s\" er ikke en Postscript-ressursfil" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: Det er ikke sttte for Postscript-ressursfilen \"%s\"" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: Ressursfilen \"%s\" er feil versjon" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Inkompatibel multibytekoding og tegnsett" - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset kan ikke vre tom med multibytekoding" - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Ingen standardfont spesifisert for multibyteutskrift" - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Kan ikke pne Postscript-fil for skriving" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Kan ikke pne filen \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Fant ikke Postscript-ressursfilen \"prolog.ps\"" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Fant ikke Postscript-ressursfilen \"cidfont.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Fant ikke Postscript-ressursfilen \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Klarte ikke konvertere til utskriftskoding \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Sender til skriver..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Feil under utskrift av Postscript-fil" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Skriverjobb sendt." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Legg til en ny database" diff --git a/src/nvim/po/pl.UTF-8.po b/src/nvim/po/pl.UTF-8.po index 7e978113f6..c00130ac8c 100644 --- a/src/nvim/po/pl.UTF-8.po +++ b/src/nvim/po/pl.UTF-8.po @@ -2954,126 +2954,6 @@ msgstr "szukanie dobiło GÓRY; kontynuacja od KOŃCA" msgid "search hit BOTTOM, continuing at TOP" msgstr "szukanie dobiło KOŃCA; kontynuacja od GÓRY" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Brak dwukropka" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Niedozwolona część" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: oczekiwałem na cyfrę" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Strona %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "Brak tekstu do drukowania" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Drukuję stronę %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Kopia %d z %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Wydrukowano: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Drukowanie odwołane" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Nie można zapisać do wyjściowego pliku PostScriptu" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Nie mogę otworzyć pliku \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Nie można odczytać pliku zasobów PostScriptu \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: plik \"%s\" nie jest plikiem zasobów PostScriptu" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: plik \"%s\" nie jest wspieranym plikiem zasobów PostScriptu" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" nieprawidłowa wersja pliku zasobów" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Niekompatybilne kodowanie wielobajtowe i zestaw znaków." - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset nie może być pusty przy kodowaniu wielobajtowym." - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Nie określono domyślnej czcionki dla drukowania wielobajtowego." - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Nie można otworzyć pliku PostScript do wyjścia" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Nie mogę otworzyć pliku \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Nie można znaleźć pliku zasobów PostScriptu \"prolog.ps\"" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Nie można znaleźć pliku zasobów PostScriptu \"cidfont.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Nie można znaleźć pliku zasobów PostScriptu \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Nie można przekonwertować by drukować kodowanie \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Przesyłam do drukarki..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Drukowanie pliku PostScript nie powiodło się" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Zadanie drukowanie przesłane." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Dodaj nową bazę danych" diff --git a/src/nvim/po/pt_BR.po b/src/nvim/po/pt_BR.po index bfd64b4d28..ca5a4508c7 100644 --- a/src/nvim/po/pt_BR.po +++ b/src/nvim/po/pt_BR.po @@ -4417,129 +4417,6 @@ msgstr "E663: No final da lista de modificaes" msgid "Type :quit<Enter> to exit Nvim" msgstr "Digite :quit<Enter> para sair do Vim" -#: ../hardcopy.c:296 -msgid "E550: Missing colon" -msgstr "E550: Dois-pontos faltando" - -#: ../hardcopy.c:308 -msgid "E551: Illegal component" -msgstr "E551: Elemento invlido" - -#: ../hardcopy.c:315 -msgid "E552: digit expected" -msgstr "E552: era esperado um algarismo" - -#: ../hardcopy.c:529 -#, c-format -msgid "Page %d" -msgstr "Pgina %d" - -#: ../hardcopy.c:653 -msgid "No text to be printed" -msgstr "Sem texto para imprimir" - -#: ../hardcopy.c:724 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Imprimindo pgina %d (%d%%)" - -#: ../hardcopy.c:736 -#, c-format -msgid " Copy %d of %d" -msgstr " Cpia %d de %d" - -#: ../hardcopy.c:789 -#, c-format -msgid "Printed: %s" -msgstr "Impresso: %s" - -#: ../hardcopy.c:796 -msgid "Printing aborted" -msgstr "Impresso cancelada" - -#: ../hardcopy.c:1307 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Erro ao escrever no arquivo PostScript" - -#: ../hardcopy.c:1679 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Impossvel abrir arquivo \"%s\"" - -#: ../hardcopy.c:1688 ../hardcopy.c:2402 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Impossvel ler o arquivo de recursos de PostScript \"%s\"" - -#: ../hardcopy.c:1704 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: arquivo \"%s\" no um arquivo de recursos de PostScript" - -#: ../hardcopy.c:1720 ../hardcopy.c:1737 ../hardcopy.c:1776 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "" -"E619: arquivo \"%s\" no um arquivo de recursos de PostScript suportado" - -#: ../hardcopy.c:1788 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: verso errada do arquivo de recursos \"%s\"" - -#: ../hardcopy.c:2157 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "" -"E673: Codificao multi-byte incompatvel com o conjunto de caracteres." - -#: ../hardcopy.c:2170 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: 'printmbcharset' no pode estar vazio com codificaes multi-byte." - -#: ../hardcopy.c:2186 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Nenhuma fonte padro especificada para impresso em multi-byte." - -#: ../hardcopy.c:2358 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Impossvel abrir arquivo PostScript para sada" - -#: ../hardcopy.c:2390 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Impossvel abrir arquivo \"%s\"" - -#: ../hardcopy.c:2515 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Arquivo de recursos de PostScript \"prolog.ps\" no encontrado" - -#: ../hardcopy.c:2525 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Arquivo de recursos de PostScript \"cidfont.ps\" no encontrado" - -#: ../hardcopy.c:2554 ../hardcopy.c:2571 ../hardcopy.c:2597 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Arquivo de recursos de PostScript \"%s.ps\" no encontrado" - -#: ../hardcopy.c:2586 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Impossvel converter para a codificao \"%s\" para impresso" - -#: ../hardcopy.c:2809 -msgid "Sending to printer..." -msgstr "Enviando impressora..." - -#: ../hardcopy.c:2813 -msgid "E365: Failed to print PostScript file" -msgstr "E365: No foi possvel imprimir o arquivo PostScript" - -#: ../hardcopy.c:2815 -msgid "Print job sent." -msgstr "Trabalho de impresso enviado." - #. This happens when the FileChangedRO autocommand changes the #. * file in a way it becomes shorter. #: ../undo.c:355 diff --git a/src/nvim/po/ru.po b/src/nvim/po/ru.po index da356770d7..1235111c58 100644 --- a/src/nvim/po/ru.po +++ b/src/nvim/po/ru.po @@ -2979,126 +2979,6 @@ msgstr "Поиск будет продолжен с КОНЦА документ msgid "search hit BOTTOM, continuing at TOP" msgstr "Поиск будет продолжен с НАЧАЛА документа" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Пропущено двоеточие" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Недопустимый компонент" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: Требуется указать цифру" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Страница %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "Печатать нечего" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Печать стр. %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Копия %d из %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Напечатано: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Печать прекращена" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Ошибка записи в файл PostScript" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Невозможно открыть файл \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Невозможно прочитать файл ресурсов PostScript \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: Файл \"%s\" не является файлом ресурсов PostScript" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: Файл \"%s\" не является допустимым файлом ресурсов PostScript" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: Файл ресурсов \"%s\" неизвестной версии" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Несовместимые многобайтовая кодировка и набор символов." - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset не может быть пустым при многобайтовой кодировке." - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Нет определения шрифта по умолчанию для многобайтовой печати." - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Невозможно открыть файл PostScript" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Невозможно открыть файл \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Файл ресурсов PostScript \"prolog.ps\" не найден" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Файл ресурсов PostScript \"cidfont.ps\" не найден" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Файл ресурсов PostScript \"%s.ps\" не найден" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Невозможно преобразовать в кодировку печать \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Отправка на печать..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Не удалось выполнить печать файла PostScript" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Задание на печать отправлено." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Добавить новую базу данных" diff --git a/src/nvim/po/sk.cp1250.po b/src/nvim/po/sk.cp1250.po index cb8b8c6abb..f0fdc47a1e 100644 --- a/src/nvim/po/sk.cp1250.po +++ b/src/nvim/po/sk.cp1250.po @@ -2994,127 +2994,6 @@ msgstr "hadanie dosiahlo zaiatok, pokraovanie od konca" msgid "search hit BOTTOM, continuing at TOP" msgstr "hadanie dosiahlo koniec, pokraovanie od zaiatku" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Chba dvojbodka" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Neprpustn komponent" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: oakvan slica" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Strana %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "iadny text na tla" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Tlam stranu %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Kpia %d z %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Vytlaen: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Tla bola zruen" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Ned sa zapisova do vstupnho PostScriptovho sboru" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Ned sa otvori sbor \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Ned sa ta PostScriptov sbor \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: sbor \"%s\" nie je vo formte PostScript" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: sbor \"%s\" nie je podporvan PostScriptov sbor" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" zdrojov sbor m zl slo verzie" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: nekompatibiln viacbajtov kdovanie a znakov sada." - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: voba printmbcharset neme by przdna pri viacbajtovom kdovan." - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Nie je pecifikovan iadne psmo pre viacbajtov tlaenie." - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Ned sa otvori vstupn PostScriptov sbor" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Ned sa otvori sbor \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Nemono njs PostScriptov zdrojov sbor \"prolog.ps\"" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Nemono njs PostScriptov zdrojov sbor \"cidfont.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Nemono njs PostScriptov zdrojov sbor \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Nemono skonvertova do kdovania na tlaenie \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Posielam na tlaiare..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: PostScriptov sbor sa nepodarilo vytlai" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Tlaov loha bola odoslan." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Prida nov databzu" diff --git a/src/nvim/po/sk.po b/src/nvim/po/sk.po index 4f9e1fe185..2d6b4ed901 100644 --- a/src/nvim/po/sk.po +++ b/src/nvim/po/sk.po @@ -2994,127 +2994,6 @@ msgstr "hadanie dosiahlo zaiatok, pokraovanie od konca" msgid "search hit BOTTOM, continuing at TOP" msgstr "hadanie dosiahlo koniec, pokraovanie od zaiatku" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Chba dvojbodka" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Neprpustn komponent" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: oakvan slica" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Strana %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "iadny text na tla" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Tlam stranu %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Kpia %d z %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Vytlaen: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "Tla bola zruen" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Ned sa zapisova do vstupnho PostScriptovho sboru" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Ned sa otvori sbor \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Ned sa ta PostScriptov sbor \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: sbor \"%s\" nie je vo formte PostScript" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: sbor \"%s\" nie je podporvan PostScriptov sbor" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" zdrojov sbor m zl slo verzie" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: nekompatibiln viacbajtov kdovanie a znakov sada." - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: voba printmbcharset neme by przdna pri viacbajtovom kdovan." - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Nie je pecifikovan iadne psmo pre viacbajtov tlaenie." - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Ned sa otvori vstupn PostScriptov sbor" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Ned sa otvori sbor \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Nemono njs PostScriptov zdrojov sbor \"prolog.ps\"" - -#: ../hardcopy.c:2593 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Nemono njs PostScriptov zdrojov sbor \"cidfont.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Nemono njs PostScriptov zdrojov sbor \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Nemono skonvertova do kdovania na tlaenie \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Posielam na tlaiare..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: PostScriptov sbor sa nepodarilo vytlai" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Tlaov loha bola odoslan." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Prida nov databzu" diff --git a/src/nvim/po/sr.po b/src/nvim/po/sr.po index cbdf736d0f..4a9dcf4a5d 100644 --- a/src/nvim/po/sr.po +++ b/src/nvim/po/sr.po @@ -2573,100 +2573,6 @@ msgstr "Стил:" msgid "Size:" msgstr "Величина:" -msgid "E550: Missing colon" -msgstr "E550: Недостаје двотачка" - -msgid "E551: Illegal component" -msgstr "E551: Неисправна компонента" - -msgid "E552: digit expected" -msgstr "E552: очекује се цифра" - -#, c-format -msgid "Page %d" -msgstr "Страна %d" - -msgid "No text to be printed" -msgstr "Нема текста за штампу" - -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Штампање стране %d (%d%%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " Копија %d од %d" - -#, c-format -msgid "Printed: %s" -msgstr "Одштампано: %s" - -msgid "Printing aborted" -msgstr "Штампање прекинуто" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Грешка приликом уписа у PostScript излазну датотеку" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Датотека \"%s\" не може да се отвори" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: PostScript resource датотека \"%s\" не може да се чита" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: датотека \"%s\" није PostScript resource датотека" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: датотека \"%s\" није подржана PostScript resource датотека" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" resource датотека је погрешне верзије" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Вишебајтно кодирање и скуп карактера нису компатибилни." - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset не може бити празно са вишебајтним кодирањем." - -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Није наведен подразумевани фонт за вишебајтно штампање." - -msgid "E324: Can't open PostScript output file" -msgstr "E324: PostScript излазна датотека не може да се отвори" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Датотека \"%s\" не може да се отвори" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: PostScript resource датотека \"prolog.ps\" не може да се пронађе" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "" -"E456: PostScript resource датотека \"cidfont.ps\" не може да се пронађе" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: PostScript resource датотека \"%s.ps\" не може да се пронађе" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Није могућа конверзија у кодирање за штампу \"%s\"" - -msgid "Sending to printer..." -msgstr "Слање штампачу..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: PostScript датотека није успела да се одштампа" - -msgid "Print job sent." -msgstr "Задатак штампе је послат" - msgid "Add a new database" msgstr "Додај нову базу" diff --git a/src/nvim/po/sv.po b/src/nvim/po/sv.po index 406900f7b2..e46579c067 100644 --- a/src/nvim/po/sv.po +++ b/src/nvim/po/sv.po @@ -4168,126 +4168,6 @@ msgstr "E782: fel vid lsning av .sug-fil: %s" msgid "E783: duplicate char in MAP entry" msgstr "E783: dubblerat tecken i MAP-post" -#: ../hardcopy.c:296 -msgid "E550: Missing colon" -msgstr "E550: Kolon saknas" - -#: ../hardcopy.c:308 -msgid "E551: Illegal component" -msgstr "E551: Otillten komponent" - -#: ../hardcopy.c:315 -msgid "E552: digit expected" -msgstr "E552: siffra frvntades" - -#: ../hardcopy.c:529 -#, c-format -msgid "Page %d" -msgstr "Sida %d" - -#: ../hardcopy.c:653 -msgid "No text to be printed" -msgstr "Ingen text att skriva ut" - -#: ../hardcopy.c:724 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Skriver ut sida %d (%d%%)" - -#: ../hardcopy.c:736 -#, c-format -msgid " Copy %d of %d" -msgstr " Kopia %d av %d" - -#: ../hardcopy.c:789 -#, c-format -msgid "Printed: %s" -msgstr "Skrev ut: %s" - -#: ../hardcopy.c:796 -msgid "Printing aborted" -msgstr "Utskrift avbruten" - -#: ../hardcopy.c:1307 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Fel vid skrivning av utdata till PostScript-fil" - -#: ../hardcopy.c:1679 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Kan inte ppna fil \"%s\"" - -#: ../hardcopy.c:1688 ../hardcopy.c:2401 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Kan inte lsa PostScript-resursfil \"%s\"" - -#: ../hardcopy.c:1704 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: fil \"%s\" r inte en PostScript-resursfil" - -#: ../hardcopy.c:1720 ../hardcopy.c:1737 ../hardcopy.c:1776 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: fil \"%s\" r inte en PostScript-resursfil som stds" - -#: ../hardcopy.c:1788 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\"-kllfilen har fel version" - -#: ../hardcopy.c:2157 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Inkompatibel flerbitskodning och teckenuppsttning." - -#: ../hardcopy.c:2169 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset kan inte vara tom med flerbitskodning." - -#: ../hardcopy.c:2185 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Ingen standardfont angiven fr flerbitsutskrifter." - -#: ../hardcopy.c:2357 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Kan inte ppna PostScript-utfil" - -#: ../hardcopy.c:2389 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Kan inte ppna fil \"%s\"" - -#: ../hardcopy.c:2514 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Kan inte hitta PostScript-kllfilen \"prolog.ps\"" - -#: ../hardcopy.c:2524 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Kan inte hitta PostScript-kllfilen \"cidfont.ps\"" - -#: ../hardcopy.c:2553 ../hardcopy.c:2570 ../hardcopy.c:2596 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Kan inte hitta PostScript-kllfilen \"%s.ps\"" - -#: ../hardcopy.c:2585 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Kunde inte konvertera frn utskriftkodning \"%s\"" - -#: ../hardcopy.c:2808 -msgid "Sending to printer..." -msgstr "Skickar till skrivare..." - -#: ../hardcopy.c:2812 -msgid "E365: Failed to print PostScript file" -msgstr "E365: Misslyckades med att skriva ut PostScript-fil" - -#: ../hardcopy.c:2814 -msgid "Print job sent." -msgstr "Skrivarjobb skickat." - #: ../mark.c:673 msgid "No marks set" msgstr "Inga mrken satta" diff --git a/src/nvim/po/tr.po b/src/nvim/po/tr.po index 0cf91fa4d5..7d6af4d2cf 100644 --- a/src/nvim/po/tr.po +++ b/src/nvim/po/tr.po @@ -2625,99 +2625,6 @@ msgstr "Arama dosyanın SONUNU geçti, dosyanın BAŞINDAN sürüyor" msgid " line " msgstr " satır " -msgid "E550: Missing colon" -msgstr "E550: İki nokta eksik" - -msgid "E551: Illegal component" -msgstr "E551: Geçersiz bileşen" - -msgid "E552: digit expected" -msgstr "E552: Basamak bekleniyordu" - -#, c-format -msgid "Page %d" -msgstr "Sayfa %d" - -msgid "No text to be printed" -msgstr "Yazdırılacak metin yok" - -#, c-format -msgid "Printing page %d (%zu%%)" -msgstr "Sayfa %d yazdırılıyor (%%%zu)" - -#, c-format -msgid " Copy %d of %d" -msgstr " Kopya %d/%d" - -#, c-format -msgid "Printed: %s" -msgstr "Yazdırıldı: %s" - -msgid "Printing aborted" -msgstr "Yazdırma durduruldu" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: PostScript çıktı dosyasına yazarken hata" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: \"%s\" dosyası açılamıyor" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: PostScript özkaynak dosyası \"%s\" okunamıyor" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: \"%s\" dosyası bir PostScript özkaynak dosyası değil" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: \"%s\" dosyası desteklenen bir PostScript özkaynak dosyası değil" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" özkaynak dosyası sürümü hatalı" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Uyumsuz çoklu bayt kodlaması ve karakter kümesi." - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset çoklu bayt kodlamada boş olamaz." - -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Çoklu bayt yazdırma için öntanımlı yazıtipi ayarlanmamış." - -msgid "E324: Can't open PostScript output file" -msgstr "E324: PostScript çıktı dosyası açılamıyor" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: \"%s\" dosyası açılamıyor" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: PostScript özkaynak dosyası \"prolog.ps\" bulunamıyor" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: PostScript özkaynak dosyası \"cidfont.ps\" bulunamıyor" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: PostScript özkaynak dosyası \"%s.ps\" bulunamıyor" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: \"%s\" yazdırma kodlamasına dönüştürülemiyor" - -msgid "Sending to printer..." -msgstr "Yazıcıya gönderiliyor..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: PostScript dosyası yazdırılamadı" - -msgid "Print job sent." -msgstr "Yazdırma işi gönderildi." - msgid "E478: Don't panic!" msgstr "E478: Panik yok!" diff --git a/src/nvim/po/uk.po b/src/nvim/po/uk.po index 427abd9b77..b521e37177 100644 --- a/src/nvim/po/uk.po +++ b/src/nvim/po/uk.po @@ -2913,99 +2913,6 @@ msgstr "Пошук дійшов до КІНЦЯ, продовжується з msgid " line " msgstr " рядок " -msgid "E550: Missing colon" -msgstr "E550: Пропущено двокрапку" - -msgid "E551: Illegal component" -msgstr "E551: Некоректний компонент" - -msgid "E552: digit expected" -msgstr "E552: очікується цифра" - -#, c-format -msgid "Page %d" -msgstr "Сторінка %d" - -msgid "No text to be printed" -msgstr "Нічого друкувати" - -#, c-format -msgid "Printing page %d (%zu%%)" -msgstr "Друкується сторінка %d (%zu%%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " Копія %d з %d" - -#, c-format -msgid "Printed: %s" -msgstr "Надруковано: %s" - -msgid "Printing aborted" -msgstr "Друк перервано" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Не вдалося записати вихідний файл PostScript" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Не вдалося відкрити файл «%s»" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Не вдалося прочитати файл ресурсів PostScript «%s»" - -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: «%s» не є файлом ресурсів PostScript" - -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: «%s» не є підтримуваним файлом ресурсів PostScript" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: Неправильна версія файлу ресурсів «%s»" - -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Несумісні багатобайтове кодування й набір символів." - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" -"E674: printmbcharset не може бути порожнім з багатобайтовим кодуванням." - -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: Не зазначено шрифт для багатобайтового друку." - -msgid "E324: Can't open PostScript output file" -msgstr "E324: Не вдалося відкрити файл PostScript для виводу" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Не вдалося відкрити файл «%s»" - -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Не вдалося знайти файл ресурсів PostScript «prolog.ps»" - -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Не вдалося знайти файл ресурсів PostScript «cidfont.ps»" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Не вдалося знайти файл ресурсів PostScript «%s.ps»" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Не вдалося перетворити до кодування друку «%s»" - -msgid "Sending to printer..." -msgstr "Відсилається на принтер..." - -msgid "E365: Failed to print PostScript file" -msgstr "E365: Не вдалося надрукувати файл PostScript" - -msgid "Print job sent." -msgstr "Завдання друку відіслано." msgid "E424: Too many different highlighting attributes in use" msgstr "E424: Використано забагато різних атрибутів кольору" diff --git a/src/nvim/po/vi.po b/src/nvim/po/vi.po index ad59718a30..44772c99ad 100644 --- a/src/nvim/po/vi.po +++ b/src/nvim/po/vi.po @@ -3020,127 +3020,6 @@ msgstr "tìm kiếm sẽ được tiếp tục từ CUỐI tài liệu" msgid "search hit BOTTOM, continuing at TOP" msgstr "tìm kiếm sẽ được tiếp tục từ ĐẦU tài liệu" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: Thiếu dấu hai chấm" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: Thành phần không cho phép" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: Cần chỉ ra một số" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "Trang %d" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "Không có gì để in" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "In trang %d (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr " Sao chép %d của %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "Đã in: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "In bị dừng" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Lỗi ghi nhớ vào tập tin PostScript" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Không thể mở tập tin \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Không thể đọc tập tin tài nguyên PostScript \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: \"%s\" không phải là tập tin tài nguyên PostScript" - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: \"%s\" không phải là tập tin tài nguyên PostScript được hỗ trợ" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: tập tin tài nguyên \"%s\" có phiên bản không đúng" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "" - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "" - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "" - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: Không thể mở tập tin PostScript" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Không thể mở tập tin \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: Không tìm thấy tập tin tài nguyên PostScript \"prolog.ps\"" - -#: ../hardcopy.c:2593 -#, fuzzy -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: Không tìm thấy tập tin tài nguyên PostScript \"%s.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Không tìm thấy tập tin tài nguyên PostScript \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, fuzzy, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Không thể chuyển từ các ký tự nhiều byte thành bảng mã \"%s\"" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "Gửi tới máy in..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: In tập tin PostScript không thành công" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "Đã gửi công việc in." - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "Thêm một cơ sở dữ liệu mới" diff --git a/src/nvim/po/zh_CN.UTF-8.po b/src/nvim/po/zh_CN.UTF-8.po index 87b67c5d97..0606adcc37 100644 --- a/src/nvim/po/zh_CN.UTF-8.po +++ b/src/nvim/po/zh_CN.UTF-8.po @@ -3533,126 +3533,6 @@ msgstr "已查找到文件结尾,再从开头继续查找" msgid " line " msgstr " 行 " -#: ../hardcopy.c:309 -msgid "E550: Missing colon" -msgstr "E550: 缺少冒号" - -#: ../hardcopy.c:326 -msgid "E551: Illegal component" -msgstr "E551: 无效的部分" - -#: ../hardcopy.c:335 -msgid "E552: digit expected" -msgstr "E552: 应该要有数字" - -#: ../hardcopy.c:561 -#, c-format -msgid "Page %d" -msgstr "第 %d 页" - -#: ../hardcopy.c:679 -msgid "No text to be printed" -msgstr "没有要打印的文字" - -#: ../hardcopy.c:744 -#, c-format -msgid "Printing page %d (%zu%%)" -msgstr "正在打印第 %d 页 (%zu%%)" - -#: ../hardcopy.c:753 -#, c-format -msgid " Copy %d of %d" -msgstr " 副本 %d / %d" - -#: ../hardcopy.c:808 -#, c-format -msgid "Printed: %s" -msgstr "已打印: %s" - -#: ../hardcopy.c:815 -msgid "Printing aborted" -msgstr "打印中止" - -#: ../hardcopy.c:1284 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: 写入 PostScript 输出文件出错" - -#: ../hardcopy.c:1642 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: 无法打开文件 \"%s\"" - -#: ../hardcopy.c:1651 ../hardcopy.c:2372 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: 无法读取 PostScript 资源文件 \"%s\"" - -#: ../hardcopy.c:1667 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: 文件 \"%s\" 不是 PostScript 资源文件" - -#: ../hardcopy.c:1684 ../hardcopy.c:1701 ../hardcopy.c:1742 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: 文件 \"%s\" 不是已支持的 PostScript 资源文件" - -#: ../hardcopy.c:1755 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" 资源文件版本不正确" - -#: ../hardcopy.c:2128 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: 不兼容的多字节编码和字符集。" - -#: ../hardcopy.c:2140 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset 在多字节编码下不能为空" - -#: ../hardcopy.c:2156 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: 没有指定多字节打印的默认字体" - -#: ../hardcopy.c:2319 -msgid "E324: Can't open PostScript output file" -msgstr "E324: 无法打开 PostScript 输出文件" - -#: ../hardcopy.c:2352 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: 无法打开文件 \"%s\"" - -#: ../hardcopy.c:2476 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: 找不到 PostScript 资源文件 \"prolog.ps\"" - -#: ../hardcopy.c:2488 -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: 找不到 PostScript 资源文件 \"cidfont.ps\"" - -#: ../hardcopy.c:2518 ../hardcopy.c:2537 ../hardcopy.c:2563 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: 找不到 PostScript 资源文件 \"%s.ps\"" - -#: ../hardcopy.c:2553 -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: 无法转换至打印编码 \"%s\"" - -#: ../hardcopy.c:2773 -msgid "Sending to printer..." -msgstr "发送到打印机……" - -#: ../hardcopy.c:2778 -msgid "E365: Failed to print PostScript file" -msgstr "E365: 无法打印 PostScript 文件" - -#: ../hardcopy.c:2780 -msgid "Print job sent." -msgstr "打印任务已被发送。" - #: ../help.c:79 msgid "E478: Don't panic!" msgstr "E478: 不要慌!" @@ -8328,38 +8208,6 @@ msgstr "在气泡求值中显示的表达式" msgid "printing" msgstr "打印" -#: ../../../runtime/optwin.vim:632 -msgid "list of items that control the format of :hardcopy output" -msgstr "控制 :hardcopy 输出格式的项目列表" - -#: ../../../runtime/optwin.vim:634 -msgid "name of the printer to be used for :hardcopy" -msgstr "用于 :hardcopy 的打印机名称" - -#: ../../../runtime/optwin.vim:637 -msgid "expression used to print the PostScript file for :hardcopy" -msgstr "用于 :hardcopy 打印 PostScript 文件的表达式" - -#: ../../../runtime/optwin.vim:640 -msgid "name of the font to be used for :hardcopy" -msgstr ":hardcopy 使用的字体名称" - -#: ../../../runtime/optwin.vim:642 -msgid "format of the header used for :hardcopy" -msgstr "用于 :hardcopy 的标头格式" - -#: ../../../runtime/optwin.vim:645 -msgid "encoding used to print the PostScript file for :hardcopy" -msgstr "用于 :hardcopy 打印 PostScript 文件的编码" - -#: ../../../runtime/optwin.vim:648 -msgid "the CJK character set to be used for CJK output from :hardcopy" -msgstr ":hardcopy 用于 CJK 输出的 CJK 字符集" - -#: ../../../runtime/optwin.vim:650 -msgid "list of font names to be used for CJK output from :hardcopy" -msgstr ":hardcopy 用于 CJK 输出的字体名称列表" - #: ../../../runtime/optwin.vim:654 msgid "messages and info" msgstr "消息和信息" diff --git a/src/nvim/po/zh_TW.UTF-8.po b/src/nvim/po/zh_TW.UTF-8.po index e95b1e2cad..cba95e2af2 100644 --- a/src/nvim/po/zh_TW.UTF-8.po +++ b/src/nvim/po/zh_TW.UTF-8.po @@ -3024,127 +3024,6 @@ msgstr "已搜尋到檔案開頭;再從結尾繼續搜尋" msgid "search hit BOTTOM, continuing at TOP" msgstr "已搜尋到檔案結尾;再從開頭繼續搜尋" -#: ../hardcopy.c:240 -msgid "E550: Missing colon" -msgstr "E550: 缺少 colon" - -#: ../hardcopy.c:252 -msgid "E551: Illegal component" -msgstr "E551: 不正確的模式" - -#: ../hardcopy.c:259 -msgid "E552: digit expected" -msgstr "E552: 應該要有數字" - -#: ../hardcopy.c:473 -#, c-format -msgid "Page %d" -msgstr "第 %d 頁" - -#: ../hardcopy.c:597 -msgid "No text to be printed" -msgstr "沒有要列印的文字" - -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "列印中: 第 %d 頁 (%d%%)" - -#: ../hardcopy.c:680 -#, c-format -msgid " Copy %d of %d" -msgstr "複製 %d / %d" - -#: ../hardcopy.c:733 -#, c-format -msgid "Printed: %s" -msgstr "已列印: %s" - -#: ../hardcopy.c:740 -msgid "Printing aborted" -msgstr "已取消列印" - -#: ../hardcopy.c:1365 -msgid "E455: Error writing to PostScript output file" -msgstr "E455: 無法寫入 PostScript 輸出檔" - -#: ../hardcopy.c:1747 -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: 無法開啟檔案 \"%s\"" - -#: ../hardcopy.c:1756 ../hardcopy.c:2470 -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: 無法讀取 PostScript 資源檔 \"%s\"" - -#: ../hardcopy.c:1772 -#, c-format -msgid "E618: file \"%s\" is not a PostScript resource file" -msgstr "E618: 檔案 \"%s\" 不是 PostScript 資源檔 " - -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 -#, c-format -msgid "E619: file \"%s\" is not a supported PostScript resource file" -msgstr "E619: 不支援 PostScript 資源檔 \"%s\"" - -#: ../hardcopy.c:1856 -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" 資源檔版本錯誤" - -#: ../hardcopy.c:2225 -msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: 不兼容的多字節編碼和字元集" - -#: ../hardcopy.c:2238 -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset 在多字節編碼下不能為空" - -#: ../hardcopy.c:2254 -msgid "E675: No default font specified for multi-byte printing." -msgstr "E675: 沒有指定多字節打印的默認字型" - -#: ../hardcopy.c:2426 -msgid "E324: Can't open PostScript output file" -msgstr "E324: 無法開啟 PostScript 輸出檔" - -#: ../hardcopy.c:2458 -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: 無法開啟檔案 \"%s\"" - -#: ../hardcopy.c:2583 -msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: 無法讀取 PostScript 資源檔 \"prolog.ps\"" - -#: ../hardcopy.c:2593 -#, fuzzy -msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: 無法讀取 PostScript 資源檔 \"%s.ps\"" - -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: 無法讀取 PostScript 資源檔 \"%s.ps\"" - -#: ../hardcopy.c:2654 -#, fuzzy, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620:無法轉換至 \"%s\" 字元編碼" - -#: ../hardcopy.c:2877 -msgid "Sending to printer..." -msgstr "傳送資料到印表機..." - -#: ../hardcopy.c:2881 -msgid "E365: Failed to print PostScript file" -msgstr "E365: 無法列印 PostScript 檔案" - -#: ../hardcopy.c:2883 -msgid "Print job sent." -msgstr "已送出列印工作。" - #: ../if_cscope.c:85 msgid "Add a new database" msgstr "新增資料庫" diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c index 4b1748cfae..072b58e08e 100644 --- a/src/nvim/statusline.c +++ b/src/nvim/statusline.c @@ -1533,7 +1533,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n } break; case STL_PAGENUM: - num = printer_page_num; + num = 0; break; case STL_BUFNO: diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index cf155b3cb9..912e702631 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -1676,16 +1676,44 @@ endfunc func Test_tex_file() filetype on - " only tests one case, should do more + call writefile(['%& pdflatex'], 'Xfile.tex') + split Xfile.tex + call assert_equal('tex', &filetype) + bwipe + + call writefile(['\newcommand{\test}{some text}'], 'Xfile.tex') + split Xfile.tex + call assert_equal('tex', &filetype) + bwipe + + " tex_flavor is unset + call writefile(['%& plain'], 'Xfile.tex') + split Xfile.tex + call assert_equal('plaintex', &filetype) + bwipe + + let g:tex_flavor = 'plain' + call writefile(['just some text'], 'Xfile.tex') + split Xfile.tex + call assert_equal('plaintex', &filetype) + bwipe + let lines =<< trim END - % This is a sentence. + % This is a comment. - This is a sentence. + \usemodule[translate] END - call writefile(lines, "Xfile.tex") + call writefile(lines, 'Xfile.tex') split Xfile.tex - call assert_equal('plaintex', &filetype) + call assert_equal('context', &filetype) + bwipe + + let g:tex_flavor = 'context' + call writefile(['just some text'], 'Xfile.tex') + split Xfile.tex + call assert_equal('context', &filetype) bwipe + unlet g:tex_flavor call delete('Xfile.tex') filetype off diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index f3594d3cdc..500c30c76b 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1437,6 +1437,19 @@ func Test_inputlist() call assert_fails('call inputlist("")', 'E686:') endfunc +func Test_range_inputlist() + " flush out any garbage left in the buffer + while getchar(0) + endwhile + + call feedkeys(":let result = inputlist(range(10))\<CR>1\<CR>", 'x') + call assert_equal(1, result) + call feedkeys(":let result = inputlist(range(3, 10))\<CR>1\<CR>", 'x') + call assert_equal(1, result) + + unlet result +endfunc + func Test_balloon_show() CheckFeature balloon_eval @@ -2165,12 +2178,6 @@ func Test_range() call assert_equal(1, index(range(1, 5), 2)) call assert_fails("echo index([1, 2], 1, [])", 'E745:') - " inputlist() - call feedkeys(":let result = inputlist(range(10))\<CR>1\<CR>", 'x') - call assert_equal(1, result) - call feedkeys(":let result = inputlist(range(3, 10))\<CR>1\<CR>", 'x') - call assert_equal(1, result) - " insert() call assert_equal([42, 1, 2, 3, 4, 5], insert(range(1, 5), 42)) call assert_equal([42, 1, 2, 3, 4, 5], insert(range(1, 5), 42, 0)) diff --git a/src/nvim/testdir/test_hardcopy.vim b/src/nvim/testdir/test_hardcopy.vim deleted file mode 100644 index be83728b4f..0000000000 --- a/src/nvim/testdir/test_hardcopy.vim +++ /dev/null @@ -1,212 +0,0 @@ -" Test :hardcopy - -source check.vim - -func Test_printoptions() - edit test_hardcopy.vim - syn on - - for opt in ['left:5in,right:10pt,top:8mm,bottom:2pc', - \ 'left:2in,top:30pt,right:16mm,bottom:3pc', - \ 'header:3,syntax:y,number:y,wrap:n', - \ 'header:3,syntax:n,number:y,wrap:y', - \ 'header:0,syntax:a,number:y,wrap:y', - \ 'duplex:short,collate:n,jobsplit:y,portrait:n', - \ 'duplex:long,collate:y,jobsplit:n,portrait:y', - \ 'duplex:off,collate:y,jobsplit:y,portrait:y', - \ 'paper:10x14', - \ 'paper:A3', - \ 'paper:A4', - \ 'paper:A5', - \ 'paper:B4', - \ 'paper:B5', - \ 'paper:executive', - \ 'paper:folio', - \ 'paper:ledger', - \ 'paper:legal', - \ 'paper:letter', - \ 'paper:quarto', - \ 'paper:statement', - \ 'paper:tabloid', - \ 'formfeed:y', - \ ''] - exe 'set printoptions=' .. opt - if has('postscript') - 1,50hardcopy > Xhardcopy_printoptions - let lines = readfile('Xhardcopy_printoptions') - call assert_true(len(lines) > 20, opt) - call assert_true(lines[0] =~ 'PS-Adobe', opt) - call delete('Xhardcopy_printoptions') - endif - endfor - - call assert_fails('set printoptions=paper', 'E550:') - call assert_fails('set printoptions=shredder:on', 'E551:') - call assert_fails('set printoptions=left:no', 'E552:') - set printoptions& - bwipe -endfunc - -func Test_printmbfont() - " Print a help page which contains tabs, underlines (etc) to recover more code. - help syntax.txt - syn on - - for opt in [':WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-Bold-Italic,c:yes,a:no', - \ ''] - exe 'set printmbfont=' .. opt - if has('postscript') - hardcopy > Xhardcopy_printmbfont - let lines = readfile('Xhardcopy_printmbfont') - call assert_true(len(lines) > 20, opt) - call assert_true(lines[0] =~ 'PS-Adobe', opt) - call delete('Xhardcopy_printmbfont') - endif - endfor - set printmbfont& - bwipe -endfunc - -func Test_printmbcharset() - CheckFeature postscript - - " digraph.txt has plenty of non-latin1 characters. - help digraph.txt - set printmbcharset=ISO10646 printencoding=utf-8 - for courier in ['yes', 'no'] - for ascii in ['yes', 'no'] - exe 'set printmbfont=r:WadaMin-Regular,b:WadaMin-Bold,i:WadaMin-Italic,o:WadaMin-BoldItalic' - \ .. ',c:' .. courier .. ',a:' .. ascii - hardcopy > Xhardcopy_printmbcharset - let lines = readfile('Xhardcopy_printmbcharset') - call assert_true(len(lines) > 20) - call assert_true(lines[0] =~ 'PS-Adobe') - endfor - endfor - - set printmbcharset=does-not-exist printencoding=utf-8 printmbfont=r:WadaMin-Regular - call assert_fails('hardcopy > Xhardcopy_printmbcharset', 'E456:') - - set printmbcharset=GB_2312-80 printencoding=utf-8 printmbfont=r:WadaMin-Regular - call assert_fails('hardcopy > Xhardcopy_printmbcharset', 'E673:') - - set printmbcharset=ISO10646 printencoding=utf-8 printmbfont= - call assert_fails('hardcopy > Xhardcopy_printmbcharset', 'E675:') - - call delete('Xhardcopy_printmbcharset') - set printmbcharset& printencoding& printmbfont& - bwipe -endfunc - -func Test_printexpr() - CheckFeature postscript - - " Not a very useful printexpr value, but enough to test - " hardcopy with 'printexpr'. - function PrintFile(fname) - call writefile(['Test printexpr: ' .. v:cmdarg], - \ 'Xhardcopy_printexpr') - call delete(a:fname) - return 0 - endfunc - set printexpr=PrintFile(v:fname_in) - - help help - hardcopy dummy args - call assert_equal(['Test printexpr: dummy args'], - \ readfile('Xhardcopy_printexpr')) - call delete('Xhardcopy_printexpr') - - " Function returns 1 to test print failure. - function PrintFails(fname) - call delete(a:fname) - return 1 - endfunc - set printexpr=PrintFails(v:fname_in) - call assert_fails('hardcopy', 'E365:') - - " Using a script-local function - func s:NewPrintExpr() - endfunc - set printexpr=s:NewPrintExpr() - call assert_equal(expand('<SID>') .. 'NewPrintExpr()', &printexpr) - set printexpr=<SID>NewPrintExpr() - call assert_equal(expand('<SID>') .. 'NewPrintExpr()', &printexpr) - - set printexpr& - bwipe -endfunc - -func Test_errors() - CheckFeature postscript - - edit test_hardcopy.vim - call assert_fails('hardcopy >', 'E324:') - bwipe -endfunc - -func Test_dark_background() - edit test_hardcopy.vim - syn on - - for bg in ['dark', 'light'] - exe 'set background=' .. bg - - if has('postscript') - hardcopy > Xhardcopy_dark_background - let lines = readfile('Xhardcopy_dark_background') - call assert_true(len(lines) > 20) - call assert_true(lines[0] =~ 'PS-Adobe') - call delete('Xhardcopy_dark_background') - endif - endfor - - set background& - bwipe -endfun - -func Test_empty_buffer() - CheckFeature postscript - - new - call assert_equal("\nNo text to be printed", execute('hardcopy')) - bwipe -endfunc - -func Test_printheader_parsing() - " Only test that this doesn't throw an error. - set printheader=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P - set printheader=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P - set printheader=%<%f%=\ [%1*%M%*%n%R%H]\ %-19(%3l,%02c%03V%)%O'%02b' - set printheader=...%r%{VarExists('b:gzflag','\ [GZ]')}%h... - set printheader= - set printheader& -endfunc - -func Test_fname_with_spaces() - CheckFeature postscript - - split t\ e\ s\ t.txt - call setline(1, ['just', 'some', 'text']) - hardcopy > %.ps - call assert_true(filereadable('t e s t.txt.ps')) - call delete('t e s t.txt.ps') - bwipe! -endfunc - -func Test_illegal_byte() - CheckFeature postscript - if &enc != 'utf-8' - return - endif - - new - " conversion of 0xff will fail, this used to cause a crash - call setline(1, "\xff") - hardcopy >Xpstest - - bwipe! - call delete('Xpstest') -endfunc - -" vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index 9171f79c37..c6066597f0 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -32,6 +32,7 @@ #endif #include "nvim/event/rstream.h" #include "nvim/msgpack_rpc/channel.h" +#include "nvim/ui.h" #define KEY_BUFFER_SIZE 0xfff @@ -219,16 +220,11 @@ static void tinput_wait_enqueue(void **argv) const size_t len = rbuffer_size(input->key_buffer); String keys = { .data = xmallocz(len), .size = len }; rbuffer_read(input->key_buffer, keys.data, len); - if (ui_client_channel_id) { - Array args = ARRAY_DICT_INIT; - ADD(args, STRING_OBJ(keys)); // 'data' - ADD(args, BOOLEAN_OBJ(true)); // 'crlf' - ADD(args, INTEGER_OBJ(input->paste)); // 'phase' - rpc_send_event(ui_client_channel_id, "nvim_paste", args); - } else { - multiqueue_put(main_loop.events, tinput_paste_event, 3, - keys.data, keys.size, (intptr_t)input->paste); - } + Array args = ARRAY_DICT_INIT; + ADD(args, STRING_OBJ(keys)); // 'data' + ADD(args, BOOLEAN_OBJ(true)); // 'crlf' + ADD(args, INTEGER_OBJ(input->paste)); // 'phase' + rpc_send_event(ui_client_channel_id, "nvim_paste", args); if (input->paste == 1) { // Paste phase: "continue" input->paste = 2; @@ -237,60 +233,22 @@ static void tinput_wait_enqueue(void **argv) } else { // enqueue input for the main thread or Nvim server RBUFFER_UNTIL_EMPTY(input->key_buffer, buf, len) { const String keys = { .data = buf, .size = len }; - size_t consumed; - if (ui_client_channel_id) { - Array args = ARRAY_DICT_INIT; - Error err = ERROR_INIT; - ADD(args, STRING_OBJ(copy_string(keys, NULL))); - // TODO(bfredl): could be non-blocking now with paste? - ArenaMem res_mem = NULL; - Object result = rpc_send_call(ui_client_channel_id, "nvim_input", args, &res_mem, &err); - consumed = result.type == kObjectTypeInteger ? (size_t)result.data.integer : 0; - arena_mem_free(res_mem); - } else { - consumed = input_enqueue(keys); - } - if (consumed) { - rbuffer_consumed(input->key_buffer, consumed); - } + Array args = ARRAY_DICT_INIT; + ADD(args, STRING_OBJ(copy_string(keys, NULL))); + // NOTE: This is non-blocking and won't check partially processed input, + // but should be fine as all big sends are handled with nvim_paste, not nvim_input + rpc_send_event(ui_client_channel_id, "nvim_input", args); + rbuffer_consumed(input->key_buffer, len); rbuffer_reset(input->key_buffer); - if (consumed < len) { - break; - } } } - uv_mutex_lock(&input->key_buffer_mutex); - input->waiting = false; - uv_cond_signal(&input->key_buffer_cond); - uv_mutex_unlock(&input->key_buffer_mutex); -} - -static void tinput_paste_event(void **argv) -{ - String keys = { .data = argv[0], .size = (size_t)argv[1] }; - intptr_t phase = (intptr_t)argv[2]; - - Error err = ERROR_INIT; - nvim_paste(keys, true, phase, &err); - if (ERROR_SET(&err)) { - semsg("paste: %s", err.msg); - api_clear_error(&err); - } - - api_free_string(keys); } static void tinput_flush(TermInput *input, bool wait_until_empty) { size_t drain_boundary = wait_until_empty ? 0 : 0xff; do { - uv_mutex_lock(&input->key_buffer_mutex); - loop_schedule_fast(&main_loop, event_create(tinput_wait_enqueue, 1, input)); - input->waiting = true; - while (input->waiting) { - uv_cond_wait(&input->key_buffer_cond, &input->key_buffer_mutex); - } - uv_mutex_unlock(&input->key_buffer_mutex); + tinput_wait_enqueue((void **)&input); } while (rbuffer_size(input->key_buffer) > drain_boundary); } @@ -570,7 +528,10 @@ static bool handle_focus_event(TermInput *input) bool focus_gained = *rbuffer_get(input->read_stream.buffer, 2) == 'I'; // Advance past the sequence rbuffer_consumed(input->read_stream.buffer, 3); - autocmd_schedule_focusgained(focus_gained); + + Array args = ARRAY_DICT_INIT; + ADD(args, BOOLEAN_OBJ(focus_gained)); + rpc_send_event(ui_client_channel_id, "nvim_ui_set_focus", args); return true; } return false; @@ -617,10 +578,15 @@ static HandleState handle_bracketed_paste(TermInput *input) return kNotApplicable; } -static void set_bg_deferred(void **argv) +static void set_bg(char *bgvalue) { - char *bgvalue = argv[0]; - set_tty_background(bgvalue); + if (ui_client_attached) { + Array args = ARRAY_DICT_INIT; + ADD(args, STRING_OBJ(cstr_to_string("term_background"))); + ADD(args, STRING_OBJ(cstr_as_string(xstrdup(bgvalue)))); + + rpc_send_event(ui_client_channel_id, "nvim_ui_set_option", args); + } } // During startup, tui.c requests the background color (see `ext.get_bg`). @@ -702,10 +668,11 @@ static HandleState handle_background_color(TermInput *input) double g = (double)rgb[1] / (double)rgb_max[1]; double b = (double)rgb[2] / (double)rgb_max[2]; double luminance = (0.299 * r) + (0.587 * g) + (0.114 * b); // CCIR 601 - char *bgvalue = luminance < 0.5 ? "dark" : "light"; + bool is_dark = luminance < 0.5; + char *bgvalue = is_dark ? "dark" : "light"; DLOG("bg response: %s", bgvalue); - loop_schedule_deferred(&main_loop, - event_create(set_bg_deferred, 1, bgvalue)); + ui_client_bg_respose = is_dark ? kTrue : kFalse; + set_bg(bgvalue); input->waiting_for_bg_response = 0; } else if (!done && !bad) { // An incomplete sequence was found, waiting for the next input. diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 3010a7b612..0d01cd44cd 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1,7 +1,7 @@ // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com -// Terminal UI functions. Invoked (by ui_bridge.c) on the TUI thread. +// Terminal UI functions. Invoked (by UI_CALL) on the UI process. #include <assert.h> #include <signal.h> @@ -18,6 +18,7 @@ #include "nvim/api/private/helpers.h" #include "nvim/api/vim.h" #include "nvim/ascii.h" +#include "nvim/cursor_shape.h" #include "nvim/event/defs.h" #include "nvim/event/loop.h" #include "nvim/event/multiqueue.h" @@ -37,18 +38,15 @@ #include "nvim/os/input.h" #include "nvim/os/os.h" #include "nvim/os/signal.h" -#include "nvim/ui.h" -#include "nvim/vim.h" #ifdef MSWIN # include "nvim/os/os_win_console.h" #endif -#include "nvim/cursor_shape.h" -#include "nvim/macros.h" #include "nvim/tui/input.h" #include "nvim/tui/terminfo.h" #include "nvim/tui/tui.h" #include "nvim/ugrid.h" -#include "nvim/ui_bridge.h" +#include "nvim/ui.h" +#include "nvim/vim.h" // Space reserved in two output buffers to make the cursor normal or invisible // when flushing. No existing terminal will require 32 bytes to do that. @@ -91,7 +89,7 @@ typedef struct { } Rect; struct TUIData { - UIBridgeData *bridge; + UI *ui; Loop *loop; unibi_var_t params[9]; char buf[OUTBUF_SIZE]; @@ -108,8 +106,8 @@ struct TUIData { uv_pipe_t pipe; } output_handle; bool out_isatty; - SignalWatcher winch_handle, cont_handle; - bool cont_received; + SignalWatcher winch_handle; + uv_timer_t startup_delay_timer; UGrid grid; kvec_t(Rect) invalid_regions; int row, col; @@ -159,18 +157,18 @@ struct TUIData { int get_extkeys; } unibi_ext; char *space_buf; + bool stopped; }; static int got_winch = 0; static bool cursor_style_enabled = false; - #ifdef INCLUDE_GENERATED_DECLARATIONS # include "tui/tui.c.generated.h" #endif UI *tui_start(void) { - UI *ui = xcalloc(1, sizeof(UI)); // Freed by ui_bridge_stop(). + UI *ui = xcalloc(1, sizeof(UI)); // Freed by tui_data_destroy(). ui->stop = tui_stop; ui->grid_resize = tui_grid_resize; ui->grid_clear = tui_grid_clear; @@ -199,14 +197,39 @@ UI *tui_start(void) ui->ui_ext[kUILinegrid] = true; ui->ui_ext[kUITermColors] = true; - return ui_bridge_attach(ui, tui_main, tui_scheduler); + TUIData *data = xcalloc(1, sizeof(TUIData)); + ui->data = data; + data->ui = ui; + data->is_starting = true; + data->screenshot = NULL; + data->stopped = false; + data->loop = &main_loop; + kv_init(data->invalid_regions); + signal_watcher_init(data->loop, &data->winch_handle, ui); + + // TODO(bfredl): zero hl is empty, send this explicitly? + kv_push(data->attrs, HLATTRS_INIT); + + data->input.tk_ti_hook_fn = tui_tk_ti_getstr; + tinput_init(&data->input, &main_loop); + ugrid_init(&data->grid); + tui_terminal_start(ui); + + uv_timer_init(&data->loop->uv, &data->startup_delay_timer); + data->startup_delay_timer.data = ui; + uv_timer_start(&data->startup_delay_timer, after_startup_cb, + 100, 0); + + ui_attach_impl(ui, 0); + + return ui; } void tui_enable_extkeys(TUIData *data) { TermInput input = data->input; unibi_term *ut = data->ut; - UI *ui = data->bridge->ui; + UI *ui = data->ui; switch (input.extkeys_type) { case kExtkeysCSIu: @@ -237,13 +260,6 @@ static size_t unibi_pre_fmt_str(TUIData *data, unsigned int unibi_index, char *b return unibi_run(str, data->params, buf, len); } -static void termname_set_event(void **argv) -{ - char *termname = argv[0]; - set_tty_option("term", termname); - // Do not free termname, it is freed by set_tty_option. -} - static void terminfo_start(UI *ui) { TUIData *data = ui->data; @@ -294,22 +310,20 @@ static void terminfo_start(UI *ui) #endif // Set up unibilium/terminfo. - char *termname = NULL; if (term) { - os_env_var_lock(); data->ut = unibi_from_term(term); - os_env_var_unlock(); if (data->ut) { - termname = xstrdup(term); - data->term = xstrdup(term); + if (!ui_client_termname) { + ui_client_termname = xstrdup(term); + } + if (!data->term) { + data->term = xstrdup(term); + } } } if (!data->ut) { - data->ut = terminfo_from_builtin(term, &termname); + data->ut = terminfo_from_builtin(term, &ui_client_termname); } - // Update 'term' option. - loop_schedule_deferred(&main_loop, - event_create(termname_set_event, 1, termname)); // None of the following work over SSH; see :help TERM . const char *colorterm = os_getenv("COLORTERM"); @@ -443,13 +457,18 @@ static void tui_terminal_start(UI *ui) { TUIData *data = ui->data; data->print_attr_id = -1; - ugrid_init(&data->grid); terminfo_start(ui); tui_guess_size(ui); signal_watcher_start(&data->winch_handle, sigwinch_cb, SIGWINCH); tinput_start(&data->input); } +static void after_startup_cb(uv_timer_t *handle) +{ + UI *ui = handle->data; + tui_terminal_after_startup(ui); +} + static void tui_terminal_after_startup(UI *ui) FUNC_ATTR_NONNULL_ALL { @@ -461,98 +480,50 @@ static void tui_terminal_after_startup(UI *ui) flush_buf(ui); } +/// stop the terminal but allow it to restart later (like after suspend) static void tui_terminal_stop(UI *ui) { TUIData *data = ui->data; if (uv_is_closing(STRUCT_CAST(uv_handle_t, &data->output_handle))) { // Race between SIGCONT (tui.c) and SIGHUP (os/signal.c)? #8075 ELOG("TUI already stopped (race?)"); - ui->data = NULL; // Flag UI as "stopped". + data->stopped = true; return; } tinput_stop(&data->input); signal_watcher_stop(&data->winch_handle); terminfo_stop(ui); - ugrid_free(&data->grid); } static void tui_stop(UI *ui) { + TUIData *data = ui->data; tui_terminal_stop(ui); - ui->data = NULL; // Flag UI as "stopped". + tinput_destroy(&data->input); + data->stopped = true; + signal_watcher_close(&data->winch_handle, NULL); + uv_close((uv_handle_t *)&data->startup_delay_timer, NULL); + ui_detach_impl(ui, 0); } /// Returns true if UI `ui` is stopped. static bool tui_is_stopped(UI *ui) { - return ui->data == NULL; + TUIData *data = ui->data; + return data->stopped; } -/// Main function of the TUI thread. -static void tui_main(UIBridgeData *bridge, UI *ui) +#ifdef EXITFREE +void tui_free_all_mem(UI *ui) { - Loop tui_loop; - loop_init(&tui_loop, NULL); - TUIData *data = xcalloc(1, sizeof(TUIData)); - ui->data = data; - data->bridge = bridge; - data->loop = &tui_loop; - data->is_starting = true; - data->screenshot = NULL; - kv_init(data->invalid_regions); - signal_watcher_init(data->loop, &data->winch_handle, ui); - signal_watcher_init(data->loop, &data->cont_handle, data); -#ifdef UNIX - signal_watcher_start(&data->cont_handle, sigcont_cb, SIGCONT); -#endif - - // TODO(bfredl): zero hl is empty, send this explicitly? - kv_push(data->attrs, HLATTRS_INIT); - - data->input.tk_ti_hook_fn = tui_tk_ti_getstr; - tinput_init(&data->input, &tui_loop); - tui_terminal_start(ui); - - // Allow main thread to continue, we are ready to handle UI callbacks. - CONTINUE(bridge); - - // "Active" loop: first ~100 ms of startup. - for (size_t ms = 0; ms < 100 && !tui_is_stopped(ui);) { - ms += (loop_poll_events(&tui_loop, 20) ? 20 : 1); - } - if (!tui_is_stopped(ui)) { - tui_terminal_after_startup(ui); - } - // "Passive" (I/O-driven) loop: TUI thread "main loop". - while (!tui_is_stopped(ui)) { - loop_poll_events(&tui_loop, -1); // tui_loop.events is never processed - } - - ui_bridge_stopped(bridge); - tinput_destroy(&data->input); - signal_watcher_stop(&data->cont_handle); - signal_watcher_close(&data->cont_handle, NULL); - signal_watcher_close(&data->winch_handle, NULL); - loop_close(&tui_loop, false); + TUIData *data = ui->data; + ugrid_free(&data->grid); kv_destroy(data->invalid_regions); kv_destroy(data->attrs); xfree(data->space_buf); xfree(data->term); xfree(data); -} - -/// Handoff point between the main (ui_bridge) thread and the TUI thread. -static void tui_scheduler(Event event, void *d) -{ - UI *ui = d; - TUIData *data = ui->data; - loop_schedule_fast(data->loop, event); // `tui_loop` local to tui_main(). -} - -#ifdef UNIX -static void sigcont_cb(SignalWatcher *watcher, int signum, void *data) -{ - ((TUIData *)data)->cont_received = true; + xfree(ui); } #endif @@ -565,7 +536,6 @@ static void sigwinch_cb(SignalWatcher *watcher, int signum, void *data) } tui_guess_size(ui); - ui_schedule_refresh(); } static bool attrs_differ(UI *ui, int id1, int id2, bool rgb) @@ -1324,6 +1294,9 @@ static void tui_grid_scroll(UI *ui, Integer g, Integer startrow, // -V751 static void tui_hl_attr_define(UI *ui, Integer id, HlAttrs attrs, HlAttrs cterm_attrs, Array info) { TUIData *data = ui->data; + attrs.cterm_ae_attr = cterm_attrs.cterm_ae_attr; + attrs.cterm_fg_color = cterm_attrs.cterm_fg_color; + attrs.cterm_bg_color = cterm_attrs.cterm_bg_color; kv_a(data->attrs, (size_t)id) = attrs; } @@ -1421,32 +1394,13 @@ static void show_verbose_terminfo(TUIData *data) ADD(end_fold, STRING_OBJ(cstr_to_string("Title"))); ADD(chunks, ARRAY_OBJ(end_fold)); - if (ui_client_channel_id) { - Array args = ARRAY_DICT_INIT; - ADD(args, ARRAY_OBJ(chunks)); - ADD(args, BOOLEAN_OBJ(true)); // history - Dictionary opts = ARRAY_DICT_INIT; - PUT(opts, "verbose", BOOLEAN_OBJ(true)); - ADD(args, DICTIONARY_OBJ(opts)); - rpc_send_event(ui_client_channel_id, "nvim_echo", args); - } else { - loop_schedule_deferred(&main_loop, event_create(verbose_terminfo_event, 2, - chunks.items, chunks.size)); - } -} - -static void verbose_terminfo_event(void **argv) -{ - Array chunks = { .items = argv[0], .size = (size_t)argv[1] }; - Dict(echo_opts) opts = { .verbose = BOOLEAN_OBJ(true) }; - Error err = ERROR_INIT; - nvim_echo(chunks, true, &opts, &err); - api_free_array(chunks); - if (ERROR_SET(&err)) { - fprintf(stderr, "TUI bought the farm: %s\n", err.msg); - exit(1); - } - api_clear_error(&err); + Array args = ARRAY_DICT_INIT; + ADD(args, ARRAY_OBJ(chunks)); + ADD(args, BOOLEAN_OBJ(true)); // history + Dictionary opts = ARRAY_DICT_INIT; + PUT(opts, "verbose", BOOLEAN_OBJ(true)); + ADD(args, DICTIONARY_OBJ(opts)); + rpc_send_event(ui_client_channel_id, "nvim_echo", args); } #ifdef UNIX @@ -1456,38 +1410,28 @@ static void suspend_event(void **argv) TUIData *data = ui->data; bool enable_mouse = data->mouse_enabled; tui_terminal_stop(ui); - data->cont_received = false; stream_set_blocking(input_global_fd(), true); // normalize stream (#2598) - signal_stop(); + kill(0, SIGTSTP); - signal_start(); - while (!data->cont_received) { - // poll the event loop until SIGCONT is received - loop_poll_events(data->loop, -1); - } + tui_terminal_start(ui); tui_terminal_after_startup(ui); if (enable_mouse) { tui_mouse_on(ui); } stream_set_blocking(input_global_fd(), false); // libuv expects this - // resume the main thread - CONTINUE(data->bridge); } #endif static void tui_suspend(UI *ui) { - TUIData *data = ui->data; +// on a non-UNIX system, this is a no-op #ifdef UNIX // kill(0, SIGTSTP) won't stop the UI thread, so we must poll for SIGCONT // before continuing. This is done in another callback to avoid // loop_poll_events recursion - multiqueue_put_event(data->loop->fast_events, + multiqueue_put_event(resize_events, event_create(suspend_event, 1, ui)); -#else - // Resume the main thread as suspending isn't implemented. - CONTINUE(data->bridge); #endif } @@ -1547,6 +1491,13 @@ static void tui_option_set(UI *ui, String name, Object value) ui->rgb = value.data.boolean; data->print_attr_id = -1; invalidate(ui, 0, data->grid.height, 0, data->grid.width); + + if (ui_client_channel_id) { + Array args = ARRAY_DICT_INIT; + ADD(args, STRING_OBJ(cstr_as_string(xstrdup("rgb")))); + ADD(args, BOOLEAN_OBJ(value.data.boolean)); + rpc_send_event(ui_client_channel_id, "nvim_ui_set_option", args); + } } else if (strequal(name.data, "ttimeout")) { data->input.ttimeout = value.data.boolean; } else if (strequal(name.data, "ttimeoutlen")) { @@ -1659,8 +1610,11 @@ static void tui_guess_size(UI *ui) height = DFLT_ROWS; } - data->bridge->bridge.width = ui->width = width; - data->bridge->bridge.height = ui->height = height; + ui->width = width; + ui->height = height; + + // TODO(bfredl): only if different from last value + ui_schedule_refresh(); } static void unibi_goto(UI *ui, int row, int col) @@ -1747,7 +1701,7 @@ static void pad(void *ctx, size_t delay, int scale FUNC_ATTR_UNUSED, int force) } flush_buf(ui); - loop_uv_run(data->loop, (int)(delay / 10), false); + loop_uv_run(data->loop, (int64_t)(delay / 10), false); } static void unibi_set_if_empty(unibi_term *ut, enum unibi_string str, const char *val) diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 7a22acfc8b..a28faf7890 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -10,6 +10,7 @@ #include "auto/config.h" #include "klib/kvec.h" +#include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" #include "nvim/buffer_defs.h" @@ -31,16 +32,11 @@ #include "nvim/option.h" #include "nvim/os/time.h" #include "nvim/strings.h" +#include "nvim/tui/tui.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/vim.h" #include "nvim/window.h" -#ifdef FEAT_TUI -# include "nvim/tui/tui.h" -#else -# include "nvim/msgpack_rpc/server.h" -#endif -#include "nvim/api/private/helpers.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui.c.generated.h" @@ -126,28 +122,28 @@ void ui_init(void) kv_ensure_space(call_buf, 16); } +static UI *builtin_ui = NULL; + +#ifdef EXITFREE void ui_free_all_mem(void) { kv_destroy(call_buf); + if (builtin_ui) { + tui_free_all_mem(builtin_ui); + builtin_ui = NULL; + } } +#endif void ui_builtin_start(void) { -#ifdef FEAT_TUI - tui_start(); -#else - fprintf(stderr, "Nvim headless-mode started.\n"); - size_t len; - char **addrs = server_address_list(&len); - if (addrs != NULL) { - fprintf(stderr, "Listening on:\n"); - for (size_t i = 0; i < len; i++) { - fprintf(stderr, "\t%s\n", addrs[i]); - } - xfree(addrs); - } - fprintf(stderr, "Press CTRL+C to exit.\n"); -#endif + builtin_ui = tui_start(); +} + +UI *ui_get_by_index(int idx) +{ + assert(idx < 16); + return uis[idx]; } bool ui_rgb_attached(void) @@ -186,7 +182,7 @@ void ui_refresh(void) } if (updating_screen) { - deferred_refresh_event(NULL); + ui_schedule_refresh(); return; } @@ -228,10 +224,20 @@ void ui_refresh(void) screen_resize(width, height); p_lz = save_p_lz; } else { - Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ((int)width)); - ADD(args, INTEGER_OBJ((int)height)); - rpc_send_event(ui_client_channel_id, "nvim_ui_try_resize", args); + if (ui_client_attached) { + // TODO(bfredl): ui_refresh() should only be used on the server + // we are in the client process. forward the resize + Array args = ARRAY_DICT_INIT; + ADD(args, INTEGER_OBJ((int)width)); + ADD(args, INTEGER_OBJ((int)height)); + rpc_send_event(ui_client_channel_id, "nvim_ui_try_resize", args); + } else { + /// TODO(bfredl): Messy! The screen does not yet exist, but we need to + /// communicate its size from the TUI to the client. Clean this up + /// in The UI Devirtualization Project. + Rows = height; + Columns = width; + } } if (ext_widgets[kUIMessages]) { @@ -279,10 +285,6 @@ static void ui_refresh_event(void **argv) void ui_schedule_refresh(void) { - loop_schedule_fast(&main_loop, event_create(deferred_refresh_event, 0)); -} -static void deferred_refresh_event(void **argv) -{ multiqueue_put(resize_events, ui_refresh_event, 0); } @@ -504,6 +506,7 @@ handle_T ui_cursor_grid(void) void ui_flush(void) { + assert(!ui_client_channel_id); if (!ui_active()) { return; } diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c deleted file mode 100644 index 25c230a941..0000000000 --- a/src/nvim/ui_bridge.c +++ /dev/null @@ -1,223 +0,0 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - -// UI wrapper that sends requests to the UI thread. -// Used by the built-in TUI and libnvim-based UIs. - -#include <stdbool.h> -#include <stdint.h> -#include <stdlib.h> - -#include "nvim/api/private/defs.h" -#include "nvim/api/private/helpers.h" -#include "nvim/event/loop.h" -#include "nvim/grid_defs.h" -#include "nvim/highlight_defs.h" -#include "nvim/main.h" -#include "nvim/memory.h" -#include "nvim/ui.h" -#include "nvim/ui_bridge.h" - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "ui_bridge.c.generated.h" -#endif - -#define UI(b) (((UIBridgeData *)b)->ui) - -// Schedule a function call on the UI bridge thread. -#define UI_BRIDGE_CALL(ui, name, argc, ...) \ - ((UIBridgeData *)ui)->scheduler(event_create(ui_bridge_##name##_event, argc, __VA_ARGS__), UI(ui)) - -#define INT2PTR(i) ((void *)(intptr_t)i) -#define PTR2INT(p) ((Integer)(intptr_t)p) - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "ui_events_bridge.generated.h" -#endif - -UI *ui_bridge_attach(UI *ui, ui_main_fn ui_main, event_scheduler scheduler) -{ - UIBridgeData *rv = xcalloc(1, sizeof(UIBridgeData)); - rv->ui = ui; - rv->bridge.rgb = ui->rgb; - rv->bridge.width = ui->width; - rv->bridge.height = ui->height; - rv->bridge.stop = ui_bridge_stop; - rv->bridge.grid_resize = ui_bridge_grid_resize; - rv->bridge.grid_clear = ui_bridge_grid_clear; - rv->bridge.grid_cursor_goto = ui_bridge_grid_cursor_goto; - rv->bridge.mode_info_set = ui_bridge_mode_info_set; - rv->bridge.update_menu = ui_bridge_update_menu; - rv->bridge.busy_start = ui_bridge_busy_start; - rv->bridge.busy_stop = ui_bridge_busy_stop; - rv->bridge.mouse_on = ui_bridge_mouse_on; - rv->bridge.mouse_off = ui_bridge_mouse_off; - rv->bridge.mode_change = ui_bridge_mode_change; - rv->bridge.grid_scroll = ui_bridge_grid_scroll; - rv->bridge.hl_attr_define = ui_bridge_hl_attr_define; - rv->bridge.bell = ui_bridge_bell; - rv->bridge.visual_bell = ui_bridge_visual_bell; - rv->bridge.default_colors_set = ui_bridge_default_colors_set; - rv->bridge.flush = ui_bridge_flush; - rv->bridge.suspend = ui_bridge_suspend; - rv->bridge.set_title = ui_bridge_set_title; - rv->bridge.set_icon = ui_bridge_set_icon; - rv->bridge.screenshot = ui_bridge_screenshot; - rv->bridge.option_set = ui_bridge_option_set; - rv->bridge.raw_line = ui_bridge_raw_line; - rv->bridge.inspect = ui_bridge_inspect; - rv->scheduler = scheduler; - - for (UIExtension i = 0; (int)i < kUIExtCount; i++) { - rv->bridge.ui_ext[i] = ui->ui_ext[i]; - } - - rv->ui_main = ui_main; - uv_mutex_init(&rv->mutex); - uv_cond_init(&rv->cond); - uv_mutex_lock(&rv->mutex); - rv->ready = false; - - if (uv_thread_create(&rv->ui_thread, ui_thread_run, rv)) { - abort(); - } - - // Suspend the main thread until CONTINUE is called by the UI thread. - while (!rv->ready) { - uv_cond_wait(&rv->cond, &rv->mutex); - } - uv_mutex_unlock(&rv->mutex); - - ui_attach_impl(&rv->bridge, 0); - - return &rv->bridge; -} - -void ui_bridge_stopped(UIBridgeData *bridge) -{ - uv_mutex_lock(&bridge->mutex); - bridge->stopped = true; - uv_mutex_unlock(&bridge->mutex); -} - -static void ui_thread_run(void *data) -{ - UIBridgeData *bridge = data; - bridge->ui_main(bridge, bridge->ui); -} - -static void ui_bridge_stop(UI *b) -{ - // Detach bridge first, so that "stop" is the last event the TUI loop - // receives from the main thread. #8041 - ui_detach_impl(b, 0); - - UIBridgeData *bridge = (UIBridgeData *)b; - bool stopped = bridge->stopped = false; - UI_BRIDGE_CALL(b, stop, 1, b); - for (;;) { - uv_mutex_lock(&bridge->mutex); - stopped = bridge->stopped; - uv_mutex_unlock(&bridge->mutex); - if (stopped) { // -V547 - break; - } - // TODO(justinmk): Remove this. Use a cond-wait above. #9274 - loop_poll_events(&main_loop, 10); // Process one event. - } - uv_thread_join(&bridge->ui_thread); - uv_mutex_destroy(&bridge->mutex); - uv_cond_destroy(&bridge->cond); - xfree(bridge->ui); // Threads joined, now safe to free UI container. #7922 - xfree(b); -} -static void ui_bridge_stop_event(void **argv) -{ - UI *ui = UI(argv[0]); - ui->stop(ui); -} - -static void ui_bridge_hl_attr_define(UI *ui, Integer id, HlAttrs attrs, HlAttrs cterm_attrs, - Array info) -{ - HlAttrs *a = xmalloc(sizeof(HlAttrs)); - *a = attrs; - UI_BRIDGE_CALL(ui, hl_attr_define, 3, ui, INT2PTR(id), a); -} -static void ui_bridge_hl_attr_define_event(void **argv) -{ - UI *ui = UI(argv[0]); - Array info = ARRAY_DICT_INIT; - ui->hl_attr_define(ui, PTR2INT(argv[1]), *((HlAttrs *)argv[2]), - *((HlAttrs *)argv[2]), info); - xfree(argv[2]); -} - -static void ui_bridge_raw_line_event(void **argv) -{ - UI *ui = UI(argv[0]); - ui->raw_line(ui, PTR2INT(argv[1]), PTR2INT(argv[2]), PTR2INT(argv[3]), - PTR2INT(argv[4]), PTR2INT(argv[5]), PTR2INT(argv[6]), - (LineFlags)PTR2INT(argv[7]), argv[8], argv[9]); - xfree(argv[8]); - xfree(argv[9]); -} -static void ui_bridge_raw_line(UI *ui, Integer grid, Integer row, Integer startcol, Integer endcol, - Integer clearcol, Integer clearattr, LineFlags flags, - const schar_T *chunk, const sattr_T *attrs) -{ - size_t ncol = (size_t)(endcol - startcol); - schar_T *c = xmemdup(chunk, ncol * sizeof(schar_T)); - sattr_T *hl = xmemdup(attrs, ncol * sizeof(sattr_T)); - UI_BRIDGE_CALL(ui, raw_line, 10, ui, INT2PTR(grid), INT2PTR(row), - INT2PTR(startcol), INT2PTR(endcol), INT2PTR(clearcol), - INT2PTR(clearattr), INT2PTR(flags), c, hl); -} - -static void ui_bridge_suspend(UI *b) -{ - UIBridgeData *data = (UIBridgeData *)b; - uv_mutex_lock(&data->mutex); - UI_BRIDGE_CALL(b, suspend, 1, b); - data->ready = false; - // Suspend the main thread until CONTINUE is called by the UI thread. - while (!data->ready) { - uv_cond_wait(&data->cond, &data->mutex); - } - uv_mutex_unlock(&data->mutex); -} -static void ui_bridge_suspend_event(void **argv) -{ - UI *ui = UI(argv[0]); - ui->suspend(ui); -} - -static void ui_bridge_option_set(UI *ui, String name, Object value) -{ - String copy_name = copy_string(name, NULL); - Object *copy_value = xmalloc(sizeof(Object)); - *copy_value = copy_object(value, NULL); - UI_BRIDGE_CALL(ui, option_set, 4, ui, copy_name.data, - INT2PTR(copy_name.size), copy_value); - // TODO(bfredl): when/if TUI/bridge teardown is refactored to use events, the - // commit that introduced this special case can be reverted. - // For now this is needed for nvim_list_uis(). - if (strequal(name.data, "termguicolors")) { - ui->rgb = value.data.boolean; - } -} -static void ui_bridge_option_set_event(void **argv) -{ - UI *ui = UI(argv[0]); - String name = (String){ .data = argv[1], .size = (size_t)argv[2] }; - Object value = *(Object *)argv[3]; - ui->option_set(ui, name, value); - api_free_string(name); - api_free_object(value); - xfree(argv[3]); -} - -static void ui_bridge_inspect(UI *ui, Dictionary *info) -{ - PUT(*info, "chan", INTEGER_OBJ(0)); -} diff --git a/src/nvim/ui_bridge.h b/src/nvim/ui_bridge.h deleted file mode 100644 index 094367126a..0000000000 --- a/src/nvim/ui_bridge.h +++ /dev/null @@ -1,47 +0,0 @@ -// Bridge for communication between a UI thread and nvim core. -// Used by the built-in TUI and libnvim-based UIs. -#ifndef NVIM_UI_BRIDGE_H -#define NVIM_UI_BRIDGE_H - -#include <stdbool.h> -#include <uv.h> - -#include "nvim/event/defs.h" -#include "nvim/ui.h" - -struct ui_bridge_data; - -typedef struct ui_bridge_data UIBridgeData; -typedef void (*ui_main_fn)(UIBridgeData *bridge, UI *ui); -struct ui_bridge_data { - UI bridge; // actual UI passed to ui_attach - UI *ui; // UI pointer that will have its callback called in - // another thread - event_scheduler scheduler; - uv_thread_t ui_thread; - ui_main_fn ui_main; - uv_mutex_t mutex; - uv_cond_t cond; - // When the UI thread is called, the main thread will suspend until - // the call returns. This flag is used as a condition for the main - // thread to continue. - bool ready; - // When a stop request is sent from the main thread, it must wait until the UI - // thread finishes handling all events. This flag is set by the UI thread as a - // signal that it will no longer send messages to the main thread. - bool stopped; -}; - -#define CONTINUE(b) \ - do { \ - UIBridgeData *d = (UIBridgeData *)b; \ - uv_mutex_lock(&d->mutex); \ - d->ready = true; \ - uv_cond_signal(&d->cond); \ - uv_mutex_unlock(&d->mutex); \ - } while (0) - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "ui_bridge.h.generated.h" -#endif -#endif // NVIM_UI_BRIDGE_H diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c index 27c63433a7..6fc3a05e96 100644 --- a/src/nvim/ui_client.c +++ b/src/nvim/ui_client.c @@ -6,6 +6,7 @@ #include <stdlib.h> #include "nvim/api/private/helpers.h" +#include "nvim/eval.h" #include "nvim/event/loop.h" #include "nvim/event/multiqueue.h" #include "nvim/globals.h" @@ -24,23 +25,71 @@ #endif // uncrustify:on -void ui_client_init(uint64_t chan) +uint64_t ui_client_start_server(int argc, char **argv) { + varnumber_T exit_status; + char **args = xmalloc(((size_t)(2 + argc)) * sizeof(char *)); + int args_idx = 0; + args[args_idx++] = xstrdup((const char *)get_vim_var_str(VV_PROGPATH)); + args[args_idx++] = xstrdup("--embed"); + for (int i = 1; i < argc; i++) { + args[args_idx++] = xstrdup(argv[i]); + } + args[args_idx++] = NULL; + + Channel *channel = channel_job_start(args, CALLBACK_READER_INIT, + CALLBACK_READER_INIT, CALLBACK_NONE, + false, true, true, false, kChannelStdinPipe, + NULL, 0, 0, NULL, &exit_status); + if (ui_client_forward_stdin) { + close(0); + dup(2); + } + + return channel->id; +} + +void ui_client_run(bool remote_ui) + FUNC_ATTR_NORETURN +{ + ui_builtin_start(); + + loop_poll_events(&main_loop, 1); + Array args = ARRAY_DICT_INIT; - int width = Columns; - int height = Rows; Dictionary opts = ARRAY_DICT_INIT; PUT(opts, "rgb", BOOLEAN_OBJ(true)); PUT(opts, "ext_linegrid", BOOLEAN_OBJ(true)); PUT(opts, "ext_termcolors", BOOLEAN_OBJ(true)); - ADD(args, INTEGER_OBJ((int)width)); - ADD(args, INTEGER_OBJ((int)height)); + if (ui_client_termname) { + PUT(opts, "term_name", STRING_OBJ(cstr_as_string(ui_client_termname))); + } + if (ui_client_bg_respose != kNone) { + bool is_dark = (ui_client_bg_respose == kTrue); + PUT(opts, "term_background", STRING_OBJ(cstr_as_string(is_dark ? "dark" : "light"))); + } + PUT(opts, "term_colors", INTEGER_OBJ(t_colors)); + if (!remote_ui) { + PUT(opts, "stdin_tty", BOOLEAN_OBJ(stdin_isatty)); + PUT(opts, "stdout_tty", BOOLEAN_OBJ(stdout_isatty)); + if (ui_client_forward_stdin) { + PUT(opts, "stdin_fd", INTEGER_OBJ(UI_CLIENT_STDIN_FD)); + } + } + + ADD(args, INTEGER_OBJ(Columns)); + ADD(args, INTEGER_OBJ(Rows)); ADD(args, DICTIONARY_OBJ(opts)); - rpc_send_event(chan, "nvim_ui_attach", args); - ui_client_channel_id = chan; + rpc_send_event(ui_client_channel_id, "nvim_ui_attach", args); + ui_client_attached = true; + + // os_exit() will be invoked when the client channel detaches + while (true) { + LOOP_PROCESS_EVENTS(&main_loop, resize_events, -1); + } } UIClientHandler ui_client_get_redraw_handler(const char *name, size_t name_len, Error *error) @@ -63,20 +112,6 @@ Object handle_ui_client_redraw(uint64_t channel_id, Array args, Arena *arena, Er return NIL; } -/// run the main thread in ui client mode -/// -/// This is just a stub. the full version will handle input, resizing, etc -void ui_client_execute(uint64_t chan) - FUNC_ATTR_NORETURN -{ - while (true) { - loop_poll_events(&main_loop, -1); - multiqueue_process_events(resize_events); - } - - getout(0); -} - static HlAttrs ui_client_dict2hlattrs(Dictionary d, bool rgb) { Error err = ERROR_INIT; @@ -85,7 +120,7 @@ static HlAttrs ui_client_dict2hlattrs(Dictionary d, bool rgb) // TODO(bfredl): log "err" return HLATTRS_INIT; } - return dict2hlattrs(&dict, true, NULL, &err); + return dict2hlattrs(&dict, rgb, NULL, &err); } void ui_client_event_grid_resize(Array args) diff --git a/src/nvim/ui_client.h b/src/nvim/ui_client.h index bed73d83d3..67d16e7fb1 100644 --- a/src/nvim/ui_client.h +++ b/src/nvim/ui_client.h @@ -17,6 +17,26 @@ EXTERN size_t grid_line_buf_size INIT(= 0); EXTERN schar_T *grid_line_buf_char INIT(= NULL); EXTERN sattr_T *grid_line_buf_attr INIT(= NULL); +// ID of the ui client channel. If zero, the client is not running. +EXTERN uint64_t ui_client_channel_id INIT(= 0); + +// TODO(bfredl): the current structure for how tui and ui_client.c communicate is a bit awkward. +// This will be restructured as part of The UI Devirtualization Project. + +/// Whether ui client has sent nvim_ui_attach yet +EXTERN bool ui_client_attached INIT(= false); + +/// Whether ui client has gotten a response about the bg color of the terminal, +/// kTrue=dark, kFalse=light, kNone=no response yet +EXTERN TriState ui_client_bg_respose INIT(= kNone); + +/// The ui client should forward its stdin to the nvim process +/// by convention, this uses fd=3 (next free number after stdio) +EXTERN bool ui_client_forward_stdin INIT(= false); + +EXTERN char *ui_client_termname INIT(= NULL); + +#define UI_CLIENT_STDIN_FD 3 #ifdef INCLUDE_GENERATED_DECLARATIONS # include "ui_client.h.generated.h" diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 0777d1309d..9cbe5d5d9e 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -116,7 +116,6 @@ #include "nvim/os/os.h" #include "nvim/os/os_defs.h" #include "nvim/os/time.h" -#include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/pos.h" #include "nvim/screen.h" diff --git a/src/nvim/version.c b/src/nvim/version.c index 98719fce4a..92122b2523 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -69,11 +69,7 @@ static char *features[] = { "-iconv", #endif -#ifdef FEAT_TUI "+tui", -#else - "-tui", -#endif NULL }; diff --git a/src/nvim/window.c b/src/nvim/window.c index 5c1c861f45..57d40ceb42 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -4277,7 +4277,9 @@ static int leave_tabpage(buf_T *new_curbuf, bool trigger_leave_autocmds) tp->tp_firstwin = firstwin; tp->tp_lastwin = lastwin; tp->tp_old_Rows_avail = ROWS_AVAIL; - tp->tp_old_Columns = Columns; + if (tp->tp_old_Columns != -1) { + tp->tp_old_Columns = Columns; + } firstwin = NULL; lastwin = NULL; return OK; @@ -4340,8 +4342,13 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a if (curtab->tp_old_Rows_avail != ROWS_AVAIL || (old_off != firstwin->w_winrow)) { win_new_screen_rows(); } - if (curtab->tp_old_Columns != Columns && starting == 0) { - win_new_screen_cols(); // update window widths + if (curtab->tp_old_Columns != Columns) { + if (starting == 0) { + win_new_screen_cols(); // update window widths + curtab->tp_old_Columns = Columns; + } else { + curtab->tp_old_Columns = -1; // update window widths later + } } lastused_tabpage = old_curtab; diff --git a/test/functional/autocmd/focus_spec.lua b/test/functional/autocmd/focus_spec.lua index 024dccbe8e..d7a87e17ed 100644 --- a/test/functional/autocmd/focus_spec.lua +++ b/test/functional/autocmd/focus_spec.lua @@ -33,18 +33,37 @@ describe('autoread TUI FocusGained/FocusLost', function() helpers.write_file(path, '') lfs.touch(path, os.time() - 10) - feed_command('edit '..path) - feed_data('\027[O') screen:expect{grid=[[ {1: } | {4:~ }| {4:~ }| {4:~ }| + {5:[No Name] }| + | + {3:-- TERMINAL --} | + ]]} + feed_command('edit '..path) + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| {5:xtest-foo }| :edit xtest-foo | {3:-- TERMINAL --} | ]]} + feed_data('\027[O') + feed_data('\027[O') + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:xtest-foo }| + :edit xtest-foo | + {3:-- TERMINAL --} | + ]], unchanged=true} helpers.write_file(path, expected_addition) diff --git a/test/functional/core/main_spec.lua b/test/functional/core/main_spec.lua index 53461f505a..ab11e14a67 100644 --- a/test/functional/core/main_spec.lua +++ b/test/functional/core/main_spec.lua @@ -56,7 +56,7 @@ describe('Command-line option', function() screen:attach() local args = { nvim_prog_abs(), '-u', 'NONE', '-i', 'NONE', - '--cmd', 'set noswapfile shortmess+=IFW fileformats=unix', + '--cmd', '"set noswapfile shortmess+=IFW fileformats=unix"', '-s', '-' } diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 7664401824..72d8f3a103 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -465,6 +465,19 @@ describe('startup', function() clear{args={'--cmd', 'set packpath^=test/functional/fixtures', '--cmd', [[ lua _G.test_loadorder = {} vim.cmd "runtime! filen.lua" ]]}, env={XDG_CONFIG_HOME='test/functional/fixtures/'}} eq({'ordinary', 'FANCY', 'FANCY after', 'ordinary after'}, exec_lua [[ return _G.test_loadorder ]]) end) + + it('window widths are correct when modelines set &columns with tabpages', function() + write_file('tab1.noft', 'vim: columns=81') + write_file('tab2.noft', 'vim: columns=81') + finally(function() + os.remove('tab1.noft') + os.remove('tab2.noft') + end) + clear({args = {'-p', 'tab1.noft', 'tab2.noft'}}) + eq(81, meths.win_get_width(0)) + command('tabnext') + eq(81, meths.win_get_width(0)) + end) end) describe('sysinit', function() @@ -531,7 +544,7 @@ describe('sysinit', function() nvim_exec() | cmd: aunmenu * | > | - <" -u NONE -i NONE --cmd "set noruler" -D 1,1 All| + <" -u NONE -i NONE --cmd "set noruler" -D 1,0-1 All| | ]]) command([[call chansend(g:id, "cont\n")]]) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index ca59eb3182..a14bedbbbd 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -243,7 +243,7 @@ function module.run_session(lsession, request_cb, notification_cb, setup_cb, tim end loop_running = true - session:run(on_request, on_notification, on_setup, timeout) + lsession:run(on_request, on_notification, on_setup, timeout) loop_running = false if last_error then local err = last_error @@ -251,7 +251,7 @@ function module.run_session(lsession, request_cb, notification_cb, setup_cb, tim error(err) end - return session.eof_err + return lsession.eof_err end function module.run(request_cb, notification_cb, setup_cb, timeout) @@ -465,8 +465,14 @@ end -- clear('-e') -- clear{args={'-e'}, args_rm={'-i'}, env={TERM=term}} function module.clear(...) + module.set_session(module.spawn_argv(false, ...)) +end + +-- same params as clear, but does returns the session instead +-- of replacing the default session +function module.spawn_argv(keep, ...) local argv, env, io_extra = module.new_argv(...) - module.set_session(module.spawn(argv, nil, env, nil, io_extra)) + return module.spawn(argv, nil, env, keep, io_extra) end -- Builds an argument list for use in clear(). diff --git a/test/functional/plugin/lsp/codelens_spec.lua b/test/functional/plugin/lsp/codelens_spec.lua index ecc2f579b8..3d7a15a191 100644 --- a/test/functional/plugin/lsp/codelens_spec.lua +++ b/test/functional/plugin/lsp/codelens_spec.lua @@ -58,6 +58,41 @@ describe('vim.lsp.codelens', function() ]], bufnr) eq({[1] = {'Lens1', 'LspCodeLens'}}, virtual_text_chunks) + end) + + it('can clear all lens', function() + local fake_uri = "file:///fake/uri" + local bufnr = exec_lua([[ + fake_uri = ... + local bufnr = vim.uri_to_bufnr(fake_uri) + local lines = {'So', 'many', 'lines'} + vim.fn.bufload(bufnr) + vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines) + return bufnr + ]], fake_uri) + + exec_lua([[ + local bufnr = ... + local lenses = { + { + range = { + start = { line = 0, character = 0, }, + ['end'] = { line = 0, character = 0 } + }, + command = { title = 'Lens1', command = 'Dummy' } + }, + } + vim.lsp.codelens.on_codelens(nil, lenses, {method='textDocument/codeLens', client_id=1, bufnr=bufnr}) + ]], bufnr) + + local stored_lenses = exec_lua('return vim.lsp.codelens.get(...)', bufnr) + eq(1, #stored_lenses) + + exec_lua([[ + vim.lsp.codelens.clear() + ]]) + stored_lenses = exec_lua('return vim.lsp.codelens.get(...)', bufnr) + eq(0, #stored_lenses) end) end) diff --git a/test/functional/terminal/api_spec.lua b/test/functional/terminal/api_spec.lua index 38ef7c2a61..724791343d 100644 --- a/test/functional/terminal/api_spec.lua +++ b/test/functional/terminal/api_spec.lua @@ -19,6 +19,16 @@ describe('api', function() end) it("qa! RPC request during insert-mode", function() + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + | + {3:-- TERMINAL --} | + ]]} + -- Start the socket from the child nvim. child_session.feed_data(":echo serverstart('"..socket_name.."')\n") diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index b3d2625d78..964fc8941d 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -13,6 +13,7 @@ local feed_command = helpers.feed_command local feed_data = thelpers.feed_data local clear = helpers.clear local command = helpers.command +local exec = helpers.exec local testprg = helpers.testprg local retry = helpers.retry local nvim_prog = helpers.nvim_prog @@ -23,6 +24,11 @@ local funcs = helpers.funcs local meths = helpers.meths local is_ci = helpers.is_ci local is_os = helpers.is_os +local new_pipename = helpers.new_pipename +local spawn_argv = helpers.spawn_argv +local set_session = helpers.set_session +local feed = helpers.feed +local eval = helpers.eval if helpers.skip(helpers.is_os('win')) then return end @@ -33,7 +39,7 @@ describe('TUI', function() before_each(function() clear() - local child_server = helpers.new_pipename() + local child_server = new_pipename() screen = thelpers.screen_setup(0, string.format([=[["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "%s laststatus=2 background=dark"]]=], nvim_prog, child_server, nvim_set)) @@ -90,24 +96,6 @@ describe('TUI', function() assert_alive() end) - it('resize at startup', function() - -- Issues: #17285 #15044 #11330 - screen:try_resize(50, 10) - feed_command([[call termopen([v:progpath, '--clean', '--cmd', 'let start = reltime() | while v:true | if reltimefloat(reltime(start)) > 2 | break | endif | endwhile']) | sleep 500m | vs new]]) - screen:expect([[ - {1: } │ | - {4:~ }│{4:~ }| - {4:~ }│{4:~ }| - {4:~ }│{4:~ }| - {4:~ }│{4:~ }| - {4:~ }│{5:[No Name] 0,0-1 All}| - {4:~ }│ | - {5:new }{MATCH:<.*[/\]nvim }| - | - {3:-- TERMINAL --} | - ]]) - end) - it('accepts resize while pager is active', function() child_session:request("nvim_command", [[ set more @@ -1208,6 +1196,15 @@ describe('TUI', function() it('paste: split "start paste" code', function() feed_data('i') + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]} -- Send split "start paste" sequence. feed_data('\027[2') feed_data('00~pasted from terminal\027[201~') @@ -1224,6 +1221,15 @@ describe('TUI', function() it('paste: split "stop paste" code', function() feed_data('i') + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]} -- Send split "stop paste" sequence. feed_data('\027[200~pasted from terminal\027[20') feed_data('1~') @@ -1249,6 +1255,15 @@ describe('TUI', function() end)(vim.paste) ]], {}) feed_data('i') + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]} feed_data('\027[200~pasted') -- phase 1 screen:expect([[ pasted{1: } | @@ -1382,7 +1397,7 @@ describe('TUI', function() | {4:~ }| {5: }| - [[['chan', 0], ['height', 6], ['override', v:false| + [[['chan', 1], ['height', 6], ['override', v:false| ], ['rgb', v:false], ['width', 50]]] | {10:Press ENTER or type command to continue}{1: } | {3:-- TERMINAL --} | @@ -1437,6 +1452,35 @@ describe('TUI', function() os.remove('testF') end) + it('resize at startup #17285 #15044 #11330', function() + local screen = Screen.new(50, 10) + screen:set_default_attr_ids({ + [1] = {reverse = true}, + [2] = {bold = true, foreground = Screen.colors.Blue}, + [3] = {bold = true}, + [4] = {foreground = tonumber('0x4040ff'), fg_indexed = true}, + [5] = {bold = true, reverse = true}, + }) + screen:attach() + exec([[ + call termopen([v:progpath, '--clean', '--cmd', 'let start = reltime() | while v:true | if reltimefloat(reltime(start)) > 2 | break | endif | endwhile']) + sleep 500m + vs new + ]]) + screen:expect([[ + ^ │ | + {2:~ }│{4:~ }| + {2:~ }│{4:~ }| + {2:~ }│{4:~ }| + {2:~ }│{4:~ }| + {2:~ }│{4:~ }| + {2:~ }│{5:[No Name] 0,0-1 All}| + {2:~ }│ | + {5:new }{MATCH:<.*[/\]nvim }| + | + ]]) + end) + it('with non-tty (pipe) stdout/stderr', function() local screen = thelpers.screen_setup(0, '"'..nvim_prog ..' -u NONE -i NONE --cmd \'set noswapfile noshowcmd noruler\' --cmd \'normal iabc\' > /dev/null 2>&1 && cat testF && rm testF"') @@ -1455,6 +1499,15 @@ describe('TUI', function() it('<C-h> #10134', function() local screen = thelpers.screen_setup(0, '["'..nvim_prog ..[[", "-u", "NONE", "-i", "NONE", "--cmd", "set noruler", "--cmd", ':nnoremap <C-h> :echomsg "\<C-h\>"<CR>']]..']') + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + | + {3:-- TERMINAL --} | + ]]} command([[call chansend(b:terminal_job_id, "\<C-h>")]]) screen:expect([[ @@ -1481,6 +1534,15 @@ describe('TUI UIEnter/UILeave', function() ..[[, "--cmd", "autocmd VimEnter * :call add(g:evs, 'VimEnter')"]] ..']' ) + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + | + {3:-- TERMINAL --} | + ]]} feed_data(":echo g:evs\n") screen:expect{grid=[[ {1: } | @@ -1501,61 +1563,88 @@ describe('TUI FocusGained/FocusLost', function() clear() screen = thelpers.screen_setup(0, '["'..nvim_prog ..'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile noshowcmd noruler"]') - feed_data(":autocmd FocusGained * echo 'gained'\n") - feed_data(":autocmd FocusLost * echo 'lost'\n") - feed_data("\034\016") -- CTRL-\ CTRL-N - end) - - it('in normal-mode', function() - retry(2, 3 * screen.timeout, function() - feed_data('\027[I') - screen:expect([[ + screen:expect{grid=[[ {1: } | {4:~ }| {4:~ }| {4:~ }| {5:[No Name] }| - gained | + | {3:-- TERMINAL --} | - ]]) + ]]} + feed_data(":autocmd FocusGained * echo 'gained'\n") + feed_data(":autocmd FocusLost * echo 'lost'\n") + feed_data("\034\016") -- CTRL-\ CTRL-N + end) - feed_data('\027[O') - screen:expect([[ + it('in normal-mode', function() + screen:expect{grid=[[ {1: } | {4:~ }| {4:~ }| {4:~ }| {5:[No Name] }| - lost | + :autocmd FocusLost * echo 'lost' | {3:-- TERMINAL --} | - ]]) + ]]} + retry(2, 3 * screen.timeout, function() + feed_data('\027[I') + screen:expect([[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + gained | + {3:-- TERMINAL --} | + ]]) + + feed_data('\027[O') + screen:expect([[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + lost | + {3:-- TERMINAL --} | + ]]) end) end) it('in insert-mode', function() feed_command('set noshowmode') feed_data('i') - retry(2, 3 * screen.timeout, function() - feed_data('\027[I') - screen:expect([[ - {1: } | - {4:~ }| - {4:~ }| - {4:~ }| - {5:[No Name] }| - gained | - {3:-- TERMINAL --} | - ]]) - feed_data('\027[O') - screen:expect([[ + screen:expect{grid=[[ {1: } | {4:~ }| {4:~ }| {4:~ }| {5:[No Name] }| - lost | + :set noshowmode | {3:-- TERMINAL --} | - ]]) + ]]} + retry(2, 3 * screen.timeout, function() + feed_data('\027[I') + screen:expect([[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + gained | + {3:-- TERMINAL --} | + ]]) + feed_data('\027[O') + screen:expect([[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + lost | + {3:-- TERMINAL --} | + ]]) end) end) @@ -1592,6 +1681,15 @@ describe('TUI FocusGained/FocusLost', function() feed_data(":autocmd!\n") feed_data(":autocmd FocusLost * call append(line('$'), 'lost')\n") feed_data(":autocmd FocusGained * call append(line('$'), 'gained')\n") + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + | + {3:-- TERMINAL --} | + ]]} retry(2, 3 * screen.timeout, function() -- Enter cmdline-mode. feed_data(':') @@ -1650,9 +1748,18 @@ describe('TUI FocusGained/FocusLost', function() feed_data(":echom 'msg1'|echom 'msg2'|echom 'msg3'|echom 'msg4'|echom 'msg5'\n") -- Execute :messages to provoke the press-enter prompt. feed_data(":messages\n") + screen:expect{grid=[[ + msg1 | + msg2 | + msg3 | + msg4 | + msg5 | + {10:Press ENTER or type command to continue}{1: } | + {3:-- TERMINAL --} | + ]]} feed_data('\027[I') feed_data('\027[I') - screen:expect([[ + screen:expect{grid=[[ msg1 | msg2 | msg3 | @@ -1660,7 +1767,7 @@ describe('TUI FocusGained/FocusLost', function() msg5 | {10:Press ENTER or type command to continue}{1: } | {3:-- TERMINAL --} | - ]]) + ]], unchanged=true} end) end) @@ -2028,7 +2135,7 @@ describe("TUI", function() retry(nil, 3000, function() -- Wait for log file to be flushed. local log = read_file('Xtest_tui_verbose_log') or '' - eq('--- Terminal info --- {{{\n', string.match(log, '%-%-%- Terminal.-\n')) + eq('--- Terminal info --- {{{\n', string.match(log, '%-%-%- Terminal.-\n')) -- }}} ok(#log > 50) end) end) @@ -2152,3 +2259,165 @@ describe('TUI bg color', function() screen:expect{any='new_bg=dark'} end) end) + +-- These tests require `thelpers` because --headless/--embed +-- does not initialize the TUI. +describe("TUI as a client", function() + + it("connects to remote instance (with its own TUI)", function() + local server_super = spawn_argv(false) -- equivalent to clear() + local client_super = spawn_argv(true) + + set_session(server_super) + local server_pipe = new_pipename() + local screen_server = thelpers.screen_setup(0, + string.format([=[["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "%s laststatus=2 background=dark"]]=], + nvim_prog, server_pipe, nvim_set)) + + feed_data("iHello, World") + screen_server:expect{grid=[[ + Hello, World{1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]} + feed_data("\027") + screen_server:expect{grid=[[ + Hello, Worl{1:d} | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + | + {3:-- TERMINAL --} | + ]]} + + set_session(client_super) + local screen_client = thelpers.screen_setup(0, + string.format([=[["%s", "-u", "NONE", "-i", "NONE", "--server", "%s", "--remote-ui"]]=], + nvim_prog, server_pipe)) + + screen_client:expect{grid=[[ + Hello, Worl{1:d} | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + | + {3:-- TERMINAL --} | + ]]} + + feed_data(":q!\n") + + server_super:close() + client_super:close() + end) + + it("connects to remote instance (--headless)", function() + local server = helpers.spawn_argv(false) -- equivalent to clear() + local client_super = spawn_argv(true) + + set_session(server) + local server_pipe = eval'v:servername' + feed'iHalloj!<esc>' + + set_session(client_super) + local screen = thelpers.screen_setup(0, + string.format([=[["%s", "-u", "NONE", "-i", "NONE", "--server", "%s", "--remote-ui"]]=], + nvim_prog, server_pipe)) + + screen:expect{grid=[[ + Halloj{1:!} | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + | + {3:-- TERMINAL --} | + ]]} + + client_super:close() + server:close() + end) + + + it("throws error when no server exists", function() + clear() + local screen = thelpers.screen_setup(0, + string.format([=[["%s", "-u", "NONE", "-i", "NONE", "--server", "127.0.0.1:2436546", "--remote-ui"]]=], + nvim_prog)) + + screen:try_resize(60, 7) + + screen:expect([[ + Remote ui failed to start: {MATCH:.*}| + | + [Process exited 1]{1: } | + | + | + | + {3:-- TERMINAL --} | + ]]) + end) + + it("exits when server quits", function() + local server_super = spawn_argv(false) -- equivalent to clear() + local client_super = spawn_argv(true) + + set_session(server_super) + local server_pipe = new_pipename() + local screen_server = thelpers.screen_setup(0, + string.format([=[["%s", "--listen", "%s", "-u", "NONE", "-i", "NONE", "--cmd", "%s laststatus=2 background=dark"]]=], + nvim_prog, server_pipe, nvim_set)) + + feed_data("iHello, World") + screen_server:expect{grid=[[ + Hello, World{1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + {3:-- INSERT --} | + {3:-- TERMINAL --} | + ]]} + feed_data("\027") + screen_server:expect{grid=[[ + Hello, Worl{1:d} | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + | + {3:-- TERMINAL --} | + ]]} + + set_session(client_super) + local screen_client = thelpers.screen_setup(0, + string.format([=[["%s", "-u", "NONE", "-i", "NONE", "--server", "%s", "--remote-ui"]]=], + nvim_prog, server_pipe)) + + screen_client:expect{grid=[[ + Hello, Worl{1:d} | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] [+] }| + | + {3:-- TERMINAL --} | + ]]} + + -- quitting the server + set_session(server_super) + feed_data(":q!\n") + screen_server:expect({any="Process exited 0"}) + + -- assert that client has exited + screen_client:expect({any="Process exited 0"}) + + server_super:close() + client_super:close() + end) +end) diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 79927273a6..3b9cce0e6f 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -1550,7 +1550,8 @@ function Screen:_get_attr_id(attr_state, attrs, hl_id) attr_state.modified = true return id end - return "UNEXPECTED "..self:_pprint_attrs(self._attr_table[hl_id][1]) + local kind = self._options.rgb and 1 or 2 + return "UNEXPECTED "..self:_pprint_attrs(self._attr_table[hl_id][kind]) else if self:_equal_attrs(attrs, {}) then -- ignore this attrs diff --git a/test/unit/tui_spec.lua b/test/unit/tui_spec.lua index 36ce4a1493..15b019edd1 100644 --- a/test/unit/tui_spec.lua +++ b/test/unit/tui_spec.lua @@ -33,7 +33,7 @@ itp('handle_background_color', function() term_input.waiting_for_bg_response = 1 eq(kComplete, handle_background_color(term_input)) eq(0, term_input.waiting_for_bg_response) - eq(1, multiqueue.multiqueue_size(events)) + eq(0, multiqueue.multiqueue_size(events)) local event = multiqueue.multiqueue_get(events) local bg_event = ffi.cast("Event*", event.argv[1]) |