aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt29
-rw-r--r--Makefile8
-rw-r--r--runtime/doc/autocmd.txt3
-rw-r--r--runtime/doc/cmdline.txt27
-rw-r--r--runtime/doc/editing.txt29
-rw-r--r--runtime/doc/eval.txt9
-rw-r--r--runtime/doc/filetype.txt2
-rw-r--r--runtime/doc/gui.txt2
-rw-r--r--runtime/doc/intro.txt15
-rw-r--r--runtime/doc/manpages/vim.113
-rw-r--r--runtime/doc/options.txt75
-rw-r--r--runtime/doc/os_unix.txt8
-rw-r--r--runtime/doc/print.txt23
-rw-r--r--runtime/doc/quickfix.txt51
-rw-r--r--runtime/doc/quickref.txt3
-rw-r--r--runtime/doc/recover.txt8
-rw-r--r--runtime/doc/spell.txt3
-rw-r--r--runtime/doc/starting.txt139
-rw-r--r--runtime/doc/term.txt29
-rw-r--r--runtime/doc/todo.txt42
-rw-r--r--runtime/doc/usr_01.txt11
-rw-r--r--runtime/doc/usr_05.txt10
-rw-r--r--runtime/doc/various.txt1
-rw-r--r--runtime/doc/vi_diff.txt31
-rw-r--r--runtime/evim.vim6
-rw-r--r--runtime/filetype.vim6
-rw-r--r--runtime/ftplugin/ada.vim6
-rw-r--r--runtime/ftplugin/c.vim7
-rw-r--r--runtime/ftplugin/zimbu.vim2
-rw-r--r--runtime/gvimrc_example.vim12
-rw-r--r--runtime/menu.vim30
-rw-r--r--runtime/print/dec-mcs.ps40
-rw-r--r--runtime/scripts.vim5
-rw-r--r--runtime/syntax/dcl.vim3
-rw-r--r--runtime/vimrc_example.vim28
-rw-r--r--src/nvim/buffer.c32
-rw-r--r--src/nvim/eval.c20
-rw-r--r--src/nvim/ex_cmds.c10
-rw-r--r--src/nvim/ex_cmds2.c76
-rw-r--r--src/nvim/ex_docmd.c18
-rw-r--r--src/nvim/ex_getln.c4
-rw-r--r--src/nvim/fileio.c32
-rw-r--r--src/nvim/hardcopy.c24
-rw-r--r--src/nvim/indent.c4
-rw-r--r--src/nvim/indent_c.c302
-rw-r--r--src/nvim/keymap.c3
-rw-r--r--src/nvim/macros.h8
-rw-r--r--src/nvim/main.c15
-rw-r--r--src/nvim/mbyte.c37
-rw-r--r--src/nvim/normal.c2
-rw-r--r--src/nvim/ops.c6
-rw-r--r--src/nvim/option.c23
-rw-r--r--src/nvim/option_defs.h4
-rw-r--r--src/nvim/os_unix.c9
-rw-r--r--src/nvim/path.c4
-rw-r--r--src/nvim/path.h1
-rw-r--r--src/nvim/regexp.c2
-rw-r--r--src/nvim/regexp_defs.h2
-rw-r--r--src/nvim/syntax.c35
-rw-r--r--src/nvim/tempfile.c2
-rw-r--r--src/nvim/term.c2
-rw-r--r--src/nvim/testdir/Makefile2
-rw-r--r--src/nvim/testdir/test100.in2
-rw-r--r--src/nvim/testdir/test12.in1
-rw-r--r--src/nvim/testdir/test15.in1
-rw-r--r--src/nvim/testdir/test17.in4
-rw-r--r--src/nvim/testdir/test24.inbin1301 -> 1265 bytes
-rw-r--r--src/nvim/testdir/test29.in1
-rw-r--r--src/nvim/testdir/test3.in64
-rw-r--r--src/nvim/testdir/test3.ok50
-rw-r--r--src/nvim/testdir/test30.in7
-rw-r--r--src/nvim/testdir/test32.in2
-rw-r--r--src/nvim/testdir/test44.in2
-rw-r--r--src/nvim/testdir/test49.in2
-rw-r--r--src/nvim/testdir/test61.in1
-rw-r--r--src/nvim/testdir/test70.in1
-rw-r--r--src/nvim/testdir/test72.in2
-rw-r--r--src/nvim/testdir/test73.in1
-rw-r--r--src/nvim/testdir/test74.in2
-rw-r--r--src/nvim/testdir/test78.in2
-rw-r--r--src/nvim/testdir/test8.in2
-rw-r--r--src/nvim/testdir/test85.in1
-rw-r--r--src/nvim/testdir/test89.in2
-rw-r--r--src/nvim/testdir/test91.in1
-rw-r--r--src/nvim/testdir/test91.ok4
-rw-r--r--src/nvim/testdir/test94.in1
-rw-r--r--src/nvim/testdir/test95.in2
-rw-r--r--src/nvim/testdir/test99.in2
-rw-r--r--src/nvim/testdir/test_breakindent.in2
-rw-r--r--src/nvim/undo.c2
-rw-r--r--src/nvim/version.c26
-rw-r--r--src/nvim/window.c1
-rw-r--r--test/functional/legacy/027_expand_file_names_spec.lua1
-rw-r--r--test/functional/legacy/043_magic_settings_spec.lua1
-rw-r--r--third-party/CMakeLists.txt15
95 files changed, 722 insertions, 881 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20d653a082..42eb50ac43 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,12 +5,8 @@ project(NEOVIM)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Prefer our bundled versions of dependencies.
-set(DEPS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.deps")
-set(DEPS_BUILD_DIR "${DEPS_DIR}/build")
-set(DEPS_INSTALL_DIR "${DEPS_DIR}/usr")
-set(DEPS_BIN_DIR "${DEPS_INSTALL_DIR}/bin")
-
-list(APPEND CMAKE_PREFIX_PATH ${DEPS_INSTALL_DIR})
+set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
+list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# CMake tries to treat /sw and /opt/local as extension of the system path, but
@@ -74,6 +70,17 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
# does not work with Neovim due to some uses of dynamically-sized structures.
# See https://github.com/neovim/neovim/issues/223 for details.
include(CheckCSourceCompiles)
+
+# Include the build type's default flags in the check for _FORTIFY_SOURCE,
+# otherwise we may incorrectly identify the level as acceptable and find out
+# later that it was not when optimizations were enabled. CFLAGS is applied
+# even though you don't see it in CMAKE_REQUIRED_FLAGS.
+set(INIT_FLAGS_NAME CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE})
+string(TOUPPER ${INIT_FLAGS_NAME} INIT_FLAGS_NAME)
+if(${INIT_FLAGS_NAME})
+ set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}")
+endif()
+
check_c_source_compiles("
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
#error \"_FORTIFY_SOURCE > 1\"
@@ -86,10 +93,16 @@ main(void)
" _FORTIFY_SOURCE_ACCEPTABLE)
if(NOT _FORTIFY_SOURCE_ACCEPTABLE)
+ # Extract possible prefix to _FORTIFY_SOURCE (e.g. -Wp,-D_FORTIFY_SOURCE).
+ STRING(REGEX MATCH "[^\ ]+-D_FORTIFY_SOURCE" _FORTIFY_SOURCE_PREFIX "${CMAKE_C_FLAGS}")
+ STRING(REPLACE "-D_FORTIFY_SOURCE" "" _FORTIFY_SOURCE_PREFIX "${_FORTIFY_SOURCE_PREFIX}" )
+ if (NOT _FORTIFY_SOURCE_PREFIX STREQUAL "")
+ message(STATUS "Detected _FORTIFY_SOURCE Prefix=${_FORTIFY_SOURCE_PREFIX}")
+ endif()
# -U in add_definitions doesn't end up in the correct spot, so we add it to
# the flags variable instead.
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_FORTIFY_SOURCE_PREFIX}-U_FORTIFY_SOURCE ${_FORTIFY_SOURCE_PREFIX}-D_FORTIFY_SOURCE=1")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_FORTIFY_SOURCE_PREFIX}-U_FORTIFY_SOURCE ${_FORTIFY_SOURCE_PREFIX}-D_FORTIFY_SOURCE=1")
endif()
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
diff --git a/Makefile b/Makefile
index c675965048..7a37e9ba4b 100644
--- a/Makefile
+++ b/Makefile
@@ -64,15 +64,15 @@ build/.ran-cmake: | deps
deps: | build/.ran-third-party-cmake
ifeq ($(call filter-true,$(USE_BUNDLED_DEPS)),)
- +$(BUILD_CMD) -C .deps/build/third-party
+ +$(BUILD_CMD) -C .deps
endif
build/.ran-third-party-cmake:
ifeq ($(call filter-true,$(USE_BUNDLED_DEPS)),)
- mkdir -p .deps/build/third-party
- cd .deps/build/third-party && \
+ mkdir -p .deps
+ cd .deps && \
cmake -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) \
- $(DEPS_CMAKE_FLAGS) ../../../third-party
+ $(DEPS_CMAKE_FLAGS) ../third-party
endif
mkdir -p build
touch $@
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 9f8e0acccd..cf7f183e54 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -528,8 +528,7 @@ CursorHold When the user doesn't press a key for the time
Hint: to force an update of the status lines
use: >
:let &ro = &ro
-< {only on Amiga, Unix, Win32, MSDOS and all GUI
- versions}
+
*CursorHoldI*
CursorHoldI Just like CursorHold, but in Insert mode.
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index 77813423ba..9f925d6e58 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -407,8 +407,7 @@ CTRL-N After using 'wildchar' which got multiple matches, go to next
<S-Tab> *c_CTRL-P* *c_<S-Tab>*
CTRL-P After using 'wildchar' which got multiple matches, go to
previous match. Otherwise recall older command-line from
- history. <S-Tab> only works with the GUI, on the Amiga and
- with MS-DOS.
+ history. <S-Tab> only works with the GUI and with MS-DOS.
*c_CTRL-A*
CTRL-A All names that match the pattern in front of the cursor are
inserted.
@@ -587,10 +586,9 @@ When the character '%' or '#' is used where a file name is expected, they are
expanded to the current and alternate file name (see the chapter "editing
files" |:_%| |:_#|).
-Embedded spaces in file names are allowed on the Amiga if one file name is
-expected as argument. Trailing spaces will be ignored, unless escaped with a
-backslash or CTRL-V. Note that the ":next" command uses spaces to separate
-file names. Escape the spaces to include them in a file name. Example: >
+Trailing spaces in filenames will be ignored, unless escaped with a backslash
+or CTRL-V. Note that the ":next" command uses spaces to separate file names.
+Escape the spaces to include them in a file name. Example: >
:next foo\ bar goes\ to school\
starts editing the three files "foo bar", "goes to" and "school ".
@@ -832,12 +830,11 @@ These are not available when Vim has been compiled without the |+modify_fname|
feature.
These modifiers can be given, in this order:
:p Make file name a full path. Must be the first modifier. Also
- changes "~/" (and "~user/" for Unix and VMS) to the path for
- the home directory. If the name is a directory a path
- separator is added at the end. For a file name that does not
- exist and does not have an absolute path the result is
- unpredictable. On MS-Windows an 8.3 filename is expanded to
- the long name.
+ changes "~/" (and "~user/" for Unix) to the path for the home
+ directory. If the name is a directory a path separator is
+ added at the end. For a file name that does not exist and
+ does not have an absolute path the result is unpredictable.
+ On MS-Windows an 8.3 filename is expanded to the long name.
:8 Converts the path to 8.3 short format (currently only on
MS-Windows). Will act on as much of a path that is an
existing path.
@@ -855,9 +852,9 @@ These modifiers can be given, in this order:
separator is removed. Thus ":p:h" on a directory name results
on the directory name itself (without trailing slash).
When the file name is an absolute path (starts with "/" for
- Unix; "x:\" for MS-DOS, WIN32; "drive:" for Amiga), that
- part is not removed. When there is no head (path is relative
- to current directory) the result is empty.
+ Unix; "x:\" for MS-DOS and WIN32), that part is not removed.
+ When there is no head (path is relative to current directory)
+ the result is empty.
:t Tail of the file name (last component of the name). Must
precede any :r or :e.
:r Root of the file name (the last extension removed). When
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 3496a03921..f2daa9ec24 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -359,10 +359,10 @@ expected are mentioned at |cmdline-special|.
Note for systems other than Unix: When using a command that accepts a single
file name (like ":edit file") spaces in the file name are allowed, but
trailing spaces are ignored. This is useful on systems that regularly embed
-spaces in file names (like MS-Windows and the Amiga). Example: The command
-":e Long File Name " will edit the file "Long File Name". When using a
-command that accepts more than one file name (like ":next file1 file2")
-embedded spaces must be escaped with a backslash.
+spaces in file names (like MS-Windows). Example: The command ":e Long File
+Name " will edit the file "Long File Name". When using a command that accepts
+more than one file name (like ":next file1 file2") embedded spaces must be
+escaped with a backslash.
*wildcard* *wildcards*
Wildcards in {file} are expanded, but as with file completion, 'wildignore'
@@ -510,10 +510,10 @@ characters will be replaced with <CR><NL> (assuming 'fileformats' includes
If you start editing a new file and the 'fileformats' option is not empty
(which is the default), Vim will try to detect whether the lines in the file
are separated by the specified formats. When set to "unix,dos", Vim will
-check for lines with a single <NL> (as used on Unix and Amiga) or by a <CR>
-<NL> pair (MS-DOS). Only when ALL lines end in <CR><NL>, 'fileformat' is set
-to "dos", otherwise it is set to "unix". When 'fileformats' includes "mac",
-and no <NL> characters are found in the file, 'fileformat' is set to "mac".
+check for lines with a single <NL> (as used on Unix) or by a <CR><NL> pair
+(MS-DOS). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos",
+otherwise it is set to "unix". When 'fileformats' includes "mac", and no <NL>
+characters are found in the file, 'fileformat' is set to "mac".
If the 'fileformat' option is set to "dos" on non-MS-DOS systems the message
"[dos format]" is shown to remind you that something unusual is happening. On
@@ -1031,7 +1031,6 @@ and for MS-DOS or MS-Windows: >
For Unix a device is detected when the name doesn't refer to a normal file or
a directory. A fifo or named pipe also looks like a device to Vim.
For MS-DOS and MS-Windows the device is detected by its name:
- AUX
CON
CLOCK$
NUL
@@ -1063,8 +1062,7 @@ The names can be in upper- or lowercase.
buffers. Use ":qall!" to exit always.
:cq[uit] Quit always, without writing, and return an error
- code. See |:cq|. Used for Manx's QuickFix mode (see
- |quickfix|). {not in Vi}
+ code. See |:cq|. {not in Vi}
*:wq*
:wq [++opt] Write the current file and quit. Writing fails when
@@ -1316,11 +1314,10 @@ There are a few things to remember when editing binary files:
split in two.
- When there are not many <EOL>s, the lines will become very long. If you
want to edit a line that does not fit on the screen reset the 'wrap' option.
- Horizontal scrolling is used then. If a line becomes too long (more than
- about 32767 characters on the Amiga, much more on 32-bit systems, see
- |limits|) you cannot edit that line. The line will be split when reading
- the file. It is also possible that you get an "out of memory" error when
- reading the file.
+ Horizontal scrolling is used then. If a line becomes too long (see |limits|)
+ you cannot edit that line. The line will be split when reading the file.
+ It is also possible that you get an "out of memory" error when reading the
+ file.
- Make sure the 'binary' option is set BEFORE loading the
file. Otherwise both <CR> <NL> and <NL> are considered to end a line
and when the file is written the <NL> will be replaced with <CR> <NL>.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 46ee28a461..2699d4c1b2 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -3578,6 +3578,8 @@ gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()*
Get the value of a tab-local variable {varname} in tab page
{tabnr}. |t:var|
Tabs are numbered starting with one.
+ When {varname} is empty a dictionary with all tab-local
+ variables is returned.
Note that the name without "t:" must be used.
When the tab or variable doesn't exist {def} or an empty
string is returned, there is no error message.
@@ -6660,9 +6662,7 @@ There are four types of features:
acl Compiled with |ACL| support.
all_builtin_terms Compiled with all builtin terminals enabled.
-amiga Amiga version of Vim.
arabic Compiled with Arabic support |Arabic|.
-arp Compiled with ARP support (Amiga).
autocmd Compiled with autocommand support. |autocommand|
balloon_eval Compiled with |balloon-eval| support.
balloon_multiline GUI supports multiline balloons.
@@ -6701,8 +6701,8 @@ filterpipe When 'shelltemp' is off pipes are used for shell
find_in_path Compiled with support for include file searches
|+find_in_path|.
float Compiled with support for |Float|.
-fname_case Case in file names matters (for Amiga, MS-DOS, and
- Windows this is not present).
+fname_case Case in file names matters (for MS-DOS and Windows
+ this is not present).
folding Compiled with |folding| support.
footer Compiled with GUI footer support. |gui-footer|
fork Compiled to use fork()/exec() instead of system().
@@ -6801,7 +6801,6 @@ virtualedit Compiled with 'virtualedit' option.
visual Compiled with Visual mode.
visualextra Compiled with extra Visual mode commands.
|blockwise-operators|.
-vms VMS version of Vim.
vreplace Compiled with |gR| and |gr| commands.
wildignore Compiled with 'wildignore' option.
wildmenu Compiled with 'wildmenu' option.
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index 2894814025..6b89529bfe 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -33,11 +33,9 @@ compatible means options are global. Resetting 'compatible' is recommended,
if you didn't do that already.
Detail: The ":filetype on" command will load one of these files:
- Amiga $VIMRUNTIME/filetype.vim
Mac $VIMRUNTIME/filetype.vim
MS-DOS $VIMRUNTIME\filetype.vim
Unix $VIMRUNTIME/filetype.vim
- VMS $VIMRUNTIME/filetype.vim
This file is a Vim script that defines autocommands for the
BufNewFile and BufRead events. If the file type is not found by the
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index c174914c54..8166919a51 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -94,8 +94,6 @@ Recommended place for your personal GUI initializations:
Unix $HOME/.gvimrc or $HOME/.vim/gvimrc
MS-DOS and Win32 $HOME/_gvimrc, $HOME/vimfiles/gvimrc
or $VIM/_gvimrc
- Amiga s:.gvimrc, home:.gvimrc, home:vimfiles:gvimrc
- or $VIM/.gvimrc
The personal initialization files are searched in the order specified above
and only the first one that is found is read.
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index a03079c798..2b6c24cecf 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -466,9 +466,7 @@ notation meaning equivalent decimal value(s) ~
-----------------------------------------------------------------------
Note: The shifted cursor keys, the help key, and the undo key are only
-available on a few terminals. On the Amiga, shifted function key 10 produces
-a code (CSI) that is also used by key sequences. It will be recognized only
-after typing another key.
+available on a few terminals.
Note: There are two codes for the delete key. 127 is the decimal ASCII value
for the delete key, which is always recognized. Some delete keys send another
@@ -809,12 +807,11 @@ messages before you have a chance to read them}
Some commands show how many lines were affected. Above which threshold this
happens can be controlled with the 'report' option (default 2).
-On the Amiga Vim will run in a CLI window. The name Vim and the full name of
-the current file name will be shown in the title bar. When the window is
-resized, Vim will automatically redraw the window. You may make the window as
-small as you like, but if it gets too small not a single line will fit in it.
-Make it at least 40 characters wide to be able to read most messages on the
-last line.
+The name Vim and the full name of the current file name will be shown in the
+title bar. When the window is resized, Vim will automatically redraw the
+window. You may make the window as small as you like, but if it gets too
+small not a single line will fit in it. Make it at least 40 characters wide
+to be able to read most messages on the last line.
On most Unix systems, resizing the window is recognized and handled correctly
by Vim. {Vi: not ok}
diff --git a/runtime/doc/manpages/vim.1 b/runtime/doc/manpages/vim.1
index 59f21e1b9b..aaf05b59be 100644
--- a/runtime/doc/manpages/vim.1
+++ b/runtime/doc/manpages/vim.1
@@ -90,8 +90,7 @@ See ":help tag\-commands".
Start in quickFix mode.
The file [errorfile] is read and the first error is displayed.
If [errorfile] is omitted, the filename is obtained from the 'errorfile'
-option (defaults to "AztecC.Err" for the Amiga, "errors.err" on other
-systems).
+option (defaults to "errors.err").
Further errors can be jumped to with the ":cn" command.
See ":help quickfix".
.PP
@@ -192,12 +191,6 @@ There should be two, three or four file name arguments.
will open all the files and show differences between them.
Works like vimdiff(1).
.TP
-\-d {device}
-Open {device} for use as a terminal.
-Only on the Amiga.
-Example:
-"\-d con:20/30/600/150".
-.TP
\-D
Debugging. Go to debugging mode when executing the first command from a
script.
@@ -216,14 +209,10 @@ in improved Ex mode, just like the executable was called "exim".
Foreground. For the GUI version,
.B Vim
will not fork and detach from the shell it was started in.
-On the Amiga,
-.B Vim
-is not restarted to open a new window.
This option should be used when
.B Vim
is executed by a program that will wait for the edit
session to finish (e.g. mail).
-On the Amiga the ":sh" and ":!" commands will not work.
.TP
\-\-nofork
Foreground. For the GUI version,
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index c646caae4f..39f83ac75d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -986,8 +986,7 @@ A jump table for the options with a short description can be found at |Q_op|.
again not rename the file.
*'backupdir'* *'bdir'*
-'backupdir' 'bdir' string (default for Amiga: ".,t:",
- for MS-DOS and Win32: ".,$TEMP,c:/tmp,c:/temp"
+'backupdir' 'bdir' string (default for MS-DOS and Win32: ".,$TEMP,c:/tmp,c:/temp",
for Unix: ".,~/tmp,~/")
global
{not in Vi}
@@ -1026,7 +1025,7 @@ A jump table for the options with a short description can be found at |Q_op|.
security reasons.
*'backupext'* *'bex'* *E589*
-'backupext' 'bex' string (default "~", for VMS: "_")
+'backupext' 'bex' string (default "~")
global
{not in Vi}
String which is appended to a file name to make the name of the
@@ -2455,8 +2454,7 @@ A jump table for the options with a short description can be found at |Q_op|.
NOTE: This option is reset when 'compatible' is set.
*'directory'* *'dir'*
-'directory' 'dir' string (default for Amiga: ".,t:",
- for MS-DOS and Win32: ".,$TEMP,c:\tmp,c:\temp"
+'directory' 'dir' string (default for MS-DOS and Win32: ".,$TEMP,c:\tmp,c:\temp",
for Unix: ".,~/tmp,/var/tmp,/tmp")
global
List of directory names for the swap file, separated with commas.
@@ -2655,8 +2653,7 @@ A jump table for the options with a short description can be found at |Q_op|.
screen flash or do nothing.
*'errorfile'* *'ef'*
-'errorfile' 'ef' string (Amiga default: "AztecC.Err",
- others: "errors.err")
+'errorfile' 'ef' string (default: "errors.err")
global
{not in Vi}
{not available when compiled without the |+quickfix|
@@ -3313,8 +3310,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'grepprg'* *'gp'*
'grepprg' 'gp' string (default "grep -n ",
Unix: "grep -n $* /dev/null",
- Win32: "findstr /n" or "grep -n",
- VMS: "SEARCH/NUMBERS ")
+ Win32: "findstr /n" or "grep -n")
global or local to buffer |global-local|
{not in Vi}
Program to use for the |:grep| command. This option may contain '%'
@@ -4263,8 +4259,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'isfname'* *'isf'*
'isfname' 'isf' string (default for MS-DOS and Win32:
"@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,="
- for AMIGA: "@,48-57,/,.,-,_,+,,,$,:"
- for VMS: "@,48-57,/,.,-,_,+,,,#,$,%,<,>,[,],:,;,~"
otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=")
global
{not in Vi}
@@ -4418,8 +4412,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The 'keymodel' option is set by the |:behave| command.
*'keywordprg'* *'kp'*
-'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help",
- VMS: "help")
+'keywordprg' 'kp' string (default "man" or "man -s", DOS: ":help")
global or local to buffer |global-local|
{not in Vi}
Program to use for the |K| command. Environment variables are
@@ -4713,12 +4706,12 @@ A jump table for the options with a short description can be found at |Q_op|.
security reasons.
*'makeprg'* *'mp'*
-'makeprg' 'mp' string (default "make", VMS: "MMS")
+'makeprg' 'mp' string (default "make")
global or local to buffer |global-local|
{not in Vi}
Program to use for the ":make" command. See |:make_makeprg|.
- This option may contain '%' and '#' characters (see |:_%| and |:_#|),
- which are expanded to the current and alternate file name. Use |::S|
+ This option may contain '%' and '#' characters (see |:_%| and |:_#|),
+ which are expanded to the current and alternate file name. Use |::S|
to escape file names in case they contain special characters.
Environment variables are expanded |:set_env|. See |option-backslash|
about including spaces and backslashes.
@@ -5679,19 +5672,9 @@ A jump table for the options with a short description can be found at |Q_op|.
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/.vim/after"
- Amiga: "home:vimfiles,
- $VIM/vimfiles,
- $VIMRUNTIME,
- $VIM/vimfiles/after,
- home:vimfiles/after"
Macintosh: "$VIM:vimfiles,
$VIMRUNTIME,
$VIM:vimfiles:after"
- VMS: "sys$login:vimfiles,
- $VIM/vimfiles,
- $VIMRUNTIME,
- $VIM/vimfiles/after,
- sys$login:vimfiles/after")
global
{not in Vi}
This is a list of directories which will be searched for runtime
@@ -5995,8 +5978,8 @@ A jump table for the options with a short description can be found at |Q_op|.
The name of the temporary file can be represented by "%s" if necessary
(the file name is appended automatically if no %s appears in the value
of this option).
- For the Amiga and MS-DOS the default is ">". The output is directly
- saved in a file and not echoed to the screen.
+ For MS-DOS the default is ">". The output is directly saved in a file
+ and not echoed to the screen.
For Unix the default it "| tee". The stdout of the compiler is saved
in a file and echoed to the screen. If the 'shell' option is "csh" or
"tcsh" after initializations, the default becomes "|& tee". If the
@@ -7057,11 +7040,9 @@ A jump table for the options with a short description can be found at |Q_op|.
*'term'* *E529* *E530* *E531*
'term' string (default is $TERM, if that fails:
in the GUI: "builtin_gui"
- on Amiga: "amiga"
on Mac: "mac-ansi"
on MS-DOS: "pcterm"
on Unix: "ansi"
- on VMS: "ansi"
on Win 32: "win32")
global
Name of the terminal. Used for choosing the terminal control
@@ -7244,9 +7225,9 @@ A jump table for the options with a short description can be found at |Q_op|.
(path) is the path of the file being edited
- VIM the server name |v:servername| or "VIM"
Only works if the terminal supports setting window titles
- (currently Amiga console, Win32 console, all GUI versions and
- terminals with a non- empty 't_ts' option - this is Unix xterm
- by default, where 't_ts' is taken from the builtin termcap).
+ (currently Win32 console, all GUI versions and terminals with a non-
+ empty 't_ts' option - this is Unix xterm by default, where 't_ts' is
+ taken from the builtin termcap).
*X11*
When Vim was compiled with HAVE_X11 defined, the original title will
be restored if possible. The output of ":version" will include "+X11"
@@ -7298,8 +7279,8 @@ A jump table for the options with a short description can be found at |Q_op|.
When this option is not empty, it will be used for the title of the
window. This happens only when the 'title' option is on.
Only works if the terminal supports setting window titles (currently
- Amiga console, Win32 console, all GUI versions and terminals with a
- non-empty 't_ts' option).
+ Win32 console, all GUI versions and terminals with a non-empty 't_ts'
+ option).
When Vim was compiled with HAVE_X11 defined, the original title will
be restored if possible |X11|.
When this option contains printf-style '%' items, they will be
@@ -7391,7 +7372,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'ttymouse' 'ttym' string (default depends on 'term')
global
{not in Vi}
- {only in Unix and VMS, doesn't work in the GUI; not
+ {only in Unix, doesn't work in the GUI; not
available when compiled without |+mouse|}
Name of the terminal type for which mouse codes are to be recognized.
Currently these strings are valid:
@@ -7498,8 +7479,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When 'undofile' is turned off the undo file is NOT deleted.
*'undolevels'* *'ul'*
-'undolevels' 'ul' number (default 100, 1000 for Unix, VMS,
- and Win32)
+'undolevels' 'ul' number (default 100, 1000 for Unix and Win32)
global or local to buffer |global-local|
{not in Vi}
Maximum number of changes that can be undone. Since undo information
@@ -7594,11 +7574,8 @@ A jump table for the options with a short description can be found at |Q_op|.
displayed when 'verbosefile' is set.
*'viewdir'* *'vdir'*
-'viewdir' 'vdir' string (default for Amiga, MS-DOS, and Win32:
- "$VIM/vimfiles/view",
- for Unix: "~/.vim/view",
- for Macintosh: "$VIM:vimfiles:view"
- for VMS: "sys$login:vimfiles/view")
+'viewdir' 'vdir' string (default for MS-DOS and Win32: "$VIM/vimfiles/view",
+ for Unix: "~/.vim/view")
global
{not in Vi}
{not available when compiled without the |+mksession|
@@ -7633,7 +7610,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'viminfo'* *'vi'* *E526* *E527* *E528*
'viminfo' 'vi' string (Vi default: "", Vim default for MS-DOS,
Windows: '100,<50,s10,h,rA:,rB:,
- for Amiga: '100,<50,s10,h,rdf0:,rdf1:,rdf2:
for others: '100,<50,s10,h)
global
{not in Vi}
@@ -7715,10 +7691,9 @@ A jump table for the options with a short description can be found at |Q_op|.
','). This parameter can be given several times. Each
specifies the start of a path for which no marks will be
stored. This is to avoid removable media. For MS-DOS you
- could use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:". You can
- also use it for temp files, e.g., for Unix: "r/tmp". Case is
- ignored. Maximum length of each 'r' argument is 50
- characters.
+ could use "ra:,rb:". You can also use it for temp files,
+ e.g., for Unix: "r/tmp". Case is ignored. Maximum length of
+ each 'r' argument is 50 characters.
*viminfo-s*
s Maximum size of an item in Kbyte. If zero then registers are
not saved. Currently only applies to registers. The default
@@ -7786,9 +7761,7 @@ A jump table for the options with a short description can be found at |Q_op|.
might want to set it again in your |gvimrc|.
In the GUI, 't_vb' defaults to "<Esc>|f", which inverts the display
for 20 msec. If you want to use a different time, use "<Esc>|40f",
- where 40 is the time in msec.
- Does not work on the Amiga, you always get a screen flash.
- Also see 'errorbells'.
+ where 40 is the time in msec. Also see 'errorbells'.
*'warn'* *'nowarn'*
'warn' boolean (default on)
diff --git a/runtime/doc/os_unix.txt b/runtime/doc/os_unix.txt
index 6273597d27..49f19c6661 100644
--- a/runtime/doc/os_unix.txt
+++ b/runtime/doc/os_unix.txt
@@ -9,10 +9,10 @@ This file contains the particularities for the Unix version of Vim.
For compiling Vim on Unix see "INSTALL" and "Makefile" in the src directory.
-The default help file name is "/usr/local/lib/vim/help.txt"
-The files "$HOME/.vimrc" and "$HOME/.exrc" are used instead of "s:.vimrc" and
-"s:.exrc". Additionally "/usr/local/etc/vimrc" is used first.
-If "/usr/local/share" exists it is used instead of "/usr/local/lib".
+The default help file name is "/usr/local/lib/vim/help.txt" The files
+"$HOME/.vimrc" and "$HOME/.exrc" are used for configuration. Additionally
+"/usr/local/etc/vimrc" is used first. If "/usr/local/share" exists it is used
+instead of "/usr/local/lib".
Temporary files (for filtering) are put in "/tmp". If you want to place them
somewhere else, set the environment variable $TMPDIR to the directory you
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
index 0ffc661c95..9d07819a1e 100644
--- a/runtime/doc/print.txt
+++ b/runtime/doc/print.txt
@@ -95,7 +95,6 @@ If the option is empty, then vim will use the system default printer for
'printencoding' 'penc' String (default empty, except for:
Windows: cp1252,
Macintosh: mac-roman,
- VMS: dec-mcs,
HPUX: hp-roman8)
global
Sets the character encoding used when printing. This option tells VIM which
@@ -120,9 +119,9 @@ other than latin1 will require VIM to be compiled with the |+iconv| feature.
If no conversion is possible then printing will fail. Any characters that
cannot be converted will be replaced with upside down question marks.
-Three print character encoding files are provided to support default Mac, VMS,
-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.
+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)
@@ -134,8 +133,8 @@ 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 or VMS systems is to simply use "lpr" to print
-the file: >
+The default for non MS-Windows systems is to simply use "lpr" to print the
+file: >
system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice)
. ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error
@@ -147,12 +146,6 @@ currently specified printdevice: >
? ' LPT1:' : (' \"' . &printdevice . '\"')))
. delete(v:fname_in)
-On VMS machines the default is to send the file to either the default or
-currently specified printdevice: >
-
- system('print' . (&printdevice == '' ? '' : ' /queue=' .
- &printdevice) . ' ' . v:fname_in) . 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: >
@@ -613,12 +606,6 @@ X11
http://www.cs.wisc.edu/~ghost/gv/
-OpenVMS
-
-- Is apparently supported in the main code now (untested). See:
-
- http://wwwthep.physik.uni-mainz.de/~plass/gv/
-
Windows
- GSview. Obtainable from:
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index 6b80482f6b..22a5e41fd1 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -35,12 +35,10 @@ positions in files. For example, |:vimgrep| finds pattern matches. You can
use the positions in a script with the |getqflist()| function. Thus you can
do a lot more than the edit/compile/fix cycle!
-If you are using Manx's Aztec C compiler on the Amiga look here for how to use
-it with Vim: |quickfix-manx|. If you are using another compiler you should
-save the error messages in a file and start Vim with "vim -q filename". An
-easy way to do this is with the |:make| command (see below). The
-'errorformat' option should be set to match the error messages from your
-compiler (see |errorformat| below).
+You should save your compiler's error messages to a file and start vim with
+"vim -q filename". An easy way to do this is with the |:make| command (see
+below). The 'errorformat' option should be set to match the error messages
+from your compiler (see |errorformat| below).
*location-list* *E776*
A location list is similar to a quickfix list and contains a list of positions
@@ -501,14 +499,14 @@ or simpler >
"$*" can be given multiple times, for example: >
:set makeprg=gcc\ -o\ $*\ $*
-The 'shellpipe' option defaults to ">" for the Amiga, MS-DOS and Win32. This
-means that the output of the compiler is saved in a file and not shown on the
-screen directly. For Unix "| tee" is used. The compiler output is shown on
-the screen and saved in a file the same time. Depending on the shell used
-"|& tee" or "2>&1| tee" is the default, so stderr output will be included.
+The 'shellpipe' option defaults to ">" for MS-DOS and Win32. This means that
+the output of the compiler is saved in a file and not shown on the screen
+directly. For Unix "| tee" is used. The compiler output is shown on the
+screen and saved in a file the same time. Depending on the shell used "|&
+tee" or "2>&1| tee" is the default, so stderr output will be included.
If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
-for compilers that write to an errorfile themselves (e.g., Manx's Amiga C).
+for compilers that write to an errorfile themselves.
Using QuickFixCmdPost to fix the encoding ~
@@ -792,31 +790,6 @@ g:compiler_gcc_ignore_unmatched_lines
positives.
-MANX AZTEC C *quickfix-manx* *compiler-manx*
-
-To use Vim with Manx's Aztec C compiler on the Amiga you should do the
-following:
-- Set the CCEDIT environment variable with the command: >
- mset "CCEDIT=vim -q"
-- Compile with the -qf option. If the compiler finds any errors, Vim is
- started and the cursor is positioned on the first error. The error message
- will be displayed on the last line. You can go to other errors with the
- commands mentioned above. You can fix the errors and write the file(s).
-- If you exit Vim normally the compiler will re-compile the same file. If you
- exit with the :cq command, the compiler will terminate. Do this if you
- cannot fix the error, or if another file needs to be compiled first.
-
-There are some restrictions to the Quickfix mode on the Amiga. The
-compiler only writes the first 25 errors to the errorfile (Manx's
-documentation does not say how to get more). If you want to find the others,
-you will have to fix a few errors and exit the editor. After recompiling,
-up to 25 remaining errors will be found.
-
-If Vim was started from the compiler, the :sh and some :! commands will not
-work, because Vim is then running in the same process as the compiler and
-stdin (standard input) will not be interactive.
-
-
PERL *quickfix-perl* *compiler-perl*
The Perl compiler plugin doesn't actually compile, but invokes Perl's internal
@@ -1171,9 +1144,7 @@ If the error format does not contain a file name Vim cannot switch to the
correct file. You will have to do this by hand.
-Examples
-
-The format of the file from the Amiga Aztec compiler is:
+For example, the format of the output from the Amiga Aztec compiler is:
filename>linenumber:columnnumber:errortype:errornumber:errormessage
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index d320e6cd24..bb3ec6e7fe 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1147,13 +1147,10 @@ Context-sensitive completion on the command-line:
|-n| -n do not create a swap file
|-o| -o [num] open [num] windows (default: one for each file)
|-f| -f GUI: foreground process, don't fork
- Amiga: do not restart Vim to open a window (for
- e.g., mail)
|-s| -s {scriptin} first read commands from the file {scriptin}
|-w| -w {scriptout} write typed chars to file {scriptout} (append)
|-W| -W {scriptout} write typed chars to file {scriptout} (overwrite)
|-T| -T {terminal} set terminal name
-|-d| -d {device} Amiga: open {device} to be used as a console
|-u| -u {vimrc} read inits from {vimrc} instead of other inits
|-U| -U {gvimrc} idem, for when starting the GUI
|-i| -i {viminfo} read info from {viminfo} instead of other files
diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt
index 570340cf0c..99a0837224 100644
--- a/runtime/doc/recover.txt
+++ b/runtime/doc/recover.txt
@@ -56,14 +56,9 @@ Disadvantages:
- When you use your home directory, and somebody else tries to edit the same
file, he will not see your swap file and will not get the ATTENTION warning
message.
-On the Amiga you can also use a recoverable ram disk, but there is no 100%
-guarantee that this works. Putting swap files in a normal ram disk (like RAM:
-on the Amiga) or in a place that is cleared when rebooting (like /tmp on Unix)
-makes no sense, you will lose the swap file in a crash.
If you want to put swap files in a fixed place, put a command resembling the
following ones in your .vimrc:
- :set dir=dh2:tmp (for Amiga)
:set dir=~/tmp (for Unix)
:set dir=c:\\tmp (for MS-DOS and Win32)
This is also very handy when editing files on floppy. Of course you will have
@@ -100,8 +95,7 @@ the time with the 'updatetime' option. The time is given in milliseconds.
After writing to the swap file Vim syncs the file to disk. This takes some
time, especially on busy Unix systems. If you don't want this you can set the
'swapsync' option to an empty string. The risk of losing work becomes bigger
-though. On some non-Unix systems (MS-DOS, Amiga) the swap file won't be
-written at all.
+though.
If the writing to the swap file is not wanted, it can be switched off by
setting the 'updatecount' option to 0. The same is done when starting Vim
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index 91322def5b..da447e3b78 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -340,9 +340,6 @@ A spell file might not be available in the current 'encoding'. See
|spell-mkspell| about how to create a spell file. Converting a spell file
with "iconv" will NOT work!
-Note: on VMS ".{enc}.spl" is changed to "_{enc}.spl" to avoid trouble with
-filenames.
-
*spell-sug-file* *E781*
If there is a file with exactly the same name as the ".spl" file but ending in
".sug", that file will be used for giving better suggestions. It isn't loaded
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index bceaea0d83..0c0b02e591 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -7,14 +7,13 @@
Starting Vim *starting*
1. Vim arguments |vim-arguments|
-2. Vim on the Amiga |starting-amiga|
-3. Running eVim |evim-keys|
-4. Initialization |initialization|
-5. $VIM and $VIMRUNTIME |$VIM|
-6. Suspending |suspend|
-7. Saving settings |save-settings|
-8. Views and Sessions |views-sessions|
-9. The viminfo file |viminfo-file|
+2. Running eVim |evim-keys|
+3. Initialization |initialization|
+4. $VIM and $VIMRUNTIME |$VIM|
+5. Suspending |suspend|
+6. Saving settings |save-settings|
+7. Views and Sessions |views-sessions|
+8. The viminfo file |viminfo-file|
==============================================================================
1. Vim arguments *vim-arguments*
@@ -122,9 +121,6 @@ The option arguments may be given in any order. Single-letter options can be
combined after one dash. There can be no option arguments after the "--"
argument.
-On VMS all option arguments are assumed to be lowercase, unless preceded with
-a slash. Thus "-R" means recovery and "-/R" readonly.
-
--help *-h* *--help*
-h Give usage (help) message and exit. {not in Vi}
See |info-message| about capturing the text.
@@ -416,15 +412,6 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
{not in Vi} {not available when compiled without the |+diff|
feature}
--d {device} Only on the Amiga and when not compiled with the |+diff|
- feature. Works like "-dev".
- *-dev*
--dev {device} Only on the Amiga: The {device} is opened to be used for
- editing.
- Normally you would use this to set the window position and
- size: "-d con:x/y/width/height", e.g.,
- "-d con:30/10/600/150". But you can also use it to start
- editing on another device, e.g., AUX:. {not in Vi}
*-f*
-f GUI: Do not disconnect from the program that started Vim.
'f' stands for "foreground". If omitted, the GUI forks a new
@@ -435,11 +422,6 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
Careful: You can use "-gf" to start the GUI in the foreground,
but "-fg" is used to specify the foreground color. |gui-fork|
- Amiga: Do not restart Vim to open a new window. This
- option should be used when Vim is started by a program that
- will wait for the edit session to finish (e.g., mail or
- readnews). See |amiga-window|.
-
MS-Windows: This option is not supported. However, when
running Vim with an installed vim.bat or gvim.bat file it
works.
@@ -488,8 +470,8 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
avoids a long startup time when running Vim in a terminal
emulator and the connection to the X server is slow.
See |--startuptime| to find out if affects you.
- Only makes a difference on Unix or VMS, when compiled with the
- |+X11| feature. Otherwise it's ignored.
+ Only makes a difference on Unix when compiled with the |+X11|
+ feature. Otherwise it's ignored.
To disable the connection only for specific terminals, see the
'clipboard' option.
When the X11 Session Management Protocol (XSMP) handler has
@@ -606,57 +588,7 @@ Additional arguments are available on unix like systems when compiled with
X11 GUI support. See |gui-resources|.
==============================================================================
-2. Vim on the Amiga *starting-amiga*
-
-Starting Vim from the Workbench *workbench*
--------------------------------
-
-Vim can be started from the Workbench by clicking on its icon twice. It will
-then start with an empty buffer.
-
-Vim can be started to edit one or more files by using a "Project" icon. The
-"Default Tool" of the icon must be the full pathname of the Vim executable.
-The name of the ".info" file must be the same as the name of the text file.
-By clicking on this icon twice, Vim will be started with the file name as
-current file name, which will be read into the buffer (if it exists). You can
-edit multiple files by pressing the shift key while clicking on icons, and
-clicking twice on the last one. The "Default Tool" for all these icons must
-be the same.
-
-It is not possible to give arguments to Vim, other than file names, from the
-workbench.
-
-Vim window *amiga-window*
-----------
-
-Vim will run in the CLI window where it was started. If Vim was started with
-the "run" or "runback" command, or if Vim was started from the workbench, it
-will open a window of its own.
-
-Technical detail:
- To open the new window a little trick is used. As soon as Vim
- recognizes that it does not run in a normal CLI window, it will
- create a script file in "t:". This script file contains the same
- command as the one Vim was started with, and an "endcli" command.
- This script file is then executed with a "newcli" command (the "c:run"
- and "c:newcli" commands are required for this to work). The script
- file will hang around until reboot, or until you delete it. This
- method is required to get the ":sh" and ":!" commands to work
- correctly. But when Vim was started with the -f option (foreground
- mode), this method is not used. The reason for this is that
- when a program starts Vim with the -f option it will wait for Vim to
- exit. With the script trick, the calling program does not know when
- Vim exits. The -f option can be used when Vim is started by a mail
- program which also waits for the edit session to finish. As a
- consequence, the ":sh" and ":!" commands are not available when the
- -f option is used.
-
-Vim will automatically recognize the window size and react to window
-resizing. Under Amiga DOS 1.3, it is advised to use the fastfonts program,
-"FF", to speed up display redrawing.
-
-==============================================================================
-3. Running eVim *evim-keys*
+2. Running eVim *evim-keys*
EVim runs Vim as click-and-type editor. This is very unlike the original Vi
idea. But it helps for people that don't use Vim often enough to learn the
@@ -668,7 +600,7 @@ In Evim these options are changed from their default value:
:set nocompatible Use Vim improvements
:set insertmode Remain in Insert mode most of the time
:set hidden Keep invisible buffers loaded
- :set backup Keep backup files (not for VMS)
+ :set backup Keep backup files
:set backspace=2 Backspace over everything
:set autoindent auto-indent new lines
:set history=50 keep 50 lines of Ex commands
@@ -708,7 +640,7 @@ One hint: If you want to go to Normal mode to be able to type a sequence of
commands, use CTRL-L. |i_CTRL-L|
==============================================================================
-4. Initialization *initialization* *startup*
+3. Initialization *initialization* *startup*
This section is about the non-GUI version of Vim. See |gui-fork| for
additional initialization when starting the GUI.
@@ -744,8 +676,6 @@ accordingly. Vim proceeds in this order:
Unix $HOME/.vimrc or $HOME/.vim/vimrc
MS-Windows $HOME/_vimrc, $HOME/vimfiles/vimrc
or $VIM/_vimrc
- Amiga s:.vimrc, home:.vimrc, home:vimfiles:vimrc
- or $VIM/.vimrc
The files are searched in the order specified above and only the first
one that is found is read.
@@ -767,9 +697,9 @@ accordingly. Vim proceeds in this order:
a. If vim was started as |evim| or |eview| or with the |-y| argument, the
script $VIMRUNTIME/evim.vim will be loaded.
*system-vimrc*
- b. For Unix, MS-DOS, MS-Windows, VMS, Macintosh, and Amiga,
- the system vimrc file is read for initializations. The path of this
- file is shown with the ":version" command. Mostly it's "$VIM/vimrc".
+ b. For Unix, MS-DOS, MS-Windows, and Macintosh, the system vimrc file is
+ read for initializations. The path of this file is shown with the
+ ":version" command. Mostly it's "$VIM/vimrc".
Note that this file is ALWAYS read in 'compatible' mode, since the
automatic resetting of 'compatible' is only done later. Add a ":set
nocp" command if you like.
@@ -785,14 +715,10 @@ accordingly. Vim proceeds in this order:
- The user vimrc file(s):
"$HOME/.vimrc" (for Unix) (*)
"$HOME/.vim/vimrc" (for Unix) (*)
- "s:.vimrc" (for Amiga) (*)
- "home:.vimrc" (for Amiga) (*)
- "home:vimfiles:vimrc" (for Amiga) (*)
- "$VIM/.vimrc" (for Amiga) (*)
"$HOME/_vimrc" (for MS-DOS and Win32) (*)
"$HOME/vimfiles/vimrc" (for MS-DOS and Win32) (*)
"$VIM/_vimrc" (for MS-DOS and Win32) (*)
- Note: For Unix and Amiga, when ".vimrc" does not exist,
+ Note: For Unix, when ".vimrc" does not exist,
"_vimrc" is also tried, in case an MS-DOS compatible file
system is used. For MS-DOS and Win32 ".vimrc" is checked
after "_vimrc", in case long file names are used.
@@ -808,11 +734,11 @@ accordingly. Vim proceeds in this order:
d. If the 'exrc' option is on (which is not the default), the current
directory is searched for three files. The first that exists is used,
the others are ignored.
- - The file ".vimrc" (for Unix and Amiga) (*)
+ - The file ".vimrc" (for Unix) (*)
"_vimrc" (for MS-DOS and Win32) (*)
- - The file "_vimrc" (for Unix and Amiga) (*)
+ - The file "_vimrc" (for Unix) (*)
".vimrc" (for MS-DOS and Win32) (*)
- - The file ".exrc" (for Unix and Amiga)
+ - The file ".exrc" (for Unix)
"_exrc" (for MS-DOS and Win32)
(*) Using this file or environment variable will cause 'compatible' to be
@@ -880,7 +806,6 @@ Standard setup:
Create a vimrc file to set the default settings and mappings for all your edit
sessions. Put it in a place so that it will be found by 3b:
~/.vimrc (Unix)
- s:.vimrc (Amiga)
$VIM\_vimrc (MS-DOS and Win32)
Note that creating a vimrc file will cause the 'compatible' option to be off
by default. See |compatible-default|.
@@ -906,12 +831,6 @@ Avoiding setup problems for Vi users:
Vi uses the variable EXINIT and the file "~/.exrc". So if you do not want to
interfere with Vi, then use the variable VIMINIT and the file "vimrc" instead.
-Amiga environment variables:
-On the Amiga, two types of environment variables exist. The ones set with the
-DOS 1.3 (or later) setenv command are recognized. See the AmigaDos 1.3
-manual. The environment variables set with the old Manx Set command (before
-version 5.0) are not recognized.
-
MS-DOS line separators:
On MS-DOS-like systems (MS-DOS itself and Win32), Vim assumes that all
the vimrc files have <CR> <NL> pairs as line separators. This will give
@@ -1016,7 +935,7 @@ This still won't work for systems where gvim does not use stdout at all
though.
==============================================================================
-5. $VIM and $VIMRUNTIME
+4. $VIM and $VIMRUNTIME
*$VIM*
The environment variable "$VIM" is used to locate various user files for Vim,
such as the user startup script ".vimrc". This depends on the system, see
@@ -1078,7 +997,7 @@ greps in the help files) you might be able to use this: >
VIMRUNTIME=`vim -e -T dumb --cmd 'exe "set t_cm=\<C-M>"|echo $VIMRUNTIME|quit' | tr -d '\015' `
==============================================================================
-6. Suspending *suspend*
+5. Suspending *suspend*
*iconize* *iconise* *CTRL-Z* *v_CTRL-Z*
CTRL-Z Suspend Vim, like ":stop".
@@ -1111,7 +1030,7 @@ can't paste it in another application (since Vim is going to sleep an attempt
to get the selection would make the program hang).
==============================================================================
-7. Saving settings *save-settings*
+6. Saving settings *save-settings*
Mostly you will edit your vimrc files manually. This gives you the greatest
flexibility. There are a few commands to generate a vimrc file automatically.
@@ -1152,7 +1071,7 @@ with ":map" and ":set" commands and write the modified file. First read the
default ".vimrc" in with a command like ":source ~piet/.vimrc.Cprogs", change
the settings and then save them in the current directory with ":mkvimrc!". If
you want to make this file your default .vimrc, move it to your home directory
-(on Unix), s: (Amiga) or $VIM directory (MS-DOS). You could also use
+(on Unix) or $VIM directory (MS-DOS). You could also use
autocommands |autocommand| and/or modelines |modeline|.
*vimrc-option-example*
@@ -1173,7 +1092,7 @@ option, which has several side effects. See |'compatible'|.
'compatible' option to the output file first, because of these side effects.
==============================================================================
-8. Views and Sessions *views-sessions*
+7. Views and Sessions *views-sessions*
This is introduced in sections |21.4| and |21.5| of the user manual.
@@ -1320,7 +1239,7 @@ To automatically save and restore views for *.c files: >
au BufWinEnter *.c silent loadview
==============================================================================
-9. The viminfo file *viminfo* *viminfo-file* *E136*
+8. The viminfo file *viminfo* *viminfo-file* *E136*
*E575* *E576* *E577*
If you exit Vim and later start it again, you would normally lose a lot of
information. The viminfo file can be used to remember that information, which
@@ -1387,7 +1306,7 @@ stored, but the '"' mark is. The '"' mark is very useful for jumping to the
cursor position when the file was last exited. No marks are saved for files
that start with any string given with the "r" flag in 'viminfo'. This can be
used to avoid saving marks for files on removable media (for MS-DOS you would
-use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:").
+use "ra:,rb:".
The |v:oldfiles| variable is filled with the file names that the viminfo file
has marks for.
@@ -1419,9 +1338,9 @@ remembered.
VIMINFO FILE NAME *viminfo-file-name*
- The default name of the viminfo file is "$HOME/.viminfo" for Unix,
- "s:.viminfo" for Amiga, "$HOME\_viminfo" for MS-DOS and Win32. For the last
- two, when $HOME is not set, "$VIM\_viminfo" is used. When $VIM is also not
- set, "c:\_viminfo" is used.
+ "$HOME\_viminfo" for MS-DOS and Win32. For the last two, when $HOME is not
+ set, "$VIM\_viminfo" is used. When $VIM is also not set, "c:\_viminfo" is
+ used.
- The 'n' flag in the 'viminfo' option can be used to specify another viminfo
file name |'viminfo'|.
- The "-i" Vim argument can be used to set another file name, |-i|. When the
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index f81a530499..ea272031d6 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -24,9 +24,9 @@ NOTE: Most of this is not used when running the |GUI|.
==============================================================================
1. Startup *startup-terminal*
-When Vim is started a default terminal type is assumed. For the Amiga this is
-a standard CLI window, for MS-DOS the pc terminal, for Unix an ansi terminal.
-A few other terminal types are always available, see below |builtin-terms|.
+When Vim is started a default terminal type is assumed. for MS-DOS this is
+the pc terminal, for Unix an ansi terminal. A few other terminal types are
+always available, see below |builtin-terms|.
You can give the terminal name with the '-T' Vim argument. If it is not given
Vim will try to get the name from the TERM environment variable.
@@ -84,10 +84,7 @@ defined with 't_ti' and 't_ks' will be sent to the terminal. Normally this
puts the terminal in a state where the termcap codes are valid and activates
the cursor and function keys. When Vim exits the terminal will be put back
into the mode it was before Vim started. The strings defined with 't_te' and
-'t_ke' will be sent to the terminal. On the Amiga, with commands that execute
-an external command (e.g., "!!"), the terminal will be put into Normal mode
-for a moment. This means that you can stop the output to the screen by
-hitting a printing key. Output resumes when you hit <BS>.
+'t_ke' will be sent to the terminal.
*cs7-problem*
Note: If the terminal settings are changed after running Vim, you might have
@@ -100,17 +97,6 @@ cursor keys send codes different from the codes defined in the termcap. To
avoid this you can set 't_ks' (and 't_ke') to empty strings. This must be
done during initialization (see |initialization|), otherwise it's too late.
-Some termcap entries assume that the highest bit is always reset. For
-example: The cursor-up entry for the Amiga could be ":ku=\E[A:". But the
-Amiga really sends "\233A". This works fine if the highest bit is reset,
-e.g., when using an Amiga over a serial line. If the cursor keys don't work,
-try the entry ":ku=\233A:".
-
-Some termcap entries have the entry ":ku=\E[A:". But the Amiga really sends
-"\233A". On output "\E[" and "\233" are often equivalent, on input they
-aren't. You will have to change the termcap entry, or change the key code with
-the :set command to fix this.
-
Many cursor key codes start with an <Esc>. Vim must find out if this is a
single hit of the <Esc> key or the start of a cursor key sequence. It waits
for a next character to arrive. If it does not arrive within one second a
@@ -121,9 +107,6 @@ you want to enter a single <Esc> you must type it twice. Resetting the
'esckeys' option avoids this problem in Insert mode, but you lose the
possibility to use cursor and function keys in Insert mode.
-On the Amiga the recognition of window resizing is activated only when the
-terminal name is "amiga" or "builtin_amiga".
-
Some terminals have confusing codes for the cursor keys. The televideo 925 is
such a terminal. It sends a CTRL-H for cursor-left. This would make it
impossible to distinguish a backspace and cursor-left. To avoid this problem
@@ -516,9 +499,7 @@ closes the window. On other systems you can probably use them.)
[This is about the size of the whole window Vim is using, not a window that is
created with the ":split" command.]
-If you are running Vim on an Amiga and the terminal name is "amiga" or
-"builtin_amiga", the amiga-specific window resizing will be enabled. On Unix
-systems three methods are tried to get the window size:
+On Unix systems, three methods are tried to get the window size:
- an ioctl call (TIOCGSIZE or TIOCGWINSZ, depends on your system)
- the environment variables "LINES" and "COLUMNS"
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 40f30ff077..c6a8398737 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -204,9 +204,6 @@ Patch to support expression argument to sort() instead of a function name.
Yasuhiro Matsumoto, 2013 May 31.
Or should we add a more general mechanism, like lambda functions?
-VMS: Select() doesn't work properly, typing ESC may hang Vim. Use sys$qiow
-instead. (Samuel Ferencik, 2013 Sep 28)
-
Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4)
Remark on the docs. Should not be a compile time feature. But then what?
@@ -1380,11 +1377,6 @@ character typed. (Tyler Spivey, 2008 Sep 3) Only redraw cmdline for
Cheng Fang made javacomplete. (2007 Aug 11)
Asked about latest version: 0.77.1 is on www.vim.org.
-More AmigaOS4 patches. (Peter Bengtsson, Nov 9)
-
-Amiga patches with vbcc. (Adrien Destugues, 2010 Aug 30)
-http://pulkomandy.ath.cx/drop/vim73_vbcc_amiga.diff
-
Insert mode completion: When editing the text and pressing CTRL-N again goes
back to originally completed text, edited text is gone. (Peng Yu, 2008 Jul 24)
Suggestion by Ben Schmidt, 2008 Aug 6.
@@ -1587,12 +1579,6 @@ The buffer has the full path in ffname, should pass this to the autocommand.
"vim -C" often has 'nocompatible', because it's set in some startup script.
Set 'compatible' after startup is done? Patch by James Vega, 2008 Feb 7.
-VMS: while editing a file found in complex, Vim will save file into the first
-directory of the path and not to the original location of the file.
-(Zoltan Arpadffy)
-
-VMS: VFC files are in some cases truncated during reading (Zoltan Arpadffy)
-
input() completion should not insert a backslash to escape a space in a file
name?
@@ -2247,11 +2233,9 @@ GUI:
Need better separation of Vim core and GUI code.
8 When fontset support is enabled, setting 'guifont' to a single font
doesn't work.
-8 Menu priority for sub-menus for: Amiga.
8 When translating menus ignore the part after the Tab, the shortcut. So
that the same menu item with a different shortcut (e.g., for the Mac) are
still translated.
-8 Add menu separators for Amiga.
8 Add way to specify the file filter for the browse dialog. At least for
browse().
8 Add dialog for search/replace to other GUIs? Tk has something for this,
@@ -2360,15 +2344,6 @@ Win32 console:
exiting.
-Amiga:
-8 In mch_inchar() should use convert_input_safe() to handle incomplete byte
- sequences.
-9 In mch_expandpath() a "*" is to be expanded, but "\*" isn't. Remove
- backslashes in result.
-8 Executing a shell, only one option for 'shell' is separated. Should do
- all options, using white space separation.
-
-
Macintosh:
- GUI: gui_mch_browsedir() is missing.
7 Loading the Perl library only works on OS/X 10.2 or 10.3, never on both.
@@ -2685,9 +2660,6 @@ Problems that will (probably) not be solved:
- In zsh, "gvim&" changes the terminal settings. This is a zsh problem.
(Jennings)
- Problem with HPterm under X: old contents of window is lost (Cosentino).
-- Amiga: When using quickfix with the Manx compiler we only get the first 25
- errors. How do we get the rest?
-- Amiga: The ":cq" command does not always abort the Manx compiler. Why?
- Linux: A file with protection r--rw-rw- is seen readonly for others. The
access() function in GNU libc is probably wrong.
- MSDOS: When using smartdrive with write-back buffering, writing to a
@@ -2726,8 +2698,6 @@ Problems that will (probably) not be solved:
libraries, get a patch from Sun.
- Solaris 2.6 with GTK and Perl: gvim crashes when started. Problem with X
input method called from GDK code. Without Perl it doesn't crash.
-- VMS: Vimdiff doesn't work with the VMS diff, because the output looks
- different. This makes test 47 fail. Install a Unix-compatible diff.
- Win32 GUI: mouse wheel always scrolls rightmost window. The events arrive
in Vim as if the rightmost scrollbar was used.
- GTK with Gnome: Produces an error message when starting up:
@@ -2867,7 +2837,6 @@ User Friendlier:
disabling it. Be careful that tear-offs don't disappear (keep one empty
item?).
Alternative: use BufEnter and BufLeave autocommands.
-8 make a vimtutor script for Amiga and other systems.
7 Add the arguments for configure to the ":version" output?
7 When Vim detects a file is being edited elsewhere and it's a gvim session
of the same user it should offer a "Raise" button, so that the other gvim
@@ -3741,7 +3710,6 @@ Win32 GUI:
GUI:
-8 Make inputdialog() work for Amiga.
- <C--> cannot be mapped. Should be possible to recognize this as a
normal "-" with the Ctrl modifier.
7 Implement ":popup" for other systems than Windows.
@@ -4812,9 +4780,7 @@ Digraphs:
Writing files:
-- In vim_rename(), should lock "from" file when deleting "to" file for
- systems other than Amiga.
-8 write mch_isdevice() for Amiga, Mac, VMS, etc.
+- In vim_rename(), should lock "from" file when deleting "to" file.
8 When appending to a file, Vim should also make a backup and a 'patchmode'
file.
8 'backupskip' doesn't write a backup file at all, a bit dangerous for some
@@ -4869,7 +4835,6 @@ Mouse support:
8 Add 'mouse' flag, which sets a behavior like Visual mode, but automatic
yanking at the button-up event. Or like Select mode, but typing gets you
out of Select mode, instead of replacing the text. (Bhaskar)
-- Implement mouse support for the Amiga console.
- Using right mouse button to extend a blockwise selection should attach to
the nearest corner of the rectangle (four possible corners).
- Precede mouse click by a number to simulate double clicks?!?
@@ -5211,8 +5176,6 @@ Various improvements:
- Add "-d null" for editing from a script file without displaying.
- In Insert mode: Remember the characters that were removed with backspace
and re-insert them one at a time with <key1>, all together with <key2>.
-- Amiga: Add possibility to set a keymap. The code in amiga.c does not work
- yet.
- Implement 'redraw' option.
- Add special code to 'sections' option to define something else but '{' or
'}' as the start of a section (e.g. one shiftwidth to the right).
@@ -5231,15 +5194,12 @@ Various improvements:
off".
- Check handling of CTRL-V and '\' for ":" commands that do not have TRLBAR.
- When a file cannot be opened but does exist, give error message.
-- Amiga: When 'r' protection bit is not set, file can still be opened but
- gives read errors. Check protection before opening.
- When writing check for file exists but no permission, "Permission denied".
- If file does not exist, check if directory exists.
- MSDOS: although t_cv and t_ci are not set, do invert char under cursor.
- Settings edit mode: make file with ":set opt=xx", edit it, parse it as ex
commands.
- ":set -w all": list one option per line.
-- Amiga: test for 'w' flag when reading a file.
- :table command (Webb)
- Add new operator: clear, make area white (replace with spaces): "g ".
- Add command to ":read" a file at a certain column (blockwise read?).
diff --git a/runtime/doc/usr_01.txt b/runtime/doc/usr_01.txt
index 0de1fac803..df76542c6e 100644
--- a/runtime/doc/usr_01.txt
+++ b/runtime/doc/usr_01.txt
@@ -73,8 +73,6 @@ Unix: >
:!cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc
MS-DOS, MS-Windows: >
:!copy $VIMRUNTIME/vimrc_example.vim $VIM/_vimrc
-Amiga: >
- :!copy $VIMRUNTIME/vimrc_example.vim $VIM/.vimrc
If the file already exists you probably want to keep it.
@@ -126,14 +124,7 @@ available, use the two-letter language code. For French: >
vimtutor fr
On Unix, if you prefer using the GUI version of Vim, use "gvimtutor" or
-"vimtutor -g" instead of "vimtutor".
-
-For OpenVMS, if Vim has been properly installed, you can start vimtutor from a
-VMS prompt with: >
-
- @VIM:vimtutor
-
-Optionally add the two-letter language code as above.
+"vimtutor -g", optionally with a two-letter language code.
On other systems, you have to do a little work:
diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
index a409d7e3ce..9eee058a99 100644
--- a/runtime/doc/usr_05.txt
+++ b/runtime/doc/usr_05.txt
@@ -96,14 +96,9 @@ when pressing <Enter> in Insert mode, and when using the "o" command to open a
new line.
>
- if has("vms")
- set nobackup
- else
- set backup
- endif
+ set backup
-This tells Vim to keep a backup copy of a file when overwriting it. But not
-on the VMS system, since it keeps old versions of files already. The backup
+This tells Vim to keep a backup copy of a file when overwriting it. The backup
file will have the same name as the original file with "~" added. See |07.4|
>
@@ -314,7 +309,6 @@ Then copy the file to your plugin directory:
system plugin directory ~
Unix ~/.vim/plugin/
- Amiga s:vimfiles/plugin
Macintosh $VIM:vimfiles:plugin
Mac OS X ~/.vim/plugin/
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index 6f639e0fe9..be0bfb1f23 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -300,7 +300,6 @@ g8 Print the hex values of the bytes used in the
*+feature-list*
*+acl* |ACL| support included
- *+ARP* Amiga only: ARP support included
B *+arabic* |Arabic| language support
N *+autocmd* |:autocmd|, automatic commands
m *+balloon_eval* |balloon-eval| support. Included when compiling with
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt
index a3abd2cfd3..66cc9c0412 100644
--- a/runtime/doc/vi_diff.txt
+++ b/runtime/doc/vi_diff.txt
@@ -71,10 +71,8 @@ Vim has only a few limits for the files that can be edited {Vi: can not handle
<Nul> characters and characters above 128, has limited line length, many other
limits}.
*E340*
-Maximum line length On machines with 16-bit ints (Amiga and MS-DOS real
- mode): 32767, otherwise 2147483647 characters.
- Longer lines are split.
-Maximum number of lines 2147483647 lines.
+Maximum line length 2147483647 characters
+Maximum number of lines 2147483647 lines
Maximum file size 2147483647 bytes (2 Gbyte) when a long integer is
32 bits. Much more for 64 bit longs. Also limited
by available disk space for the |swap-file|.
@@ -102,9 +100,8 @@ Memory usage limits
The option 'maxmem' ('mm') is used to set the maximum memory used for one
buffer (in kilobytes). 'maxmemtot' is used to set the maximum memory used for
-all buffers (in kilobytes). The defaults depend on the system used. For the
-Amiga and MS-DOS, 'maxmemtot' is set depending on the amount of memory
-available.
+all buffers (in kilobytes). The defaults depend on the system used. For
+MS-DOS, 'maxmemtot' is set depending on the amount of memory available.
These are not hard limits, but tell Vim when to move text into a swap file.
If you don't like Vim to swap to a file, set 'maxmem' and 'maxmemtot' to a
very large value. The swap file will then only be used for recovery. If you
@@ -132,11 +129,9 @@ Support for different systems.
Vim can be used on:
- All Unix systems (it works on all systems it was tested on, although
the GUI and Perl interface may not work everywhere).
- - Amiga (500, 1000, 1200, 2000, 3000, 4000, ...).
- MS-DOS in real-mode (no additional drivers required).
- In protected mode on Windows 3.1 and MS-DOS (DPMI driver required).
- Windows 95 and Windows NT, with support for long file names.
- - VMS
- Macintosh
Note that on some systems features need to be disabled to reduce
resource usage, esp. on MS-DOS. For some outdated systems you need to
@@ -159,7 +154,7 @@ Graphical User Interface (GUI). |gui|
define your own menus. Better support for CTRL/SHIFT/ALT keys in
combination with special keys and mouse. Supported for various
platforms, such as X11 (with Motif and Athena interfaces), GTK, Win32
- (Windows 95 and later), Amiga and Macintosh.
+ (Windows 95 and later), and Macintosh.
Multiple windows and buffers. |windows.txt|
Vim can split the screen into several windows, each editing a
@@ -718,10 +713,6 @@ When the 'fileformats' option is not empty, Vim tries to detect the type of
On systems that have no job control (older Unix systems and non-Unix systems)
the CTRL-Z, ":stop" or ":suspend" command starts a new shell.
-If Vim is started on the Amiga without an interactive window for output, a
-window is opened (and :sh still works). You can give a device to use for
-editing with the |-d| argument, e.g. "-d con:20/20/600/150".
-
The 'columns' and 'lines' options are used to set or get the width and height
of the display.
@@ -734,8 +725,8 @@ If the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode.
And it comes back there, when pressing <Esc>.
Undo information is kept in memory. Available memory limits the number and
-size of change that can be undone. This may be a problem with MS-DOS, is
-hardly a problem on the Amiga and almost never with Unix and Win32.
+size of change that can be undone. This may be a problem with MS-DOS, but is
+almost never one with Unix and Win32.
If the 'backup' or 'writebackup' option is set: Before a file is overwritten,
a backup file (.bak) is made. If the "backup" option is set it is left
@@ -760,8 +751,6 @@ changing files.
The "No lines in buffer" message is a normal message instead of an error
message, since that may cause a mapping to be aborted.
-The AUX: device of the Amiga is supported.
-
==============================================================================
6. Command-line arguments *cmdline-arguments*
@@ -837,12 +826,8 @@ Only Vim is able to accept options in between and after the file names.
loading the edit buffer.
Vim: allow up to 10 "-c" arguments
--d {device} Vim: Use {device} for I/O (Amiga only). {only when compiled
- without the |+diff| feature}
-d Vim: start with 'diff' set. |vimdiff|
--dev {device} Vim: Use {device} for I/O (Amiga only).
-
-D Vim: debug mode.
-e Elvis, Nvi, Vim: Start in Ex mode, as if the executable is
@@ -850,7 +835,7 @@ Only Vim is able to accept options in between and after the file names.
-E Vim: Start in improved Ex mode |gQ|, like "exim".
--f Vim: Run GUI in foreground (Amiga: don't open new window).
+-f Vim: Run GUI in foreground.
-f {session} Elvis: Use {session} as the session file.
-F Vim: Start in Farsi mode (when compiled with Farsi).
diff --git a/runtime/evim.vim b/runtime/evim.vim
index 650ce428d6..e35f1be085 100644
--- a/runtime/evim.vim
+++ b/runtime/evim.vim
@@ -28,11 +28,7 @@ cnoremap <silent> <C-F> <C-C>:promptfind<CR>
set backspace=2 " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
-if has("vms")
- set nobackup " do not keep a backup file, use versions instead
-else
- set backup " keep a backup file
-endif
+set backup " keep a backup file
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set incsearch " do incremental searching
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index a6b918a0f2..f6d455fcbf 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -91,11 +91,7 @@ au BufNewFile,BufRead *.wrm setf acedb
" Ada (83, 9X, 95)
au BufNewFile,BufRead *.adb,*.ads,*.ada setf ada
-if has("vms")
- au BufNewFile,BufRead *.gpr,*.ada_m,*.adc setf ada
-else
- au BufNewFile,BufRead *.gpr setf ada
-endif
+au BufNewFile,BufRead *.gpr setf ada
" AHDL
au BufNewFile,BufRead *.tdf setf ahdl
diff --git a/runtime/ftplugin/ada.vim b/runtime/ftplugin/ada.vim
index 0809e7b206..1f2d690b95 100644
--- a/runtime/ftplugin/ada.vim
+++ b/runtime/ftplugin/ada.vim
@@ -119,11 +119,7 @@ endif
" Section: Compiler {{{1
"
if ! exists("g:ada_default_compiler")
- if has("vms")
- let g:ada_default_compiler = 'decada'
- else
- let g:ada_default_compiler = 'gnat'
- endif
+ let g:ada_default_compiler = 'gnat'
endif
if ! exists("current_compiler") ||
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim
index 19e8c51edb..487ce7a165 100644
--- a/runtime/ftplugin/c.vim
+++ b/runtime/ftplugin/c.vim
@@ -15,7 +15,7 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo-=C
-let b:undo_ftplugin = "setl fo< com< ofu< | if has('vms') | setl isk< | endif"
+let b:undo_ftplugin = "setl fo< com< ofu<"
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".
@@ -29,11 +29,6 @@ endif
" Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
-" In VMS C keywords contain '$' characters.
-if has("vms")
- setlocal iskeyword+=$
-endif
-
" When the matchit plugin is loaded, this makes the % command skip parens and
" braces in comments.
let b:match_words = &matchpairs . ',^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>'
diff --git a/runtime/ftplugin/zimbu.vim b/runtime/ftplugin/zimbu.vim
index ff281202e0..558aea7df0 100644
--- a/runtime/ftplugin/zimbu.vim
+++ b/runtime/ftplugin/zimbu.vim
@@ -15,7 +15,7 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo-=C
-let b:undo_ftplugin = "setl fo< com< ofu< efm< tw< et< sts< sw< | if has('vms') | setl isk< | endif"
+let b:undo_ftplugin = "setl fo< com< ofu< efm< tw< et< sts< sw<"
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".
diff --git a/runtime/gvimrc_example.vim b/runtime/gvimrc_example.vim
index 26b3001220..ab9803413b 100644
--- a/runtime/gvimrc_example.vim
+++ b/runtime/gvimrc_example.vim
@@ -1,14 +1,12 @@
" An example for a gvimrc file.
" The commands in this are executed when the GUI is started.
"
-" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last change: 2001 Sep 02
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2001 Sep 02
"
" To use it, copy it to
-" for Unix: ~/.gvimrc
-" for Amiga: s:.gvimrc
+" for Unix: ~/.gvimrc
" for MS-DOS and Win32: $VIM\_gvimrc
-" for OpenVMS: sys$login:.gvimrc
" Make external commands work through a pipe instead of a pseudo-tty
"set noguipty
@@ -16,9 +14,9 @@
" set the X11 font to use
" set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
-set ch=2 " Make command line two lines high
+set ch=2 " Make command line two lines high
-set mousehide " Hide the mouse when typing text
+set mousehide " Hide the mouse when typing text
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
diff --git a/runtime/menu.vim b/runtime/menu.vim
index 09d3443155..5cbc0faabd 100644
--- a/runtime/menu.vim
+++ b/runtime/menu.vim
@@ -194,8 +194,6 @@ fun! s:EditVimrc()
else
let fname = $VIM . "/_vimrc"
endif
- elseif has("amiga")
- let fname = "s:.vimrc"
else
let fname = $HOME . "/.vimrc"
endif
@@ -345,7 +343,7 @@ endfun
" get NL separated string with file names
let s:n = globpath(&runtimepath, "colors/*.vim")
-" split at NL, Ignore case for VMS and windows, sort on name
+" split at NL, ignore case for Windows, sort on name
let s:names = sort(map(split(s:n, "\n"), 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1)
" define all the submenu entries
@@ -372,7 +370,7 @@ if has("keymap")
let s:name = strpart(s:n, 0, s:i)
let s:n = strpart(s:n, s:i + 1, 19999)
endif
- " Ignore case for VMS and windows
+ " Ignore case for Windows
let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
exe "an 20.460." . s:idx . ' &Edit.&Keymap.' . s:name . " :set keymap=" . s:name . "<CR>"
unlet s:name
@@ -389,11 +387,7 @@ endif
" Programming menu
if !exists("g:ctags_command")
- if has("vms")
- let g:ctags_command = "mc vim:ctags *.*"
- else
- let g:ctags_command = "ctags -R ."
- endif
+ let g:ctags_command = "ctags -R ."
endif
an 40.300 &Tools.&Jump\ to\ this\ tag<Tab>g^] g<C-]>
@@ -538,12 +532,8 @@ an <silent> 40.540 &Tools.Conve&rt\ back<Tab>:%!xxd\ -r
" set.
func! s:XxdConv()
let mod = &mod
- if has("vms")
- %!mc vim:xxd
- else
- call s:XxdFind()
- exe '%!"' . g:xxdprogram . '"'
- endif
+ call s:XxdFind()
+ exe '%!"' . g:xxdprogram . '"'
if getline(1) =~ "^0000000:" " only if it worked
set ft=xxd
endif
@@ -552,12 +542,8 @@ endfun
func! s:XxdBack()
let mod = &mod
- if has("vms")
- %!mc vim:xxd -r
- else
- call s:XxdFind()
- exe '%!"' . g:xxdprogram . '" -r'
- endif
+ call s:XxdFind()
+ exe '%!"' . g:xxdprogram . '" -r'
set ft=
doautocmd filetypedetect BufReadPost
let &mod = mod
@@ -586,7 +572,7 @@ while strlen(s:n) > 0
let s:name = strpart(s:n, 0, s:i)
let s:n = strpart(s:n, s:i + 1, 19999)
endif
- " Ignore case for VMS and windows
+ " Ignore case for Windows
let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '')
exe "an 30.440." . s:idx . ' &Tools.Se&T\ Compiler.' . s:name . " :compiler " . s:name . "<CR>"
unlet s:name
diff --git a/runtime/print/dec-mcs.ps b/runtime/print/dec-mcs.ps
deleted file mode 100644
index 34702b7273..0000000000
--- a/runtime/print/dec-mcs.ps
+++ /dev/null
@@ -1,40 +0,0 @@
-%!PS-Adobe-3.0 Resource-Encoding
-%%Title: VIM-dec-mcs
-%%Version: 1.0 0
-%%EndComments
-/VIM-dec-mcs[
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.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
-/.notdef /exclamdown /cent /sterling /.notdef /yen /.notdef /section
-/currency /copyright /ordfeminine /guillemotleft /.notdef /.notdef /.notdef /.notdef
-/degree /plusminus /twosuperior /threesuperior /.notdef /mu /paragraph /periodcentered
-/.notdef /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /.notdef /questiondown
-/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
-/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis
-/.notdef /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /OE
-/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Ydieresis /.notdef /germandbls
-/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla
-/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
-/.notdef /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /oe
-/oslash /ugrave /uacute /ucircumflex /udieresis /ydieresis /.notdef /.notdef]
-/Encoding defineresource pop
-% vim:ff=unix:
-%%EOF
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
index 251e4c8f08..93206b8e6e 100644
--- a/runtime/scripts.vim
+++ b/runtime/scripts.vim
@@ -223,11 +223,6 @@ else
\ || s:line5 =~ '^\s*dnl\>'
set ft=m4
- " AmigaDos scripts
- elseif $TERM == "amiga"
- \ && (s:line1 =~ "^;" || s:line1 =~ '^\.[bB][rR][aA]')
- set ft=amiga
-
" SiCAD scripts (must have procn or procd as the first line to trigger this)
elseif s:line1 =~? '^ *proc[nd] *$'
set ft=sicad
diff --git a/runtime/syntax/dcl.vim b/runtime/syntax/dcl.vim
index b051b08cf1..cf62cdf202 100644
--- a/runtime/syntax/dcl.vim
+++ b/runtime/syntax/dcl.vim
@@ -107,9 +107,6 @@ syn match dclGotoLabel "^\$\s*\I\i*:\s*$" contains=dclStart
" parameters
syn match dclParam "'\I[a-zA-Z0-9_$]*'\="
-" () matching (the clusters are commented out until a vim/vms comes out for v5.2+)
-"syn cluster dclNextGroups contains=dclCmdDirPath,dclCmdProc,dclCmdProc,dclDirPath,dclFilename,dclFilename,dclMdfySet,dclMdfySetString,delCmdProc,dclExe,dclTodo
-"syn region dclFuncList matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,@dclNextGroups
syn region dclFuncList matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALLBUT,dclCmdDirPath,dclCmdProc,dclCmdProc,dclDirPath,dclFilename,dclFilename,dclMdfySet,dclMdfySetString,delCmdProc,dclExe,dclTodo
syn match dclError ")"
diff --git a/runtime/vimrc_example.vim b/runtime/vimrc_example.vim
index 3175711aa1..11656f2d5d 100644
--- a/runtime/vimrc_example.vim
+++ b/runtime/vimrc_example.vim
@@ -1,13 +1,11 @@
" An example for a vimrc file.
"
-" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last change: 2014 Feb 05
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2014 Feb 05
"
" To use it, copy it to
" for Unix: ~/.vimrc
-" for Amiga: s:.vimrc
-" for MS-DOS and Win32: $VIM\_vimrc
-" for OpenVMS: sys$login:.vimrc
+" for MS-DOS and Win32: $VIM\_vimrc
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
@@ -21,16 +19,12 @@ set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
-if has("vms")
- set nobackup " do not keep a backup file, use versions instead
-else
- set backup " keep a backup file (restore to previous version)
- set undofile " keep an undo file (undo changes after closing)
-endif
-set history=50 " keep 50 lines of command line history
-set ruler " show the cursor position all the time
-set showcmd " display incomplete commands
-set incsearch " do incremental searching
+set backup " keep a backup file (restore to previous version)
+set undofile " keep an undo file (undo changes after closing)
+set history=50 " keep 50 lines of command line history
+set ruler " show the cursor position all the time
+set showcmd " display incomplete commands
+set incsearch " do incremental searching
" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")
@@ -84,7 +78,7 @@ if has("autocmd")
else
- set autoindent " always set autoindenting on
+ set autoindent " always set autoindenting on
endif " has("autocmd")
@@ -93,5 +87,5 @@ endif " has("autocmd")
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
- \ | wincmd p | diffthis
+ \ | wincmd p | diffthis
endif
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index f84e25cdfb..8327f3c836 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1758,7 +1758,7 @@ buflist_findpat (
FOR_ALL_BUFFERS(buf) {
if (buf->b_p_bl == find_listed
&& (!diffmode || diff_mode_buf(buf))
- && buflist_match(prog, buf) != NULL) {
+ && buflist_match(prog, buf, false) != NULL) {
if (curtab_only) {
/* Ignore the match if the buffer is not open in
* the current tab. */
@@ -1852,7 +1852,7 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options)
FOR_ALL_BUFFERS(buf) {
if (!buf->b_p_bl) /* skip unlisted buffers */
continue;
- p = buflist_match(prog, buf);
+ p = buflist_match(prog, buf, p_wic);
if (p != NULL) {
if (round == 1)
++count;
@@ -1885,26 +1885,27 @@ int ExpandBufnames(char_u *pat, int *num_file, char_u ***file, int options)
#ifdef HAVE_BUFLIST_MATCH
-/*
- * Check for a match on the file name for buffer "buf" with regprog "prog".
- */
-static char_u *buflist_match(regprog_T *prog, buf_T *buf)
+/// Check for a match on the file name for buffer "buf" with regprog "prog".
+///
+/// @param ignore_case When TRUE, ignore case. Use 'fic' otherwise.
+static char_u *buflist_match(regprog_T *prog, buf_T *buf, bool ignore_case)
{
char_u *match;
/* First try the short file name, then the long file name. */
- match = fname_match(prog, buf->b_sfname);
- if (match == NULL)
- match = fname_match(prog, buf->b_ffname);
+ match = fname_match(prog, buf->b_sfname, ignore_case);
+ if (match == NULL) {
+ match = fname_match(prog, buf->b_ffname, ignore_case);
+ }
return match;
}
-/*
- * Try matching the regexp in "prog" with file name "name".
- * Return "name" when there is a match, NULL when not.
- */
-static char_u *fname_match(regprog_T *prog, char_u *name)
+/// Try matching the regexp in "prog" with file name "name".
+///
+/// @param ignore_case When TRUE, ignore case. Use 'fileignorecase' otherwise.
+/// @return "name" when there is a match, NULL when not.
+static char_u *fname_match(regprog_T *prog, char_u *name, bool ignore_case)
{
char_u *match = NULL;
char_u *p;
@@ -1912,7 +1913,8 @@ static char_u *fname_match(regprog_T *prog, char_u *name)
if (name != NULL) {
regmatch.regprog = prog;
- regmatch.rm_ic = p_fic; /* ignore case when 'fileignorecase' is set */
+ // Ignore case when 'fileignorecase' or the argument is set.
+ regmatch.rm_ic = p_fic || ignore_case;
if (vim_regexec(&regmatch, name, (colnr_T)0))
match = name;
else {
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 71cb83e566..d058e6ccae 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -6652,7 +6652,7 @@ char_u *get_function_name(expand_T *xp, int idx)
if (name != NULL)
return name;
}
- if (++intidx < (int)(sizeof(functions) / sizeof(struct fst))) {
+ if (++intidx < (int)ARRAY_SIZE(functions)) {
STRCPY(IObuff, functions[intidx].f_name);
STRCAT(IObuff, "(");
if (functions[intidx].f_max_argc == 0)
@@ -6695,7 +6695,7 @@ find_internal_func (
)
{
int first = 0;
- int last = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
+ int last = (int)ARRAY_SIZE(functions) - 1;
/*
* Find the function name in the table. Binary search.
@@ -9603,7 +9603,8 @@ static void f_getregtype(typval_T *argvars, typval_T *rettv)
*/
static void f_gettabvar(typval_T *argvars, typval_T *rettv)
{
- tabpage_T *tp;
+ win_T *oldcurwin;
+ tabpage_T *tp, *oldtabpage;
dictitem_T *v;
char_u *varname;
int done = FALSE;
@@ -9614,16 +9615,25 @@ static void f_gettabvar(typval_T *argvars, typval_T *rettv)
varname = get_tv_string_chk(&argvars[1]);
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
if (tp != NULL && varname != NULL) {
+ /* Set tp to be our tabpage, temporarily. Also set the window to the
+ * first window in the tabpage, otherwise the window is not valid. */
+ switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin, tp, TRUE);
+
/* look up the variable */
- v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 0, varname, FALSE);
+ /* Let gettabvar({nr}, "") return the "t:" dictionary. */
+ v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, FALSE);
if (v != NULL) {
copy_tv(&v->di_tv, rettv);
done = TRUE;
}
+
+ /* restore previous notion of curwin */
+ restore_win(oldcurwin, oldtabpage, TRUE);
}
- if (!done && argvars[2].v_type != VAR_UNKNOWN)
+ if (!done && argvars[2].v_type != VAR_UNKNOWN) {
copy_tv(&argvars[2], rettv);
+ }
}
/*
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 049934d680..a8d2f5589e 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1294,14 +1294,6 @@ do_shell (
}
starttermcap(); /* start termcap if not done by wait_return() */
-
- /*
- * In an Amiga window redrawing is caused by asking the window size.
- * If we got an interrupt this will not work. The chance that the
- * window size is wrong is very small, but we need to redraw the
- * screen. Don't do this if ':' hit in wait_return(). THIS IS UGLY
- * but it saves an extra redraw.
- */
}
/* display any error messages now */
@@ -4954,7 +4946,7 @@ int find_help_tags(char_u *arg, int *num_matches, char_u ***matches, int keep_la
* Recognize a few exceptions to the rule. Some strings that contain '*'
* with "star". Otherwise '*' is recognized as a wildcard.
*/
- for (i = (int)(sizeof(mtable) / sizeof(char *)); --i >= 0; )
+ for (i = (int)ARRAY_SIZE(mtable); --i >= 0; )
if (STRCMP(arg, mtable[i]) == 0) {
STRCPY(d, rtable[i]);
break;
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index fa78047a46..072972d24e 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -3291,3 +3291,79 @@ static void script_host_do_range(char *name, exarg_T *eap)
(void)eval_call_provider(name, "do_range", args);
}
+/*
+ * ":drop"
+ * Opens the first argument in a window. When there are two or more arguments
+ * the argument list is redefined.
+ */
+void ex_drop(exarg_T *eap)
+{
+ int split = FALSE;
+ buf_T *buf;
+
+ /*
+ * Check if the first argument is already being edited in a window. If
+ * so, jump to that window.
+ * We would actually need to check all arguments, but that's complicated
+ * and mostly only one file is dropped.
+ * This also ignores wildcards, since it is very unlikely the user is
+ * editing a file name with a wildcard character.
+ */
+ do_arglist(eap->arg, AL_SET, 0);
+
+ /*
+ * Expanding wildcards may result in an empty argument list. E.g. when
+ * editing "foo.pyc" and ".pyc" is in 'wildignore'. Assume that we
+ * already did an error message for this.
+ */
+ if (ARGCOUNT == 0)
+ return;
+
+ if (cmdmod.tab)
+ {
+ /* ":tab drop file ...": open a tab for each argument that isn't
+ * 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);
+
+ FOR_ALL_TAB_WINDOWS(tp, wp)
+ {
+ if (wp->w_buffer == buf)
+ {
+ goto_tabpage_win(tp, wp);
+ curwin->w_arg_idx = 0;
+ 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 (!P_HID(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);
+ }
+}
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 56c8206d2a..f25af3f587 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -135,7 +135,6 @@ struct dbg_stuff {
#endif
# define HAVE_EX_SCRIPT_NI
-# define ex_drop ex_ni
# define ex_gui ex_nogui
# define ex_tearoff ex_ni
# define ex_popup ex_ni
@@ -2281,7 +2280,7 @@ int modifier_len(char_u *cmd)
if (VIM_ISDIGIT(*cmd))
p = skipwhite(skipdigits(cmd));
- for (i = 0; i < (int)(sizeof(cmdmods) / sizeof(struct cmdmod)); ++i) {
+ for (i = 0; i < (int)ARRAY_SIZE(cmdmods); ++i) {
for (j = 0; p[j] != NUL; ++j)
if (p[j] != cmdmods[i].name[j])
break;
@@ -2306,7 +2305,7 @@ int cmd_exists(char_u *name)
char_u *p;
/* Check command modifiers. */
- for (i = 0; i < (int)(sizeof(cmdmods) / sizeof(struct cmdmod)); ++i) {
+ for (i = 0; i < (int)ARRAY_SIZE(cmdmods); ++i) {
for (j = 0; name[j] != NUL; ++j)
if (name[j] != cmdmods[i].name[j])
break;
@@ -4974,7 +4973,7 @@ char_u *get_user_cmd_flags(expand_T *xp, int idx)
{"bang", "bar", "buffer", "complete", "count",
"nargs", "range", "register"};
- if (idx >= (int)(sizeof(user_cmd_flags) / sizeof(user_cmd_flags[0])))
+ if (idx >= (int)ARRAY_SIZE(user_cmd_flags))
return NULL;
return (char_u *)user_cmd_flags[idx];
}
@@ -4986,7 +4985,7 @@ char_u *get_user_cmd_nargs(expand_T *xp, int idx)
{
static char *user_cmd_nargs[] = {"0", "1", "*", "?", "+"};
- if (idx >= (int)(sizeof(user_cmd_nargs) / sizeof(user_cmd_nargs[0])))
+ if (idx >= (int)ARRAY_SIZE(user_cmd_nargs))
return NULL;
return (char_u *)user_cmd_nargs[idx];
}
@@ -5142,8 +5141,7 @@ static void ex_quit(exarg_T *eap)
*/
static void ex_cquit(exarg_T *eap)
{
- getout(1); /* this does not always pass on the exit code to the Manx
- compiler. why? */
+ getout(1);
}
/*
@@ -7482,7 +7480,7 @@ int find_cmdline_var(const char_u *src, int *usedlen) FUNC_ATTR_NONNULL_ALL
# define SPEC_AMATCH 9
};
- for (i = 0; i < (int)(sizeof(spec_str) / sizeof(char *)); ++i) {
+ for (i = 0; i < (int)ARRAY_SIZE(spec_str); ++i) {
len = (int)STRLEN(spec_str[i]);
if (STRNCMP(src, spec_str[i], len) == 0) {
*usedlen = len;
@@ -8543,7 +8541,9 @@ static void ex_loadview(exarg_T *eap)
fname = get_view_file(*eap->arg);
if (fname != NULL) {
- do_source(fname, FALSE, DOSO_NONE);
+ if (do_source(fname, FALSE, DOSO_NONE) == FAIL) {
+ EMSG2(_(e_notopen), fname);
+ }
free(fname);
}
}
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index aed0484356..a19cb36d12 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -3715,7 +3715,7 @@ ExpandFromContext (
* right function to do the expansion.
*/
ret = FAIL;
- for (i = 0; i < (int)(sizeof(tab) / sizeof(struct expgen)); ++i)
+ for (i = 0; i < (int)ARRAY_SIZE(tab); ++i)
if (xp->xp_context == tab[i].context) {
if (tab[i].ic) {
regmatch.rm_ic = TRUE;
@@ -4155,7 +4155,7 @@ static char_u *get_history_arg(expand_T *xp, int idx)
static char_u compl[2] = { NUL, NUL };
char *short_names = ":=@>?/";
int short_names_count = (int)STRLEN(short_names);
- int history_name_count = sizeof(history_names) / sizeof(char *) - 1;
+ int history_name_count = ARRAY_SIZE(history_names) - 1;
if (idx < short_names_count) {
compl[0] = (char_u)short_names[idx];
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 9734ac07f9..9c6d7c96bb 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -2839,27 +2839,25 @@ buf_write (
* Check if backup file already exists.
*/
if (os_fileinfo((char *)backup, &file_info_new)) {
- /*
- * Check if backup file is same as original file.
- * May happen when modname() gave the same file back (e.g. silly
- * link). If we don't check here, we either ruin the file when
- * copying or erase it after writing.
- */
if (os_fileinfo_id_equal(&file_info_new, &file_info_old)) {
+ /*
+ * Backup file is same as original file.
+ * May happen when modname() gave the same file back (e.g. silly
+ * link). If we don't check here, we either ruin the file when
+ * copying or erase it after writing.
+ */
free(backup);
backup = NULL; /* no backup file to delete */
- }
-
- /*
- * If we are not going to keep the backup file, don't
- * delete an existing one, try to use another name.
- * Change one character, just before the extension.
- */
- if (!p_bk) {
- wp = backup + STRLEN(backup) - 1
- - STRLEN(backup_ext);
- if (wp < backup) /* empty file name ??? */
+ } else if (!p_bk) {
+ /*
+ * We are not going to keep the backup file, so don't
+ * delete an existing one, and try to use another name instead.
+ * Change one character, just before the extension.
+ */
+ wp = backup + STRLEN(backup) - 1 - STRLEN(backup_ext);
+ if (wp < backup) { /* empty file name ??? */
wp = backup;
+ }
*wp = 'z';
while (*wp > 'a'
&& os_fileinfo((char *)backup, &file_info_new)) {
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c
index 5d9d353fc8..f1f619066a 100644
--- a/src/nvim/hardcopy.c
+++ b/src/nvim/hardcopy.c
@@ -945,8 +945,6 @@ static colnr_T hardcopy_line(prt_settings_T *psettings, int page_line, prt_pos_T
* http://www.adobe.com
*/
-#define NUM_ELEMENTS(arr) (sizeof(arr)/sizeof((arr)[0]))
-
#define PRT_PS_DEFAULT_DPI (72) /* Default user space resolution */
#define PRT_PS_DEFAULT_FONTSIZE (10)
#define PRT_PS_DEFAULT_BUFFER_SIZE (80)
@@ -1139,33 +1137,33 @@ static struct prt_ps_charset_S k_charsets[] =
static struct prt_ps_mbfont_S prt_ps_mbfonts[] =
{
{
- NUM_ELEMENTS(j_encodings),
+ ARRAY_SIZE(j_encodings),
j_encodings,
- NUM_ELEMENTS(j_charsets),
+ ARRAY_SIZE(j_charsets),
j_charsets,
"jis_roman",
"JIS_X_1983"
},
{
- NUM_ELEMENTS(sc_encodings),
+ ARRAY_SIZE(sc_encodings),
sc_encodings,
- NUM_ELEMENTS(sc_charsets),
+ ARRAY_SIZE(sc_charsets),
sc_charsets,
"gb_roman",
"GB_2312-80"
},
{
- NUM_ELEMENTS(tc_encodings),
+ ARRAY_SIZE(tc_encodings),
tc_encodings,
- NUM_ELEMENTS(tc_charsets),
+ ARRAY_SIZE(tc_charsets),
tc_charsets,
"cns_roman",
"BIG5"
},
{
- NUM_ELEMENTS(k_encodings),
+ ARRAY_SIZE(k_encodings),
k_encodings,
- NUM_ELEMENTS(k_charsets),
+ ARRAY_SIZE(k_charsets),
k_charsets,
"ks_roman",
"KS_X_1992"
@@ -1639,12 +1637,12 @@ static int prt_next_dsc(struct prt_dsc_line_S *p_dsc_line)
return FALSE;
/* Find type of DSC comment */
- for (comment = 0; comment < (int)NUM_ELEMENTS(prt_dsc_table); 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 != NUM_ELEMENTS(prt_dsc_table)) {
+ 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;
@@ -2135,7 +2133,7 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
props = enc_canon_props(p_encoding);
if (!(props & ENC_8BIT) && ((*p_pmcs != NUL) || !(props & ENC_UNICODE))) {
p_mbenc_first = NULL;
- for (cmap = 0; cmap < (int)NUM_ELEMENTS(prt_ps_mbfonts); cmap++)
+ 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)
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index 7090e007bf..075acc6c13 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -58,8 +58,8 @@ int get_indent_str(char_u *ptr, int ts, int list)
if (!list || lcs_tab1) { // count a tab for what it is worth
count += ts - (count % ts);
} else {
- // in list mode, when tab is not set, count screen char width for Tab:
- // ^I
+ // In list mode, when tab is not set, count screen char width
+ // for Tab, displays: ^I
count += ptr2cells(ptr);
}
} else if (*ptr == ' ') {
diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c
index 6648a9f7c6..bbc0b291dc 100644
--- a/src/nvim/indent_c.c
+++ b/src/nvim/indent_c.c
@@ -210,9 +210,36 @@ static pos_T *find_line_comment(void) /* XXX */
return NULL;
}
-/*
- * Check if string matches "label:"; move to character after ':' if true.
- */
+/// Checks if `text` starts with "key:".
+static bool cin_has_js_key(char_u *text)
+{
+ char_u *s = skipwhite(text);
+
+ char_u quote = 0;
+ if (*s == '\'' || *s == '"') {
+ // can be 'key': or "key":
+ quote = *s;
+ ++s;
+ }
+ if (!vim_isIDc(*s)) { // need at least one ID character
+ return FALSE;
+ }
+
+ while (vim_isIDc(*s)) {
+ ++s;
+ }
+ if (*s && *s == quote) {
+ ++s;
+ }
+
+ s = cin_skipcomment(s);
+
+ // "::" is not a label, it's C++
+ return (*s == ':' && s[1] != ':');
+}
+
+/// Checks if string matches "label:"; move to character after ':' if true.
+/// "*s" must point to the start of the label, if there is one.
static int cin_islabel_skip(char_u **s)
{
if (!vim_isIDc(**s)) /* need at least one ID character */
@@ -303,7 +330,7 @@ static int cin_isinit(void)
for (;; ) {
int i, l;
- for (i = 0; i < (int)(sizeof(skip) / sizeof(char *)); ++i) {
+ for (i = 0; i < (int)ARRAY_SIZE(skip); ++i) {
l = (int)strlen(skip[i]);
if (cin_starts_with(s, skip[i])) {
s = cin_skipcomment(s + l);
@@ -1198,21 +1225,21 @@ static pos_T *find_start_brace(void)
return trypos;
}
-/*
- * Find the matching '(', failing if it is in a comment.
- * Return NULL if no match found.
- */
-static pos_T *
-find_match_paren ( /* XXX */
- int ind_maxparen
-)
+/// Find the matching '(', ignoring it if it is in a comment.
+/// @returns NULL or the found match.
+static pos_T *find_match_paren(int ind_maxparen)
+{
+ return find_match_char('(', ind_maxparen);
+}
+
+static pos_T * find_match_char(char_u c, int ind_maxparen)
{
pos_T cursor_save;
pos_T *trypos;
static pos_T pos_copy;
cursor_save = curwin->w_cursor;
- if ((trypos = findmatchlimit(NULL, '(', 0, ind_maxparen)) != NULL) {
+ if ((trypos = findmatchlimit(NULL, c, 0, ind_maxparen)) != NULL) {
/* check if the ( is in a // comment */
if ((colnr_T)cin_skip2pos(trypos) > trypos->col)
trypos = NULL;
@@ -1220,7 +1247,7 @@ find_match_paren ( /* XXX */
pos_copy = *trypos; /* copy trypos, findmatch will change it */
trypos = &pos_copy;
curwin->w_cursor = *trypos;
- if (ind_find_start_comment() != NULL) /* XXX */
+ if (ind_find_start_comment() != NULL)
trypos = NULL;
}
}
@@ -1228,6 +1255,29 @@ find_match_paren ( /* XXX */
return trypos;
}
+/// Find the matching '(', ignoring it if it is in a comment or before an
+/// unmatched {.
+/// @returns NULL or the found match.
+static pos_T *find_match_paren_after_brace(int ind_maxparen)
+{
+ pos_T *trypos = find_match_paren(ind_maxparen);
+ if (trypos == NULL) {
+ return NULL;
+ }
+
+ pos_T *tryposBrace = find_start_brace();
+ // If both an unmatched '(' and '{' is found. Ignore the '('
+ // position if the '{' is further down.
+ if (tryposBrace != NULL
+ && (trypos->lnum != tryposBrace->lnum
+ ? trypos->lnum < tryposBrace->lnum
+ : trypos->col < tryposBrace->col)) {
+ trypos = NULL;
+ }
+ return trypos;
+}
+
+
/*
* Return ind_maxparen corrected for the difference in line number between the
* cursor position and "startpos". This makes sure that searching for a
@@ -1517,6 +1567,8 @@ int get_c_indent(void)
#define LOOKFOR_NOBREAK 8
#define LOOKFOR_CPP_BASECLASS 9
#define LOOKFOR_ENUM_OR_INIT 10
+#define LOOKFOR_JS_KEY 11
+#define LOOKFOR_NO_COMMA 12
int whilelevel;
linenr_T lnum;
@@ -1731,6 +1783,12 @@ int get_c_indent(void)
}
}
}
+ // Are we looking at a ']' that has a match?
+ else if (*skipwhite(theline) == ']'
+ && (trypos = find_match_char('[', curbuf->b_ind_maxparen)) != NULL) {
+ // align with the line containing the '['.
+ amount = get_indent_lnum(trypos->lnum);
+ }
/*
* Are we inside parentheses or braces?
*/ /* XXX */
@@ -1939,13 +1997,14 @@ int get_c_indent(void)
else {
curwin->w_cursor.lnum = our_paren_pos.lnum;
curwin->w_cursor.col = col;
- if (find_match_paren(curbuf->b_ind_maxparen) != NULL)
+ if (find_match_paren_after_brace(curbuf->b_ind_maxparen)) {
amount += curbuf->b_ind_unclosed2;
- else {
- if (is_if_for_while)
+ } else {
+ if (is_if_for_while) {
amount += curbuf->b_ind_if_for_while;
- else
+ } else {
amount += curbuf->b_ind_unclosed;
+ }
}
}
/*
@@ -1964,13 +2023,10 @@ int get_c_indent(void)
/* add extra indent for a comment */
if (cin_iscomment(theline))
amount += curbuf->b_ind_comment;
- }
- /*
- * Are we at least inside braces, then?
- */
- else {
+ } else {
+ // We are inside braces, there is a { before this line at the position
+ // stored in tryposBrace.
trypos = tryposBrace;
-
ourscope = trypos->lnum;
start = ml_get(ourscope);
@@ -1989,28 +2045,22 @@ int get_c_indent(void)
else
start_brace = BRACE_AT_START;
} else {
- /*
- * that opening brace might have been on a continuation
- * line. if so, find the start of the line.
- */
+ // That opening brace might have been on a continuation
+ // line. If so, find the start of the line.
curwin->w_cursor.lnum = ourscope;
- /*
- * position the cursor over the rightmost paren, so that
- * matching it will take us back to the start of the line.
- */
+ // Position the cursor over the rightmost paren, so that
+ // matching it will take us back to the start of the line.
lnum = ourscope;
if (find_last_paren(start, '(', ')')
- && (trypos = find_match_paren(curbuf->b_ind_maxparen))
- != NULL)
+ && (trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL) {
lnum = trypos->lnum;
+ }
- /*
- * It could have been something like
- * case 1: if (asdf &&
- * ldfd) {
- * }
- */
+ // It could have been something like
+ // case 1: if (asdf &&
+ // ldfd) {
+ // }
if ((curbuf->b_ind_js || curbuf->b_ind_keep_case_label)
&& cin_iscase(skipwhite(get_cursor_line_ptr()), FALSE)) {
amount = get_indent();
@@ -2023,11 +2073,12 @@ int get_c_indent(void)
start_brace = BRACE_AT_END;
}
- /*
- * if we're looking at a closing brace, that's where
- * we want to be. otherwise, add the amount of room
- * that an indent is supposed to be.
- */
+ // For Javascript check if the line starts with "key:".
+ bool js_cur_has_key = curbuf->b_ind_js ? cin_has_js_key(theline) : false;
+
+ // If we're looking at a closing brace, that's where
+ // we want to be. Otherwise, add the amount of room
+ // that an indent is supposed to be.
if (theline[0] == '}') {
/*
* they may want closing braces to line up with something
@@ -2109,14 +2160,12 @@ int get_c_indent(void)
scope_amount = amount;
whilelevel = 0;
- /*
- * Search backwards. If we find something we recognize, line up
- * with that.
- *
- * if we're looking at an open brace, indent
- * the usual amount relative to the conditional
- * that opens the block.
- */
+ // Search backwards. If we find something we recognize, line up
+ // with that.
+ //
+ // If we're looking at an open brace, indent
+ // the usual amount relative to the conditional
+ // that opens the block.
curwin->w_cursor = cur_curpos;
for (;; ) {
curwin->w_cursor.lnum--;
@@ -2485,26 +2534,58 @@ int get_c_indent(void)
*/
terminated = cin_isterminated(l, FALSE, TRUE);
+ if (js_cur_has_key) {
+ js_cur_has_key = false; // only check the first line
+ if (curbuf->b_ind_js && terminated == ',') {
+ // For Javascript we might be inside an object:
+ // key: something, <- align with this
+ // key: something
+ // or:
+ // key: something + <- align with this
+ // something,
+ // key: something
+ lookfor = LOOKFOR_JS_KEY;
+ }
+ }
+ if (lookfor == LOOKFOR_JS_KEY && cin_has_js_key(l)) {
+ amount = get_indent();
+ break;
+ }
+ if (lookfor == LOOKFOR_NO_COMMA) {
+ if (terminated != ',') {
+ // Line below current line is the one that starts a
+ // (possibly broken) line ending in a comma.
+ break;
+ }
+ amount = get_indent();
+ if (curwin->w_cursor.lnum - 1 == ourscope) {
+ // line above is start of the scope, thus current line
+ // is the one that stars a (possibly broken) line
+ // ending in a comma.
+ break;
+ }
+ }
+
if (terminated == 0 || (lookfor != LOOKFOR_UNTERM
&& terminated == ',')) {
- /*
- * if we're in the middle of a paren thing,
- * go back to the line that starts it so
- * we can get the right prevailing indent
- * if ( foo &&
- * bar )
- */
- /*
- * position the cursor over the rightmost paren, so that
- * matching it will take us back to the start of the line.
- */
+ // If we're in the middle of a paren thing, Go back to the line
+ // that starts it so we can get the right prevailing indent
+ // if ( foo &&
+ // bar )
+
+ // Position the cursor over the rightmost paren, so that
+ // matching it will take us back to the start of the line.
+ // Ignore a match before the start of the block.
(void)find_last_paren(l, '(', ')');
trypos = find_match_paren(corr_ind_maxparen(&cur_curpos));
+ if (trypos != NULL && (trypos->lnum < tryposBrace->lnum
+ || (trypos->lnum == tryposBrace->lnum
+ && trypos->col < tryposBrace->col))) {
+ trypos = NULL;
+ }
- /*
- * If we are looking for ',', we also look for matching
- * braces.
- */
+ // If we are looking for ',', we also look for matching
+ // braces.
if (trypos == NULL && terminated == ','
&& find_last_paren(l, '{', '}'))
trypos = find_start_brace();
@@ -2546,10 +2627,11 @@ int get_c_indent(void)
* Get indent and pointer to text for current line,
* ignoring any jump label. XXX
*/
- if (!curbuf->b_ind_js)
- cur_amount = skip_label(curwin->w_cursor.lnum, &l);
- else
+ if (curbuf->b_ind_js) {
cur_amount = get_indent();
+ } else {
+ cur_amount = skip_label(curwin->w_cursor.lnum, &l);
+ }
/*
* If this is just above the line we are indenting, and it
* starts with a '{', line it up with this line.
@@ -2570,7 +2652,7 @@ int get_c_indent(void)
if (*skipwhite(l) != '{')
amount += curbuf->b_ind_open_extra;
- if (curbuf->b_ind_cpp_baseclass) {
+ if (curbuf->b_ind_cpp_baseclass && !curbuf->b_ind_js) {
/* have to look back, whether it is a cpp base
* class declaration or initialization */
lookfor = LOOKFOR_CPP_BASECLASS;
@@ -2716,17 +2798,43 @@ int get_c_indent(void)
* yet.
*/
if (lookfor == LOOKFOR_INITIAL && terminated == ',') {
- lookfor = LOOKFOR_ENUM_OR_INIT;
- cont_amount = cin_first_id_amount();
+ if (curbuf->b_ind_js) {
+ // Search for a line ending in a comma
+ // and line up with the line below it
+ // (could be the current line).
+ // some = [
+ // 1, <- line up here
+ // 2,
+ // some = [
+ // 3 + <- line up here
+ // 4 *
+ // 5,
+ // 6,
+ lookfor = LOOKFOR_NO_COMMA;
+ amount = get_indent(); // XXX
+ trypos = find_match_char('[', curbuf->b_ind_maxparen);
+ if (trypos != NULL) {
+ if (trypos->lnum == curwin->w_cursor.lnum - 1) {
+ // Current line is first inside
+ // [], line up with it.
+ break;
+ }
+ ourscope = trypos->lnum;
+ }
+ } else {
+ lookfor = LOOKFOR_ENUM_OR_INIT;
+ cont_amount = cin_first_id_amount();
+ }
} else {
if (lookfor == LOOKFOR_INITIAL
&& *l != NUL
- && l[STRLEN(l) - 1] == '\\')
- /* XXX */
- cont_amount = cin_get_equal_amount(
- curwin->w_cursor.lnum);
- if (lookfor != LOOKFOR_TERM)
+ && l[STRLEN(l) - 1] == '\\') {
+ // XXX
+ cont_amount = cin_get_equal_amount( curwin->w_cursor.lnum);
+ }
+ if (lookfor != LOOKFOR_TERM && lookfor != LOOKFOR_JS_KEY) {
lookfor = LOOKFOR_UNTERM;
+ }
}
}
}
@@ -2735,8 +2843,7 @@ int get_c_indent(void)
* Check if we are after a while (cond);
* If so: Ignore until the matching "do".
*/
- /* XXX */
- else if (cin_iswhileofdo_end(terminated)) {
+ else if (cin_iswhileofdo_end(terminated)) { // XXX
/*
* Found an unterminated line after a while ();, line up
* with the last one.
@@ -2933,21 +3040,17 @@ term_again:
if (curbuf->b_ind_jump_label > 0 && original_line_islabel)
amount -= curbuf->b_ind_jump_label;
}
- /*
- * ok -- we're not inside any sort of structure at all!
- *
- * this means we're at the top level, and everything should
- * basically just match where the previous line is, except
- * for the lines immediately following a function declaration,
- * which are K&R-style parameters and need to be indented.
- */
else {
- /*
- * if our line starts with an open brace, forget about any
- * prevailing indent and make sure it looks like the start
- * of a function
- */
-
+ // Ok -- we're not inside any sort of structure at all!
+ //
+ // this means we're at the top level, and everything should
+ // basically just match where the previous line is, except
+ // for the lines immediately following a function declaration,
+ // which are K&R-style parameters and need to be indented.
+
+ // if our line starts with an open brace, forget about any
+ // prevailing indent and make sure it looks like the start
+ // of a function
if (theline[0] == '{') {
amount = curbuf->b_ind_first_open;
}
@@ -3081,6 +3184,15 @@ term_again:
if (cin_ends_in(l, (char_u *)"};", NULL))
break;
+ // If the previous line ends on '[' we are probably in an
+ // array constant:
+ // something = [
+ // 234, <- extra indent
+ if (cin_ends_in(l, (char_u *)"[", NULL)) {
+ amount = get_indent() + ind_continuation;
+ break;
+ }
+
/*
* Find a line only has a semicolon that belongs to a previous
* line ending in '}', e.g. before an #endif. Don't increase
diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c
index 45977b96ae..9c5160ffb2 100644
--- a/src/nvim/keymap.c
+++ b/src/nvim/keymap.c
@@ -284,8 +284,7 @@ static struct key_name_entry {
{0, NULL}
};
-#define KEY_NAMES_TABLE_LEN (sizeof(key_names_table) / \
- sizeof(struct key_name_entry))
+#define KEY_NAMES_TABLE_LEN ARRAY_SIZE(key_names_table)
static struct mousetable {
int pseudo_code; /* Code for pseudo mouse event */
diff --git a/src/nvim/macros.h b/src/nvim/macros.h
index 215ad3a1f7..7dd8120d09 100644
--- a/src/nvim/macros.h
+++ b/src/nvim/macros.h
@@ -152,4 +152,12 @@
# define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE
+/// Calculate the length of a C array.
+///
+/// This should be called with a real array. Calling this with a pointer is an
+/// error. A mechanism to detect many (though not all) of those errors at compile
+/// time is implemented. It works by the second division producing a division by
+/// zero in those cases (-Wdiv-by-zero in GCC).
+#define ARRAY_SIZE(arr) ((sizeof(arr)/sizeof((arr)[0])) / ((size_t)(!(sizeof(arr) % sizeof((arr)[0])))))
+
#endif // NVIM_MACROS_H
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 6c2cb2b645..1f6c8ddc81 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -208,9 +208,6 @@ int main(int argc, char **argv)
/*
* Check if we have an interactive window.
- * On the Amiga: If there is no window, we open one with a newcli command
- * (needed for :! to * work). mch_check_win() will also handle the -d or
- * -dev argument.
*/
check_and_set_isatty(&params);
@@ -1087,8 +1084,7 @@ static void command_line_scan(mparm_T *parmp)
exmode_active = EXMODE_VIM;
break;
- case 'f': /* "-f" GUI: run in foreground. Amiga: open
- window directly, not with newcli */
+ case 'f': /* "-f" GUI: run in foreground. */
break;
case 'g': /* "-g" start GUI */
@@ -1489,9 +1485,6 @@ static void init_startuptime(mparm_T *paramp)
/*
* Check if we have an interactive window.
- * On the Amiga: If there is no window, we open one with a newcli command
- * (needed for :! to * work). mch_check_win() will also handle the -d or
- * -dev argument.
*/
static void check_and_set_isatty(mparm_T *paramp)
{
@@ -1957,10 +1950,10 @@ static void source_startup_scripts(mparm_T *parmp)
/*
* Try to read initialization commands from the following places:
* - environment variable VIMINIT
- * - user vimrc file (s:.vimrc for Amiga, ~/.vimrc otherwise)
+ * - user vimrc file (~/.vimrc)
* - second user vimrc file ($VIM/.vimrc for Dos)
* - environment variable EXINIT
- * - user exrc file (s:.exrc for Amiga, ~/.exrc otherwise)
+ * - user exrc file (~/.exrc)
* - second user exrc file ($VIM/.exrc for Dos)
* The first that exists is used, the rest is ignored.
*/
@@ -2168,7 +2161,7 @@ static void usage(void)
for (i = 0;; ++i) {
mch_msg(_(" vim [arguments] "));
mch_msg(_(use[i]));
- if (i == (sizeof(use) / sizeof(char_u *)) - 1)
+ if (i == ARRAY_SIZE(use) - 1)
break;
mch_msg(_("\n or:"));
}
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index db4516527a..26eda01f98 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -289,11 +289,9 @@ enc_canon_table[] =
#define IDX_MACROMAN 57
{"macroman", ENC_8BIT + ENC_MACROMAN, 0}, /* Mac OS */
-#define IDX_DECMCS 58
- {"dec-mcs", ENC_8BIT, 0}, /* DEC MCS */
-#define IDX_HPROMAN8 59
+#define IDX_HPROMAN8 58
{"hp-roman8", ENC_8BIT, 0}, /* HP Roman8 */
-#define IDX_COUNT 60
+#define IDX_COUNT 59
};
/*
@@ -925,9 +923,9 @@ static int dbcs_ptr2len_len(const char_u *p, int size)
}
/*
- * Return true if "c" is in "table[size / sizeof(struct interval)]".
+ * Return true if "c" is in "table".
*/
-static bool intable(const struct interval *table, size_t size, int c)
+static bool intable(const struct interval *table, size_t n_items, int c)
{
int mid, bot, top;
@@ -937,7 +935,7 @@ static bool intable(const struct interval *table, size_t size, int c)
/* binary search in table */
bot = 0;
- top = (int)(size / sizeof(struct interval) - 1);
+ top = (int)(n_items - 1);
while (top >= bot) {
mid = (bot + top) / 2;
if (table[mid].last < c)
@@ -1204,7 +1202,7 @@ int utf_char2cells(int c)
#else
if (!utf_printable(c))
return 6; /* unprintable, displays <xxxx> */
- if (intable(doublewidth, sizeof(doublewidth), c))
+ if (intable(doublewidth, ARRAY_SIZE(doublewidth), c))
return 2;
#endif
}
@@ -1212,7 +1210,7 @@ int utf_char2cells(int c)
else if (c >= 0x80 && !vim_isprintc(c))
return 4; /* unprintable, displays <xx> */
- if (c >= 0x80 && *p_ambw == 'd' && intable(ambiguous, sizeof(ambiguous), c))
+ if (c >= 0x80 && *p_ambw == 'd' && intable(ambiguous, ARRAY_SIZE(ambiguous), c))
return 2;
return 1;
@@ -2026,7 +2024,7 @@ bool utf_iscomposing(int c)
{0xe0100, 0xe01ef}
};
- return intable(combining, sizeof(combining), c);
+ return intable(combining, ARRAY_SIZE(combining), c);
}
/*
@@ -2050,7 +2048,7 @@ bool utf_printable(int c)
{0xfffe, 0xffff}
};
- return !intable(nonprint, sizeof(nonprint), c);
+ return !intable(nonprint, ARRAY_SIZE(nonprint), c);
#endif
}
@@ -2138,7 +2136,7 @@ int utf_class(int c)
{0x2f800, 0x2fa1f, 0x4e00}, /* CJK Ideographs */
};
int bot = 0;
- int top = sizeof(classes) / sizeof(struct clinterval) - 1;
+ int top = ARRAY_SIZE(classes) - 1;
int mid;
/* First quick check for Latin1 characters, use 'iskeyword'. */
@@ -2346,13 +2344,12 @@ static convertStruct foldCase[] =
* Return the converted equivalent of "a", which is a UCS-4 character. Use
* the given conversion "table". Uses binary search on "table".
*/
-static int utf_convert(int a, convertStruct *table, int tableSize)
+static int utf_convert(int a, convertStruct *table, size_t n_items)
{
- int start, mid, end; /* indices into table */
- int entries = tableSize / sizeof(convertStruct);
+ size_t start, mid, end; /* indices into table */
start = 0;
- end = entries;
+ end = n_items;
while (start < end) {
/* need to search further */
mid = (end + start) / 2;
@@ -2361,7 +2358,7 @@ static int utf_convert(int a, convertStruct *table, int tableSize)
else
end = mid;
}
- if (start < entries
+ if (start < n_items
&& table[start].rangeStart <= a
&& a <= table[start].rangeEnd
&& (a - table[start].rangeStart) % table[start].step == 0)
@@ -2376,7 +2373,7 @@ static int utf_convert(int a, convertStruct *table, int tableSize)
*/
int utf_fold(int a)
{
- return utf_convert(a, foldCase, (int)sizeof(foldCase));
+ return utf_convert(a, foldCase, ARRAY_SIZE(foldCase));
}
static convertStruct toLower[] =
@@ -2702,7 +2699,7 @@ int utf_toupper(int a)
return TOUPPER_LOC(a);
/* For any other characters use the above mapping table. */
- return utf_convert(a, toUpper, (int)sizeof(toUpper));
+ return utf_convert(a, toUpper, ARRAY_SIZE(toUpper));
}
bool utf_islower(int a)
@@ -2732,7 +2729,7 @@ int utf_tolower(int a)
return TOLOWER_LOC(a);
/* For any other characters use the above mapping table. */
- return utf_convert(a, toLower, (int)sizeof(toLower));
+ return utf_convert(a, toLower, ARRAY_SIZE(toLower));
}
bool utf_isupper(int a)
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 7a2cd686c6..e1dc2b93d9 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -318,7 +318,7 @@ static const struct nv_cmd {
};
/* Number of commands in nv_cmds[]. */
-#define NV_CMDS_SIZE (sizeof(nv_cmds) / sizeof(struct nv_cmd))
+#define NV_CMDS_SIZE ARRAY_SIZE(nv_cmds)
/* Sorted index of commands in nv_cmds[]. */
static short nv_cmd_idx[NV_CMDS_SIZE];
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index a6dee2be5b..931b877a95 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -30,6 +30,7 @@
#include "nvim/fold.h"
#include "nvim/getchar.h"
#include "nvim/indent.h"
+#include "nvim/log.h"
#include "nvim/mark.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
@@ -2641,7 +2642,10 @@ do_put (
/* Autocommands may be executed when saving lines for undo, which may make
* y_array invalid. Start undo now to avoid that. */
- u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1);
+ if (u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1) == FAIL) {
+ ELOG(_("Failed to save undo information"));
+ return;
+ }
if (insert_string != NULL) {
y_type = MCHAR;
diff --git a/src/nvim/option.c b/src/nvim/option.c
index c1ab3f2ee5..5b5570fad4 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1808,7 +1808,7 @@ static struct vimoption
}
};
-#define PARAM_COUNT (sizeof(options) / sizeof(struct vimoption))
+#define PARAM_COUNT ARRAY_SIZE(options)
static char *(p_ambw_values[]) = {"single", "double", NULL};
static char *(p_bg_values[]) = {"light", "dark", NULL};
@@ -1883,7 +1883,7 @@ void set_init_1(void)
int mustfree;
ga_init(&ga, 1, 100);
- for (n = 0; n < (long)(sizeof(names) / sizeof(char *)); ++n) {
+ for (n = 0; n < (long)ARRAY_SIZE(names); ++n) {
mustfree = FALSE;
# ifdef UNIX
if (*names[n] == NUL)
@@ -4723,10 +4723,10 @@ static char_u *set_chars_option(char_u **varp)
if (varp == &p_lcs) {
tab = lcstab;
- entries = sizeof(lcstab) / sizeof(struct charstab);
+ entries = ARRAY_SIZE(lcstab);
} else {
tab = filltab;
- entries = sizeof(filltab) / sizeof(struct charstab);
+ entries = ARRAY_SIZE(filltab);
}
/* first round: check for valid value, second round: assign values */
@@ -6196,15 +6196,17 @@ int makeset(FILE *fd, int opt_flags, int local_only)
int pri;
/*
- * The options that don't have a default (terminal name, columns, lines)
- * are never written. Terminal options are also not written.
+ * Some options are never written:
+ * - Options that don't have a default (terminal name, columns, lines).
+ * - Terminal options.
+ * - Hidden options.
+ *
* Do the loop over "options[]" twice: once for options with the
* P_PRI_MKRC flag and once without.
*/
for (pri = 1; pri >= 0; --pri) {
for (p = &options[0]; !istermoption(p); p++)
if (!(p->flags & P_NO_MKRC)
- && !istermoption(p)
&& ((pri == 1) == ((p->flags & P_PRI_MKRC) != 0))) {
/* skip global option when only doing locals */
if (p->indir == PV_NONE && !(opt_flags & OPT_GLOBAL))
@@ -6215,8 +6217,11 @@ int makeset(FILE *fd, int opt_flags, int local_only)
if ((opt_flags & OPT_GLOBAL) && (p->flags & P_NOGLOB))
continue;
- /* Global values are only written when not at the default value. */
varp = get_varp_scope(p, opt_flags);
+ /* Hidden options are never written. */
+ if (!varp)
+ continue;
+ /* Global values are only written when not at the default value. */
if ((opt_flags & OPT_GLOBAL) && optval_default(p, varp))
continue;
@@ -7245,7 +7250,7 @@ int ExpandSettings(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***
for (loop = 0; loop <= 1; ++loop) {
regmatch->rm_ic = ic;
if (xp->xp_context != EXPAND_BOOL_SETTINGS) {
- for (match = 0; match < (int)(sizeof(names) / sizeof(char *));
+ for (match = 0; match < (int)ARRAY_SIZE(names);
++match)
if (vim_regexec(regmatch, (char_u *)names[match], (colnr_T)0)) {
if (loop == 0)
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 39dfbe8b88..4422fbc756 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -369,7 +369,7 @@ EXTERN int p_ek; /* 'esckeys' */
EXTERN int p_exrc; /* 'exrc' */
EXTERN char_u *p_fencs; /* 'fileencodings' */
EXTERN char_u *p_ffs; /* 'fileformats' */
-EXTERN long p_fic; /* 'fileignorecase' */
+EXTERN bool p_fic; ///< 'fileignorecase'
EXTERN char_u *p_fcl; /* 'foldclose' */
EXTERN long p_fdls; /* 'foldlevelstart' */
EXTERN char_u *p_fdo; /* 'foldopen' */
@@ -621,7 +621,7 @@ EXTERN int p_wiv; /* 'weirdinvert' */
EXTERN char_u *p_ww; /* 'whichwrap' */
EXTERN long p_wc; /* 'wildchar' */
EXTERN long p_wcm; /* 'wildcharm' */
-EXTERN long p_wic; /* 'wildignorecase' */
+EXTERN bool p_wic; ///< 'wildignorecase'
EXTERN char_u *p_wim; /* 'wildmode' */
EXTERN int p_wmnu; /* 'wildmenu' */
EXTERN long p_wh; /* 'winheight' */
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index 4db84a4f12..7ec4059bce 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -1,6 +1,5 @@
/*
* VIM - Vi IMproved by Bram Moolenaar
- * VMS merge by Zoltan Arpadffy
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
@@ -1066,10 +1065,12 @@ int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file,
|| pat[i][j + 1] == '`')
*p++ = '\\';
++j;
- } else if (!intick && vim_strchr(SHELL_SPECIAL,
- pat[i][j]) != NULL)
+ } else if (!intick
+ && ((flags & EW_KEEPDOLLAR) == 0 || pat[i][j] != '$')
+ && vim_strchr(SHELL_SPECIAL, pat[i][j]) != NULL)
/* Put a backslash before a special character, but not
- * when inside ``. */
+ * when inside ``. And not for $var when EW_KEEPDOLLAR is
+ * set. */
*p++ = '\\';
/* Copy one character. */
diff --git a/src/nvim/path.c b/src/nvim/path.c
index e8d31f3f73..8af4015611 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -179,7 +179,7 @@ char_u *path_next_component(char_u *fname)
/*
* Get a pointer to one character past the head of a path name.
- * Unix: after "/"; DOS: after "c:\"; Amiga: after "disk:/"; Mac: no head.
+ * Unix: after "/"; DOS: after "c:\"; Mac: no head.
* If there is no head, path is returned.
*/
char_u *get_past_head(char_u *path)
@@ -1080,7 +1080,7 @@ gen_expand_wildcards (
free(p);
ga_clear_strings(&ga);
i = mch_expand_wildcards(num_pat, pat, num_file, file,
- flags);
+ flags | EW_KEEPDOLLAR);
recursive = FALSE;
return i;
}
diff --git a/src/nvim/path.h b/src/nvim/path.h
index 9a994f3477..628ea335ed 100644
--- a/src/nvim/path.h
+++ b/src/nvim/path.h
@@ -17,6 +17,7 @@
#define EW_ICASE 0x100 /* ignore case */
#define EW_NOERROR 0x200 /* no error for bad regexp */
#define EW_NOTWILD 0x400 /* add match with literal name if exists */
+#define EW_KEEPDOLLAR 0x800 /* do not escape $, $var is expanded */
/* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
* is used when executing commands and EW_SILENT for interactive expanding. */
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 69c2119697..dd7af63ce0 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -602,7 +602,7 @@ static int get_char_class(char_u **pp)
int i;
if ((*pp)[1] == ':') {
- for (i = 0; i < (int)(sizeof(class_names) / sizeof(*class_names)); ++i)
+ for (i = 0; i < (int)ARRAY_SIZE(class_names); ++i)
if (STRNCMP(*pp + 2, class_names[i], STRLEN(class_names[i])) == 0) {
*pp += STRLEN(class_names[i]) + 2;
return i;
diff --git a/src/nvim/regexp_defs.h b/src/nvim/regexp_defs.h
index 8aa89d22b7..1e00f14ac6 100644
--- a/src/nvim/regexp_defs.h
+++ b/src/nvim/regexp_defs.h
@@ -108,7 +108,7 @@ typedef struct {
regprog_T *regprog;
char_u *startp[NSUBEXP];
char_u *endp[NSUBEXP];
- int rm_ic;
+ bool rm_ic;
} regmatch_T;
/*
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index b7a485598b..6787ca8080 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -3943,7 +3943,7 @@ get_syn_options (
if (strchr(first_letters, *arg) == NULL)
break;
- for (fidx = sizeof(flagtab) / sizeof(struct flag); --fidx >= 0; ) {
+ for (fidx = ARRAY_SIZE(flagtab); --fidx >= 0; ) {
p = flagtab[fidx].name;
int i;
for (i = 0, len = 0; p[i] != NUL; i += 2, ++len)
@@ -5157,22 +5157,21 @@ get_id_list (
regmatch.rm_ic = TRUE;
id = 0;
for (int i = highlight_ga.ga_len; --i >= 0; ) {
- if (!vim_regexec(&regmatch, HL_TABLE()[i].sg_name, (colnr_T)0)) {
- continue;
- }
- if (round == 2) {
- /* Got more items than expected; can happen
- * when adding items that match:
- * "contains=a.*b,axb".
- * Go back to first round */
- if (count >= total_count) {
- free(retval);
- round = 1;
- } else
- retval[count] = i + 1;
+ if (vim_regexec(&regmatch, HL_TABLE()[i].sg_name, (colnr_T)0)) {
+ if (round == 2) {
+ /* Got more items than expected; can happen
+ * when adding items that match:
+ * "contains=a.*b,axb".
+ * Go back to first round */
+ if (count >= total_count) {
+ free(retval);
+ round = 1;
+ } else
+ retval[count] = i + 1;
+ }
+ ++count;
+ id = -1; /* remember that we found one */
}
- ++count;
- id = -1; /* remember that we found one */
}
vim_regfree(regmatch.regprog);
}
@@ -6296,7 +6295,7 @@ do_highlight (
attr = 0;
off = 0;
while (arg[off] != NUL) {
- for (i = sizeof(hl_attr_table) / sizeof(int); --i >= 0; ) {
+ for (i = ARRAY_SIZE(hl_attr_table); --i >= 0; ) {
len = (int)STRLEN(hl_name_table[i]);
if (STRNICMP(arg + off, hl_name_table[i], len) == 0) {
attr |= hl_attr_table[i];
@@ -6417,7 +6416,7 @@ do_highlight (
/* reduce calls to STRICMP a bit, it can be slow */
off = TOUPPER_ASC(*arg);
- for (i = (sizeof(color_names) / sizeof(char *)); --i >= 0; )
+ for (i = ARRAY_SIZE(color_names); --i >= 0; )
if (off == color_names[i][0]
&& STRICMP(arg + 1, color_names[i] + 1) == 0)
break;
diff --git a/src/nvim/tempfile.c b/src/nvim/tempfile.c
index 33d6f0f37d..f81aff53a1 100644
--- a/src/nvim/tempfile.c
+++ b/src/nvim/tempfile.c
@@ -30,7 +30,7 @@ static void vim_maketempdir(void)
// Try the entries in `TEMP_DIR_NAMES` to create the temp directory.
char_u template[TEMP_FILE_PATH_MAXLEN];
char_u path[TEMP_FILE_PATH_MAXLEN];
- for (size_t i = 0; i < sizeof(temp_dirs) / sizeof(char *); ++i) {
+ for (size_t i = 0; i < ARRAY_SIZE(temp_dirs); ++i) {
// Expand environment variables, leave room for "/nvimXXXXXX/999999999"
expand_env((char_u *)temp_dirs[i], template, TEMP_FILE_PATH_MAXLEN - 22);
if (!os_isdir(template)) { // directory doesn't exist
diff --git a/src/nvim/term.c b/src/nvim/term.c
index 24969bf90f..ceec140670 100644
--- a/src/nvim/term.c
+++ b/src/nvim/term.c
@@ -80,7 +80,7 @@
*
* The entries are compact, therefore they normally are included even when
* HAVE_TGETENT is defined. When HAVE_TGETENT is defined, the builtin entries
- * can be accessed with "builtin_amiga", "builtin_ansi", "builtin_debug", etc.
+ * can be accessed with "builtin_ansi", "builtin_debug", etc.
*
* Each termcap is a list of builtin_term structures. It always starts with
* KS_NAME, which separates the entries. See parse_builtin_tcap() for all
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index 6bacef9778..fce0971d89 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -94,7 +94,7 @@ $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) test1.out
RM_ON_RUN := test.out X* viminfo
RM_ON_START := tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok
-RUN_VIM := VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(TOOL) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in
+RUN_VIM := VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(TOOL) $(VIMPROG) -u unix.vim -U NONE -i viminfo --noplugin -s dotest.in
clean:
-rm -rf *.out \
diff --git a/src/nvim/testdir/test100.in b/src/nvim/testdir/test100.in
index 2bf931fd4f..083b4324b2 100644
--- a/src/nvim/testdir/test100.in
+++ b/src/nvim/testdir/test100.in
@@ -2,7 +2,7 @@ Tests for 'undolevel' setting being global-local
STARTTEST
:so small.vim
-:set nocompatible viminfo+=nviminfo ul=5
+:set ul=5
:fu! FillBuffer()
:for i in range(1,13)
:put=i
diff --git a/src/nvim/testdir/test12.in b/src/nvim/testdir/test12.in
index 46e9c45b80..be3169a625 100644
--- a/src/nvim/testdir/test12.in
+++ b/src/nvim/testdir/test12.in
@@ -5,7 +5,6 @@ Tests for 'directory' option.
STARTTEST
:so small.vim
-:set nocompatible viminfo+=nviminfo
:set dir=.,~
:/start of testfile/,/end of testfile/w! Xtest1
:" do an ls of the current dir to find the swap file (should not be there)
diff --git a/src/nvim/testdir/test15.in b/src/nvim/testdir/test15.in
index 366529a550..60d8717278 100644
--- a/src/nvim/testdir/test15.in
+++ b/src/nvim/testdir/test15.in
@@ -12,7 +12,6 @@ STARTTEST
:set fo+=tcroql tw=72
/xxxxxxxx$
0gq6kk
-:set nocp viminfo+=nviminfo
:" undo/redo here to make the next undo only work on the following changes
u
:map gg :.,.+2s/^/x/<CR>kk:set tw=3<CR>gqq
diff --git a/src/nvim/testdir/test17.in b/src/nvim/testdir/test17.in
index 64534ec77c..7fef87d383 100644
--- a/src/nvim/testdir/test17.in
+++ b/src/nvim/testdir/test17.in
@@ -16,11 +16,7 @@ STARTTEST
:let $CDIR = "."
/CDIR
:else
-:if has("amiga")
-:let $TDIR = "/testdir"
-:else
:let $TDIR = "."
-:endif
/TDIR
:endif
:" Dummy writing for making that sure gf doesn't fail even if the current
diff --git a/src/nvim/testdir/test24.in b/src/nvim/testdir/test24.in
index 7dfc1afdc6..292f403048 100644
--- a/src/nvim/testdir/test24.in
+++ b/src/nvim/testdir/test24.in
Binary files differ
diff --git a/src/nvim/testdir/test29.in b/src/nvim/testdir/test29.in
index 83c6acdc1c..4cc2120814 100644
--- a/src/nvim/testdir/test29.in
+++ b/src/nvim/testdir/test29.in
@@ -5,7 +5,6 @@ Test for joining lines and marks in them
STARTTEST
:so small.vim
-:set viminfo+=nviminfo
:set nojoinspaces
:set cpoptions-=j
/firstline/
diff --git a/src/nvim/testdir/test3.in b/src/nvim/testdir/test3.in
index a7543945c4..7f6d412806 100644
--- a/src/nvim/testdir/test3.in
+++ b/src/nvim/testdir/test3.in
@@ -4,7 +4,7 @@ Test for 'cindent'
STARTTEST
:so small.vim
-:set nocompatible viminfo+=nviminfo modeline
+:set modeline
:edit " read modeline
/start of AUTO
=/end of AUTO
@@ -1432,7 +1432,7 @@ int main ()
STARTTEST
:set cino=(0,ts
-2kdd=][
+2kdd2j=][
ENDTEST
void func(int a
@@ -1446,7 +1446,7 @@ void func(int a
STARTTEST
:set cino=(0
-2kdd=][
+2kdd2j=][
ENDTEST
void
@@ -1461,7 +1461,7 @@ func(int a
STARTTEST
:set cino&
-2kdd=7][
+2kdd2j=7][
ENDTEST
void func(void)
@@ -1538,7 +1538,7 @@ func6(
STARTTEST
:set cino&
:set cino+=l1
-2kdd=][
+2kdd2j=][
ENDTEST
void func(void)
@@ -1567,7 +1567,7 @@ break;
STARTTEST
:set cino&
-2kdd=][
+2kdd2j=][
ENDTEST
void func(void)
@@ -1592,7 +1592,7 @@ void func(void)
STARTTEST
:set cino&
-2kdd=][
+2kdd2j=][
ENDTEST
void func(void)
@@ -1919,10 +1919,10 @@ ENDTEST
JSSTART
var foo = [
-1, // indent 8 more
+1,
2,
3
-]; // indent 8 less
+];
JSEND
STARTTEST
@@ -1937,7 +1937,7 @@ var foo = [
1,
2,
3
-]; // indent 16 less
+];
}
JSEND
@@ -1950,6 +1950,12 @@ ENDTEST
JSSTART
(function($){
+if (cond &&
+cond) {
+stmt;
+}
+window.something.left =
+(width - 50 + offset) + "px";
var class_name='myclass';
function private_method() {
@@ -1965,15 +1971,15 @@ function init(options) {
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
-bar: 2, // indent 8 more
-foobar: [ // indent 8 more
-1, // indent 8 more
-2, // indent 16 more
-3 // indent 16 more
+bar: 2,
+foobar: [
+1,
+2,
+3
],
-callback: function(){ // indent 8 more
-return true; // indent 8 more
-} // indent 8 more
+callback: function(){
+return true;
+}
}, options||{}));
}
@@ -2014,9 +2020,9 @@ $(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
bar: 2,
foobar: [
-1, // indent 8 more
-2, // indent 8 more
-3 // indent 8 more
+1,
+2,
+3
],
callback: function(){
return true;
@@ -2036,15 +2042,15 @@ JSSTART
function init(options) {
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
-bar: 2, // indent 8 more
-foobar: [ // indent 8 more
-1, // indent 8 more
-2, // indent 16 more
-3 // indent 16 more
+bar: 2,
+foobar: [
+1,
+2,
+3
],
-callback: function(){ // indent 8 more
-return true; // indent 8 more
-} // indent 8 more
+callback: function(){
+return true;
+}
}, options||{}));
}
})(jQuery);
diff --git a/src/nvim/testdir/test3.ok b/src/nvim/testdir/test3.ok
index d73a5e1230..0d0e76fce4 100644
--- a/src/nvim/testdir/test3.ok
+++ b/src/nvim/testdir/test3.ok
@@ -1707,10 +1707,10 @@ JSEND
JSSTART
var foo = [
-1, // indent 8 more
+ 1,
2,
3
- ]; // indent 8 less
+];
JSEND
@@ -1720,7 +1720,7 @@ function bar() {
1,
2,
3
- ]; // indent 16 less
+ ];
}
JSEND
@@ -1728,6 +1728,12 @@ JSEND
JSSTART
(function($){
+ if (cond &&
+ cond) {
+ stmt;
+ }
+ window.something.left =
+ (width - 50 + offset) + "px";
var class_name='myclass';
function private_method() {
@@ -1743,15 +1749,15 @@ JSSTART
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
- bar: 2, // indent 8 more
- foobar: [ // indent 8 more
- 1, // indent 8 more
- 2, // indent 16 more
- 3 // indent 16 more
+ bar: 2,
+ foobar: [
+ 1,
+ 2,
+ 3
],
- callback: function(){ // indent 8 more
- return true; // indent 8 more
- } // indent 8 more
+ callback: function(){
+ return true;
+ }
}, options||{}));
}
@@ -1787,9 +1793,9 @@ function init(options) {
foo: 'bar',
bar: 2,
foobar: [
- 1, // indent 8 more
- 2, // indent 8 more
- 3 // indent 8 more
+ 1,
+ 2,
+ 3
],
callback: function(){
return true;
@@ -1804,15 +1810,15 @@ JSSTART
function init(options) {
$(this).data(class_name+'_public',$.extend({},{
foo: 'bar',
- bar: 2, // indent 8 more
- foobar: [ // indent 8 more
- 1, // indent 8 more
- 2, // indent 16 more
- 3 // indent 16 more
+ bar: 2,
+ foobar: [
+ 1,
+ 2,
+ 3
],
- callback: function(){ // indent 8 more
- return true; // indent 8 more
- } // indent 8 more
+ callback: function(){
+ return true;
+ }
}, options||{}));
}
})(jQuery);
diff --git a/src/nvim/testdir/test30.in b/src/nvim/testdir/test30.in
index 4a8778d2de..3f7b9eb472 100644
--- a/src/nvim/testdir/test30.in
+++ b/src/nvim/testdir/test30.in
@@ -24,12 +24,7 @@ STARTTEST
:set nobin eol
:bwipe XXUnix XXDos XXMac
:" create mixed format files
-:if has("vms")
-: !copy XXUnix,XXDos XXUxDs.
-: !copy XXUnix,XXMac XXUxMac.
-: !copy XXDos,XXMac XXDosMac.
-: !copy XXUnix,XXDos,XXMac XXUxDsMc.
-:elseif has("win32")
+:if has("win32")
: !copy /b XXUnix+XXDos XXUxDs
: !copy /b XXUnix+XXMac XXUxMac
: !copy /b XXDos+XXMac XXDosMac
diff --git a/src/nvim/testdir/test32.in b/src/nvim/testdir/test32.in
index 6b399fa6c6..02a41141ab 100644
--- a/src/nvim/testdir/test32.in
+++ b/src/nvim/testdir/test32.in
@@ -22,7 +22,7 @@ Test for insert expansion
STARTTEST
:so small.vim
-:se nocp viminfo+=nviminfo cpt=.,w ff=unix | $-2,$w!Xtestfile | set ff&
+:se cpt=.,w ff=unix | $-2,$w!Xtestfile | set ff&
:se cot=
nO#include "Xtestfile"
ru
diff --git a/src/nvim/testdir/test44.in b/src/nvim/testdir/test44.in
index 87de1b95a4..65b08b08b8 100644
--- a/src/nvim/testdir/test44.in
+++ b/src/nvim/testdir/test44.in
@@ -4,7 +4,7 @@ See test99 for exactly the same test with re=2.
STARTTEST
:so mbyte.vim
-:set nocompatible encoding=utf-8 termencoding=latin1 viminfo+=nviminfo
+:set encoding=utf-8 termencoding=latin1
:set re=1
/^1
/a*b\{2}c\+/e
diff --git a/src/nvim/testdir/test49.in b/src/nvim/testdir/test49.in
index 5e1d6b461e..1ce57246ee 100644
--- a/src/nvim/testdir/test49.in
+++ b/src/nvim/testdir/test49.in
@@ -5,7 +5,7 @@ test49.failed, try to add one or more "G"s at the line ending in "test.out"
STARTTEST
:so small.vim
-:se nocp nomore viminfo+=nviminfo
+:se nomore
:lang mess C
:so test49.vim
GGGGGGGGGGGGGG"rp:.-,$w! test.out
diff --git a/src/nvim/testdir/test61.in b/src/nvim/testdir/test61.in
index dc24ab9804..87bb07a209 100644
--- a/src/nvim/testdir/test61.in
+++ b/src/nvim/testdir/test61.in
@@ -85,7 +85,6 @@ ggO---:0put b
ggO---:0put a
ggO---:w >>test.out
:so small.vim
-:set nocp viminfo+=nviminfo
:enew!
oa
:set ul=100
diff --git a/src/nvim/testdir/test70.in b/src/nvim/testdir/test70.in
index 9fbe818b3d..24d2e4c446 100644
--- a/src/nvim/testdir/test70.in
+++ b/src/nvim/testdir/test70.in
@@ -2,7 +2,6 @@ Smoke test for MzScheme interface and mzeval() function
STARTTEST
:so mzscheme.vim
-:set nocompatible viminfo+=nviminfo
:function! MzRequire()
:redir => l:mzversion
:mz (version)
diff --git a/src/nvim/testdir/test72.in b/src/nvim/testdir/test72.in
index 4700d86981..20897f01a0 100644
--- a/src/nvim/testdir/test72.in
+++ b/src/nvim/testdir/test72.in
@@ -6,7 +6,7 @@ STARTTEST
:so small.vim
:"
:" Test 'undofile': first a simple one-line change.
-:set nocompatible viminfo+=nviminfo visualbell
+:set visualbell
:set ul=100 undofile nomore
:set ft=unix
:e! Xtestfile
diff --git a/src/nvim/testdir/test73.in b/src/nvim/testdir/test73.in
index 666e4d2e50..60cda2d970 100644
--- a/src/nvim/testdir/test73.in
+++ b/src/nvim/testdir/test73.in
@@ -7,7 +7,6 @@ STARTTEST
:"
:" This will cause a few errors, do it silently.
:set visualbell
-:set nocp viminfo+=nviminfo
:"
:function! DeleteDirectory(dir)
: if has("win16") || has("win32") || has("win64") || has("dos16") || has("dos32")
diff --git a/src/nvim/testdir/test74.in b/src/nvim/testdir/test74.in
index 4fbe5e4d01..9fdbe771b3 100644
--- a/src/nvim/testdir/test74.in
+++ b/src/nvim/testdir/test74.in
@@ -7,7 +7,7 @@ STARTTEST
:"
:" This will cause a few errors, do it silently.
:set visualbell
-:set nocp viminfo+=!,nviminfo
+:set viminfo+=!
:let MY_GLOBAL_DICT={'foo': 1, 'bar': 0, 'longvarible': 1000}
:" store a really long list, so line wrapping will occur in viminfo file
:let MY_GLOBAL_LIST=range(1,100)
diff --git a/src/nvim/testdir/test78.in b/src/nvim/testdir/test78.in
index 1850bd9236..cb0e51edd5 100644
--- a/src/nvim/testdir/test78.in
+++ b/src/nvim/testdir/test78.in
@@ -6,7 +6,7 @@ blocks.
STARTTEST
:so small.vim
-:set nocp fileformat=unix undolevels=-1 viminfo+=nviminfo
+:set fileformat=unix undolevels=-1
:e! Xtest
ggdG
:let text = "\tabcdefghijklmnoparstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnoparstuvwxyz0123456789"
diff --git a/src/nvim/testdir/test8.in b/src/nvim/testdir/test8.in
index d9d00d97ae..0f27c813ec 100644
--- a/src/nvim/testdir/test8.in
+++ b/src/nvim/testdir/test8.in
@@ -32,7 +32,7 @@ endfunc
$put ='VimLeave done'
write
endfunc
-:set viminfo='100,nviminfo
+:set viminfo='100
:au BufUnload * call CloseAll()
:au VimLeave * call WriteToOut()
:e small.vim
diff --git a/src/nvim/testdir/test85.in b/src/nvim/testdir/test85.in
index c5ca873a49..f7112792e9 100644
--- a/src/nvim/testdir/test85.in
+++ b/src/nvim/testdir/test85.in
@@ -3,7 +3,6 @@ Test for Lua interface and luaeval() function
STARTTEST
:so small.vim
:so lua.vim
-:set nocompatible viminfo+=nviminfo
:lua l = vim.list():add"item0":add"dictionary with list OK":add"item2"
:lua h = vim.dict(); h.list = l
:call garbagecollect()
diff --git a/src/nvim/testdir/test89.in b/src/nvim/testdir/test89.in
index 1968066198..f1f64fb41f 100644
--- a/src/nvim/testdir/test89.in
+++ b/src/nvim/testdir/test89.in
@@ -5,7 +5,7 @@
STARTTEST
:so small.vim
-:set hidden nocp nu rnu viminfo+=nviminfo
+:set hidden nu rnu
:redir @a | set nu? rnu? | redir END
:e! xx
:redir @b | set nu? rnu? | redir END
diff --git a/src/nvim/testdir/test91.in b/src/nvim/testdir/test91.in
index e900a522df..b66776b1e4 100644
--- a/src/nvim/testdir/test91.in
+++ b/src/nvim/testdir/test91.in
@@ -55,6 +55,7 @@ STARTTEST
:tabnew
:tabnew
:let t:var_list = [1, 2, 3]
+:let t:other = 777
:let def_list = [4, 5, 6, 7]
:tabrewind
:$put =string(gettabvar(3, 'var_list'))
diff --git a/src/nvim/testdir/test91.ok b/src/nvim/testdir/test91.ok
index 22e1572209..809952b69d 100644
--- a/src/nvim/testdir/test91.ok
+++ b/src/nvim/testdir/test91.ok
@@ -26,8 +26,8 @@ iso-8859-2
0
[1, 2, 3]
[1, 2, 3]
-''
-[4, 5, 6, 7]
+{'var_list': [1, 2, 3], 'other': 777}
+{'var_list': [1, 2, 3], 'other': 777}
[4, 5, 6, 7]
''
[4, 5, 6, 7]
diff --git a/src/nvim/testdir/test94.in b/src/nvim/testdir/test94.in
index dfa91d8340..a8b46112d2 100644
--- a/src/nvim/testdir/test94.in
+++ b/src/nvim/testdir/test94.in
@@ -17,7 +17,6 @@ Test cases:
STARTTEST
:so small.vim
-:set nocp viminfo+=nviminfo
:
:" User functions
:function MoveToCap()
diff --git a/src/nvim/testdir/test95.in b/src/nvim/testdir/test95.in
index b2b9de772e..221b550487 100644
--- a/src/nvim/testdir/test95.in
+++ b/src/nvim/testdir/test95.in
@@ -7,7 +7,7 @@ actually tried.
STARTTEST
:so small.vim
:so mbyte.vim
-:set nocp encoding=utf-8 viminfo+=nviminfo nomore
+:set encoding=utf-8 nomore
:" tl is a List of Lists with:
:" 2: test auto/old/new 0: test auto/old 1: test auto/new
:" regexp pattern
diff --git a/src/nvim/testdir/test99.in b/src/nvim/testdir/test99.in
index 77828f4b68..32bc68cce4 100644
--- a/src/nvim/testdir/test99.in
+++ b/src/nvim/testdir/test99.in
@@ -4,7 +4,7 @@ See test44 for exactly the same test with re=1.
STARTTEST
:so mbyte.vim
-:set nocompatible encoding=utf-8 termencoding=latin1 viminfo+=nviminfo
+:set encoding=utf-8 termencoding=latin1
:set re=2
/^1
/a*b\{2}c\+/e
diff --git a/src/nvim/testdir/test_breakindent.in b/src/nvim/testdir/test_breakindent.in
index 0b00c95a85..ad12d0074d 100644
--- a/src/nvim/testdir/test_breakindent.in
+++ b/src/nvim/testdir/test_breakindent.in
@@ -81,7 +81,7 @@ STARTTEST
:" https://groups.google.com/d/msg/vim_dev/ZOdg2mc9c9Y/TT8EhFjEy0IJ
:only
:vert 20new
-:set all& nocp breakindent briopt=min:10
+:set all& breakindent briopt=min:10
:call setline(1, [" a\tb\tc\td\te", " z y x w v"])
:/^\s*a
fbgjyl:let line1 = @0
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 2ab31b6cfd..9a3da5bcdb 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -230,7 +230,7 @@ int u_save(linenr_T top, linenr_T bot)
if (top > curbuf->b_ml.ml_line_count
|| top >= bot
|| bot > curbuf->b_ml.ml_line_count + 1)
- return FALSE; /* rely on caller to do error messages */
+ return FAIL; /* rely on caller to do error messages */
if (top + 2 == bot)
u_saveline((linenr_T)(top + 1));
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 3460b7c6c3..245f797306 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -178,6 +178,14 @@ static char *(features[]) = {
};
static int included_patches[] = {
+ //560,
+ //559,
+ //558 NA
+ //557 NA
+ //556 NA
+ //555 NA
+ //554,
+ //553,
//552,
//551,
//550,
@@ -274,7 +282,7 @@ static int included_patches[] = {
//458,
//457,
//456,
- //455,
+ 455,
454,
//453 NA
//452,
@@ -287,7 +295,7 @@ static int included_patches[] = {
//445,
444,
//443,
- //442,
+ 442,
//441,
440,
439,
@@ -295,7 +303,7 @@ static int included_patches[] = {
437,
436,
435,
- //434,
+ 434,
433,
//432 NA
//431 NA
@@ -306,7 +314,7 @@ static int included_patches[] = {
//426 NA
425,
//424 NA
- //423,
+ 423,
//422,
421,
//420 NA
@@ -339,7 +347,7 @@ static int included_patches[] = {
//393 NA
392,
391,
- //390,
+ 390,
//389,
388,
387,
@@ -374,12 +382,12 @@ static int included_patches[] = {
358,
357,
//356 NA
- //355,
+ 355,
//354 NA
353,
352,
351,
- //350,
+ 350,
349,
348,
347,
@@ -986,7 +994,7 @@ void intro_message(int colon)
};
// blanklines = screen height - # message lines
- blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
+ blanklines = (int)Rows - (ARRAY_SIZE(lines) - 1);
// Don't overwrite a statusline. Depends on 'cmdheight'.
if (p_ls > 1) {
@@ -1006,7 +1014,7 @@ void intro_message(int colon)
row = blanklines / 2;
if (((row >= 2) && (Columns >= 50)) || colon) {
- for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i) {
+ for (i = 0; i < (int)ARRAY_SIZE(lines); ++i) {
p = lines[i];
if (sponsor != 0) {
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 0ed43b0184..029fcaac8b 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -1977,6 +1977,7 @@ void win_close_othertab(win_T *win, int free_buf, tabpage_T *tp)
tabpage_T *ptp = NULL;
int free_tp = FALSE;
+ assert(win->w_buffer); // to avoid np dereference warning in next line
if (win->w_closing || win->w_buffer->b_closing)
return; /* window is already being closed */
diff --git a/test/functional/legacy/027_expand_file_names_spec.lua b/test/functional/legacy/027_expand_file_names_spec.lua
index bff61c1516..d31f29d38a 100644
--- a/test/functional/legacy/027_expand_file_names_spec.lua
+++ b/test/functional/legacy/027_expand_file_names_spec.lua
@@ -10,7 +10,6 @@ describe('expand file name', function()
setup(clear)
it('is working', function()
- execute('set nocp')
execute('!mkdir Xdir1')
execute('!mkdir Xdir2')
execute('!mkdir Xdir3')
diff --git a/test/functional/legacy/043_magic_settings_spec.lua b/test/functional/legacy/043_magic_settings_spec.lua
index ccef298cdd..27694e3754 100644
--- a/test/functional/legacy/043_magic_settings_spec.lua
+++ b/test/functional/legacy/043_magic_settings_spec.lua
@@ -21,7 +21,6 @@ describe('regexp with magic settings', function()
9 foobar
]])
- execute('set nocompatible viminfo+=nviminfo')
execute('/^1')
execute([[/a*b\{2}c\+/e]])
feed([[x/\Md\*e\{2}f\+/e<cr>]])
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt
index 9f0e3fac9e..5abfa23da4 100644
--- a/third-party/CMakeLists.txt
+++ b/third-party/CMakeLists.txt
@@ -2,15 +2,10 @@
cmake_minimum_required (VERSION 2.8.7)
project(NEOVIM_DEPS)
-if(NOT DEPS_DIR)
- get_filename_component(PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
- set(DEPS_DIR ${PARENT_DIR}/.deps)
-endif()
-
-set(DEPS_INSTALL_DIR "${DEPS_DIR}/usr")
-set(DEPS_BIN_DIR "${DEPS_DIR}/usr/bin")
-set(DEPS_LIB_DIR "${DEPS_DIR}/usr/lib")
-set(DEPS_BUILD_DIR "${DEPS_DIR}/build")
+set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/usr")
+set(DEPS_BIN_DIR "${CMAKE_BINARY_DIR}/usr/bin")
+set(DEPS_LIB_DIR "${CMAKE_BINARY_DIR}/usr/lib")
+set(DEPS_BUILD_DIR "${CMAKE_BINARY_DIR}/build")
set(DEPS_DOWNLOAD_DIR "${DEPS_BUILD_DIR}/downloads")
option(USE_BUNDLED "Use bundled dependencies." ON)
@@ -255,7 +250,7 @@ if(USE_BUNDLED_LUAROCKS)
add_custom_command(OUTPUT ${DEPS_BIN_DIR}/busted
COMMAND ${DEPS_BIN_DIR}/luarocks
- ARGS build busted 2.0.rc3 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
+ ARGS build busted 2.0.rc4 CC=${DEPS_C_COMPILER} LD=${DEPS_C_COMPILER}
DEPENDS luarocks)
add_custom_target(busted
DEPENDS ${DEPS_BIN_DIR}/busted)