diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/provider/clipboard.vim | 1 | ||||
-rw-r--r-- | runtime/doc/change.txt | 19 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 52 | ||||
-rw-r--r-- | runtime/doc/windows.txt | 1 |
4 files changed, 50 insertions, 23 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 5d1ce7896d..3728eb9367 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -83,6 +83,7 @@ function! s:clipboard.set(lines, regtype, reg) end let selection.data = [a:lines, a:regtype] let argv = split(s:copy[a:reg], " ") + let selection.detach = s:cache_enabled let jobid = jobstart(argv, selection) if jobid <= 0 echohl WarningMsg diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 0fa383bc67..42dc84e0de 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -371,8 +371,10 @@ CTRL-X Subtract [count] from the number or alphabetic character at or after the cursor. The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned -octal and hexadecimal numbers and alphabetic characters. This depends on the -'nrformats' option. +binary/octal/hexadecimal numbers and alphabetic characters. This +depends on the 'nrformats' option. +- When 'nrformats' includes "bin", Vim considers numbers starting with '0b' or + '0B' as binary. - When 'nrformats' includes "octal", Vim considers numbers starting with a '0' to be octal, unless the number includes a '8' or '9'. Other numbers are decimal and may have a preceding minus sign. @@ -386,6 +388,10 @@ octal and hexadecimal numbers and alphabetic characters. This depends on the under or after the cursor. This is useful to make lists with an alphabetic index. +For decimals a leading negative sign is considered for incrementing or +decrementing, for binary and octal and hex values, it won't be considered. To +ignore the sign Visually select the number before using CTRL-A or CTRL-X. + For numbers with leading zeros (including all octal and hexadecimal numbers), Vim preserves the number of characters in the number when possible. CTRL-A on "0077" results in "0100", CTRL-X on "0x100" results in "0x0ff". @@ -397,6 +403,10 @@ octal number. Note that when 'nrformats' includes "octal", decimal numbers with leading zeros cause mistakes, because they can be confused with octal numbers. +Note similarly, when 'nrformats' includes "bin", binary numbers with a leading +'0x' or '0X' can be interpreted as hexadecimal rather than binary since '0b' +are valid hexadecimal digits. + The CTRL-A command is very useful in a macro. Example: Use the following steps to make a numbered list. @@ -1602,7 +1612,7 @@ Vim has a sorting function and a sorting command. The sorting function can be found here: |sort()|, |uniq()|. *:sor* *:sort* -:[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/] +:[range]sor[t][!] [i][u][r][n][x][o][b] [/{pattern}/] Sort lines in [range]. When no range is given all lines are sorted. @@ -1622,6 +1632,9 @@ found here: |sort()|, |uniq()|. With [o] sorting is done on the first octal number in the line (after or inside a {pattern} match). + With [b] sorting is done on the first binary number in + the line (after or inside a {pattern} match). + With [u] only keep the first of a sequence of identical lines (ignoring case when [i] is used). Without this flag, a sequence of identical lines diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1f1dc71f28..f0747dad1b 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -65,14 +65,16 @@ the Number. Examples: Number 0 --> String "0" ~ Number -1 --> String "-1" ~ *octal* -Conversion from a String to a Number is done by converting the first digits -to a number. Hexadecimal "0xf9" and Octal "017" numbers are recognized. If -the String doesn't start with digits, the result is zero. Examples: +Conversion from a String to a Number is done by converting the first digits to +a number. Hexadecimal "0xf9", Octal "017", and Binary "0b10" numbers are +recognized. If the String doesn't start with digits, the result is zero. +Examples: String "456" --> Number 456 ~ String "6bar" --> Number 6 ~ String "foo" --> Number 0 ~ String "0xf1" --> Number 241 ~ String "0100" --> Number 64 ~ + String "0b101" --> Number 5 ~ String "-8" --> Number -8 ~ String "+8" --> Number 0 ~ @@ -1894,6 +1896,7 @@ isdirectory( {directory}) Number TRUE if {directory} is a directory islocked( {expr}) Number TRUE if {expr} is locked items( {dict}) List key-value pairs in {dict} jobclose({job}[, {stream}]) Number Closes a job stream(s) +jobpid({job}) Number Returns pid of a job. jobresize({job}, {width}, {height}) Number Resize {job}'s pseudo terminal window jobsend({job}, {data}) Number Writes {data} to {job}'s stdin @@ -4157,6 +4160,9 @@ jobclose({job}[, {stream}]) {Nvim} *jobclose()* Close {job}'s {stream}, which can be one "stdin", "stdout" or "stderr". If {stream} is omitted, all streams are closed. +jobpid({job}) {Nvim} *jobpid()* + Return the pid (process id) of {job}. + jobresize({job}, {width}, {height}) {Nvim} *jobresize()* Resize {job}'s pseudo terminal window to {width} and {height}. This function will fail if used on jobs started without the @@ -4194,6 +4200,10 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* - width: Width of the terminal screen(only if pty is set) - height: Height of the terminal screen(only if pty is set) - TERM: $TERM environment variable(only if pty is set) + - detach: Detach the job process from the nvim process. The + process won't get killed when nvim exists. If the process + dies before nvim exits, on_exit will still be invoked. + This option is only allowed for non-pty jobs. Either funcrefs or function names can be passed as event handlers. The {opts} object is also used as the "self" argument for the callback, so the caller may pass arbitrary @@ -4911,6 +4921,9 @@ printf({fmt}, {expr1} ...) *printf()* %c single byte %d decimal number %5d decimal number padded with spaces to 5 characters + %b binary number + %08b binary number padded with zeros to at least 8 characters + %B binary number using upper case letters %x hex number %04x hex number padded with zeros to at least 4 characters %X hex number using upper case letters @@ -4997,20 +5010,19 @@ printf({fmt}, {expr1} ...) *printf()* The conversion specifiers and their meanings are: - *printf-d* *printf-o* *printf-x* *printf-X* - doxX The Number argument is converted to signed decimal - (d), unsigned octal (o), or unsigned hexadecimal (x - and X) notation. The letters "abcdef" are used for - x conversions; the letters "ABCDEF" are used for X - conversions. - The precision, if any, gives the minimum number of - digits that must appear; if the converted value - requires fewer digits, it is padded on the left with - zeros. - In no case does a non-existent or small field width - cause truncation of a numeric field; if the result of - a conversion is wider than the field width, the field - is expanded to contain the conversion result. + *printf-d* *printf-b* *printf-B* *printf-o* *printf-x* *printf-X* + dbBoxX The Number argument is converted to signed decimal (d), + unsigned binary (b and B), unsigned octal (o), or + unsigned hexadecimal (x and X) notation. The letters + "abcdef" are used for x conversions; the letters + "ABCDEF" are used for X conversions. The precision, if + any, gives the minimum number of digits that must + appear; if the converted value requires fewer digits, it + is padded on the left with zeros. In no case does a + non-existent or small field width cause truncation of a + numeric field; if the result of a conversion is wider + than the field width, the field is expanded to contain + the conversion result. *printf-c* c The Number argument is converted to a byte, and the @@ -6126,12 +6138,14 @@ str2float( {expr}) *str2float()* str2nr( {expr} [, {base}]) *str2nr()* Convert string {expr} to a number. - {base} is the conversion base, it can be 8, 10 or 16. + {base} is the conversion base, it can be 2, 8, 10 or 16. When {base} is omitted base 10 is used. This also means that a leading zero doesn't cause octal conversion to be used, as with the default String to Number conversion. When {base} is 16 a leading "0x" or "0X" is ignored. With a - different base the result will be zero. + different base the result will be zero. Similarly, when {base} + is 8 a leading "0" is ignored, and when {base} is 2 a leading + "0b" or "0B" is ignored. Text after the number is silently ignored. diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 56f57c21c5..eee171b7da 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -681,7 +681,6 @@ can also get to them with the buffer list commands, like ":bnext". When using the |:tab| modifier each argument is opened in a tab page. The last window is used if it's empty. Also see |++opt| and |+cmd|. - {only available when compiled with a GUI} ============================================================================== 8. Do a command in all buffers or windows *list-repeat* |