aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-07-10 08:10:15 +0800
committerckelsel <ckelsel@hotmail.com>2017-07-10 08:10:15 +0800
commit465bbee520d1b1b57477fd7d80fbdeaf5e1e1e77 (patch)
treeedae38568202ba41dee4a49f78884da313fd114b
parent1514cdc7d8863eeee6b04883b1c50aac40048b49 (diff)
parent6725667d31591e8025589c4c1df34469f3bfdb52 (diff)
downloadrneovim-465bbee520d1b1b57477fd7d80fbdeaf5e1e1e77.tar.gz
rneovim-465bbee520d1b1b57477fd7d80fbdeaf5e1e1e77.tar.bz2
rneovim-465bbee520d1b1b57477fd7d80fbdeaf5e1e1e77.zip
Merge remote-tracking branch 'upstream/master'
-rw-r--r--ISSUE_TEMPLATE.md11
-rw-r--r--cmake/FindJeMalloc.cmake3
-rw-r--r--runtime/doc/api.txt105
-rw-r--r--runtime/doc/deprecated.txt8
-rw-r--r--runtime/doc/eval.txt9
-rw-r--r--runtime/doc/gui.txt15
-rw-r--r--runtime/doc/intro.txt4
-rw-r--r--runtime/doc/map.txt27
-rw-r--r--runtime/doc/options.txt37
-rw-r--r--runtime/doc/quickref.txt4
-rw-r--r--runtime/doc/starting.txt4
-rw-r--r--runtime/doc/syntax.txt12
-rw-r--r--runtime/doc/term.txt242
-rw-r--r--runtime/doc/tips.txt10
-rw-r--r--runtime/doc/vim_diff.txt31
-rw-r--r--runtime/doc/visual.txt6
-rw-r--r--runtime/doc/windows.txt2
-rw-r--r--runtime/ftplugin/help.vim5
-rw-r--r--runtime/ftplugin/vim.vim5
-rw-r--r--runtime/syntax/vim.vim2
-rwxr-xr-xscripts/pvscheck.sh26
-rw-r--r--src/nvim/api/private/helpers.c2
-rw-r--r--src/nvim/api/vim.c12
-rw-r--r--src/nvim/bufhl_defs.h2
-rw-r--r--src/nvim/charset.c6
-rw-r--r--src/nvim/edit.c2
-rw-r--r--src/nvim/eval.c28
-rw-r--r--src/nvim/eval/typval.c23
-rw-r--r--src/nvim/event/process.c35
-rw-r--r--src/nvim/event/process.h3
-rw-r--r--src/nvim/event/socket.c9
-rw-r--r--src/nvim/ex_cmds.c3
-rw-r--r--src/nvim/ex_docmd.c2
-rw-r--r--src/nvim/ex_getln.c2
-rw-r--r--src/nvim/getchar.c36
-rw-r--r--src/nvim/keymap.c17
-rw-r--r--src/nvim/keymap.h10
-rw-r--r--src/nvim/main.c23
-rw-r--r--src/nvim/mbyte.c85
-rw-r--r--src/nvim/menu.c5
-rw-r--r--src/nvim/message.c161
-rw-r--r--src/nvim/normal.c5
-rw-r--r--src/nvim/option.c28
-rw-r--r--src/nvim/option_defs.h70
-rw-r--r--src/nvim/options.lua4
-rw-r--r--src/nvim/os/fileio.c76
-rw-r--r--src/nvim/os/os_defs.h7
-rw-r--r--src/nvim/os/win_defs.h10
-rw-r--r--src/nvim/regexp.c7
-rw-r--r--src/nvim/screen.c11
-rw-r--r--src/nvim/shada.c12
-rw-r--r--src/nvim/spell.c12
-rw-r--r--src/nvim/syntax.c17
-rw-r--r--src/nvim/terminal.c2
-rw-r--r--src/nvim/tui/terminfo.c121
-rw-r--r--src/nvim/tui/terminfo.h10
-rw-r--r--src/nvim/tui/tui.c931
-rw-r--r--test/functional/api/keymap_spec.lua112
-rw-r--r--test/functional/api/vim_spec.lua13
-rw-r--r--test/functional/autocmd/termclose_spec.lua41
-rw-r--r--test/functional/eval/map_functions_spec.lua41
-rw-r--r--test/functional/ex_cmds/echo_spec.lua321
-rw-r--r--test/functional/fixtures/bigfile_oneline.txt593
-rw-r--r--test/functional/helpers.lua26
-rw-r--r--test/functional/insert/ctrl_o_spec.lua43
-rw-r--r--test/functional/shada/errors_spec.lua18
-rw-r--r--test/functional/terminal/tui_spec.lua217
-rw-r--r--test/functional/ui/inccommand_spec.lua28
-rw-r--r--test/unit/eval/typval_spec.lua36
-rw-r--r--test/unit/os/env_spec.lua4
-rw-r--r--test/unit/os/fileio_spec.lua72
71 files changed, 3176 insertions, 746 deletions
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index 011739396d..1a7268a51e 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -1,16 +1,19 @@
+<!-- Before reporting: search existing issues and check the FAQ. -->
+
- `nvim --version`:
- Vim (version: ) behaves differently?
- Operating system/version:
- Terminal name/version:
- `$TERM`:
-### Actual behaviour
-
-### Expected behaviour
-
### Steps to reproduce using `nvim -u NORC`
```
nvim -u NORC
```
+
+### Actual behaviour
+
+### Expected behaviour
+
diff --git a/cmake/FindJeMalloc.cmake b/cmake/FindJeMalloc.cmake
index 820ceeed4a..f139196a38 100644
--- a/cmake/FindJeMalloc.cmake
+++ b/cmake/FindJeMalloc.cmake
@@ -27,6 +27,9 @@ find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h
if(JEMALLOC_USE_STATIC)
list(APPEND JEMALLOC_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ list(INSERT JEMALLOC_NAMES 0
+ "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
list(APPEND JEMALLOC_NAMES jemalloc)
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index ebc2a40561..7c6b8a3c1a 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -165,7 +165,16 @@ nvim_input({keys}) *nvim_input()*
*nvim_replace_termcodes()*
nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special})
- Replaces any terminal codes with the internal representation
+ Replaces terminal codes and |keycodes| (<CR>, <Esc>, ...) in a
+ string with the internal representation.
+
+ Parameters:~
+ {str} String to be converted.
+ {from_part} Legacy Vim parameter. Usually true.
+ {do_lt} Also translate <lt>. Does nothing if
+ `special` is false.
+ {special} Replace |keycodes|, e.g. <CR> becomes a "\n"
+ char.
nvim_command_output({str}) *nvim_command_output()*
TODO: Documentation
@@ -182,8 +191,10 @@ nvim_eval({expr}) *nvim_eval()*
Evaluation result or expanded object
nvim_call_function({fname}, {args}) *nvim_call_function()*
- Calls a VimL function with the given arguments. On VimL error:
- Returns a generic error; v:errmsg is not updated.
+ Calls a VimL function with the given arguments
+
+ On VimL error: Returns a generic error; v:errmsg is not
+ updated.
Parameters:~
{fname} Function to call
@@ -192,6 +203,23 @@ nvim_call_function({fname}, {args}) *nvim_call_function()*
Return:~
Result of the function call
+nvim_execute_lua({code}, {args}) *nvim_execute_lua()*
+ Execute lua code. Parameters might be passed, they are
+ available inside the chunk as `...`. The chunk can return a
+ value.
+
+ To evaluate an expression, it must be prefixed with "return ".
+ For instance, to call a lua function with arguments sent in
+ and get its return value back, use the code "return
+ my_function(...)".
+
+ Parameters:~
+ {code} lua code to execute
+ {args} Arguments to the code
+
+ Return:~
+ Return value of lua code if present or NIL.
+
nvim_strwidth({str}) *nvim_strwidth()*
Calculates the number of display cells occupied by `text`.
<Tab> counts as one cell.
@@ -382,6 +410,17 @@ nvim_get_mode() *nvim_get_mode()*
Return:~
Dictionary { "mode": String, "blocking": Boolean }
+nvim_get_keymap({mode}) *nvim_get_keymap()*
+ Get a list of dictionaries describing global (i.e. non-buffer)
+ mappings Note that the "buffer" key will be 0 to represent
+ false.
+
+ Parameters:~
+ {mode} The abbreviation for the mode
+
+ Return:~
+ An array of maparg() like dictionaries describing mappings
+
nvim_get_api_info() *nvim_get_api_info()*
TODO: Documentation
@@ -414,6 +453,54 @@ nvim_call_atomic({calls}) *nvim_call_atomic()*
error ocurred, the values from all preceding calls will
still be returned.
+nvim__id({obj}) *nvim__id()*
+ Returns object given as argument
+
+ This API function is used for testing. One should not rely on
+ its presence in plugins.
+
+ Parameters:~
+ {obj} Object to return.
+
+ Return:~
+ its argument.
+
+nvim__id_array({arr}) *nvim__id_array()*
+ Returns array given as argument
+
+ This API function is used for testing. One should not rely on
+ its presence in plugins.
+
+ Parameters:~
+ {arr} Array to return.
+
+ Return:~
+ its argument.
+
+nvim__id_dictionary({dct}) *nvim__id_dictionary()*
+ Returns dictionary given as argument
+
+ This API function is used for testing. One should not rely on
+ its presence in plugins.
+
+ Parameters:~
+ {dct} Dictionary to return.
+
+ Return:~
+ its argument.
+
+nvim__id_float({flt}) *nvim__id_float()*
+ Returns floating-point value given as argument
+
+ This API function is used for testing. One should not rely on
+ its presence in plugins.
+
+ Parameters:~
+ {flt} Value to return.
+
+ Return:~
+ its argument.
+
==============================================================================
Buffer Functions *api-buffer*
@@ -492,6 +579,18 @@ nvim_buf_get_changedtick({buffer}) *nvim_buf_get_changedtick()*
Return:~
b:changedtickvalue.
+nvim_buf_get_keymap({buffer}, {mode}) *nvim_buf_get_keymap()*
+ Get a list of dictionaries describing buffer-local mappings
+ Note that the buffer key in the dictionary will represent the
+ buffer handle where the mapping is present
+
+ Parameters:~
+ {mode} The abbreviation for the mode
+ {buffer_id} Buffer handle
+
+ Return:~
+ An array of maparg() like dictionaries describing mappings
+
nvim_buf_set_var({buffer}, {name}, {value}) *nvim_buf_set_var()*
Sets a buffer-scoped (b:) variable
diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt
index 26cd5b24cc..b3e2f7a92f 100644
--- a/runtime/doc/deprecated.txt
+++ b/runtime/doc/deprecated.txt
@@ -39,10 +39,16 @@ Functions ~
*highlightID()* Obsolete name for |hlID()|.
*last_buffer_nr()* Obsolete name for bufnr("$").
+Modifiers ~
+*:menu-<special>*
+*:menu-special* <> notation is always enabled. |cpo-<|
+*:map-<special>*
+*:map-special* <> notation is always enabled. |cpo-<|
+
Options ~
*'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
*'langnoremap'* Deprecated alias to 'nolangremap'.
*'vi'*
*'viminfo'* Deprecated alias to 'shada' option.
- vim:tw=78:ts=8:ft=help:norl:
+ vim:noet:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 2a73590c76..cca62f1469 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1852,10 +1852,11 @@ v:t_number Value of Number type. Read-only. See: |type()|
v:t_string Value of String type. Read-only. See: |type()|
*v:termresponse* *termresponse-variable*
-v:termresponse The escape sequence returned by the terminal for the |t_RV|
- termcap entry. It is set when Vim receives an escape sequence
- that starts with ESC [ or CSI and ends in a 'c', with only
- digits, ';' and '.' in between.
+v:termresponse The escape sequence returned by the terminal for the DA
+ (request primary device attributes) control sequence. It is
+ set when Vim receives an escape sequence that starts with ESC
+ [ or CSI and ends in a 'c', with only digits, ';' and '.' in
+ between.
When this option is set, the TermResponse autocommand event is
fired, so that you can react to the response from the
terminal.
diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index 0bd3a40a7c..b66a60c860 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -490,9 +490,6 @@ expression register: >
:amenu Insert.foobar "='foobar'<CR>P
-Note that the '<' and 'k' flags in 'cpoptions' also apply here (when
-included they make the <> form and raw key codes not being recognized).
-
Note that <Esc> in Cmdline mode executes the command, like in a mapping. This
is Vi compatible. Use CTRL-C to quit Cmdline mode.
@@ -504,21 +501,13 @@ The ":set ic" will not be echoed when using this menu. Messages from the
executed command are still given though. To shut them up too, add a ":silent"
in the executed command: >
:menu <silent> Search.Header :exe ":silent normal /Header\r"<CR>
-"<silent>" may also appear just after "<special>" or "<script>".
-
- *:menu-<special>* *:menu-special*
-Define a menu with <> notation for special keys, even though the "<" flag
-may appear in 'cpoptions'. This is useful if the side effect of setting
-'cpoptions' is not desired. Example: >
- :menu <special> Search.Header /Header<CR>
-"<special>" must appear as the very first argument to the ":menu" command or
-just after "<silent>" or "<script>".
+"<silent>" may also appear just after "<script>".
*:menu-<script>* *:menu-script*
The "to" part of the menu will be inspected for mappings. If you don't want
this, use the ":noremenu" command (or the similar one for a specific mode).
If you do want to use script-local mappings, add "<script>" as the very first
-argument to the ":menu" command or just after "<silent>" or "<special>".
+argument to the ":menu" command or just after "<silent>".
*menu-priority*
You can give a priority to a menu. Menus with a higher priority go more to
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index c745d60ebc..88d04aa76b 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -442,8 +442,8 @@ 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
-value, in which case this value is obtained from the termcap entry "kD". Both
-values have the same effect.
+value, in which case this value is obtained from the |terminfo| entry "key_dc".
+Both values have the same effect.
Note: The keypad keys are used in the same way as the corresponding "normal"
keys. For example, <kHome> has the same effect as <Home>. If a keypad key
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 16c044a21d..bfcf621cb8 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -149,7 +149,7 @@ type "a", then "bar" will get inserted.
1.2 SPECIAL ARGUMENTS *:map-arguments*
-"<buffer>", "<nowait>", "<silent>", "<special>", "<script>", "<expr>" and
+"<buffer>", "<nowait>", "<silent>", "<script>", "<expr>" and
"<unique>" can be used in any order. They must appear right after the
command, before any other arguments.
@@ -189,12 +189,6 @@ Prompts will still be given, e.g., for inputdialog().
Using "<silent>" for an abbreviation is possible, but will cause redrawing of
the command line to fail.
- *:map-<special>* *:map-special*
-Define a mapping with <> notation for special keys, even though the "<" flag
-may appear in 'cpoptions'. This is useful if the side effect of setting
-'cpoptions' is not desired. Example: >
- :map <special> <F12> /Header<CR>
-<
*:map-<script>* *:map-script*
If the first argument to one of these commands is "<script>" and it is used to
define a new mapping or abbreviation, the mapping will only remap characters
@@ -443,17 +437,15 @@ There are two ways to map a special key:
1. The Vi-compatible method: Map the key code. Often this is a sequence that
starts with <Esc>. To enter a mapping like this you type ":map " and then
you have to type CTRL-V before hitting the function key. Note that when
- the key code for the key is in the termcap, it will automatically be
- translated into the internal code and become the second way of mapping
- (unless the 'k' flag is included in 'cpoptions').
+ the key code for the key is in the |terminfo| entry, it will automatically
+ be translated into the internal code and become the second way of mapping.
2. The second method is to use the internal code for the function key. To
enter such a mapping type CTRL-K and then hit the function key, or use
the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc.
(see table of keys |key-notation|, all keys from <Up> can be used). The
first ten function keys can be defined in two ways: Just the number, like
"#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0"
- refers to function key 10. The <> form cannot be used when 'cpoptions'
- includes the '<' flag.
+ refers to function key 10.
DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it
isn't the terminal key codes are tried. If a terminal code is found it is
@@ -571,9 +563,9 @@ Since the '|' character is used to separate a map command from the next
command, you will have to do something special to include a '|' in {rhs}.
There are three methods:
use works when example ~
- <Bar> '<' is not in 'cpoptions' :map _l :!ls <Bar> more^M
+ <Bar> always :map _l :!ls <Bar> more^M
\| 'b' is not in 'cpoptions' :map _l :!ls \| more^M
- ^V| always, in Vim and Vi :map _l :!ls ^V| more^M
+ ^V| always :map _l :!ls ^V| more^M
(here ^V stands for CTRL-V; to get one CTRL-V you have to type it twice; you
cannot use the <> notation "<C-V>" here).
@@ -628,8 +620,7 @@ out about, ^D is CTRL-D).
1.8 EXAMPLES *map-examples*
-A few examples (given as you type them, for "<CR>" you type four characters;
-the '<' flag must not be present in 'cpoptions' for this to work). >
+A few examples (as you type them: for "<CR>" you type four characters). >
:map <F3> o#include
:map <M-g> /foo<CR>cwbar<Esc>
@@ -881,7 +872,6 @@ character is mostly ignored otherwise.
It is possible to move the cursor after an abbreviation: >
:iab if if ()<Left>
-This does not work if 'cpoptions' includes the '<' flag. |<>|
You can even do more complicated things. For example, to consume the space
typed after an abbreviation: >
@@ -1029,8 +1019,7 @@ functions used in one script use the same name as in other scripts. To avoid
this, they can be made local to the script.
*<SID>* *<SNR>* *E81*
-The string "<SID>" can be used in a mapping or menu. This requires that the
-'<' flag is not present in 'cpoptions'.
+The string "<SID>" can be used in a mapping or menu.
When executing the map command, Vim will replace "<SID>" with the special
key code <SNR>, followed by a number that's unique for the script, and an
underscore. Example: >
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index bb5cfb4a80..dc968cd666 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -24,10 +24,7 @@ achieve special effects. These options come in three forms:
:se[t] all Show all but terminal options.
-:se[t] termcap Show all terminal options. Note that in the GUI the
- key codes are not shown, because they are generated
- internally and can't be changed. Changing the terminal
- codes in the GUI is not useful either...
+:se[t] termcap Do nothing. Nvim uses |terminfo|.
*E518* *E519*
:se[t] {option}? Show value of {option}.
@@ -1571,7 +1568,6 @@ A jump table for the options with a short description can be found at |Q_op|.
results in X being mapped to:
'B' included: "\^[" (^[ is a real <Esc>)
'B' excluded: "<Esc>" (5 characters)
- ('<' excluded in both cases)
*cpo-c*
c Searching continues at the end of any match at the
cursor position, but not further than the start of the
@@ -1621,15 +1617,6 @@ A jump table for the options with a short description can be found at |Q_op|.
J A |sentence| has to be followed by two spaces after
the '.', '!' or '?'. A <Tab> is not recognized as
white space.
- *cpo-k*
- k Disable the recognition of raw key codes in
- mappings, abbreviations, and the "to" part of menu
- commands. For example, if <Key> sends ^[OA (where ^[
- is <Esc>), the command ":map X ^[OA" results in X
- being mapped to:
- 'k' included: "^[OA" (3 characters)
- 'k' excluded: "<Key>" (one key code)
- Also see the '<' flag below.
*cpo-K*
K Don't wait for a key code to complete when it is
halfway through a mapping. This breaks mapping
@@ -1763,14 +1750,6 @@ A jump table for the options with a short description can be found at |Q_op|.
+ When included, a ":write file" command will reset the
'modified' flag of the buffer, even though the buffer