Mirror of the Vim source from https://github.com/vim/vim
Revisão | bd9069d21c5d3933c9fcef14b2b18e764c8fe0ff (tree) |
---|---|
Hora | 2020-02-15 01:00:04 |
Autor | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
patch 8.2.0258: modifyOtherKeys cannot be temporarily disabled
Commit: https://github.com/vim/vim/commit/4132eb505c506f7a0710b03a275d1c5a247e4196
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 14 16:53:00 2020 +0100
@@ -1,4 +1,4 @@ | ||
1 | -*eval.txt* For Vim version 8.2. Last change: 2020 Feb 03 | |
1 | +*eval.txt* For Vim version 8.2. Last change: 2020 Feb 14 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -2414,6 +2414,7 @@ | ||
2414 | 2414 | did_filetype() Number |TRUE| if FileType autocmd event used |
2415 | 2415 | diff_filler({lnum}) Number diff filler lines about {lnum} |
2416 | 2416 | diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col} |
2417 | +echoraw({expr}) none output {expr} as-is | |
2417 | 2418 | empty({expr}) Number |TRUE| if {expr} is empty |
2418 | 2419 | environ() Dict return environment variables |
2419 | 2420 | escape({string}, {chars}) String escape {chars} in {string} with '\' |
@@ -2899,6 +2900,7 @@ | ||
2899 | 2900 | win_screenpos({nr}) List get screen position of window {nr} |
2900 | 2901 | win_splitmove({nr}, {target} [, {options}]) |
2901 | 2902 | Number move window {nr} to split of {target} |
2903 | +win_type([{nr}]) String type of window {nr} | |
2902 | 2904 | winbufnr({nr}) Number buffer number of window {nr} |
2903 | 2905 | wincol() Number window column of the cursor |
2904 | 2906 | winheight({nr}) Number height of window {nr} |
@@ -3944,6 +3946,17 @@ | ||
3944 | 3946 | Can also be used as a |method|: > |
3945 | 3947 | GetLnum()->diff_hlID(col) |
3946 | 3948 | |
3949 | + | |
3950 | +echoraw({expr}) *echoraw()* | |
3951 | + Output {expr} as-is, including unprintable characters. This | |
3952 | + can be used to output a terminal code. For example, to disable | |
3953 | + modifyOtherKeys: > | |
3954 | + call echoraw(&t_TE) | |
3955 | +< and to enable it again: > | |
3956 | + call echoraw(&t_TI) | |
3957 | +< Use with care, you can mess up the terminal this way. | |
3958 | + | |
3959 | + | |
3947 | 3960 | empty({expr}) *empty()* |
3948 | 3961 | Return the Number 1 if {expr} is empty, zero otherwise. |
3949 | 3962 | - A |List| or |Dictionary| is empty when it does not have any |
@@ -10402,6 +10415,7 @@ | ||
10402 | 10415 | Can also be used as a |method|: > |
10403 | 10416 | GetWinid()->win_splitmove(target) |
10404 | 10417 | < |
10418 | + | |
10405 | 10419 | *winbufnr()* |
10406 | 10420 | winbufnr({nr}) The result is a Number, which is the number of the buffer |
10407 | 10421 | associated with window {nr}. {nr} can be the window number or |
@@ -60,6 +60,7 @@ | ||
60 | 60 | #endif |
61 | 61 | static void f_deepcopy(typval_T *argvars, typval_T *rettv); |
62 | 62 | static void f_did_filetype(typval_T *argvars, typval_T *rettv); |
63 | +static void f_echoraw(typval_T *argvars, typval_T *rettv); | |
63 | 64 | static void f_empty(typval_T *argvars, typval_T *rettv); |
64 | 65 | static void f_environ(typval_T *argvars, typval_T *rettv); |
65 | 66 | static void f_escape(typval_T *argvars, typval_T *rettv); |
@@ -394,6 +395,7 @@ | ||
394 | 395 | {"did_filetype", 0, 0, 0, &t_number, f_did_filetype}, |
395 | 396 | {"diff_filler", 1, 1, FEARG_1, &t_number, f_diff_filler}, |
396 | 397 | {"diff_hlID", 2, 2, FEARG_1, &t_number, f_diff_hlID}, |
398 | + {"echoraw", 1, 1, FEARG_1, &t_number, f_echoraw}, | |
397 | 399 | {"empty", 1, 1, FEARG_1, &t_number, f_empty}, |
398 | 400 | {"environ", 0, 0, 0, &t_dict_string, f_environ}, |
399 | 401 | {"escape", 2, 2, FEARG_1, &t_string, f_escape}, |
@@ -1814,6 +1816,21 @@ | ||
1814 | 1816 | } |
1815 | 1817 | |
1816 | 1818 | /* |
1819 | + * "echoraw({expr})" function | |
1820 | + */ | |
1821 | + static void | |
1822 | +f_echoraw(typval_T *argvars, typval_T *rettv UNUSED) | |
1823 | +{ | |
1824 | + char_u *str = tv_get_string_chk(&argvars[0]); | |
1825 | + | |
1826 | + if (str != NULL && *str != NUL) | |
1827 | + { | |
1828 | + out_str(str); | |
1829 | + out_flush(); | |
1830 | + } | |
1831 | +} | |
1832 | + | |
1833 | +/* | |
1817 | 1834 | * "empty({expr})" function |
1818 | 1835 | */ |
1819 | 1836 | static void |
@@ -0,0 +1,5 @@ | ||
1 | +>x+0&#ffffff0|e|l@1|o| @34 | |
2 | +|~+0#4040ff13&| @38 | |
3 | +|~| @38 | |
4 | +|~| @38 | |
5 | +| +0#0000000&@21|0|,|0|-|1| @8|A|l@1| |
@@ -2,6 +2,7 @@ | ||
2 | 2 | source shared.vim |
3 | 3 | source check.vim |
4 | 4 | source term_util.vim |
5 | +source screendump.vim | |
5 | 6 | |
6 | 7 | " Must be done first, since the alternate buffer must be unset. |
7 | 8 | func Test_00_bufexists() |
@@ -2017,3 +2018,19 @@ | ||
2017 | 2018 | " uniq() |
2018 | 2019 | call assert_equal([0, 1, 2, 3, 4], uniq(range(5))) |
2019 | 2020 | endfunc |
2021 | + | |
2022 | +func Test_echoraw() | |
2023 | + CheckScreendump | |
2024 | + | |
2025 | + " Normally used for escape codes, but let's test with a CR. | |
2026 | + let lines =<< trim END | |
2027 | + call echoraw("hello\<CR>x") | |
2028 | + END | |
2029 | + call writefile(lines, 'XTest_echoraw') | |
2030 | + let buf = RunVimInTerminal('-S XTest_echoraw', {'rows': 5, 'cols': 40}) | |
2031 | + call VerifyScreenDump(buf, 'Test_functions_echoraw', {}) | |
2032 | + | |
2033 | + " clean up | |
2034 | + call StopVimInTerminal(buf) | |
2035 | + call delete('XTest_echoraw') | |
2036 | +endfunc |
@@ -743,6 +743,8 @@ | ||
743 | 743 | static int included_patches[] = |
744 | 744 | { /* Add new patch number below this line */ |
745 | 745 | /**/ |
746 | + 258, | |
747 | +/**/ | |
746 | 748 | 257, |
747 | 749 | /**/ |
748 | 750 | 256, |