From 8924e75f3477b20f0ef4e3df64b56bf496b197ae Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Thu, 2 Mar 2017 23:04:57 +0100 Subject: [PATCH 001/257] vim-patch:7.4.2170 Problem: Cannot get information about timers. Solution: Add timer_info(). https://github.com/vim/vim/commit/8e97bd74b5377753597e3d98e7123d8985c7fffd --- runtime/doc/eval.txt | 31 +++++++++++++++++++++---- src/nvim/eval.c | 55 ++++++++++++++++++++++++++++++++++++++++++++ src/nvim/eval.lua | 1 + src/nvim/version.c | 2 +- 4 files changed, 83 insertions(+), 6 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e1a8ba079a..37ce0e1b5f 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2297,6 +2297,7 @@ tan({expr}) Float tangent of {expr} tanh({expr}) Float hyperbolic tangent of {expr} tempname() String name for a temporary file test_garbagecollect_now() none free memory right now for testing +timer_info([{id}]) List information about timers timer_start({time}, {callback} [, {options}]) Number create a timer timer_stop({timer}) none stop a timer @@ -3198,8 +3199,12 @@ exepath({expr}) *exepath()* *exists()* exists({expr}) The result is a Number, which is |TRUE| if {expr} is - defined, zero otherwise. The {expr} argument is a string, - which contains one of these: + defined, zero otherwise. + + For checking for a supported feature use |has()|. + For checking if a file exists use |filereadable()|. + + The {expr} argument is a string, which contains one of these: &option-name Vim option (only checks if it exists, not if it really works) +option-name Vim option that works. @@ -3247,7 +3252,6 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is event and pattern. ##event autocommand for this event is supported. - For checking for a supported feature use |has()|. Examples: > exists("&mouse") @@ -5329,7 +5333,8 @@ matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]]) available from |getmatches()|. All matches can be deleted in one operation by |clearmatches()|. -matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) *matchaddpos()* + *matchaddpos()* +matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) Same as |matchadd()|, but requires a list of positions {pos} instead of a pattern. This command is faster than |matchadd()| because it does not require to handle regular expressions and @@ -7513,6 +7518,22 @@ tanh({expr}) *tanh()* < -0.761594 + *timer_info()* +timer_info([{id}]) + Return a list with information about timers. + When {id} is given only information about this timer is + returned. When timer {id} does not exist an empty list is + returned. + When {id} is omitted information about all timers is returned. + + For each timer the information is stored in a Dictionary with + these items: + "id" the timer ID + "time" time the timer was started with + "repeat" number of times the timer will still fire; + -1 means forever + "callback" the callback + *timer_start()* timer_start({time}, {callback} [, {options}]) Create a timer and return the timer ID. @@ -7542,7 +7563,7 @@ timer_start({time}, {callback} [, {options}]) timer_stop({timer}) *timer_stop()* Stop a timer. The timer callback will no longer be invoked. {timer} is an ID returned by timer_start(), thus it must be a - Number. + Number. If {timer} does not exist there is no error. tolower({expr}) *tolower()* The result is a copy of the String given, with all uppercase diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d4daffb469..537e9e696f 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -17931,6 +17931,61 @@ static bool set_ref_in_callback(Callback *callback, int copyID, return false; } +static void add_timer_info(typval_T *rettv, timer_T *timer) +{ + list_T *list = rettv->vval.v_list; + dict_T *dict = dict_alloc(); + + list_append_dict(list, dict); + dict_add_nr_str(dict, "id", (long)timer->timer_id, NULL); + dict_add_nr_str(dict, "time", timer->timeout, NULL); + + dict_add_nr_str(dict, "repeat", + (long)(timer->repeat_count < 0 ? -1 : timer->repeat_count), + NULL); + + dictitem_T *di = dictitem_alloc((char_u *)"callback"); + if (dict_add(dict, di) == FAIL) { + xfree(di); + return; + } + + if (timer->callback.type == kCallbackPartial) { + di->di_tv.v_type = VAR_PARTIAL; + di->di_tv.vval.v_partial = timer->callback.data.partial; + timer->callback.data.partial->pt_refcount++; + } else if (timer->callback.type == kCallbackFuncref) { + di->di_tv.v_type = VAR_FUNC; + di->di_tv.vval.v_string = vim_strsave(timer->callback.data.funcref); + } + di->di_tv.v_lock = 0; +} + +static void add_timer_info_all(typval_T *rettv) +{ + timer_T *timer; + map_foreach_value(timers, timer, { + add_timer_info(rettv, timer); + }) +} + +/// "timer_info([timer])" function +static void f_timer_info(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + rettv_list_alloc(rettv); + if (argvars[0].v_type != VAR_UNKNOWN) { + if (argvars[0].v_type != VAR_NUMBER) { + EMSG(_(e_number_exp)); + } else { + timer_T *timer = pmap_get(uint64_t)(timers, get_tv_number(&argvars[0])); + if (timer != NULL) { + add_timer_info(rettv, timer); + } + } + } else { + add_timer_info_all(rettv); + } +} /// "timer_start(timeout, callback, opts)" function static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr) diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index e3c5981b32..e923fee316 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -306,6 +306,7 @@ return { tempname={}, termopen={args={1, 2}}, test_garbagecollect_now={}, + timer_info={args={0,1}}, timer_start={args={2,3}}, timer_stop={args=1}, tolower={args=1}, diff --git a/src/nvim/version.c b/src/nvim/version.c index 8fd0fce329..b283059c7a 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -271,7 +271,7 @@ static int included_patches[] = { // 2173, // 2172, // 2171, - // 2170, + 2170, // 2169, // 2168 NA // 2167 NA From 5b8ce2feed6b528bae4bceba6f234be000949971 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sun, 5 Mar 2017 16:25:40 +0100 Subject: [PATCH 002/257] vim-patch:7.4.2180 Problem: There is no easy way to stop all timers. There is no way to temporary pause a timer. Solution: Add timer_stopall() and timer_pause(). https://github.com/vim/vim/commit/b73598e2f022a22fec512ea681c70d2775e8fd87 --- runtime/doc/eval.txt | 22 +++++++- src/nvim/eval.c | 34 +++++++++++-- src/nvim/eval.lua | 2 + src/nvim/testdir/shared.vim | 17 +++++++ src/nvim/testdir/test_timers.vim | 86 ++++++++++++++++++++++++++------ src/nvim/version.c | 2 +- 6 files changed, 141 insertions(+), 22 deletions(-) create mode 100644 src/nvim/testdir/shared.vim diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 37ce0e1b5f..8d3bd6aeb7 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1947,7 +1947,7 @@ assert_exception( {error} [, {msg}]) none assert {error} is in v:exception assert_fails( {cmd} [, {error}]) none assert {cmd} fails assert_false({actual} [, {msg}]) none assert {actual} is false assert_inrange({lower}, {upper}, {actual} [, {msg}]) - none assert {actual} is inside the range + none assert {actual} is inside the range assert_match( {pat}, {text} [, {msg}]) none assert {pat} matches {text} assert_notequal( {exp}, {act} [, {msg}]) none assert {exp} is not equal {act} assert_notmatch( {pat}, {text} [, {msg}]) none assert {pat} not matches {text} @@ -2298,9 +2298,11 @@ tanh({expr}) Float hyperbolic tangent of {expr} tempname() String name for a temporary file test_garbagecollect_now() none free memory right now for testing timer_info([{id}]) List information about timers +timer_pause({id}, {pause}) none pause or unpause a timer timer_start({time}, {callback} [, {options}]) Number create a timer timer_stop({timer}) none stop a timer +timer_stopall() none stop all timers tolower({expr}) String the String {expr} switched to lowercase toupper({expr}) String the String {expr} switched to uppercase tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} @@ -7534,6 +7536,19 @@ timer_info([{id}]) -1 means forever "callback" the callback +timer_pause({timer}, {paused}) *timer_pause()* + Pause or unpause a timer. A paused timer does not invoke its + callback, while the time it would is not changed. Unpausing a + timer may cause the callback to be invoked almost immediately + if enough time has passed. + + Pausing a timer is useful to avoid the callback to be called + for a short time. + + If {paused} evaluates to a non-zero Number or a non-empty + String, then the timer is paused, otherwise it is unpaused. + See |non-zero-arg|. + *timer_start()* timer_start({time}, {callback} [, {options}]) Create a timer and return the timer ID. @@ -7565,6 +7580,11 @@ timer_stop({timer}) *timer_stop()* {timer} is an ID returned by timer_start(), thus it must be a Number. If {timer} does not exist there is no error. +timer_stopall() *timer_stopall()* + Stop all timers. The timer callbacks will no longer be + invoked. Useful if some timers is misbehaving. If there are + no timers there is no error. + tolower({expr}) *tolower()* The result is a copy of the String given, with all uppercase characters turned into lowercase (just like applying |gu| to diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 537e9e696f..062999e73b 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -446,6 +446,7 @@ typedef struct { int refcount; long timeout; bool stopped; + bool paused; Callback callback; } timer_T; @@ -17939,6 +17940,7 @@ static void add_timer_info(typval_T *rettv, timer_T *timer) list_append_dict(list, dict); dict_add_nr_str(dict, "id", (long)timer->timer_id, NULL); dict_add_nr_str(dict, "time", timer->timeout, NULL); + dict_add_nr_str(dict, "paused", (long)timer->paused, NULL); dict_add_nr_str(dict, "repeat", (long)(timer->repeat_count < 0 ? -1 : timer->repeat_count), @@ -17965,7 +17967,9 @@ static void add_timer_info_all(typval_T *rettv) { timer_T *timer; map_foreach_value(timers, timer, { - add_timer_info(rettv, timer); + if (!timer->stopped) { + add_timer_info(rettv, timer); + } }) } @@ -17978,7 +17982,7 @@ static void f_timer_info(typval_T *argvars, typval_T *rettv, FunPtr fptr) EMSG(_(e_number_exp)); } else { timer_T *timer = pmap_get(uint64_t)(timers, get_tv_number(&argvars[0])); - if (timer != NULL) { + if (timer != NULL && !timer->stopped) { add_timer_info(rettv, timer); } } @@ -17987,6 +17991,20 @@ static void f_timer_info(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } +/// "timer_pause(timer, paused)" function +static void f_timer_pause(typval_T *argvars, typval_T *unused, FunPtr fptr) +{ + if (argvars[0].v_type != VAR_NUMBER) { + EMSG(_(e_number_exp)); + } else { + int paused = (bool)get_tv_number(&argvars[1]); + timer_T *timer = pmap_get(uint64_t)(timers, get_tv_number(&argvars[0])); + if (timer != NULL) { + timer->paused = paused; + } + } +} + /// "timer_start(timeout, callback, opts)" function static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr) { @@ -18019,6 +18037,7 @@ static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr) timer = xmalloc(sizeof *timer); timer->refcount = 1; timer->stopped = false; + timer->paused = false; timer->repeat_count = repeat; timer->timeout = timeout; timer->timer_id = last_timer_id++; @@ -18028,8 +18047,7 @@ static void f_timer_start(typval_T *argvars, typval_T *rettv, FunPtr fptr) timer->tw.events = multiqueue_new_child(main_loop.events); // if main loop is blocked, don't queue up multiple events timer->tw.blockable = true; - time_watcher_start(&timer->tw, timer_due_cb, timeout, - timeout * (repeat != 1)); + time_watcher_start(&timer->tw, timer_due_cb, timeout, timeout); pmap_put(uint64_t)(timers, timer->timer_id, timer); rettv->vval.v_number = timer->timer_id; @@ -18053,13 +18071,19 @@ static void f_timer_stop(typval_T *argvars, typval_T *rettv, FunPtr fptr) timer_stop(timer); } +static void f_timer_stopall(typval_T *argvars, typval_T *unused, FunPtr fptr) +{ + timer_teardown(); +} + // invoked on the main loop static void timer_due_cb(TimeWatcher *tw, void *data) { timer_T *timer = (timer_T *)data; - if (timer->stopped) { + if (timer->stopped || timer->paused) { return; } + timer->refcount++; // if repeat was negative repeat forever if (timer->repeat_count >= 0 && --timer->repeat_count == 0) { diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index e923fee316..d30d34135b 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -307,8 +307,10 @@ return { termopen={args={1, 2}}, test_garbagecollect_now={}, timer_info={args={0,1}}, + timer_pause={args=2}, timer_start={args={2,3}}, timer_stop={args=1}, + timer_stopall={args=0}, tolower={args=1}, toupper={args=1}, tr={args=3}, diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim new file mode 100644 index 0000000000..9573f5a9c3 --- /dev/null +++ b/src/nvim/testdir/shared.vim @@ -0,0 +1,17 @@ +" Functions shared by several tests. + +" Wait for up to a second for "expr" to become true. +" Return time slept in milliseconds. +func WaitFor(expr) + let slept = 0 + for i in range(100) + try + if eval(a:expr) + return slept + endif + catch + endtry + let slept += 10 + sleep 10m + endfor +endfunc diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index 56f9feef66..b03295bd01 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -4,8 +4,10 @@ if !has('timers') finish endif +source shared.vim + func MyHandler(timer) - let s:val += 1 + let g:val += 1 endfunc func MyHandlerWithLists(lists, timer) @@ -13,44 +15,98 @@ func MyHandlerWithLists(lists, timer) endfunc func Test_oneshot() - let s:val = 0 + let g:val = 0 let timer = timer_start(50, 'MyHandler') - sleep 200m - call assert_equal(1, s:val) + let slept = WaitFor('g:val == 1') + call assert_equal(1, g:val) + call assert_inrange(30, 100, slept) endfunc func Test_repeat_three() - let s:val = 0 + let g:val = 0 let timer = timer_start(50, 'MyHandler', {'repeat': 3}) - sleep 500m - call assert_equal(3, s:val) + let slept = WaitFor('g:val == 3') + call assert_equal(3, g:val) + call assert_inrange(100, 250, slept) endfunc func Test_repeat_many() - let s:val = 0 + let g:val = 0 let timer = timer_start(50, 'MyHandler', {'repeat': -1}) sleep 200m call timer_stop(timer) - call assert_true(s:val > 1) - call assert_true(s:val < 5) + call assert_inrange(2, 4, g:val) endfunc func Test_with_partial_callback() - let s:val = 0 + let g:val = 0 let s:meow = {} function s:meow.bite(...) - let s:val += 1 + let g:val += 1 endfunction call timer_start(50, s:meow.bite) - sleep 200m - call assert_equal(1, s:val) + let slept = WaitFor('g:val == 1') + call assert_equal(1, g:val) + call assert_inrange(30, 100, slept) endfunc func Test_retain_partial() - call timer_start(100, function('MyHandlerWithLists', [['a']])) + call timer_start(50, function('MyHandlerWithLists', [['a']])) call garbagecollect() + sleep 100m +endfunc + +func Test_info() + let id = timer_start(1000, 'MyHandler') + let info = timer_info(id) + call assert_equal(id, info[0]['id']) + call assert_equal(1000, info[0]['time']) + call assert_equal("function('MyHandler')", string(info[0]['callback'])) + + let found = 0 + for info in timer_info() + if info['id'] == id + let found += 1 + endif + endfor + call assert_equal(1, found) + + call timer_stop(id) + call assert_equal([], timer_info(id)) +endfunc + +func Test_stopall() + let id1 = timer_start(1000, 'MyHandler') + let id2 = timer_start(2000, 'MyHandler') + let info = timer_info() + call assert_equal(2, len(info)) + + call timer_stopall() + let info = timer_info() + call assert_equal(0, len(info)) +endfunc + +func Test_paused() + let g:val = 0 + + let id = timer_start(50, 'MyHandler') + let info = timer_info(id) + call assert_equal(0, info[0]['paused']) + + call timer_pause(id, 1) + let info = timer_info(id) + call assert_equal(1, info[0]['paused']) sleep 200m + call assert_equal(0, g:val) + + call timer_pause(id, 0) + let info = timer_info(id) + call assert_equal(0, info[0]['paused']) + + let slept = WaitFor('g:val == 1') + call assert_equal(1, g:val) + call assert_inrange(0, 10, slept) endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/version.c b/src/nvim/version.c index b283059c7a..4da970d43b 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -261,7 +261,7 @@ static int included_patches[] = { 2183, // 2182 NA // 2181, - // 2180, + 2180, // 2179, // 2178, // 2177, From 420a9955fa969ee0460f41798c60c1374476fd08 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Mon, 6 Mar 2017 07:15:19 +0100 Subject: [PATCH 003/257] version.c: Mark 7.4.2171 and 7.4.2181 as NA. --- src/nvim/version.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/version.c b/src/nvim/version.c index 4da970d43b..0bf0f10b56 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -260,7 +260,7 @@ static int included_patches[] = { // 2184, 2183, // 2182 NA - // 2181, + // 2181 NA 2180, // 2179, // 2178, @@ -270,7 +270,7 @@ static int included_patches[] = { 2174, // 2173, // 2172, - // 2171, + // 2171 NA 2170, // 2169, // 2168 NA From 5c2f1e29e3dfdfab8c2a9b31962d9cc12c171e46 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Mon, 20 Mar 2017 20:52:54 +0100 Subject: [PATCH 004/257] vim-patch:7.4.2240 Problem: Tests using the sleep time can be flaky. Solution: Use reltime() if available. (Partly by Shane Harper) https://github.com/vim/vim/commit/f267f8bdf777073e392ada5b31d837c7b6090eb4 --- src/nvim/testdir/shared.vim | 21 ++++++++++++++++----- src/nvim/testdir/test_timers.vim | 24 ++++++++++++++++++++---- src/nvim/version.c | 2 +- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index 9573f5a9c3..1138ceba4d 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -1,17 +1,28 @@ " Functions shared by several tests. -" Wait for up to a second for "expr" to become true. -" Return time slept in milliseconds. +" Return time slept in milliseconds. With the +reltime feature this can be +" more than the actual waiting time. Without +reltime it can also be less. func WaitFor(expr) - let slept = 0 + " using reltime() is more accurate, but not always available + if has('reltime') + let start = reltime() + else + let slept = 0 + endif for i in range(100) try if eval(a:expr) - return slept + if has('reltime') + return float2nr(reltimefloat(reltime(start)) * 1000) + endif + return slept endif catch endtry - let slept += 10 + if !has('reltime') + let slept += 10 + endif sleep 10m endfor + return 1000 endfunc diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index b03295bd01..2a5fa5c662 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -19,7 +19,11 @@ func Test_oneshot() let timer = timer_start(50, 'MyHandler') let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) - call assert_inrange(30, 100, slept) + if has('reltime') + call assert_inrange(50, 100, slept) + else + call assert_inrange(20, 100, slept) + endif endfunc func Test_repeat_three() @@ -27,7 +31,11 @@ func Test_repeat_three() let timer = timer_start(50, 'MyHandler', {'repeat': 3}) let slept = WaitFor('g:val == 3') call assert_equal(3, g:val) - call assert_inrange(100, 250, slept) + if has('reltime') + call assert_inrange(150, 200, slept) + else + call assert_inrange(80, 200, slept) + endif endfunc func Test_repeat_many() @@ -48,7 +56,11 @@ func Test_with_partial_callback() call timer_start(50, s:meow.bite) let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) - call assert_inrange(30, 100, slept) + if has('reltime') + call assert_inrange(50, 100, slept) + else + call assert_inrange(20, 100, slept) + endif endfunc func Test_retain_partial() @@ -106,7 +118,11 @@ func Test_paused() let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) - call assert_inrange(0, 10, slept) + if has('reltime') + call assert_inrange(0, 30, slept) + else + call assert_inrange(0, 10, slept) + endif endfunc " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/version.c b/src/nvim/version.c index 0bf0f10b56..ef6c9d1454 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -201,7 +201,7 @@ static int included_patches[] = { // 2243 NA // 2242, // 2241, - // 2240, + 2240, // 2239, // 2238 NA 2237, From 3558f89d22faad613e0049592d2187ad35f5bec8 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Mon, 20 Mar 2017 21:11:24 +0100 Subject: [PATCH 005/257] vim-patch:7.4.2241 Problem: Timer test sometimes fails. Solution: Increase the maximum time for repeating timer. https://github.com/vim/vim/commit/973365dcc40a41e6b72ece56f15cebfee69b1329 --- src/nvim/testdir/test_timers.vim | 2 +- src/nvim/version.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index 2a5fa5c662..8829b5de59 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -32,7 +32,7 @@ func Test_repeat_three() let slept = WaitFor('g:val == 3') call assert_equal(3, g:val) if has('reltime') - call assert_inrange(150, 200, slept) + call assert_inrange(150, 250, slept) else call assert_inrange(80, 200, slept) endif diff --git a/src/nvim/version.c b/src/nvim/version.c index ef6c9d1454..b7516e443a 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -200,7 +200,7 @@ static int included_patches[] = { // 2244, // 2243 NA // 2242, - // 2241, + 2241, 2240, // 2239, // 2238 NA From 4f69a8fb8854698adb2de8956ad0d86ff35a6f68 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Mon, 20 Mar 2017 21:12:31 +0100 Subject: [PATCH 006/257] vim-patch:7.4.2242 Problem: Timer test sometimes fails. Solution: Increase the maximum time for callback timer test. https://github.com/vim/vim/commit/17f1347b867cbcc0ce380bf9a2466b4c31896f04 --- src/nvim/testdir/test_timers.vim | 2 +- src/nvim/version.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index 8829b5de59..db10f351ae 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -57,7 +57,7 @@ func Test_with_partial_callback() let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) if has('reltime') - call assert_inrange(50, 100, slept) + call assert_inrange(50, 130, slept) else call assert_inrange(20, 100, slept) endif diff --git a/src/nvim/version.c b/src/nvim/version.c index b7516e443a..91c37658aa 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -199,7 +199,7 @@ static int included_patches[] = { // 2245, // 2244, // 2243 NA - // 2242, + 2242, 2241, 2240, // 2239, From 6a6bbbc6d8fa79a0c14fb913baa3ba2d7046419c Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 6 Apr 2017 08:54:30 -0400 Subject: [PATCH 007/257] vim-patch:7.4.2281 Problem: Timer test fails sometimes. Solution: Reduce minimum time by 1 msec. https://github.com/vim/vim/commit/0426bae2abede764d0dd366a28663d1c6e6ab0fe --- src/nvim/testdir/test_timers.vim | 6 +++--- src/nvim/version.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index db10f351ae..16c70b166b 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -20,7 +20,7 @@ func Test_oneshot() let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) if has('reltime') - call assert_inrange(50, 100, slept) + call assert_inrange(49, 100, slept) else call assert_inrange(20, 100, slept) endif @@ -32,7 +32,7 @@ func Test_repeat_three() let slept = WaitFor('g:val == 3') call assert_equal(3, g:val) if has('reltime') - call assert_inrange(150, 250, slept) + call assert_inrange(149, 250, slept) else call assert_inrange(80, 200, slept) endif @@ -57,7 +57,7 @@ func Test_with_partial_callback() let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) if has('reltime') - call assert_inrange(50, 130, slept) + call assert_inrange(49, 130, slept) else call assert_inrange(20, 100, slept) endif diff --git a/src/nvim/version.c b/src/nvim/version.c index ca520c7af5..3944551cb4 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -160,7 +160,7 @@ static const int included_patches[] = { 2284, 2283, // 2282 NA - // 2281 NA + 2281, 2280, 2279, // 2278 NA From 0f99645b8faf3e5970e46c185c0cbbd7a9cfe318 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 6 Apr 2017 08:55:51 -0400 Subject: [PATCH 008/257] vim-patch:7.4.2304 Problem: In a timer callback the timer itself can't be found or stopped. (Thinca) Solution: Do not remove the timer from the list, remember whether it was freed. https://github.com/vim/vim/commit/417ccd7138d4d230d328de8b0d3892dd82ff1bee --- src/nvim/testdir/test_timers.vim | 15 +++++++++++++++ src/nvim/version.c | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index 16c70b166b..6a8b09c898 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -125,4 +125,19 @@ func Test_paused() endif endfunc +func StopMyself(timer) + let g:called += 1 + if g:called == 2 + call timer_stop(a:timer) + endif +endfunc + +func Test_delete_myself() + let g:called = 0 + let t = timer_start(10, 'StopMyself', {'repeat': -1}) + call WaitFor('g:called == 2') + call assert_equal(2, g:called) + call assert_equal([], timer_info(t)) +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/version.c b/src/nvim/version.c index 3944551cb4..beb23090ec 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -137,7 +137,7 @@ static const int included_patches[] = { 2307, 2306, 2305, - // 2304 NA + 2304, 2303, // 2302 NA // 2301 NA From 9edbeec07716cff5607202dbd20b81917416030f Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 6 Apr 2017 08:56:53 -0400 Subject: [PATCH 009/257] vim-patch:7.4.2332 Problem: Crash when stop_timer() is called in a callback of a callback. Vim hangs when the timer callback uses too much time. Solution: Set tr_id to -1 when a timer is to be deleted. Don't keep calling callbacks forever. (Ozaki Kiichi) https://github.com/vim/vim/commit/75537a93e985ef32e6c267b06ce93629855dd983 --- src/nvim/testdir/test_timers.vim | 30 ++++++++++++++++++++++++++++++ src/nvim/version.c | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index 6a8b09c898..2a768585ce 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -140,4 +140,34 @@ func Test_delete_myself() call assert_equal([], timer_info(t)) endfunc +func StopTimer1(timer) + let g:timer2 = timer_start(10, 'StopTimer2') + " avoid maxfuncdepth error + call timer_pause(g:timer1, 1) + sleep 40m +endfunc + +func StopTimer2(timer) + call timer_stop(g:timer1) +endfunc + +func Test_stop_in_callback() + let g:timer1 = timer_start(10, 'StopTimer1') + sleep 40m +endfunc + +func StopTimerAll(timer) + call timer_stopall() +endfunc + +func Test_stop_all_in_callback() + let g:timer1 = timer_start(10, 'StopTimerAll') + let info = timer_info() + call assert_equal(1, len(info)) + sleep 40m + let info = timer_info() + call assert_equal(0, len(info)) +endfunc + + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/version.c b/src/nvim/version.c index beb23090ec..d16eab7201 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -109,7 +109,7 @@ static const int included_patches[] = { 2335, 2334, 2333, - // 2332 NA + 2332, 2331, 2330, 2329, From 071f2da66bacfd5a2d4ab87bda275d3848ddcc0e Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 6 Apr 2017 08:58:18 -0400 Subject: [PATCH 010/257] vim-patch:7.4.2359 Problem: Memory leak in timer_start(). Solution: Check the right field to be NULL. https://github.com/vim/vim/commit/26fe0d56912e42c2b16a61b2480e19ba569aee98 --- src/nvim/testdir/test_timers.vim | 8 ++++---- src/nvim/version.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index 2a768585ce..fd2b50b495 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -48,12 +48,12 @@ endfunc func Test_with_partial_callback() let g:val = 0 - let s:meow = {} - function s:meow.bite(...) - let g:val += 1 + let meow = {'one': 1} + function meow.bite(...) + let g:val += self.one endfunction - call timer_start(50, s:meow.bite) + call timer_start(50, meow.bite) let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) if has('reltime') diff --git a/src/nvim/version.c b/src/nvim/version.c index d16eab7201..9a5d7ce169 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -82,7 +82,7 @@ static const int included_patches[] = { 2362, // 2361 NA // 2360, - // 2359 NA + 2359, // 2358 NA 2357, // 2356, From 19044a15f9d41a7424e94fb3f0e257537e7afa5e Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 6 Apr 2017 21:21:11 +0300 Subject: [PATCH 011/257] strings: Replace vim_strchr implementation with a saner one Removes dead code (enc_utf8, enc_dbcs and has_mbyte now have hardcoded values), relies on libc implementation being more optimized. Also where previously negative character just would never be found it is an assertion error now. Ref #1476 --- src/nvim/strings.c | 64 ++++++++++++++-------------------------------- 1 file changed, 19 insertions(+), 45 deletions(-) diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 5dcffe00e0..c4bc9b204a 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -401,54 +401,28 @@ int vim_strnicmp(const char *s1, const char *s2, size_t len) } #endif -/* - * Version of strchr() and strrchr() that handle unsigned char strings - * with characters from 128 to 255 correctly. It also doesn't return a - * pointer to the NUL at the end of the string. - */ -char_u *vim_strchr(const char_u *string, int c) - FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE +/// strchr() version which handles multibyte strings +/// +/// @param[in] string String to search in. +/// @param[in] c Character to search for. Must be a valid character. +/// +/// @return Pointer to the first byte of the found character in string or NULL +/// if it was not found. NUL character is never found, use `strlen()` +/// instead. +char_u *vim_strchr(const char_u *const string, const int c) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { - int b; - - const char_u *p = string; - if (enc_utf8 && c >= 0x80) { - while (*p != NUL) { - int l = (*mb_ptr2len)(p); - - // Avoid matching an illegal byte here. - if (l > 1 && utf_ptr2char(p) == c) { - return (char_u *) p; - } - p += l; - } + assert(c >= 0); + if (c == 0) { return NULL; + } else if (c < 0x80) { + return (char_u *)strchr((const char *)string, c); + } else { + char u8char[MB_MAXBYTES + 1]; + const int len = utf_char2bytes(c, (char_u *)u8char); + u8char[len] = NUL; + return (char_u *)strstr((const char *)string, u8char); } - if (enc_dbcs != 0 && c > 255) { - int n2 = c & 0xff; - - c = ((unsigned)c >> 8) & 0xff; - while ((b = *p) != NUL) { - if (b == c && p[1] == n2) - return (char_u *) p; - p += (*mb_ptr2len)(p); - } - return NULL; - } - if (has_mbyte) { - while ((b = *p) != NUL) { - if (b == c) - return (char_u *) p; - p += (*mb_ptr2len)(p); - } - return NULL; - } - while ((b = *p) != NUL) { - if (b == c) - return (char_u *) p; - ++p; - } - return NULL; } /* From 171baaee93c8e257ef593b30c05405d03ac30c96 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 6 Apr 2017 21:31:37 +0300 Subject: [PATCH 012/257] strings: Remove vim_strbyte Ref #1476 --- src/nvim/ex_cmds.c | 13 ++++++------- src/nvim/getchar.c | 4 ++-- src/nvim/mbyte.c | 6 +++--- src/nvim/regexp.c | 42 +++++++++++++++--------------------------- src/nvim/regexp_nfa.c | 13 +++---------- src/nvim/strings.c | 18 ------------------ 6 files changed, 29 insertions(+), 67 deletions(-) diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 9a847a4c0a..8485a1ca66 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -5087,14 +5087,13 @@ static void helptags_one(char_u *dir, char_u *ext, char_u *tagfname, } p1 = vim_strchr(IObuff, '*'); /* find first '*' */ while (p1 != NULL) { - /* Use vim_strbyte() instead of vim_strchr() so that when - * 'encoding' is dbcs it still works, don't find '*' in the - * second byte. */ - p2 = vim_strbyte(p1 + 1, '*'); /* find second '*' */ - if (p2 != NULL && p2 > p1 + 1) { /* skip "*" and "**" */ - for (s = p1 + 1; s < p2; ++s) - if (*s == ' ' || *s == '\t' || *s == '|') + p2 = (char_u *)strchr((const char *)p1 + 1, '*'); // Find second '*'. + if (p2 != NULL && p2 > p1 + 1) { // Skip "*" and "**". + for (s = p1 + 1; s < p2; s++) { + if (*s == ' ' || *s == '\t' || *s == '|') { break; + } + } /* * Only accept a *tag* when it consists of valid diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index b83681ad01..56493a300d 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -3588,8 +3588,8 @@ int check_abbr(int c, char_u *ptr, int col, int mincol) char_u *q = mp->m_keys; int match; - if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL) { - /* might have CSI escaped mp->m_keys */ + if (strchr((const char *)mp->m_keys, K_SPECIAL) != NULL) { + // Might have CSI escaped mp->m_keys. q = vim_strsave(mp->m_keys); vim_unescape_csi(q); qlen = (int)STRLEN(q); diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index d96848754c..c31fee44af 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -356,10 +356,10 @@ int bomb_size(void) */ void remove_bom(char_u *s) { - char_u *p = s; + char *p = (char *)s; - while ((p = vim_strbyte(p, 0xef)) != NULL) { - if (p[1] == 0xbb && p[2] == 0xbf) { + while ((p = strchr(p, 0xef)) != NULL) { + if ((uint8_t)p[1] == 0xbb && (uint8_t)p[2] == 0xbf) { STRMOVE(p, p + 3); } else { p++; diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 9baa53d2a2..e9c9b491fd 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -3429,32 +3429,26 @@ static long bt_regexec_both(char_u *line, c = *prog->regmust; s = line + col; - /* - * This is used very often, esp. for ":global". Use three versions of - * the loop to avoid overhead of conditions. - */ - if (!ireg_ic - && !has_mbyte - ) - while ((s = vim_strbyte(s, c)) != NULL) { - if (cstrncmp(s, prog->regmust, &prog->regmlen) == 0) - break; /* Found it. */ - ++s; - } - else if (!ireg_ic || (!enc_utf8 && mb_char2len(c) > 1)) + // This is used very often, esp. for ":global". Use two versions of + // the loop to avoid overhead of conditions. + if (!ireg_ic) { while ((s = vim_strchr(s, c)) != NULL) { - if (cstrncmp(s, prog->regmust, &prog->regmlen) == 0) - break; /* Found it. */ + if (cstrncmp(s, prog->regmust, &prog->regmlen) == 0) { + break; // Found it. + } mb_ptr_adv(s); } - else + } else { while ((s = cstrchr(s, c)) != NULL) { - if (cstrncmp(s, prog->regmust, &prog->regmlen) == 0) - break; /* Found it. */ + if (cstrncmp(s, prog->regmust, &prog->regmlen) == 0) { + break; // Found it. + } mb_ptr_adv(s); } - if (s == NULL) /* Not present. */ + } + if (s == NULL) { // Not present. goto theend; + } } regline = line; @@ -3484,14 +3478,8 @@ static long bt_regexec_both(char_u *line, /* Messy cases: unanchored match. */ while (!got_int) { if (prog->regstart != NUL) { - /* Skip until the char we know it must start with. - * Used often, do some work to avoid call overhead. */ - if (!ireg_ic - && !has_mbyte - ) - s = vim_strbyte(regline + col, prog->regstart); - else - s = cstrchr(regline + col, prog->regstart); + // Skip until the char we know it must start with. + s = cstrchr(regline + col, prog->regstart); if (s == NULL) { retval = 0; break; diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 5b49ab38f0..a77978884e 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -4855,17 +4855,10 @@ static int failure_chance(nfa_state_T *state, int depth) */ static int skip_to_start(int c, colnr_T *colp) { - char_u *s; - - /* Used often, do some work to avoid call overhead. */ - if (!ireg_ic - && !has_mbyte - ) - s = vim_strbyte(regline + *colp, c); - else - s = cstrchr(regline + *colp, c); - if (s == NULL) + const char_u *const s = cstrchr(regline + *colp, c); + if (s == NULL) { return FAIL; + } *colp = (int)(s - regline); return OK; } diff --git a/src/nvim/strings.c b/src/nvim/strings.c index c4bc9b204a..ada4c108cf 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -425,24 +425,6 @@ char_u *vim_strchr(const char_u *const string, const int c) } } -/* - * Version of strchr() that only works for bytes and handles unsigned char - * strings with characters above 128 correctly. It also doesn't return a - * pointer to the NUL at the end of the string. - */ -char_u *vim_strbyte(const char_u *string, int c) - FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE -{ - const char_u *p = string; - - while (*p != NUL) { - if (*p == c) - return (char_u *) p; - ++p; - } - return NULL; -} - /* * Search for last occurrence of "c" in "string". * Return NULL if not found. From ac1cb1c72fa762b39ff457153c7fa6ecf1eaedc3 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 6 Apr 2017 21:56:49 +0300 Subject: [PATCH 013/257] regexp: Refactor cstrchr Ref #1476 --- src/nvim/regexp.c | 59 ++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index e9c9b491fd..175aa1b970 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -6287,43 +6287,38 @@ static int cstrncmp(char_u *s1, char_u *s2, int *n) /* * cstrchr: This function is used a lot for simple searches, keep it fast! */ -static char_u *cstrchr(char_u *s, int c) +static inline char_u *cstrchr(const char_u *const s, const int c) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL + FUNC_ATTR_ALWAYS_INLINE { - char_u *p; - int cc; - - if (!ireg_ic - || (!enc_utf8 && mb_char2len(c) > 1) - ) + if (!ireg_ic) { return vim_strchr(s, c); + } - /* tolower() and toupper() can be slow, comparing twice should be a lot - * faster (esp. when using MS Visual C++!). - * For UTF-8 need to use folded case. */ - if (enc_utf8 && c > 0x80) - cc = utf_fold(c); - else if (vim_isupper(c)) - cc = vim_tolower(c); - else if (vim_islower(c)) - cc = vim_toupper(c); - else - return vim_strchr(s, c); - - if (has_mbyte) { - for (p = s; *p != NUL; p += (*mb_ptr2len)(p)) { - if (enc_utf8 && c > 0x80) { - if (utf_fold(utf_ptr2char(p)) == cc) - return p; - } else if (*p == c || *p == cc) - return p; + // tolower() and toupper() can be slow, comparing twice should be a lot + // faster (esp. when using MS Visual C++!). + // For UTF-8 need to use folded case. + if (c > 0x80) { + const int folded_c = utf_fold(c); + for (const char_u *p = s; *p != NUL; p += utfc_ptr2len(p)) { + if (utf_fold(utf_ptr2char(p)) == folded_c) { + return (char_u *)p; + } } - } else - /* Faster version for when there are no multi-byte characters. */ - for (p = s; *p != NUL; ++p) - if (*p == c || *p == cc) - return p; + return NULL; + } - return NULL; + int cc; + if (vim_isupper(c)) { + cc = vim_tolower(c); + } else if (vim_islower(c)) { + cc = vim_toupper(c); + } else { + return vim_strchr(s, c); + } + + char tofind[] = { (char)c, (char)cc, NUL }; + return (char_u *)strpbrk((const char *)s, tofind); } /*************************************************************** From caeff6e1aff227bb5826ad575362d2a24adebaa9 Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 7 Apr 2017 23:18:36 +0300 Subject: [PATCH 014/257] regexp: Do not use locale-dependent functions in cstrchr --- src/nvim/regexp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 175aa1b970..893089f06d 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -6309,10 +6309,10 @@ static inline char_u *cstrchr(const char_u *const s, const int c) } int cc; - if (vim_isupper(c)) { - cc = vim_tolower(c); - } else if (vim_islower(c)) { - cc = vim_toupper(c); + if (ASCII_ISUPPER(c)) { + cc = TOLOWER_ASC(c); + } else if (ASCII_ISLOWER(c)) { + cc = TOUPPER_ASC(c); } else { return vim_strchr(s, c); } From acc52a953b99f78435c34337b8ca9b6716a057a1 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 8 Apr 2017 02:55:51 +0300 Subject: [PATCH 015/257] regexp: Update comment in cstrchr() --- src/nvim/regexp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 893089f06d..96884aa87f 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -6295,9 +6295,8 @@ static inline char_u *cstrchr(const char_u *const s, const int c) return vim_strchr(s, c); } - // tolower() and toupper() can be slow, comparing twice should be a lot - // faster (esp. when using MS Visual C++!). - // For UTF-8 need to use folded case. + // Use folded case for UTF-8, slow! For ASCII use libc strpbrk which is + // expected to be highly optimized. if (c > 0x80) { const int folded_c = utf_fold(c); for (const char_u *p = s; *p != NUL; p += utfc_ptr2len(p)) { From ebfcf2fa386853b39f6d8b9541cbe41fdc3e4009 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 10 Apr 2017 13:24:31 +0300 Subject: [PATCH 016/257] scripts: Create script which checks Neovim with PVS-studio --- scripts/pvscheck.sh | 96 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100755 scripts/pvscheck.sh diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh new file mode 100755 index 0000000000..0a3d7486f2 --- /dev/null +++ b/scripts/pvscheck.sh @@ -0,0 +1,96 @@ +#!/bin/sh +set -x +set -e + +get_jobs_num() { + local num="$(cat /proc/cpuinfo | grep -c "^processor")" + num="$(echo $(( num + 1 )))" + num="${num:-1}" + echo $num +} + +get_pvs_comment() { + cat > pvs-comment << EOF +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +EOF +} + +install_pvs() { + mkdir pvs-studio + cd pvs-studio + + curl -o pvs-studio.tar.gz "$PVS_URL" + tar xzf pvs-studio.tar.gz + rm pvs-studio.tar.gz + local pvsdir="$(find . -maxdepth 1 -mindepth 1)" + find "$pvsdir" -maxdepth 1 -mindepth 1 -exec mv '{}' . \; + rmdir "$pvsdir" + + export PATH="$PWD/bin${PATH+:}${PATH}" + + cd .. +} + +create_compile_commands() { + mkdir build + cd build + env \ + CC=clang \ + CFLAGS=' -O0 ' \ + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="$PWD/root" + make -j"$(get_jobs_num)" + find src/nvim/auto -name '*.test-include.c' -delete + + cd .. +} + +patch_sources() { + get_pvs_comment + + local sh_script=' + cat pvs-comment "$1" > "$1.tmp" + mv "$1.tmp" "$1" + ' + + find \ + src/nvim test/functional/fixtures test/unit/fixtures \ + -name '*.[ch]' \ + -exec /bin/sh -c "$sh_script" - '{}' \; + + find \ + build/src/nvim/auto build/config \ + -name '*.[ch]' -not -name '*.test-include.c' \ + -exec /bin/sh -c "$sh_script" - '{}' \; +} + +main() { + local PVS_URL="http://files.viva64.com/pvs-studio-6.14.21446.1-x86_64.tgz" + + local tgt="${1:-$PWD/../neovim-pvs}" + local branch="${2:-master}" + + git worktree add "$tgt" "$branch" + + cd "$tgt" + + install_pvs + + create_compile_commands + + patch_sources + + pvs-studio-analyzer \ + analyze \ + --threads "$(get_jobs_num)" \ + --output-file PVS-studio.log \ + --verbose \ + --file build/compile_commands.json \ + --sourcetree-root . + + plog-converter -t xml -o PVS-studio.xml PVS-studio.log + plog-converter -t errorfile -o PVS-studio.err PVS-studio.log + plog-converter -t tasklist -o PVS-studio.tsk PVS-studio.log +} + +main "$@" From 59f0cbc282b1f110dd0281d835f52cfeb62c91d4 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 10 Apr 2017 13:41:09 +0300 Subject: [PATCH 017/257] pvscheck: Add help --- scripts/pvscheck.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index 0a3d7486f2..00f2d481ea 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -64,9 +64,25 @@ patch_sources() { -exec /bin/sh -c "$sh_script" - '{}' \; } +help() { + echo 'Usage: pvscheck.sh [target-directory [branch]]' + echo + echo ' target-directory: Directory where build should occur' + echo ' Default: ../neovim-pvs' + echo + echo ' branch: Branch to check' + echo ' Must not be already checked out: uses git worktree.' + echo ' Default: master' +} + main() { local PVS_URL="http://files.viva64.com/pvs-studio-6.14.21446.1-x86_64.tgz" + if test "x$1" = "x--help" ; then + help + return 0 + fi + local tgt="${1:-$PWD/../neovim-pvs}" local branch="${2:-master}" From 3bd11f29116510baf0f7700503d0977d84bb218b Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 10 Apr 2017 13:42:31 +0300 Subject: [PATCH 018/257] pvsscript: Use git clone and not git worktree --- scripts/pvscheck.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index 00f2d481ea..0e1b9ba404 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -80,13 +80,13 @@ main() { if test "x$1" = "x--help" ; then help - return 0 + return fi local tgt="${1:-$PWD/../neovim-pvs}" local branch="${2:-master}" - git worktree add "$tgt" "$branch" + git clone --depth=1 --branch="$branch" . "$tgt" cd "$tgt" From d7086f44f46cea5d949452e22c6ca1286bd9db77 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 10 Apr 2017 13:45:33 +0300 Subject: [PATCH 019/257] pvscheck: Do not trace help --- scripts/pvscheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index 0e1b9ba404..cd8bf60a92 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -1,5 +1,4 @@ #!/bin/sh -set -x set -e get_jobs_num() { @@ -82,6 +81,7 @@ main() { help return fi + set -x local tgt="${1:-$PWD/../neovim-pvs}" local branch="${2:-master}" From 2b13c87fa241c877f56366ab632fd2057fe297d8 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 10 Apr 2017 13:47:31 +0300 Subject: [PATCH 020/257] pvscheck: Do not use --depth --- scripts/pvscheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index cd8bf60a92..3b21c65702 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -86,7 +86,7 @@ main() { local tgt="${1:-$PWD/../neovim-pvs}" local branch="${2:-master}" - git clone --depth=1 --branch="$branch" . "$tgt" + git clone --branch="$branch" . "$tgt" cd "$tgt" From 55292685d36c0aff7733982033a4567b6e7a6ee3 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 10 Apr 2017 14:07:26 +0300 Subject: [PATCH 021/257] pvscheck: Add --recheck argument --- scripts/pvscheck.sh | 101 +++++++++++++++++++++++++++++--------------- 1 file changed, 68 insertions(+), 33 deletions(-) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index 3b21c65702..2e4f990693 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -8,6 +8,20 @@ get_jobs_num() { echo $num } +help() { + echo 'Usage:' + echo ' pvscheck.sh [target-directory [branch]]' + echo ' pvscheck.sh [--recheck] [target-directory]' + echo + echo ' --recheck: run analysis on a prepared target directory' + echo + echo ' target-directory: Directory where build should occur' + echo ' Default: ../neovim-pvs' + echo + echo ' branch: Branch to check' + echo ' Default: master' +} + get_pvs_comment() { cat > pvs-comment << EOF // This is an open source non-commercial project. Dear PVS-Studio, please check it. @@ -63,39 +77,7 @@ patch_sources() { -exec /bin/sh -c "$sh_script" - '{}' \; } -help() { - echo 'Usage: pvscheck.sh [target-directory [branch]]' - echo - echo ' target-directory: Directory where build should occur' - echo ' Default: ../neovim-pvs' - echo - echo ' branch: Branch to check' - echo ' Must not be already checked out: uses git worktree.' - echo ' Default: master' -} - -main() { - local PVS_URL="http://files.viva64.com/pvs-studio-6.14.21446.1-x86_64.tgz" - - if test "x$1" = "x--help" ; then - help - return - fi - set -x - - local tgt="${1:-$PWD/../neovim-pvs}" - local branch="${2:-master}" - - git clone --branch="$branch" . "$tgt" - - cd "$tgt" - - install_pvs - - create_compile_commands - - patch_sources - +run_analysis() { pvs-studio-analyzer \ analyze \ --threads "$(get_jobs_num)" \ @@ -109,4 +91,57 @@ main() { plog-converter -t tasklist -o PVS-studio.tsk PVS-studio.log } +do_check() { + local tgt="${1}" + local branch="${2}" + + git clone --branch="$branch" . "$tgt" + + cd "$tgt" + + install_pvs + + create_compile_commands + + patch_sources + + run_analysis +} + +do_recheck() { + local tgt="${1}" + + cd "$tgt" + + export PATH="$PWD/pvs-studio/bin${PATH+:}${PATH}" + + run_analysis +} + +main() { + local PVS_URL="http://files.viva64.com/pvs-studio-6.14.21446.1-x86_64.tgz" + + if test "x$1" = "x--help" ; then + help + return + fi + + set -x + + local recheck= + if test "x$1" = "x--recheck" ; then + recheck=1 + shift + fi + + local tgt="${1:-$PWD/../neovim-pvs}" + local branch="${2:-master}" + + if test "x$recheck" = "x" ; then + do_check "$tgt" "$branch" + else + do_recheck "$tgt" + fi +} + main "$@" From 0ce961891887acc7623162ac3db1fa00156dd2bb Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 10 Apr 2017 19:12:56 +0200 Subject: [PATCH 022/257] test/rmdir(): Remove `readonly` attr on Windows. --- test/functional/helpers.lua | 27 ++++++++++++++++++++++-- test/functional/spell/spellfile_spec.lua | 4 +++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 13b06e7f1b..a27b0e7783 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -428,6 +428,16 @@ local function expect_any(contents) return ok(nil ~= string.find(curbuf_contents(), contents, 1, true)) end +local function win_remove_readonly_attr(abspath) + assert(os_name() == "windows") + local cmd = 'attrib -h -r "'..abspath..'"' + -- TODO: Lua 5.2 io.popen():close() returns better info: + -- http://stackoverflow.com/a/14031974 + -- https://www.lua.org/manual/5.2/manual.html#pdf-file:close + local exitcode = os.execute(cmd) + return (exitcode == 0), exitcode +end + local function do_rmdir(path) if lfs.attributes(path, 'mode') ~= 'directory' then return nil @@ -443,8 +453,21 @@ local function do_rmdir(path) else local ret, err = os.remove(abspath) if not ret then - error('os.remove: '..err) - return nil + if os_name() == "windows" then + -- Remove `readonly` attribute (if any)... + local attr_status, attr_rv = win_remove_readonly_attr(abspath) + if not attr_status then + error('win_remove_readonly_attr: '..attr_rv) + return nil + end + -- ...then try again. + ret, err = os.remove(abspath) + end + + if not ret then + error('os.remove: '..err) + return nil + end end end end diff --git a/test/functional/spell/spellfile_spec.lua b/test/functional/spell/spellfile_spec.lua index e7cd10d2ac..afd2c1bce4 100644 --- a/test/functional/spell/spellfile_spec.lua +++ b/test/functional/spell/spellfile_spec.lua @@ -5,6 +5,7 @@ local eq = helpers.eq local clear = helpers.clear local meths = helpers.meths local exc_exec = helpers.exc_exec +local rmdir = helpers.rmdir local write_file = helpers.write_file local testdir = 'Xtest-functional-spell-spellfile.d' @@ -12,11 +13,12 @@ local testdir = 'Xtest-functional-spell-spellfile.d' describe('spellfile', function() before_each(function() clear() + rmdir(testdir) lfs.mkdir(testdir) lfs.mkdir(testdir .. '/spell') end) after_each(function() - lfs.rmdir(testdir) + rmdir(testdir) end) -- ┌ Magic string (#VIMSPELLMAGIC) -- │ ┌ Spell file version (#VIMSPELLVERSION) From 6cbf290d56d618601635d301969c697cfcc2b653 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 10 Apr 2017 22:57:49 +0200 Subject: [PATCH 023/257] test/rmdir(): fallback to Nvim delete() Lua has too many pitfalls here: - os.execute() requires shell-escaping - os.execute() has breaking changes between Lua 5.1 and 5.2 - No native way in Lua to handle "readonly" etc. on Windows --- test/functional/helpers.lua | 40 ++++++++++--------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index a27b0e7783..bb46f57691 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -428,45 +428,28 @@ local function expect_any(contents) return ok(nil ~= string.find(curbuf_contents(), contents, 1, true)) end -local function win_remove_readonly_attr(abspath) - assert(os_name() == "windows") - local cmd = 'attrib -h -r "'..abspath..'"' - -- TODO: Lua 5.2 io.popen():close() returns better info: - -- http://stackoverflow.com/a/14031974 - -- https://www.lua.org/manual/5.2/manual.html#pdf-file:close - local exitcode = os.execute(cmd) - return (exitcode == 0), exitcode -end - local function do_rmdir(path) if lfs.attributes(path, 'mode') ~= 'directory' then - return nil + return -- Don't complain. end for file in lfs.dir(path) do if file ~= '.' and file ~= '..' then local abspath = path..'/'..file if lfs.attributes(abspath, 'mode') == 'directory' then - local ret = do_rmdir(abspath) -- recurse - if not ret then - return nil - end + do_rmdir(abspath) -- recurse else local ret, err = os.remove(abspath) if not ret then - if os_name() == "windows" then - -- Remove `readonly` attribute (if any)... - local attr_status, attr_rv = win_remove_readonly_attr(abspath) - if not attr_status then - error('win_remove_readonly_attr: '..attr_rv) - return nil - end - -- ...then try again. - ret, err = os.remove(abspath) - end - - if not ret then + if not session then error('os.remove: '..err) - return nil + else + -- Try Nvim delete(): it handles `readonly` attribute on Windows, + -- and avoids Lua cross-version/platform incompatibilities. + if -1 == nvim_call('delete', abspath) then + local hint = (os_name() == 'windows' + and ' (hint: try :%bwipeout! before rmdir())' or '') + error('delete() failed'..hint..': '..abspath) + end end end end @@ -476,7 +459,6 @@ local function do_rmdir(path) if not ret then error('lfs.rmdir('..path..'): '..err) end - return ret end local function rmdir(path) From 2d296387447cbf89308a4a136cce866e4691cca8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 10 Apr 2017 01:38:20 +0200 Subject: [PATCH 024/257] test: `:file {name}` --- test/functional/ex_cmds/file_spec.lua | 35 +++++++++++++++++++++++++++ test/functional/helpers.lua | 13 +++------- 2 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 test/functional/ex_cmds/file_spec.lua diff --git a/test/functional/ex_cmds/file_spec.lua b/test/functional/ex_cmds/file_spec.lua new file mode 100644 index 0000000000..771c283134 --- /dev/null +++ b/test/functional/ex_cmds/file_spec.lua @@ -0,0 +1,35 @@ +local helpers = require('test.functional.helpers')(after_each) +local lfs = require('lfs') +local clear = helpers.clear +local command = helpers.command +local eq = helpers.eq +local funcs = helpers.funcs +local rmdir = helpers.rmdir + +describe(':file', function() + local swapdir = lfs.currentdir()..'/Xtest-file_spec' + before_each(function() + clear() + rmdir(swapdir) + lfs.mkdir(swapdir) + end) + after_each(function() + command('%bwipeout!') + rmdir(swapdir) + end) + + it("rename does not lose swapfile #6487", function() + local testfile = 'test-file_spec' + local testfile_renamed = testfile..'-renamed' + -- Note: `set swapfile` *must* go after `set directory`: otherwise it may + -- attempt to create a swapfile in different directory. + command('set directory^='..swapdir..'//') + command('set swapfile fileformat=unix undolevels=-1') + + command('edit! '..testfile) + -- Before #6487 this gave "E301: Oops, lost the swap file !!!" on Windows. + command('file '..testfile_renamed) + eq(testfile_renamed..'.swp', + string.match(funcs.execute('swapname'), '[^%%]+$')) + end) +end) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index bb46f57691..7edb2381e8 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -32,20 +32,15 @@ local nvim_set = 'set shortmess+=I background=light noswapfile noautoindent' ..' belloff= noshowcmd noruler nomore' local nvim_argv = {nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', '--cmd', nvim_set, '--embed'} - -local mpack = require('mpack') - -local tmpname = global_helpers.tmpname -local uname = global_helpers.uname - --- Formulate a path to the directory containing nvim. We use this to --- help run test executables. It helps to keep the tests working, even --- when the build is not in the default location. +-- Directory containing nvim. local nvim_dir = nvim_prog:gsub("[/\\][^/\\]+$", "") if nvim_dir == nvim_prog then nvim_dir = "." end +local mpack = require('mpack') +local tmpname = global_helpers.tmpname +local uname = global_helpers.uname local prepend_argv if os.getenv('VALGRIND') then From 4a63d9e5f88feb16ec513b8dba1f8d02bd2ff4d6 Mon Sep 17 00:00:00 2001 From: erw7 Date: Sun, 9 Apr 2017 12:31:54 +0900 Subject: [PATCH 025/257] win: mch_open_rw: specify S_IWRITE #6487 On Windows, `mch_open_rw` is not actually doing what it claims. This manifests as "E301: Oops, lost the swap file !!!" when filename is changed with :file {name}. Steps to reproduce (covered by test/functional/ex_cmds/file_spec.lua): nvim -u NONE :edit test :file test2 E301 Oops, lost the swap file!!! From libuv/src/win/fs.c: void fs__open(uv_fs_t* req) { ... attributes |= FILE_ATTRIBUTE_NORMAL; if (flags & _O_CREAT) { if (!((req->fs.info.mode & ~current_umask) & _S_IWRITE)) { attributes |= FILE_ATTRIBUTE_READONLY; } } --- src/nvim/macros.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nvim/macros.h b/src/nvim/macros.h index 22fd48de9d..9131f8be84 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -120,8 +120,10 @@ /* mch_open_rw(): invoke os_open() with third argument for user R/W. */ #if defined(UNIX) /* open in rw------- mode */ # define mch_open_rw(n, f) os_open((n), (f), (mode_t)0600) +#elif defined(WIN32) +# define mch_open_rw(n, f) os_open((n), (f), S_IREAD | S_IWRITE) #else -# define mch_open_rw(n, f) os_open((n), (f), 0) +# define mch_open_rw(n, f) os_open((n), (f), 0) #endif # define REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG)) From dab3f86d092706514bd207dd9900740bab785859 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 10 Apr 2017 19:53:19 +0200 Subject: [PATCH 026/257] win/test: Enable recover_spec.lua --- test/functional/ex_cmds/recover_spec.lua | 43 ++++++++++++------------ 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/test/functional/ex_cmds/recover_spec.lua b/test/functional/ex_cmds/recover_spec.lua index 36bf85015a..cb68c29b9a 100644 --- a/test/functional/ex_cmds/recover_spec.lua +++ b/test/functional/ex_cmds/recover_spec.lua @@ -1,12 +1,11 @@ --- Tests for :recover - local helpers = require('test.functional.helpers')(after_each) local lfs = require('lfs') local feed_command, eq, clear, eval, feed, expect, source = helpers.feed_command, helpers.eq, helpers.clear, helpers.eval, helpers.feed, helpers.expect, helpers.source - -if helpers.pending_win32(pending) then return end +local command = helpers.command +local ok = helpers.ok +local rmdir = helpers.rmdir describe(':recover', function() before_each(clear) @@ -23,30 +22,29 @@ describe(':preserve', function() local swapdir = lfs.currentdir()..'/testdir_recover_spec' before_each(function() clear() - helpers.rmdir(swapdir) + rmdir(swapdir) lfs.mkdir(swapdir) end) after_each(function() - helpers.rmdir(swapdir) + command('%bwipeout!') + rmdir(swapdir) end) it("saves to custom 'directory' and (R)ecovers (issue #1836)", function() local testfile = 'testfile_recover_spec' + -- Put swapdir at the start of the 'directory' list. #1836 -- Note: `set swapfile` *must* go after `set directory`: otherwise it may -- attempt to create a swapfile in different directory. local init = [[ - set directory^=]]..swapdir..[[// + set directory^=]]..swapdir:gsub([[\]], [[\\]])..[[// set swapfile fileformat=unix undolevels=-1 ]] source(init) - feed_command('set swapfile fileformat=unix undolevels=-1') - -- Put swapdir at the start of the 'directory' list. #1836 - feed_command('set directory^='..swapdir..'//') - feed_command('edit '..testfile) + command('edit! '..testfile) feed('isometext') - feed_command('preserve') - source('redir => g:swapname | swapname | redir END') + command('preserve') + source('redir => g:swapname | silent swapname | redir END') local swappath1 = eval('g:swapname') @@ -59,19 +57,20 @@ describe(':preserve', function() source(init) -- Use the "SwapExists" event to choose the (R)ecover choice at the dialog. - feed_command('autocmd SwapExists * let v:swapchoice = "r"') - feed_command('silent edit '..testfile) - source('redir => g:swapname | swapname | redir END') + command('autocmd SwapExists * let v:swapchoice = "r"') + command('silent edit! '..testfile) + source('redir => g:swapname | silent swapname | redir END') local swappath2 = eval('g:swapname') - -- swapfile from session 1 should end in .swp - assert(testfile..'.swp' == string.match(swappath1, '[^%%]+$')) - - -- swapfile from session 2 should end in .swo - assert(testfile..'.swo' == string.match(swappath2, '[^%%]+$')) - expect('sometext') + -- swapfile from session 1 should end in .swp + eq(testfile..'.swp', string.match(swappath1, '[^%%]+$')) + -- swapfile from session 2 should end in .swo + eq(testfile..'.swo', string.match(swappath2, '[^%%]+$')) + -- Verify that :swapname was not truncated (:help 'shortmess'). + ok(nil == string.find(swappath1, '%.%.%.')) + ok(nil == string.find(swappath2, '%.%.%.')) end) end) From 119f0ca85463b7d9fb7dffe47d0fcee2c9604c53 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 10 Apr 2017 21:54:19 +0200 Subject: [PATCH 027/257] test: helpers.execute() => helpers.feed_command() --- test/benchmark/bench_re_freeze_spec.lua | 21 +++++++++------------ test/functional/normal/lang_spec.lua | 6 +++--- test/functional/ui/inccommand_spec.lua | 24 ++++++++++++------------ test/functional/ui/screen.lua | 17 ++++++----------- 4 files changed, 30 insertions(+), 38 deletions(-) diff --git a/test/benchmark/bench_re_freeze_spec.lua b/test/benchmark/bench_re_freeze_spec.lua index 53041b042b..ea41953014 100644 --- a/test/benchmark/bench_re_freeze_spec.lua +++ b/test/benchmark/bench_re_freeze_spec.lua @@ -1,8 +1,8 @@ -- Test for benchmarking RE engine. -local helpers = require('test.functional.helpers') +local helpers = require('test.functional.helpers')(after_each) local insert, source = helpers.insert, helpers.source -local clear, execute, wait = helpers.clear, helpers.execute, helpers.wait +local clear, command = helpers.clear, helpers.command -- Temporary file for gathering benchmarking results for each regexp engine. local result_file = 'benchmark.out' @@ -31,7 +31,7 @@ describe('regexp search', function() clear() source(measure_script) insert('" Benchmark_results:') - execute('write! ' .. result_file) + command('write! ' .. result_file) end) -- At the end of the test run we just print the contents of the result file @@ -46,22 +46,19 @@ describe('regexp search', function() it('is working with regexpengine=0', function() local regexpengine = 0 - execute(string.format(measure_cmd, regexpengine)) - execute('write') - wait() + command(string.format(measure_cmd, regexpengine)) + command('write') end) it('is working with regexpengine=1', function() local regexpengine = 1 - execute(string.format(measure_cmd, regexpengine)) - execute('write') - wait() + command(string.format(measure_cmd, regexpengine)) + command('write') end) it('is working with regexpengine=2', function() local regexpengine = 2 - execute(string.format(measure_cmd, regexpengine)) - execute('write') - wait() + command(string.format(measure_cmd, regexpengine)) + command('write') end) end) diff --git a/test/functional/normal/lang_spec.lua b/test/functional/normal/lang_spec.lua index 464b85d684..1da1d4679d 100644 --- a/test/functional/normal/lang_spec.lua +++ b/test/functional/normal/lang_spec.lua @@ -1,6 +1,6 @@ local helpers = require('test.functional.helpers')(after_each) local clear, insert, eq = helpers.clear, helpers.insert, helpers.eq -local execute, expect = helpers.execute, helpers.expect +local command, expect = helpers.command, helpers.expect local feed, eval = helpers.feed, helpers.eval local exc_exec = helpers.exc_exec @@ -32,7 +32,7 @@ describe('gu and gU', function() end before_each(function() - execute('lang ctype tr_TR.UTF-8') + command('lang ctype tr_TR.UTF-8') end) it('with default casemap', function() @@ -46,7 +46,7 @@ describe('gu and gU', function() end) it('with casemap=""', function() - execute('set casemap=') + command('set casemap=') -- expect Turkish locale behavior insert("iI") feed("VgU") diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index b7a33cb64d..a7be1a9dc8 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -1,6 +1,7 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear = helpers.clear +local command = helpers.command local curbufmeths = helpers.curbufmeths local eq = helpers.eq local eval = helpers.eval @@ -21,9 +22,9 @@ local default_text = [[ local function common_setup(screen, inccommand, text) if screen then - feed_command("syntax on") - feed_command("set nohlsearch") - feed_command("hi Substitute guifg=red guibg=yellow") + command("syntax on") + command("set nohlsearch") + command("hi Substitute guifg=red guibg=yellow") screen:attach() screen:set_default_attr_ids({ [1] = {foreground = Screen.colors.Fuchsia}, @@ -46,7 +47,7 @@ local function common_setup(screen, inccommand, text) }) end - feed_command("set inccommand=" .. (inccommand and inccommand or "")) + command("set inccommand=" .. (inccommand and inccommand or "")) if text then insert(text) @@ -456,7 +457,7 @@ describe(":substitute, 'inccommand' preserves undo", function() insert("X") feed("IY") feed(":%s/tw/MO/") - -- execute("undo") here would cause "Press ENTER". + -- feed_command("undo") here would cause "Press ENTER". feed("u") expect(default_text:gsub("Inc", "XInc")) feed("u") @@ -514,7 +515,7 @@ describe(":substitute, 'inccommand' preserves undo", function() feed("Ay") feed("Az") feed(":%s/tw/AR") - -- using execute("undo") here will result in a "Press ENTER" prompt + -- feed_command("undo") here would cause "Press ENTER". feed("u") expect(default_text:gsub("lines", "linesxy")) feed("u") @@ -603,7 +604,7 @@ describe(":substitute, 'inccommand' preserves undo", function() feed_command("set undolevels=-1") feed(":%s/tw/MO/g") - -- using execute("undo") here will result in a "Press ENTER" prompt + -- feed_command("undo") here will result in a "Press ENTER" prompt feed("u") if case == "split" then screen:expect([[ @@ -804,7 +805,6 @@ describe(":substitute, inccommand=split", function() it('does not show split window for :s/', function() feed("2gg") feed(":s/tw") - wait() screen:expect([[ Inc substitution on | two lines | @@ -1291,14 +1291,14 @@ describe("'inccommand' and :cnoremap", function() it('work with remapped characters', function() for _, case in pairs(cases) do refresh(case) - local command = "%s/lines/LINES/g" + local cmd = "%s/lines/LINES/g" - for i = 1, string.len(command) do - local c = string.sub(command, i, i) + for i = 1, string.len(cmd) do + local c = string.sub(cmd, i, i) feed_command("cnoremap ".. c .. " " .. c) end - feed_command(command) + feed_command(cmd) expect([[ Inc substitution on two LINES diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 2f2cc85dab..afbcd222c7 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -284,18 +284,13 @@ function Screen:wait(check, timeout) if failure_after_success then print([[ -Warning: Screen changes have been received after the expected state was seen. -This is probably due to an indeterminism in the test. Try adding -`wait()` (or even a separate `screen:expect(...)`) at a point of possible -indeterminism, typically in between a `feed()` or `execute()` which is non- -synchronous, and a synchronous api call. -Note that sometimes a `wait` can trigger redraws and consequently generate more -indeterminism. If adding `wait` calls seems to increase the frequency of these -messages, try removing every `wait` call in the test. - -If everything else fails, use Screen:redraw_debug to help investigate what is - causing the problem. +Warning: Screen changes were received after the expected state. This indicates +indeterminism in the test. Try adding wait() (or screen:expect(...)) between +asynchronous (feed(), nvim_input()) and synchronous API calls. + - Use Screen:redraw_debug() to investigate the problem. + - wait() can trigger redraws and consequently generate more indeterminism. + In that case try removing every wait(). ]]) local tb = debug.traceback() local index = string.find(tb, '\n%s*%[C]') From de378477cc3ebface5da5dbd24015959755f137e Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 10 Apr 2017 22:16:05 +0200 Subject: [PATCH 028/257] ci/appveyor: fix cache pattern --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8027aee166..edb679d223 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,7 @@ build_script: - call ci\build.bat cache: - C:\msys64\var\cache\pacman\pkg -> ci\build.bat -- .deps -> third-party/** +- .deps -> third-party\** artifacts: - path: build/Neovim.zip - path: build/bin/nvim.exe From 69775f603f0b21cb28adec99daaaa9356581ddd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Mon, 10 Apr 2017 19:48:45 +0200 Subject: [PATCH 029/257] ci: install Turkish locale and make locale tests more reliable --- .travis.yml | 2 ++ test/functional/normal/lang_spec.lua | 30 ++++++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 62d9ebebda..1f00b5c880 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,9 +104,11 @@ addons: - gcc-5-multilib - gcc-multilib - gdb + - language-pack-tr - libc6-dev-i386 - libtool - llvm-3.9-dev + - locales - pkg-config - unzip - valgrind diff --git a/test/functional/normal/lang_spec.lua b/test/functional/normal/lang_spec.lua index 1da1d4679d..24d1262f5f 100644 --- a/test/functional/normal/lang_spec.lua +++ b/test/functional/normal/lang_spec.lua @@ -17,13 +17,7 @@ describe('gu and gU', function() end) describe('works in Turkish locale', function() - if helpers.pending_win32(pending) then return end - clear() - if eval('has("mac")') ~= 0 then - pending("not yet on macOS", function() end) - return - end local err = exc_exec('lang ctype tr_TR.UTF-8') if err ~= 0 then @@ -47,13 +41,23 @@ describe('gu and gU', function() it('with casemap=""', function() command('set casemap=') - -- expect Turkish locale behavior - insert("iI") - feed("VgU") - expect("İI") - feed("Vgu") - expect("iı") + -- expect either Turkish locale behavior or ASCII behavior + local iupper = eval("toupper('i')") + if iupper == "İ" then + insert("iI") + feed("VgU") + expect("İI") + feed("Vgu") + expect("iı") + elseif iupper == "I" then + insert("iI") + feed("VgU") + expect("II") + feed("Vgu") + expect("ii") + else + error("expected toupper('i') to be either 'I' or 'İ'") + end end) - end) end) From 2d72d85b23761383ac7838faed2f7b53bdce8817 Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Tue, 11 Apr 2017 22:44:48 +0200 Subject: [PATCH 030/257] refactor: pos_T macros to functions (#6496) --- src/nvim/charset.c | 3 ++- src/nvim/ex_getln.c | 1 + src/nvim/indent.c | 3 ++- src/nvim/indent_c.c | 1 + src/nvim/macros.h | 19 ------------------- src/nvim/mark.h | 40 ++++++++++++++++++++++++++++++++++++++++ src/nvim/screen.c | 1 + src/nvim/spell.c | 1 + 8 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 645139f696..3037cfe669 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -15,6 +15,7 @@ #include "nvim/func_attr.h" #include "nvim/indent.h" #include "nvim/main.h" +#include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" @@ -1366,7 +1367,7 @@ void getvcols(win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, colnr_T to1; colnr_T to2; - if (ltp(pos1, pos2)) { + if (lt(*pos1, *pos2)) { getvvcol(wp, pos1, &from1, NULL, &to1); getvvcol(wp, pos2, &from2, NULL, &to2); } else { diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 9d74f554ba..0b6036ace9 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -30,6 +30,7 @@ #include "nvim/if_cscope.h" #include "nvim/indent.h" #include "nvim/main.h" +#include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/menu.h" diff --git a/src/nvim/indent.c b/src/nvim/indent.c index 7f31bb8c5c..8fbad38495 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -7,6 +7,7 @@ #include "nvim/eval.h" #include "nvim/charset.h" #include "nvim/cursor.h" +#include "nvim/mark.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/misc1.h" @@ -598,7 +599,7 @@ int get_lisp_indent(void) paren = *pos; pos = findmatch(NULL, '['); - if ((pos == NULL) || ltp(pos, &paren)) { + if ((pos == NULL) || lt(*pos, paren)) { pos = &paren; } } diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 4a73fbaf61..8f5547544d 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -10,6 +10,7 @@ #include "nvim/edit.h" #include "nvim/indent.h" #include "nvim/indent_c.h" +#include "nvim/mark.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/option.h" diff --git a/src/nvim/macros.h b/src/nvim/macros.h index 9131f8be84..b816b34b39 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -28,25 +28,6 @@ /// @return `s, sizeof(s) - 1` #define S_LEN(s) (s), (sizeof(s) - 1) -/* - * Position comparisons - */ -# define lt(a, b) (((a).lnum != (b).lnum) \ - ? (a).lnum < (b).lnum \ - : (a).col != (b).col \ - ? (a).col < (b).col \ - : (a).coladd < (b).coladd) -# define ltp(a, b) (((a)->lnum != (b)->lnum) \ - ? (a)->lnum < (b)->lnum \ - : (a)->col != (b)->col \ - ? (a)->col < (b)->col \ - : (a)->coladd < (b)->coladd) -# define equalpos(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col) && \ - ((a).coladd == (b).coladd)) -# define clearpos(a) {(a)->lnum = 0; (a)->col = 0; (a)->coladd = 0; } - -#define ltoreq(a, b) (lt(a, b) || equalpos(a, b)) - /* * lineempty() - return TRUE if the line is empty */ diff --git a/src/nvim/mark.h b/src/nvim/mark.h index c22a102926..a356c1f398 100644 --- a/src/nvim/mark.h +++ b/src/nvim/mark.h @@ -4,6 +4,7 @@ #include "nvim/macros.h" #include "nvim/ascii.h" #include "nvim/buffer_defs.h" +#include "nvim/func_attr.h" #include "nvim/mark_defs.h" #include "nvim/memory.h" #include "nvim/pos.h" @@ -75,6 +76,45 @@ static inline int mark_local_index(const char name) : -1)))); } +static inline bool lt(pos_T, pos_T) REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; +static inline bool equalpos(pos_T, pos_T) + REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; +static inline bool ltoreq(pos_T, pos_T) + REAL_FATTR_CONST REAL_FATTR_ALWAYS_INLINE; +static inline void clearpos(pos_T *) REAL_FATTR_ALWAYS_INLINE; + +/// Return true if position a is before (less than) position b. +static inline bool lt(pos_T a, pos_T b) +{ + if (a.lnum != b.lnum) { + return a.lnum < b.lnum; + } else if (a.col != b.col) { + return a.col < b.col; + } else { + return a.coladd < b.coladd; + } +} + +/// Return true if position a and b are equal. +static inline bool equalpos(pos_T a, pos_T b) +{ + return (a.lnum == b.lnum) && (a.col == b.col) && (a.coladd == b.coladd); +} + +/// Return true if position a is less than or equal to b. +static inline bool ltoreq(pos_T a, pos_T b) +{ + return lt(a, b) || equalpos(a, b); +} + +/// Clear the pos_T structure pointed to by a. +static inline void clearpos(pos_T *a) +{ + a->lnum = 0; + a->col = 0; + a->coladd = 0; +} + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "mark.h.generated.h" #endif diff --git a/src/nvim/screen.c b/src/nvim/screen.c index d9a21aa81f..febca105e9 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -102,6 +102,7 @@ #include "nvim/indent.h" #include "nvim/getchar.h" #include "nvim/main.h" +#include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 18febda1d8..17016be35f 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -92,6 +92,7 @@ #include "nvim/func_attr.h" #include "nvim/getchar.h" #include "nvim/hashtab.h" +#include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" From d6e5f94ae945308d96be414c9c1fb3f0ae71355e Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 24 Mar 2017 02:54:50 +0100 Subject: [PATCH 031/257] win: defaults: 'shellredir', 'shellxquote', 'shellxescape' --- runtime/doc/eval.txt | 19 +++++++----- runtime/doc/options.txt | 41 +++++--------------------- src/nvim/misc1.c | 6 ++-- src/nvim/options.lua | 18 +++++++++-- src/nvim/os/shell.c | 2 -- test/functional/terminal/edit_spec.lua | 3 +- 6 files changed, 39 insertions(+), 50 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 16f9a2ea6e..1ed919a241 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1524,13 +1524,18 @@ v:errors Errors found by assert functions, such as |assert_true()|. list by the assert function. *v:event* *event-variable* -v:event Dictionary of event data for the current |autocommand|. The - available keys differ per event type and are specified at the - documentation for each |event|. The possible keys are: - operator The operation performed. Unlike - |v:operator|, it is set also for an Ex - mode command. For instance, |:yank| is - translated to "|y|". +v:event Dictionary of event data for the current |autocommand|. Valid + only during the autocommand lifetime: storing or passing + `v:event` is invalid. Copy it instead: > + au TextYankPost * let g:foo = deepcopy(v:event) +< Keys vary by event; see the documentation for the specific + event, e.g. |TextYankPost|. + KEY DESCRIPTION ~ + operator The current |operator|. Also set for + Ex commands (unlike |v:operator|). For + example if |TextYankPost| is triggered + by the |:yank| Ex command then + `v:event['operator']` is "y". regcontents Text stored in the register as a |readfile()|-style list of lines. regname Requested register (e.g "x" for "xyy) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index c30a88f48d..42d665b42e 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2765,8 +2765,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") + Unix: "grep -n $* /dev/null") global or local to buffer |global-local| Program to use for the |:grep| command. This option may contain '%' and '#' characters, which are expanded like when used in a command- @@ -2781,8 +2780,6 @@ A jump table for the options with a short description can be found at |Q_op|. |:vimgrepadd| and |:lgrepadd| like |:lvimgrepadd|. See also the section |:make_makeprg|, since most of the comments there apply equally to 'grepprg'. - For Win32, the default is "findstr /n" if "findstr.exe" can be found, - otherwise it's "grep -n". This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -5251,9 +5248,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'shellcmdflag'* *'shcf'* -'shellcmdflag' 'shcf' string (default: "-c"; - Windows, when 'shell' does not - contain "sh" somewhere: "/c") +'shellcmdflag' 'shcf' string (default: "-c"; Windows: "/c") global Flag passed to the shell to execute "!" and ":!" commands; e.g., "bash.exe -c ls" or "cmd.exe /c dir". For Windows @@ -5264,15 +5259,12 @@ A jump table for the options with a short description can be found at |Q_op|. See |option-backslash| about including spaces and backslashes. See |shell-unquoting| which talks about separating this option into multiple arguments. - Also see |dos-shell| for Windows. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'shellpipe'* *'sp'* 'shellpipe' 'sp' string (default ">", "| tee", "|& tee" or "2>&1| tee") global - {not available when compiled without the |+quickfix| - feature} String to be used to put the output of the ":make" command in the error file. See also |:make_makeprg|. See |option-backslash| about including spaces and backslashes. @@ -5314,7 +5306,7 @@ A jump table for the options with a short description can be found at |Q_op|. third-party shells on Windows systems, such as the MKS Korn Shell or bash, where it should be "\"". The default is adjusted according the value of 'shell', to reduce the need to set this option by the - user. See |dos-shell|. + user. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -5346,7 +5338,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'shellslash'* *'ssl'* *'noshellslash'* *'nossl'* 'shellslash' 'ssl' boolean (default off) global - {only for MSDOS and MS-Windows} + {only for Windows} When set, a forward slash is used when expanding file names. This is useful when a Unix-like shell is used instead of command.com or cmd.exe. Backward slashes can still be typed, but they are changed to @@ -5363,10 +5355,7 @@ A jump table for the options with a short description can be found at |Q_op|. global When on, use temp files for shell commands. When off use a pipe. When using a pipe is not possible temp files are used anyway. - Currently a pipe is only supported on Unix and MS-Windows 2K and - later. You can check it with: > - :if has("filterpipe") -< The advantage of using a pipe is that nobody can read the temp file + The advantage of using a pipe is that nobody can read the temp file and the 'shell' command does not need to support redirection. The advantage of using a temp file is that the file type and encoding can be detected. @@ -5376,8 +5365,7 @@ A jump table for the options with a short description can be found at |Q_op|. |system()| does not respect this option, it always uses pipes. *'shellxescape'* *'sxe'* -'shellxescape' 'sxe' string (default: ""; - for Windows: "\"&|<>()@^") +'shellxescape' 'sxe' string (default: ""; Windows: "\"&|<>()@^") global When 'shellxquote' is set to "(" then the characters listed in this option will be escaped with a '^' character. This makes it possible @@ -5402,7 +5390,7 @@ A jump table for the options with a short description can be found at |Q_op|. strips off the first and last quote on a command, or 3rd-party shells such as the MKS Korn Shell or bash, where it should be "\"". The default is adjusted according the value of 'shell', to reduce the need - to set this option by the user. See |dos-shell|. + to set this option by the user. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -6413,8 +6401,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'title'* *'notitle'* 'title' boolean (default off, on when title can be restored) global - {not available when compiled without the |+title| - feature} When on, the title of the window will be set to the value of 'titlestring' (if it is not empty), or to: filename [+=-] (path) - VIM @@ -6426,16 +6412,10 @@ A jump table for the options with a short description can be found at |Q_op|. =+ indicates the file is read-only and modified (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 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). *'titlelen'* 'titlelen' number (default 85) global - {not available when compiled without the |+title| - feature} Gives the percentage of 'columns' to use for the length of the window title. When the title is longer, only the end of the path name is shown. A '<' character before the path name is used to indicate this. @@ -6449,8 +6429,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'titleold'* 'titleold' string (default "Thanks for flying Vim") global - {only available when compiled with the |+title| - feature} This option will be used for the window title when exiting Vim if the original title cannot be restored. Only happens if 'title' is on or 'titlestring' is not empty. @@ -6459,13 +6437,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'titlestring'* 'titlestring' string (default "") global - {not available when compiled without the |+title| - feature} 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 - Win32 console, all GUI versions and terminals with a non-empty 't_ts' - option). When this option contains printf-style '%' items, they will be expanded according to the rules used for 'statusline'. Example: > diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 0b74b4437e..8d93505be3 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -2678,7 +2678,8 @@ void fast_breakcheck(void) } } -// Call shell. Calls os_call_shell, with 'shellxquote' added. +// os_call_shell wrapper. Handles 'verbose', :profile, and v:shell_error. +// Invalidates cached tags. int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg) { int retval; @@ -2686,8 +2687,7 @@ int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg) if (p_verbose > 3) { verbose_enter(); - smsg(_("Calling shell to execute: \"%s\""), - cmd == NULL ? p_sh : cmd); + smsg(_("Calling shell to execute: \"%s\""), cmd == NULL ? p_sh : cmd); ui_putc('\n'); verbose_leave(); } diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 4ca63f2efe..774c39808f 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -2051,7 +2051,11 @@ return { secure=true, vi_def=true, varname='p_srr', - defaults={if_true={vi=">"}} + defaults={ + condition='WIN32', + if_true={vi=">%s 2>&1"}, + if_false={vi=">"} + } }, { full_name='shellslash', abbreviation='ssl', @@ -2073,7 +2077,11 @@ return { secure=true, vi_def=true, varname='p_sxq', - defaults={if_true={vi=""}} + defaults={ + condition='WIN32', + if_true={vi="("}, + if_false={vi=""} + } }, { full_name='shellxescape', abbreviation='sxe', @@ -2081,7 +2089,11 @@ return { secure=true, vi_def=true, varname='p_sxe', - defaults={if_true={vi=""}} + defaults={ + condition='WIN32', + if_true={vi='"&|<>()@^'}, + if_false={vi=""} + } }, { full_name='shiftround', abbreviation='sr', diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index b449cc3d5a..5cc9d4b79b 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -124,11 +124,9 @@ int os_call_shell(char_u *cmd, ShellOpts opts, char_u *extra_args) } size_t nread; - int exitcode = do_os_system(shell_build_argv((char *)cmd, (char *)extra_args), input.data, input.len, output_ptr, &nread, emsg_silent, forward_output); - xfree(input.data); if (output) { diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua index 42a5c768bb..f691a58f6c 100644 --- a/test/functional/terminal/edit_spec.lua +++ b/test/functional/terminal/edit_spec.lua @@ -8,6 +8,7 @@ local command = helpers.command local meths = helpers.meths local clear = helpers.clear local eq = helpers.eq +local iswin = helpers.iswin describe(':edit term://*', function() local get_screen = function(columns, lines) @@ -46,7 +47,7 @@ describe(':edit term://*', function() local winheight = curwinmeths.get_height() local buf_cont_start = rep_size - sb - winheight + 2 local function bufline (i) - return ('%d: foobar'):format(i) + return (iswin() and '%d: (foobar)' or '%d: foobar'):format(i) end for i = buf_cont_start,(rep_size - 1) do bufcontents[#bufcontents + 1] = bufline(i) From f7611d74e73329a4192666ff59911ff214f462ab Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 24 Mar 2017 14:42:42 +0100 Subject: [PATCH 032/257] win: vim_strsave_shellescape: Handle 'shellslash'. From Vim, misc2.c:vim_strsave_shellescape --- src/nvim/strings.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 87e066d80a..8a1a3beddd 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -198,8 +198,16 @@ char_u *vim_strsave_shellescape(const char_u *string, /* First count the number of extra bytes required. */ size_t length = STRLEN(string) + 3; // two quotes and a trailing NUL for (const char_u *p = string; *p != NUL; mb_ptr_adv(p)) { - if (*p == '\'') - length += 3; /* ' => '\'' */ +#ifdef WIN32 + if (!p_ssl) { + if (*p == '"') { + length++; // " -> "" + } + } else +#endif + if (*p == '\'') { + length += 3; // ' => '\'' + } if ((*p == '\n' && (csh_like || do_newline)) || (*p == '!' && (csh_like || do_special))) { ++length; /* insert backslash */ @@ -216,10 +224,25 @@ char_u *vim_strsave_shellescape(const char_u *string, escaped_string = xmalloc(length); d = escaped_string; - /* add opening quote */ + // add opening quote +#ifdef WIN32 + if (!p_ssl) { + *d++ = '"'; + } else +#endif *d++ = '\''; for (const char_u *p = string; *p != NUL; ) { +#ifdef WIN32 + if (!p_ssl) { + if (*p == '"') { + *d++ = '"'; + *d++ = '"'; + p++; + continue; + } + } else +#endif if (*p == '\'') { *d++ = '\''; *d++ = '\\'; @@ -246,7 +269,12 @@ char_u *vim_strsave_shellescape(const char_u *string, MB_COPY_CHAR(p, d); } - /* add terminating quote and finish with a NUL */ + // add terminating quote and finish with a NUL +# ifdef WIN32 + if (!p_ssl) { + *d++ = '"'; + } else +# endif *d++ = '\''; *d = NUL; From 799443c9942fa145320d9cc7c4638bdaa8c8d67a Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Sat, 25 Mar 2017 22:47:38 +0000 Subject: [PATCH 033/257] win/test: Enable more system() tests --- test/functional/eval/system_spec.lua | 74 ++++++++++++++++++++-------- test/functional/helpers.lua | 2 +- 2 files changed, 54 insertions(+), 22 deletions(-) diff --git a/test/functional/eval/system_spec.lua b/test/functional/eval/system_spec.lua index bf95752e3b..83d8028b56 100644 --- a/test/functional/eval/system_spec.lua +++ b/test/functional/eval/system_spec.lua @@ -94,17 +94,26 @@ describe('system()', function() end) end) - if helpers.pending_win32(pending) then return end - it('sets v:shell_error', function() - eval([[system("sh -c 'exit'")]]) - eq(0, eval('v:shell_error')) - eval([[system("sh -c 'exit 1'")]]) - eq(1, eval('v:shell_error')) - eval([[system("sh -c 'exit 5'")]]) - eq(5, eval('v:shell_error')) - eval([[system('this-should-not-exist')]]) - eq(127, eval('v:shell_error')) + if helpers.os_name() == 'windows' then + eval([[system("cmd.exe /c exit")]]) + eq(0, eval('v:shell_error')) + eval([[system("cmd.exe /c exit 1")]]) + eq(1, eval('v:shell_error')) + eval([[system("cmd.exe /c exit 5")]]) + eq(5, eval('v:shell_error')) + eval([[system('this-should-not-exist')]]) + eq(1, eval('v:shell_error')) + else + eval([[system("sh -c 'exit'")]]) + eq(0, eval('v:shell_error')) + eval([[system("sh -c 'exit 1'")]]) + eq(1, eval('v:shell_error')) + eval([[system("sh -c 'exit 5'")]]) + eq(5, eval('v:shell_error')) + eval([[system('this-should-not-exist')]]) + eq(127, eval('v:shell_error')) + end end) describe('executes shell function if passed a string', function() @@ -120,6 +129,15 @@ describe('system()', function() screen:detach() end) + it('escapes inner double quotes #6329', function() + if helpers.os_name() == 'windows' then + -- In Windows cmd.exe's echo prints the quotes + eq('""\n', eval([[system('echo ""')]])) + else + eq('\n', eval([[system('echo ""')]])) + end + end) + it('`echo` and waits for its return', function() feed(':call system("echo")') screen:expect([[ @@ -180,7 +198,11 @@ describe('system()', function() describe('passing no input', function() it('returns the program output', function() - eq("echoed", eval('system("echo -n echoed")')) + if helpers.os_name() == 'windows' then + eq("echoed\n", eval('system("echo echoed")')) + else + eq("echoed", eval('system("echo -n echoed")')) + end end) it('to backgrounded command does not crash', function() -- This is indeterminate, just exercise the codepath. May get E5677. @@ -277,21 +299,30 @@ describe('system()', function() end) end) -if helpers.pending_win32(pending) then return end - describe('systemlist()', function() -- Similar to `system()`, but returns List instead of String. before_each(clear) it('sets the v:shell_error variable', function() - eval([[systemlist("sh -c 'exit'")]]) - eq(0, eval('v:shell_error')) - eval([[systemlist("sh -c 'exit 1'")]]) - eq(1, eval('v:shell_error')) - eval([[systemlist("sh -c 'exit 5'")]]) - eq(5, eval('v:shell_error')) - eval([[systemlist('this-should-not-exist')]]) - eq(127, eval('v:shell_error')) + if helpers.os_name() == 'windows' then + eval([[systemlist("cmd.exe /c exit")]]) + eq(0, eval('v:shell_error')) + eval([[systemlist("cmd.exe /c exit 1")]]) + eq(1, eval('v:shell_error')) + eval([[systemlist("cmd.exe /c exit 5")]]) + eq(5, eval('v:shell_error')) + eval([[systemlist('this-should-not-exist')]]) + eq(1, eval('v:shell_error')) + else + eval([[systemlist("sh -c 'exit'")]]) + eq(0, eval('v:shell_error')) + eval([[systemlist("sh -c 'exit 1'")]]) + eq(1, eval('v:shell_error')) + eval([[systemlist("sh -c 'exit 5'")]]) + eq(5, eval('v:shell_error')) + eval([[systemlist('this-should-not-exist')]]) + eq(127, eval('v:shell_error')) + end end) describe('exectues shell function', function() @@ -389,6 +420,7 @@ describe('systemlist()', function() after_each(delete_file(fname)) it('replaces NULs by newline characters', function() + if helpers.pending_win32(pending) then return end eq({'part1\npart2\npart3'}, eval('systemlist("cat '..fname..'")')) end) end) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 7edb2381e8..5882758b5a 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -348,7 +348,7 @@ end local function set_shell_powershell() source([[ set shell=powershell shellquote=\" shellpipe=\| shellredir=> - set shellcmdflag=\ -ExecutionPolicy\ RemoteSigned\ -Command + set shellcmdflag=\ -NoProfile\ -ExecutionPolicy\ RemoteSigned\ -Command let &shellxquote=' ' ]]) end From f3cc843755a6d638ada77dc31721aa53b3ff2364 Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Tue, 28 Mar 2017 16:03:53 +0100 Subject: [PATCH 034/257] win: libuv_process_spawn(): special-case cmd.exe Disable CommandLineToArgvW-standard quoting for cmd.exe. libuv assumes spawned processes follow the convention expected by CommandLineToArgvW(). But cmd.exe is non-conformant, so for cmd.exe: - With system([]), the caller has full control (and responsibility) to quote arguments correctly. - With system(''), shell* options are used. libuv quoting is disabled if argv[0] is: - cmd.exe - cmd - $COMSPEC resolving to a path with filename cmd.exe Closes #6329 References #6387 --- runtime/doc/eval.txt | 20 ++++++++------- src/nvim/event/libuv_process.c | 22 ++++++++++++++++ test/functional/eval/system_spec.lua | 38 +++++++++++++++++++++++----- 3 files changed, 64 insertions(+), 16 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 1ed919a241..aa979ae42c 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4852,16 +4852,18 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* Spawns {cmd} as a job. If {cmd} is a |List| it is run directly. If {cmd} is a |String| it is processed like this: > :call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}']) -< NOTE: This only shows the idea; see |shell-unquoting| before - constructing lists with 'shell' or 'shellcmdflag'. +< (Only shows the idea; see |shell-unquoting| for full details.) + + NOTE: on Windows if {cmd} is a List: + - cmd[0] must be executable. If it is in $PATH it can be + called by name, with or without an extension: > + :call jobstart(['ping', 'neovim.io']) +< If it is a path (not a name), extension is required: > + :call jobstart(['System32\ping.exe', 'neovim.io']) +< - {cmd} is quoted per the convention expected by + CommandLineToArgvW https://msdn.microsoft.com/bb776391 + unless the first argument is some form of "cmd.exe". - NOTE: On Windows if {cmd} is a List, cmd[0] must be a valid - executable (.exe, .com). If the executable is in $PATH it can - be called by name, with or without an extension: > - :call jobstart(['ping', 'neovim.io']) -< If it is a path (not a name), it must include the extension: > - :call jobstart(['System32\ping.exe', 'neovim.io']) -< {opts} is a dictionary with these keys: on_stdout: stdout event handler (function name or |Funcref|) on_stderr: stderr event handler (function name or |Funcref|) diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c index 3da0c386b4..ab69bea04c 100644 --- a/src/nvim/event/libuv_process.c +++ b/src/nvim/event/libuv_process.c @@ -8,6 +8,8 @@ #include "nvim/event/process.h" #include "nvim/event/libuv_process.h" #include "nvim/log.h" +#include "nvim/path.h" +#include "nvim/os/os.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/libuv_process.c.generated.h" @@ -24,6 +26,26 @@ int libuv_process_spawn(LibuvProcess *uvproc) if (proc->detach) { uvproc->uvopts.flags |= UV_PROCESS_DETACHED; } +#ifdef WIN32 + // libuv assumes spawned processes follow the convention from + // CommandLineToArgvW(), cmd.exe does not. Disable quoting since it will + // result in unexpected behaviour, the caller is left with the responsibility + // to quote arguments accordingly. system('') has shell* options for this. + // + // Disable quoting for cmd, cmd.exe and $COMSPEC with a cmd.exe filename + bool is_cmd = STRICMP(proc->argv[0], "cmd.exe") == 0 + || STRICMP(proc->argv[0], "cmd") == 0; + if (!is_cmd) { + const char_u *comspec = (char_u *)os_getenv("COMSPEC"); + const char_u *comspecshell = path_tail((char_u *)proc->argv[0]); + is_cmd = comspec != NULL && STRICMP(proc->argv[0], comspec) == 0 + && STRICMP("cmd.exe", (char *)comspecshell) == 0; + } + + if (is_cmd) { + uvproc->uvopts.flags |= UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS; + } +#endif uvproc->uvopts.exit_cb = exit_cb; uvproc->uvopts.cwd = proc->cwd; uvproc->uvopts.env = NULL; diff --git a/test/functional/eval/system_spec.lua b/test/functional/eval/system_spec.lua index 83d8028b56..45ca69707d 100644 --- a/test/functional/eval/system_spec.lua +++ b/test/functional/eval/system_spec.lua @@ -129,14 +129,38 @@ describe('system()', function() screen:detach() end) - it('escapes inner double quotes #6329', function() - if helpers.os_name() == 'windows' then - -- In Windows cmd.exe's echo prints the quotes + if helpers.os_name() == 'windows' then + it('with the default cmd.exe shell', function() eq('""\n', eval([[system('echo ""')]])) - else - eq('\n', eval([[system('echo ""')]])) - end - end) + eq('"a b"\n', eval([[system('echo "a b"')]])) + -- TODO: consistent with Vim, but it should be fixed + eq('a & echo b\n', eval([[system('echo a & echo b')]])) + eval([[system('cd "C:\Program Files"')]]) + eq(0, eval('v:shell_error')) + end) + + it('with set shell="cmd"', function() + helpers.source('let &shell="cmd"') + eq('"a b"\n', eval([[system('echo "a b"')]])) + end) + + it('works with cmd.exe from $COMSPEC', function() + local comspecshell = eval("fnamemodify($COMSPEC, ':t')") + if comspecshell == 'cmd.exe' then + helpers.source('let &shell=$COMSPEC') + eq('"a b"\n', eval([[system('echo "a b"')]])) + else + pending('$COMSPEC is not cmd.exe ' .. comspecshell) + end + end) + + it('works with powershell', function() + helpers.set_shell_powershell() + eq('a\nb\n', eval([[system('echo a b')]])) + eq('C:\\\n', eval([[system('cd c:\; (Get-Location).Path')]])) + eq('a b\n', eval([[system('echo "a b"')]])) + end) + end it('`echo` and waits for its return', function() feed(':call system("echo")') From d31d177a0c2c9997c2cdb04975bc3354b9a23fb8 Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Thu, 30 Mar 2017 23:41:52 +0100 Subject: [PATCH 035/257] win: default shellxescape, shellxquote to empty Calling cmd.exe in Windows follows a very different pattern from Vim. The primary difference is that Vim does a nested call to cmd.exe, e.g. the following call in Vim system('echo a 2>&1') spawns the following processes "C:\Program Files (x86)\Vim\vim80\vimrun" -s C:\Windows\system32\cmd.exe /c (echo a 2^>^&1 ^>C:\Users\dummy\AppData\Local\Temp\VIoC169.tmp 2^>^&1) C:\Windows\system32\cmd.exe /c C:\Windows\system32\cmd.exe /c (echo a 2^>^&1 ^>C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2^>^&1) C:\Windows\system32\cmd.exe /c (echo a 2>&1 >C:\Users\dummy\AppData\Local\Temp\VIo3C6C.tmp 2>&1) The escaping with ^ is needed because cmd.exe calls itself and needs to preserve the special metacharacters for the last call. However in nvim no nested call is made, system('') spawns a single cmd.exe process. Setting shellxescape to "" disables escaping with ^. The previous default for shellxquote=( wrapped any command in parenthesis, in Vim this is more meaningful due to the use of tempfiles to store the output and redirection (also see &shellquote). There is a slight benefit in having the default be empty because some expressions that run in console will not run within parens e.g. due to unbalanced double quotes system('echo "a b') --- runtime/doc/options.txt | 14 ++--------- src/nvim/options.lua | 12 ++------- test/functional/eval/system_spec.lua | 34 ++++++++++++++------------ test/functional/terminal/edit_spec.lua | 6 +---- 4 files changed, 23 insertions(+), 43 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 42d665b42e..9be7dae84d 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5365,18 +5365,14 @@ A jump table for the options with a short description can be found at |Q_op|. |system()| does not respect this option, it always uses pipes. *'shellxescape'* *'sxe'* -'shellxescape' 'sxe' string (default: ""; Windows: "\"&|<>()@^") +'shellxescape' 'sxe' string (default: "") global When 'shellxquote' is set to "(" then the characters listed in this option will be escaped with a '^' character. This makes it possible to execute most external commands with cmd.exe. *'shellxquote'* *'sxq'* -'shellxquote' 'sxq' string (default: ""; - for Win32, when 'shell' is cmd.exe: "(" - for Win32, when 'shell' contains "sh" - somewhere: "\"" - for Unix, when using system(): "\"") +'shellxquote' 'sxq' string (default: "") global Quoting character(s), put around the command passed to the shell, for the "!" and ":!" commands. Includes the redirection. See @@ -5385,12 +5381,6 @@ A jump table for the options with a short description can be found at |Q_op|. When the value is '(' then ')' is appended. When the value is '"(' then ')"' is appended. When the value is '(' then also see 'shellxescape'. - This is an empty string by default on most systems, but is known to be - useful for on Win32 version, either for cmd.exe which automatically - strips off the first and last quote on a command, or 3rd-party shells - such as the MKS Korn Shell or bash, where it should be "\"". The - default is adjusted according the value of 'shell', to reduce the need - to set this option by the user. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 774c39808f..4e7be63b63 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -2077,11 +2077,7 @@ return { secure=true, vi_def=true, varname='p_sxq', - defaults={ - condition='WIN32', - if_true={vi="("}, - if_false={vi=""} - } + defaults={if_true={vi=""}} }, { full_name='shellxescape', abbreviation='sxe', @@ -2089,11 +2085,7 @@ return { secure=true, vi_def=true, varname='p_sxe', - defaults={ - condition='WIN32', - if_true={vi='"&|<>()@^'}, - if_false={vi=""} - } + defaults={if_true={vi=""}} }, { full_name='shiftround', abbreviation='sr', diff --git a/test/functional/eval/system_spec.lua b/test/functional/eval/system_spec.lua index 45ca69707d..7e213e2156 100644 --- a/test/functional/eval/system_spec.lua +++ b/test/functional/eval/system_spec.lua @@ -4,6 +4,8 @@ local nvim_dir = helpers.nvim_dir local eq, call, clear, eval, feed_command, feed, nvim = helpers.eq, helpers.call, helpers.clear, helpers.eval, helpers.feed_command, helpers.feed, helpers.nvim +local command = helpers.command +local iswin = helpers.iswin local Screen = require('test.functional.ui.screen') @@ -33,8 +35,7 @@ describe('system()', function() describe('command passed as a List', function() local function printargs_path() - return nvim_dir..'/printargs-test' - .. (helpers.os_name() == 'windows' and '.exe' or '') + return nvim_dir..'/printargs-test' .. (iswin() and '.exe' or '') end it('sets v:shell_error if cmd[0] is not executable', function() @@ -88,14 +89,14 @@ describe('system()', function() end) it('does NOT run in shell', function() - if helpers.os_name() ~= 'windows' then + if not iswin() then eq("* $PATH %PATH%\n", eval("system(['echo', '*', '$PATH', '%PATH%'])")) end end) end) it('sets v:shell_error', function() - if helpers.os_name() == 'windows' then + if iswin() then eval([[system("cmd.exe /c exit")]]) eq(0, eval('v:shell_error')) eval([[system("cmd.exe /c exit 1")]]) @@ -129,28 +130,29 @@ describe('system()', function() screen:detach() end) - if helpers.os_name() == 'windows' then - it('with the default cmd.exe shell', function() + if iswin() then + it('with shell=cmd.exe', function() + command('set shell=cmd.exe') eq('""\n', eval([[system('echo ""')]])) eq('"a b"\n', eval([[system('echo "a b"')]])) - -- TODO: consistent with Vim, but it should be fixed - eq('a & echo b\n', eval([[system('echo a & echo b')]])) + eq('a \nb\n', eval([[system('echo a & echo b')]])) + eq('a \n', eval([[system('echo a 2>&1')]])) eval([[system('cd "C:\Program Files"')]]) eq(0, eval('v:shell_error')) end) - it('with set shell="cmd"', function() - helpers.source('let &shell="cmd"') + it('with shell=cmd', function() + command('set shell=cmd') eq('"a b"\n', eval([[system('echo "a b"')]])) end) - it('works with cmd.exe from $COMSPEC', function() + it('with shell=$COMSPEC', function() local comspecshell = eval("fnamemodify($COMSPEC, ':t')") if comspecshell == 'cmd.exe' then - helpers.source('let &shell=$COMSPEC') + command('set shell=$COMSPEC') eq('"a b"\n', eval([[system('echo "a b"')]])) else - pending('$COMSPEC is not cmd.exe ' .. comspecshell) + pending('$COMSPEC is not cmd.exe: ' .. comspecshell) end end) @@ -222,7 +224,7 @@ describe('system()', function() describe('passing no input', function() it('returns the program output', function() - if helpers.os_name() == 'windows' then + if iswin() then eq("echoed\n", eval('system("echo echoed")')) else eq("echoed", eval('system("echo -n echoed")')) @@ -327,8 +329,8 @@ describe('systemlist()', function() -- Similar to `system()`, but returns List instead of String. before_each(clear) - it('sets the v:shell_error variable', function() - if helpers.os_name() == 'windows' then + it('sets v:shell_error', function() + if iswin() then eval([[systemlist("cmd.exe /c exit")]]) eq(0, eval('v:shell_error')) eval([[systemlist("cmd.exe /c exit 1")]]) diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua index f691a58f6c..d2b2d8a60c 100644 --- a/test/functional/terminal/edit_spec.lua +++ b/test/functional/terminal/edit_spec.lua @@ -8,7 +8,6 @@ local command = helpers.command local meths = helpers.meths local clear = helpers.clear local eq = helpers.eq -local iswin = helpers.iswin describe(':edit term://*', function() local get_screen = function(columns, lines) @@ -46,11 +45,8 @@ describe(':edit term://*', function() local bufcontents = {} local winheight = curwinmeths.get_height() local buf_cont_start = rep_size - sb - winheight + 2 - local function bufline (i) - return (iswin() and '%d: (foobar)' or '%d: foobar'):format(i) - end for i = buf_cont_start,(rep_size - 1) do - bufcontents[#bufcontents + 1] = bufline(i) + bufcontents[#bufcontents + 1] = ('%d: foobar'):format(i) end bufcontents[#bufcontents + 1] = '' bufcontents[#bufcontents + 1] = '[Process exited 0]' From 7c4e5dfd2722b8c25641cbbc66c5b0133d0e2f03 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 12 Apr 2017 01:35:17 +0200 Subject: [PATCH 036/257] win: os_shell_is_cmdexe() + tests --- runtime/doc/eval.txt | 12 ++++++------ src/nvim/event/libuv_process.c | 20 +++----------------- src/nvim/memory.c | 7 +++++++ src/nvim/os/env.c | 22 ++++++++++++++++++---- test/unit/os/env_spec.lua | 27 ++++++++++++++++++++++++++- 5 files changed, 60 insertions(+), 28 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index aa979ae42c..77db2699f8 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4855,14 +4855,14 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* < (Only shows the idea; see |shell-unquoting| for full details.) NOTE: on Windows if {cmd} is a List: - - cmd[0] must be executable. If it is in $PATH it can be - called by name, with or without an extension: > + - cmd[0] must be an executable (not a "built-in"). If it is + in $PATH it can be called by name, without an extension: > :call jobstart(['ping', 'neovim.io']) -< If it is a path (not a name), extension is required: > +< If it is a full or partial path, extension is required: > :call jobstart(['System32\ping.exe', 'neovim.io']) -< - {cmd} is quoted per the convention expected by - CommandLineToArgvW https://msdn.microsoft.com/bb776391 - unless the first argument is some form of "cmd.exe". +< - {cmd} is collapsed to a string of quoted args as expected + by CommandLineToArgvW https://msdn.microsoft.com/bb776391 + unless cmd[0] is some form of "cmd.exe". {opts} is a dictionary with these keys: on_stdout: stdout event handler (function name or |Funcref|) diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c index ab69bea04c..f5a41d151b 100644 --- a/src/nvim/event/libuv_process.c +++ b/src/nvim/event/libuv_process.c @@ -8,7 +8,6 @@ #include "nvim/event/process.h" #include "nvim/event/libuv_process.h" #include "nvim/log.h" -#include "nvim/path.h" #include "nvim/os/os.h" #ifdef INCLUDE_GENERATED_DECLARATIONS @@ -27,22 +26,9 @@ int libuv_process_spawn(LibuvProcess *uvproc) uvproc->uvopts.flags |= UV_PROCESS_DETACHED; } #ifdef WIN32 - // libuv assumes spawned processes follow the convention from - // CommandLineToArgvW(), cmd.exe does not. Disable quoting since it will - // result in unexpected behaviour, the caller is left with the responsibility - // to quote arguments accordingly. system('') has shell* options for this. - // - // Disable quoting for cmd, cmd.exe and $COMSPEC with a cmd.exe filename - bool is_cmd = STRICMP(proc->argv[0], "cmd.exe") == 0 - || STRICMP(proc->argv[0], "cmd") == 0; - if (!is_cmd) { - const char_u *comspec = (char_u *)os_getenv("COMSPEC"); - const char_u *comspecshell = path_tail((char_u *)proc->argv[0]); - is_cmd = comspec != NULL && STRICMP(proc->argv[0], comspec) == 0 - && STRICMP("cmd.exe", (char *)comspecshell) == 0; - } - - if (is_cmd) { + // libuv collapses the argv to a CommandLineToArgvW()-style string. cmd.exe + // expects a different syntax (must be prepared by the caller before now). + if (os_shell_is_cmdexe(proc->argv[0])) { uvproc->uvopts.flags |= UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS; } #endif diff --git a/src/nvim/memory.c b/src/nvim/memory.c index b4fdd86a6d..85ec916ba0 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -495,6 +495,13 @@ bool strequal(const char *a, const char *b) return (a == NULL && b == NULL) || (a && b && strcmp(a, b) == 0); } +/// Case-insensitive `strequal`. +bool striequal(const char *a, const char *b) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT +{ + return (a == NULL && b == NULL) || (a && b && STRICMP(a, b) == 0); +} + /* * Avoid repeating the error message many times (they take 1 second each). * Did_outofmem_msg is reset when a character is read. diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 12c2da6152..ad51e598c1 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -1,11 +1,8 @@ -// env.c -- environment variable access +// Environment inspection #include - #include -// vim.h must be included before charset.h (and possibly others) or things -// blow up #include "nvim/vim.h" #include "nvim/ascii.h" #include "nvim/charset.h" @@ -919,3 +916,20 @@ bool os_term_is_nice(void) || NULL != os_getenv("KONSOLE_DBUS_SESSION"); #endif } + +/// Returns true if `sh` looks like it resolves to "cmd.exe". +bool os_shell_is_cmdexe(const char *sh) + FUNC_ATTR_NONNULL_ALL +{ + if (*sh == NUL) { + return false; + } + if (striequal(sh, "$COMSPEC")) { + const char *comspec = os_getenv("COMSPEC"); + return striequal("cmd.exe", (char *)path_tail((char_u *)comspec)); + } + if (striequal(sh, "cmd.exe") || striequal(sh, "cmd")) { + return true; + } + return striequal("cmd.exe", (char *)path_tail((char_u *)sh)); +} diff --git a/test/unit/os/env_spec.lua b/test/unit/os/env_spec.lua index 823b6d6a85..575787a25e 100644 --- a/test/unit/os/env_spec.lua +++ b/test/unit/os/env_spec.lua @@ -67,12 +67,37 @@ describe('env function', function() end) end) + describe('os_shell_is_cmdexe', function() + itp('returns true for expected names', function() + eq(true, cimp.os_shell_is_cmdexe(to_cstr('cmd.exe'))) + eq(true, cimp.os_shell_is_cmdexe(to_cstr('cmd'))) + eq(true, cimp.os_shell_is_cmdexe(to_cstr('CMD.EXE'))) + eq(true, cimp.os_shell_is_cmdexe(to_cstr('CMD'))) + + os_setenv('COMSPEC', '/foo/bar/cmd.exe', 0) + eq(true, cimp.os_shell_is_cmdexe(to_cstr('$COMSPEC'))) + os_setenv('COMSPEC', [[C:\system32\cmd.exe]], 0) + eq(true, cimp.os_shell_is_cmdexe(to_cstr('$COMSPEC'))) + end) + itp('returns false for unexpected names', function() + eq(false, cimp.os_shell_is_cmdexe(to_cstr(''))) + eq(false, cimp.os_shell_is_cmdexe(to_cstr('powershell'))) + eq(false, cimp.os_shell_is_cmdexe(to_cstr(' cmd.exe '))) + eq(false, cimp.os_shell_is_cmdexe(to_cstr('cm'))) + eq(false, cimp.os_shell_is_cmdexe(to_cstr('md'))) + eq(false, cimp.os_shell_is_cmdexe(to_cstr('cmd.ex'))) + + os_setenv('COMSPEC', '/foo/bar/cmd', 0) + eq(false, cimp.os_shell_is_cmdexe(to_cstr('$COMSPEC'))) + end) + end) + describe('os_getenv', function() itp('reads an env variable', function() local name = 'NVIM_UNIT_TEST_GETENV_1N' local value = 'NVIM_UNIT_TEST_GETENV_1V' eq(NULL, os_getenv(name)) - -- need to use os_setenv, because lua dosn't have a setenv function + -- Use os_setenv because Lua dosen't have setenv. os_setenv(name, value, 1) eq(value, os_getenv(name)) end) From 45b5ebea9ddf029b3453ab21d20ae41f32c8de97 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 14 Apr 2017 17:41:59 +0200 Subject: [PATCH 037/257] perf: tv_clear(): Cache gettext() result. (#6519) Closes #6437 --- src/nvim/eval/typval.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 779bb18175..eb6db9547b 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1837,9 +1837,12 @@ static inline void _nothing_conv_dict_end(typval_T *const tv, /// @param[in,out] tv Value to free. void tv_clear(typval_T *const tv) { + static char *objname = NULL; // cached because gettext() is slow. #6437 + if (objname == NULL) { + objname = xstrdup(_("tv_clear() argument")); + } if (tv != NULL && tv->v_type != VAR_UNKNOWN) { - const int evn_ret = encode_vim_to_nothing(NULL, tv, - _("tv_clear() argument")); + const int evn_ret = encode_vim_to_nothing(NULL, tv, objname); (void)evn_ret; assert(evn_ret == OK); } From 58d2ce9bdbb6feab7176f451ca0248c78606aa2e Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 14 Apr 2017 20:34:54 +0200 Subject: [PATCH 038/257] test: check_cores(): Escape $TMPDIR path. (#6520) Lua string:match() considers hyphen to be a special char, we want the path to be a literal match. Also remove "./", etc. References #6483 --- test/helpers.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/helpers.lua b/test/helpers.lua index d0b1ad552b..d60d5ba242 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -32,6 +32,9 @@ local function glob(initial_path, re, exc_re) return false end + if is_excluded(initial_path) then + return ret + end while #paths_to_check > 0 do local cur_path = paths_to_check[#paths_to_check] paths_to_check[#paths_to_check] = nil @@ -185,7 +188,11 @@ local function check_cores(app, force) local gdb_db_cmd = 'gdb -n -batch -ex "thread apply all bt full" "$_NVIM_TEST_APP" -c "$_NVIM_TEST_CORE"' local lldb_db_cmd = 'lldb -Q -o "bt all" -f "$_NVIM_TEST_APP" -c "$_NVIM_TEST_CORE"' local random_skip = false - local local_tmpdir = tmpdir_is_local(tmpdir_get()) and tmpdir_get() or nil + -- Workspace-local $TMPDIR, scrubbed and pattern-escaped. + -- "./Xtest-tmpdir/" => "Xtest%-tmpdir" + local local_tmpdir = (tmpdir_is_local(tmpdir_get()) + and tmpdir_get():gsub('^[ ./]+',''):gsub('%/+$',''):gsub('([^%w])', '%%%1') + or nil) local db_cmd if hasenv('NVIM_TEST_CORE_GLOB_DIRECTORY') then initial_path = os.getenv('NVIM_TEST_CORE_GLOB_DIRECTORY') From b2942d1e729c4cfa8ec9d3bedcdc7ad838a689ef Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 13 Apr 2017 19:16:32 +0300 Subject: [PATCH 039/257] eval: Change the point at which arg_errmsg and its length are changed Ref #6437 --- src/nvim/eval.c | 130 ++++++++++++++++++++++------------------- src/nvim/eval/typval.c | 22 +++++-- src/nvim/eval/typval.h | 11 ++++ 3 files changed, 98 insertions(+), 65 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 0663e19b9a..e81378bcaa 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -2378,9 +2378,9 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, &tv, &di, true, false) == OK) { if ((di == NULL || (!var_check_ro(di->di_flags, (const char *)lp->ll_name, - STRLEN(lp->ll_name)) + TV_CSTRING) && !tv_check_lock(di->di_tv.v_lock, (const char *)lp->ll_name, - STRLEN(lp->ll_name)))) + TV_CSTRING))) && eexe_mod_op(&tv, rettv, (const char *)op) == OK) { set_var(lp->ll_name, lp->ll_name_len, &tv, false); } @@ -2393,7 +2393,7 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, } else if (tv_check_lock(lp->ll_newkey == NULL ? lp->ll_tv->v_lock : lp->ll_tv->vval.v_dict->dv_lock, - (const char *)lp->ll_name, STRLEN(lp->ll_name))) { + (const char *)lp->ll_name, TV_CSTRING)) { } else if (lp->ll_range) { listitem_T *ll_li = lp->ll_li; int ll_n1 = lp->ll_n1; @@ -2402,7 +2402,7 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, for (listitem_T *ri = rettv->vval.v_list->lv_first; ri != NULL && ll_li != NULL; ) { if (tv_check_lock(ll_li->li_tv.v_lock, (const char *)lp->ll_name, - STRLEN(lp->ll_name))) { + TV_CSTRING)) { return; } ri = ri->li_next; @@ -2992,14 +2992,14 @@ int do_unlet(const char *const name, const size_t name_len, const int forceit) } if (hi != NULL && !HASHITEM_EMPTY(hi)) { dictitem_T *const di = TV_DICT_HI2DI(hi); - if (var_check_fixed(di->di_flags, (const char *)name, STRLEN(name)) - || var_check_ro(di->di_flags, (const char *)name, STRLEN(name)) - || tv_check_lock(d->dv_lock, (const char *)name, STRLEN(name))) { + if (var_check_fixed(di->di_flags, (const char *)name, TV_CSTRING) + || var_check_ro(di->di_flags, (const char *)name, TV_CSTRING) + || tv_check_lock(d->dv_lock, (const char *)name, TV_CSTRING)) { return FAIL; } if (d == NULL - || tv_check_lock(d->dv_lock, (const char *)name, STRLEN(name))) { + || tv_check_lock(d->dv_lock, (const char *)name, TV_CSTRING)) { return FAIL; } @@ -6553,10 +6553,8 @@ static void f_add(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->vval.v_number = 1; /* Default: Failed */ if (argvars[0].v_type == VAR_LIST) { - const char *const arg_errmsg = _("add() argument"); - const size_t arg_errmsg_len = strlen(arg_errmsg); if ((l = argvars[0].vval.v_list) != NULL - && !tv_check_lock(l->lv_lock, arg_errmsg, arg_errmsg_len)) { + && !tv_check_lock(l->lv_lock, "add() argument", TV_TRANSLATE)) { tv_list_append_tv(l, &argvars[1]); tv_copy(&argvars[0], rettv); } @@ -8152,7 +8150,6 @@ static void f_expand(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_extend(typval_T *argvars, typval_T *rettv, FunPtr fptr) { const char *const arg_errmsg = N_("extend() argument"); - const size_t arg_errmsg_len = strlen(arg_errmsg); if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_LIST) { long before; @@ -8161,13 +8158,13 @@ static void f_extend(typval_T *argvars, typval_T *rettv, FunPtr fptr) list_T *const l1 = argvars[0].vval.v_list; list_T *const l2 = argvars[1].vval.v_list; if (l1 == NULL) { - const bool locked = tv_check_lock(VAR_FIXED, arg_errmsg, arg_errmsg_len); + const bool locked = tv_check_lock(VAR_FIXED, arg_errmsg, TV_TRANSLATE); (void)locked; assert(locked == true); } else if (l2 == NULL) { // Do nothing tv_copy(&argvars[0], rettv); - } else if (!tv_check_lock(l1->lv_lock, arg_errmsg, arg_errmsg_len)) { + } else if (!tv_check_lock(l1->lv_lock, arg_errmsg, TV_TRANSLATE)) { listitem_T *item; if (argvars[2].v_type != VAR_UNKNOWN) { before = tv_get_number_chk(&argvars[2], &error); @@ -8195,13 +8192,13 @@ static void f_extend(typval_T *argvars, typval_T *rettv, FunPtr fptr) dict_T *const d1 = argvars[0].vval.v_dict; dict_T *const d2 = argvars[1].vval.v_dict; if (d1 == NULL) { - const bool locked = tv_check_lock(VAR_FIXED, arg_errmsg, arg_errmsg_len); + const bool locked = tv_check_lock(VAR_FIXED, arg_errmsg, TV_TRANSLATE); (void)locked; assert(locked == true); } else if (d2 == NULL) { // Do nothing tv_copy(&argvars[0], rettv); - } else if (!tv_check_lock(d1->dv_lock, arg_errmsg, arg_errmsg_len)) { + } else if (!tv_check_lock(d1->dv_lock, arg_errmsg, TV_TRANSLATE)) { const char *action = "force"; // Check the third argument. if (argvars[2].v_type != VAR_UNKNOWN) { @@ -8349,20 +8346,19 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map) int todo; char_u *ermsg = (char_u *)(map ? "map()" : "filter()"); const char *const arg_errmsg = (map - ? _("map() argument") - : _("filter() argument")); - const size_t arg_errmsg_len = strlen(arg_errmsg); + ? N_("map() argument") + : N_("filter() argument")); int save_did_emsg; int idx = 0; if (argvars[0].v_type == VAR_LIST) { if ((l = argvars[0].vval.v_list) == NULL - || (!map && tv_check_lock(l->lv_lock, arg_errmsg, arg_errmsg_len))) { + || (!map && tv_check_lock(l->lv_lock, arg_errmsg, TV_TRANSLATE))) { return; } } else if (argvars[0].v_type == VAR_DICT) { if ((d = argvars[0].vval.v_dict) == NULL - || (!map && tv_check_lock(d->dv_lock, arg_errmsg, arg_errmsg_len))) { + || (!map && tv_check_lock(d->dv_lock, arg_errmsg, TV_TRANSLATE))) { return; } } else { @@ -8395,8 +8391,8 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map) di = TV_DICT_HI2DI(hi); if (map - && (tv_check_lock(di->di_tv.v_lock, arg_errmsg, arg_errmsg_len) - || var_check_ro(di->di_flags, arg_errmsg, arg_errmsg_len))) { + && (tv_check_lock(di->di_tv.v_lock, arg_errmsg, TV_TRANSLATE) + || var_check_ro(di->di_flags, arg_errmsg, TV_TRANSLATE))) { break; } @@ -8407,8 +8403,8 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map) break; } if (!map && rem) { - if (var_check_fixed(di->di_flags, arg_errmsg, arg_errmsg_len) - || var_check_ro(di->di_flags, arg_errmsg, arg_errmsg_len)) { + if (var_check_fixed(di->di_flags, arg_errmsg, TV_TRANSLATE) + || var_check_ro(di->di_flags, arg_errmsg, TV_TRANSLATE)) { break; } tv_dict_item_remove(d, di); @@ -8421,7 +8417,7 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map) for (li = l->lv_first; li != NULL; li = nli) { if (map - && tv_check_lock(li->li_tv.v_lock, arg_errmsg, arg_errmsg_len)) { + && tv_check_lock(li->li_tv.v_lock, arg_errmsg, TV_TRANSLATE)) { break; } nli = li->li_next; @@ -11158,13 +11154,12 @@ static void f_insert(typval_T *argvars, typval_T *rettv, FunPtr fptr) { list_T *l; bool error = false; - const char *const arg_errmsg = _("insert() argument"); - const size_t arg_errmsg_len = strlen(arg_errmsg); if (argvars[0].v_type != VAR_LIST) { EMSG2(_(e_listarg), "insert()"); } else if ((l = argvars[0].vval.v_list) != NULL - && !tv_check_lock(l->lv_lock, arg_errmsg, arg_errmsg_len)) { + && !tv_check_lock(l->lv_lock, N_("insert() argument"), + TV_TRANSLATE)) { long before = 0; if (argvars[2].v_type != VAR_UNKNOWN) { before = tv_get_number_chk(&argvars[2], &error); @@ -13205,21 +13200,20 @@ static void f_remove(typval_T *argvars, typval_T *rettv, FunPtr fptr) long end; dict_T *d; dictitem_T *di; - const char *const arg_errmsg = _("remove() argument"); - const size_t arg_errmsg_len = strlen(arg_errmsg); + const char *const arg_errmsg = N_("remove() argument"); if (argvars[0].v_type == VAR_DICT) { if (argvars[2].v_type != VAR_UNKNOWN) { EMSG2(_(e_toomanyarg), "remove()"); } else if ((d = argvars[0].vval.v_dict) != NULL - && !tv_check_lock(d->dv_lock, arg_errmsg, arg_errmsg_len)) { + && !tv_check_lock(d->dv_lock, arg_errmsg, TV_TRANSLATE)) { const char *key = tv_get_string_chk(&argvars[1]); if (key != NULL) { di = tv_dict_find(d, key, -1); if (di == NULL) { EMSG2(_(e_dictkey), key); - } else if (!var_check_fixed(di->di_flags, arg_errmsg, arg_errmsg_len) - && !var_check_ro(di->di_flags, arg_errmsg, arg_errmsg_len)) { + } else if (!var_check_fixed(di->di_flags, arg_errmsg, TV_TRANSLATE) + && !var_check_ro(di->di_flags, arg_errmsg, TV_TRANSLATE)) { *rettv = di->di_tv; di->di_tv = TV_INITIAL_VALUE; tv_dict_item_remove(d, di); @@ -13232,7 +13226,7 @@ static void f_remove(typval_T *argvars, typval_T *rettv, FunPtr fptr) } else if (argvars[0].v_type != VAR_LIST) { EMSG2(_(e_listdictarg), "remove()"); } else if ((l = argvars[0].vval.v_list) != NULL - && !tv_check_lock(l->lv_lock, arg_errmsg, arg_errmsg_len)) { + && !tv_check_lock(l->lv_lock, arg_errmsg, TV_TRANSLATE)) { bool error = false; idx = tv_get_number_chk(&argvars[1], &error); @@ -13503,14 +13497,12 @@ static void f_resolve(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_reverse(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - const char *const arg_errmsg = _("reverse() argument"); - const size_t arg_errmsg_len = strlen(arg_errmsg); - list_T *l; if (argvars[0].v_type != VAR_LIST) { EMSG2(_(e_listarg), "reverse()"); } else if ((l = argvars[0].vval.v_list) != NULL - && !tv_check_lock(l->lv_lock, arg_errmsg, arg_errmsg_len)) { + && !tv_check_lock(l->lv_lock, N_("reverse() argument"), + TV_TRANSLATE)) { listitem_T *li = l->lv_last; l->lv_first = l->lv_last = NULL; l->lv_len = 0; @@ -15202,16 +15194,14 @@ static void do_sort_uniq(typval_T *argvars, typval_T *rettv, bool sort) sortinfo = &info; const char *const arg_errmsg = (sort - ? _("sort() argument") - : _("uniq() argument")); - const size_t arg_errmsg_len = strlen(arg_errmsg); + ? N_("sort() argument") + : N_("uniq() argument")); if (argvars[0].v_type != VAR_LIST) { EMSG2(_(e_listarg), sort ? "sort()" : "uniq()"); } else { l = argvars[0].vval.v_list; - if (l == NULL - || tv_check_lock(l->lv_lock, arg_errmsg, arg_errmsg_len)) { + if (l == NULL || tv_check_lock(l->lv_lock, arg_errmsg, TV_TRANSLATE)) { goto theend; } rettv->vval.v_list = l; @@ -18876,24 +18866,37 @@ static void set_var(const char *name, const size_t name_len, typval_T *const tv, /// /// @param[in] flags di_flags attribute value. /// @param[in] name Variable name, for use in error message. -/// @param[in] name_len Variable name length. +/// @param[in] name_len Variable name length. Use #TV_TRANSLATE to translate +/// variable name and compute the length. Use #TV_CSTRING +/// to compute the length with strlen() without +/// translating. /// /// @return True if variable is read-only: either always or in sandbox when /// sandbox is enabled, false otherwise. -bool var_check_ro(const int flags, const char *const name, - const size_t name_len) +bool var_check_ro(const int flags, const char *name, + size_t name_len) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { + const char *error_message = NULL; if (flags & DI_FLAGS_RO) { - emsgf(_(e_readonlyvar), (int)name_len, name); - return true; + error_message = N_(e_readonlyvar); + } else if ((flags & DI_FLAGS_RO_SBX) && sandbox) { + error_message = N_("E794: Cannot set variable in the sandbox: \"%.*s\""); } - if ((flags & DI_FLAGS_RO_SBX) && sandbox) { - emsgf(_("E794: Cannot set variable in the sandbox: \"%.*s\""), - (int)name_len, name); - return true; + + if (error_message == NULL) { + return false; } - return false; + if (name_len == TV_TRANSLATE) { + name = _(name); + name_len = strlen(name); + } else if (name_len == TV_CSTRING) { + name_len = strlen(name); + } + + emsgf(_(error_message), (int)name_len, name); + + return true; } /// Check whether variable is fixed (DI_FLAGS_FIX) @@ -18902,14 +18905,23 @@ bool var_check_ro(const int flags, const char *const name, /// /// @param[in] flags di_flags attribute value. /// @param[in] name Variable name, for use in error message. -/// @param[in] name_len Variable name length. +/// @param[in] name_len Variable name length. Use #TV_TRANSLATE to translate +/// variable name and compute the length. Use #TV_CSTRING +/// to compute the length with strlen() without +/// translating. /// /// @return True if variable is fixed, false otherwise. -static bool var_check_fixed(const int flags, const char *const name, - const size_t name_len) +static bool var_check_fixed(const int flags, const char *name, + size_t name_len) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { if (flags & DI_FLAGS_FIX) { + if (name_len == TV_TRANSLATE) { + name = _(name); + name_len = strlen(name); + } else if (name_len == TV_CSTRING) { + name_len = strlen(name); + } emsgf(_("E795: Cannot delete variable %.*s"), (int)name_len, name); return true; } @@ -19716,12 +19728,12 @@ void ex_function(exarg_T *eap) } if (fudi.fd_di == NULL) { if (tv_check_lock(fudi.fd_dict->dv_lock, (const char *)eap->arg, - STRLEN(eap->arg))) { + TV_CSTRING)) { // Can't add a function to a locked dictionary goto erret; } } else if (tv_check_lock(fudi.fd_di->di_tv.v_lock, (const char *)eap->arg, - STRLEN(eap->arg))) { + TV_CSTRING)) { // Can't change an existing function if it is locked goto erret; } diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index eb6db9547b..c29c67124f 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -2045,11 +2045,14 @@ bool tv_islocked(const typval_T *const tv) /// /// @param[in] lock Lock status. /// @param[in] name Variable name, used in the error message. -/// @param[in] name_len Variable name length. +/// @param[in] name_len Variable name length. Use #TV_TRANSLATE to translate +/// variable name and compute the length. Use #TV_CSTRING +/// to compute the length with strlen() without +/// translating. /// /// @return true if variable is locked, false otherwise. -bool tv_check_lock(const VarLockStatus lock, const char *const name, - const size_t name_len) +bool tv_check_lock(const VarLockStatus lock, const char *name, + size_t name_len) FUNC_ATTR_WARN_UNUSED_RESULT { const char *error_message = NULL; @@ -2068,10 +2071,17 @@ bool tv_check_lock(const VarLockStatus lock, const char *const name, } assert(error_message != NULL); - const char *const unknown_name = _("Unknown"); + if (name == NULL) { + name = _("Unknown"); + name_len = strlen(name); + } else if (name_len == TV_TRANSLATE) { + name = _(name); + name_len = strlen(name); + } else if (name_len == TV_CSTRING) { + name_len = strlen(name); + } - emsgf(_(error_message), (name != NULL ? name_len : strlen(unknown_name)), - (name != NULL ? name : unknown_name)); + emsgf(_(error_message), (int)name_len, name); return true; } diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index 7eab22bc12..df46222067 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -423,6 +423,17 @@ static inline bool tv_is_func(const typval_T tv) return tv.v_type == VAR_FUNC || tv.v_type == VAR_PARTIAL; } +/// Specify that argument needs to be translated +/// +/// Used for size_t length arguments to avoid calling gettext() and strlen() +/// unless needed. +#define TV_TRANSLATE (SIZE_MAX) + +/// Specify that argument is a NUL-terminated C string +/// +/// Used for size_t length arguments to avoid calling strlen() unless needed. +#define TV_CSTRING (SIZE_MAX - 1) + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/typval.h.generated.h" #endif From 276ee1f7fb989b931a9ddfabfd4aaf1782bcbb77 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 13 Apr 2017 23:42:51 +0300 Subject: [PATCH 040/257] eval: Add comment regarding why special values are needed --- src/nvim/eval.c | 12 ++++++++++++ src/nvim/eval/typval.c | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index e81378bcaa..281b80a915 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -18871,6 +18871,12 @@ static void set_var(const char *name, const size_t name_len, typval_T *const tv, /// to compute the length with strlen() without /// translating. /// +/// Both #TV_… values are used for optimization purposes: +/// variable name with its length is needed only in case +/// of error, when no error occurs computing them is +/// a waste of CPU resources. This especially applies to +/// gettext. +/// /// @return True if variable is read-only: either always or in sandbox when /// sandbox is enabled, false otherwise. bool var_check_ro(const int flags, const char *name, @@ -18910,6 +18916,12 @@ bool var_check_ro(const int flags, const char *name, /// to compute the length with strlen() without /// translating. /// +/// Both #TV_… values are used for optimization purposes: +/// variable name with its length is needed only in case +/// of error, when no error occurs computing them is +/// a waste of CPU resources. This especially applies to +/// gettext. +/// /// @return True if variable is fixed, false otherwise. static bool var_check_fixed(const int flags, const char *name, size_t name_len) diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index c29c67124f..b70554c1ef 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -2050,6 +2050,12 @@ bool tv_islocked(const typval_T *const tv) /// to compute the length with strlen() without /// translating. /// +/// Both #TV_… values are used for optimization purposes: +/// variable name with its length is needed only in case +/// of error, when no error occurs computing them is +/// a waste of CPU resources. This especially applies to +/// gettext. +/// /// @return true if variable is locked, false otherwise. bool tv_check_lock(const VarLockStatus lock, const char *name, size_t name_len) From b54e5c220f0b1bff31ce65c6988f70cbb9780b5e Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 14 Apr 2017 00:12:05 +0300 Subject: [PATCH 041/257] unittests: Add a test for TV_CSTRING MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not using enum{} because SIZE_MAX exceeds integer and I do not really like how enum definition is described in C99: 1. Even though all values must fit into the chosen type (6.7.2.2, p 4) the type to choose is still implementation-defined. 2. 6.4.4.3 explicitly states that “an identifier declared as an enumeration constant has type `int`”. So it looks like “no matter what type was chosen for enumeration, constants will be integers”. Yet the following simple program: #include #include #include enum { X=SIZE_MAX }; int main(int argc, char **argv) { printf("x:%zu m:%zu t:%zu v:%zu", sizeof(X), sizeof(SIZE_MAX), sizeof(size_t), (size_t)X); } yields one of the following using different compilers: - clang/gcc/pathcc: `x:8 m:8 t:8 v:18446744073709551615` - pcc/tcc: `x:4 m:8 t:8 v:1844674407370955161` If I remove the cast of X to size_t then pcc/tcc both yield `x:4 m:8 t:8 v:4294967295`, other compilers’ output does not change. All compilers were called with `$compiler -std=c99 -xc -` (feeding program from echo), except for `tcc` which has missing `-std=c99`. `pcc` seems to ignore the argument though: it is perfectly fine with `-std=c1000`. --- src/nvim/eval/typval.h | 7 +++++++ test/unit/eval/typval_spec.lua | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index df46222067..0f659727ee 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -17,6 +17,7 @@ #include "nvim/pos.h" // for linenr_T #include "nvim/gettext.h" #include "nvim/message.h" +#include "nvim/macros.h" /// Type used for VimL VAR_NUMBER values typedef int varnumber_T; @@ -434,6 +435,12 @@ static inline bool tv_is_func(const typval_T tv) /// Used for size_t length arguments to avoid calling strlen() unless needed. #define TV_CSTRING (SIZE_MAX - 1) +#ifdef UNIT_TESTING +// Do not use enum constants, see commit message. +EXTERN const size_t kTVCstring INIT(= TV_CSTRING); +EXTERN const size_t kTVTranslate INIT(= TV_TRANSLATE); +#endif + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval/typval.h.generated.h" #endif diff --git a/test/unit/eval/typval_spec.lua b/test/unit/eval/typval_spec.lua index a1edfcfb7c..6308ae7367 100644 --- a/test/unit/eval/typval_spec.lua +++ b/test/unit/eval/typval_spec.lua @@ -2450,6 +2450,10 @@ describe('typval.c', function() 'E741: Value is locked: Unknown')) eq(true, tv_check_lock(lib.VAR_FIXED, nil, 0, 'E742: Cannot change value of Unknown')) + eq(true, tv_check_lock(lib.VAR_LOCKED, nil, lib.kTVCstring, + 'E741: Value is locked: Unknown')) + eq(true, tv_check_lock(lib.VAR_FIXED, 'test', lib.kTVCstring, + 'E742: Cannot change value of test')) end) end) describe('equal()', function() From 31fd6d4bbf80d0f50893ab6144aa5eb70c95c351 Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 14 Apr 2017 23:57:44 +0300 Subject: [PATCH 042/257] eval/typval: Do not translate tv_clear argument, this is useless --- src/nvim/eval/typval.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index b70554c1ef..d5177138b0 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1799,11 +1799,13 @@ static inline void _nothing_conv_dict_end(typval_T *const tv, #define TYPVAL_ENCODE_NAME nothing #define TYPVAL_ENCODE_FIRST_ARG_TYPE const void *const #define TYPVAL_ENCODE_FIRST_ARG_NAME ignored +#define TYPVAL_ENCODE_TRANSLATE_OBJECT_NAME #include "nvim/eval/typval_encode.c.h" #undef TYPVAL_ENCODE_SCOPE #undef TYPVAL_ENCODE_NAME #undef TYPVAL_ENCODE_FIRST_ARG_TYPE #undef TYPVAL_ENCODE_FIRST_ARG_NAME +#undef TYPVAL_ENCODE_TRANSLATE_OBJECT_NAME #undef TYPVAL_ENCODE_ALLOW_SPECIALS #undef TYPVAL_ENCODE_CONV_NIL @@ -1837,12 +1839,14 @@ static inline void _nothing_conv_dict_end(typval_T *const tv, /// @param[in,out] tv Value to free. void tv_clear(typval_T *const tv) { - static char *objname = NULL; // cached because gettext() is slow. #6437 - if (objname == NULL) { - objname = xstrdup(_("tv_clear() argument")); - } if (tv != NULL && tv->v_type != VAR_UNKNOWN) { - const int evn_ret = encode_vim_to_nothing(NULL, tv, objname); + // WARNING: do not translate the string here, gettext is slow and function + // is used *very* often. At the current state encode_vim_to_nothing() does + // not error out and does not use the argument anywhere. + // + // If situation changes and this argument will be used, translate it in the + // place where it is used. + const int evn_ret = encode_vim_to_nothing(NULL, tv, "tv_clear() argument"); (void)evn_ret; assert(evn_ret == OK); } From c289986c89dd0189ed8ab709bf2eb822c493542a Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Apr 2017 00:08:50 +0300 Subject: [PATCH 043/257] =?UTF-8?q?eval/encode:=20Do=20translate=20?= =?UTF-8?q?=E2=80=9C=E2=80=A6=20argument=E2=80=9D=20strings,=20but=20only?= =?UTF-8?q?=20in=20conv=5Ferror?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/eval/encode.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c index d74913a481..c058c3a9c0 100644 --- a/src/nvim/eval/encode.c +++ b/src/nvim/eval/encode.c @@ -179,9 +179,9 @@ static int conv_error(const char *const msg, const MPConvStack *const mpstack, } } } - EMSG3(msg, objname, (kv_size(*mpstack) == 0 - ? _("itself") - : (char *) msg_ga.ga_data)); + emsgf(msg, _(objname), (kv_size(*mpstack) == 0 + ? _("itself") + : (char *)msg_ga.ga_data)); ga_clear(&msg_ga); return FAIL; } @@ -790,7 +790,7 @@ char *encode_tv2string(typval_T *tv, size_t *len) garray_T ga; ga_init(&ga, (int)sizeof(char), 80); const int evs_ret = encode_vim_to_string(&ga, tv, - "encode_tv2string() argument"); + N_("encode_tv2string() argument")); (void)evs_ret; assert(evs_ret == OK); did_echo_string_emsg = false; @@ -818,7 +818,7 @@ char *encode_tv2echo(typval_T *tv, size_t *len) ga_concat(&ga, tv->vval.v_string); } } else { - const int eve_ret = encode_vim_to_echo(&ga, tv, ":echo argument"); + const int eve_ret = encode_vim_to_echo(&ga, tv, N_(":echo argument")); (void)eve_ret; assert(eve_ret == OK); } @@ -841,7 +841,8 @@ char *encode_tv2json(typval_T *tv, size_t *len) { garray_T ga; ga_init(&ga, (int)sizeof(char), 80); - const int evj_ret = encode_vim_to_json(&ga, tv, "encode_tv2json() argument"); + const int evj_ret = encode_vim_to_json(&ga, tv, + N_("encode_tv2json() argument")); if (!evj_ret) { ga_clear(&ga); } From 12fc1defd6a1b13d1f801173e0b6a1cef28527ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Sat, 15 Apr 2017 11:19:40 +0200 Subject: [PATCH 044/257] ops: fix i with multi-byte text (#6524) --- src/nvim/getchar.c | 4 ++-- test/functional/insert/ctrl_r_spec.lua | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 test/functional/insert/ctrl_r_spec.lua diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index b83681ad01..3b248c4bc6 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -302,13 +302,13 @@ static void add_num_buff(buffheader_T *buf, long n) */ static void add_char_buff(buffheader_T *buf, int c) { - char bytes[MB_MAXBYTES + 1]; + uint8_t bytes[MB_MAXBYTES + 1]; int len; if (IS_SPECIAL(c)) { len = 1; } else { - len = (*mb_char2bytes)(c, (char_u *)bytes); + len = mb_char2bytes(c, bytes); } for (int i = 0; i < len; i++) { diff --git a/test/functional/insert/ctrl_r_spec.lua b/test/functional/insert/ctrl_r_spec.lua new file mode 100644 index 0000000000..adc3c4b406 --- /dev/null +++ b/test/functional/insert/ctrl_r_spec.lua @@ -0,0 +1,19 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear, feed = helpers.clear, helpers.feed +local expect, command = helpers.expect, helpers.command + +describe('insert-mode Ctrl-R', function() + before_each(clear) + + it('works', function() + command("let @@ = 'test'") + feed('i"') + expect('test') + end) + + it('works with multi-byte text', function() + command("let @@ = 'påskägg'") + feed('i"') + expect('påskägg') + end) +end) From a8f7872f445a9ec18be40b203a65d809adb05cd1 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 15 Apr 2017 08:50:43 -0400 Subject: [PATCH 045/257] test_timers.vim: Adjust timing to handle difference in implementation --- src/nvim/testdir/test_timers.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index fd2b50b495..d377062780 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -20,7 +20,7 @@ func Test_oneshot() let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) if has('reltime') - call assert_inrange(49, 100, slept) + call assert_inrange(40, 100, slept) else call assert_inrange(20, 100, slept) endif @@ -32,7 +32,7 @@ func Test_repeat_three() let slept = WaitFor('g:val == 3') call assert_equal(3, g:val) if has('reltime') - call assert_inrange(149, 250, slept) + call assert_inrange(120, 250, slept) else call assert_inrange(80, 200, slept) endif @@ -57,7 +57,7 @@ func Test_with_partial_callback() let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) if has('reltime') - call assert_inrange(49, 130, slept) + call assert_inrange(40, 130, slept) else call assert_inrange(20, 100, slept) endif @@ -119,7 +119,7 @@ func Test_paused() let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) if has('reltime') - call assert_inrange(0, 30, slept) + call assert_inrange(0, 60, slept) else call assert_inrange(0, 10, slept) endif From c70ab1a2e2d78832e0246bd64c53c8b92912f0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Sat, 15 Apr 2017 15:06:50 +0200 Subject: [PATCH 046/257] test: make locale dependent oldtest more reliable (#6526) --- src/nvim/testdir/test_normal.vim | 40 +++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/nvim/testdir/test_normal.vim b/src/nvim/testdir/test_normal.vim index c529971528..6261625801 100644 --- a/src/nvim/testdir/test_normal.vim +++ b/src/nvim/testdir/test_normal.vim @@ -1606,12 +1606,13 @@ fun! Test_normal30_changecase() norm! V~ call assert_equal('THIS IS A simple test: äüöss', getline('.')) - " Turkish ASCII turns to multi-byte. On Mac the Turkish locale is available - " but toupper()/tolower() don't do the right thing. - if !has('mac') && !has('osx') - try - lang tr_TR.UTF-8 - set casemap= + " Turkish ASCII turns to multi-byte. On some systems Turkish locale + " is available but toupper()/tolower() don't do the right thing. + try + lang tr_TR.UTF-8 + set casemap= + let iupper = toupper('i') + if iupper == "\u0130" call setline(1, 'iI') 1normal gUU call assert_equal("\u0130I", getline(1)) @@ -1621,8 +1622,7 @@ fun! Test_normal30_changecase() 1normal guu call assert_equal("i\u0131", getline(1)) call assert_equal("i\u0131", tolower("iI")) - - set casemap& + elseif iupper == "I" call setline(1, 'iI') 1normal gUU call assert_equal("II", getline(1)) @@ -1632,13 +1632,25 @@ fun! Test_normal30_changecase() 1normal guu call assert_equal("ii", getline(1)) call assert_equal("ii", tolower("iI")) + else + call assert_true(false, "expected toupper('i') to be either 'I' or '\u0131'") + endif + set casemap& + call setline(1, 'iI') + 1normal gUU + call assert_equal("II", getline(1)) + call assert_equal("II", toupper("iI")) - lang en_US.UTF-8 - catch /E197:/ - " can't use Turkish locale - throw 'Skipped: Turkish locale not available' - endtry - endif + call setline(1, 'iI') + 1normal guu + call assert_equal("ii", getline(1)) + call assert_equal("ii", tolower("iI")) + + lang en_US.UTF-8 + catch /E197:/ + " can't use Turkish locale + throw 'Skipped: Turkish locale not available' + endtry " clean up bw! From 0dddd8a27caac1060dedbe55b285e3564e81e995 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Apr 2017 19:13:43 +0300 Subject: [PATCH 047/257] os/fileio: Remove FUNC_ATTR_MALLOC for file_open_new fp contains pointer to rbuffer --- src/nvim/os/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c index 4b7b53fc7f..3c47c66196 100644 --- a/src/nvim/os/fileio.c +++ b/src/nvim/os/fileio.c @@ -100,7 +100,7 @@ int file_open(FileDescriptor *const ret_fp, const char *const fname, /// @return [allocated] Opened file or NULL in case of error. FileDescriptor *file_open_new(int *const error, const char *const fname, const int flags, const int mode) - FUNC_ATTR_NONNULL_ALL FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT { FileDescriptor *const fp = xmalloc(sizeof(*fp)); if ((*error = file_open(fp, fname, flags, mode)) != 0) { From b08b71c7288ed7bbeae6066ab36a1366d0673bf5 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Apr 2017 19:16:00 +0300 Subject: [PATCH 048/257] eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_alloc Allocated list points to previously allocated list. Allocated list is saved to gc_first_list. --- src/nvim/eval/typval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index eb6db9547b..14db330dba 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -136,7 +136,7 @@ void tv_list_watch_fix(list_T *const l, const listitem_T *const item) /// /// @return [allocated] new list. list_T *tv_list_alloc(void) - FUNC_ATTR_NONNULL_RET FUNC_ATTR_MALLOC + FUNC_ATTR_NONNULL_RET { list_T *const list = xcalloc(1, sizeof(list_T)); From b9004d744811f530922fbb194ea02033d332f375 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Apr 2017 19:16:40 +0300 Subject: [PATCH 049/257] eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_item_copy Allocated storage may receive pointer to the list after tv_copy(). --- src/nvim/eval/typval.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 14db330dba..4d1400484a 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1011,7 +1011,6 @@ void tv_dict_item_free(dictitem_T *const item) /// @return [allocated] new dictionary item. static dictitem_T *tv_dict_item_copy(dictitem_T *const di) FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT - FUNC_ATTR_MALLOC { dictitem_T *const new_di = tv_dict_item_alloc((const char *)di->di_key); tv_copy(&di->di_tv, &new_di->di_tv); From af3579d5f7bc86a25fd73e94c6de0e73ae9d8e12 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Apr 2017 19:18:25 +0300 Subject: [PATCH 050/257] eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_alloc Allocated dict points to previously allocated dict. Queue in allocated dict points to itself. Hashtab in allocated dict points to inside itself. Allocated dict is saved to gc_first_dict. --- src/nvim/eval/typval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 4d1400484a..9e954be9b3 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1039,7 +1039,7 @@ void tv_dict_item_remove(dict_T *const dict, dictitem_T *const item) /// /// @return [allocated] new dictionary. dict_T *tv_dict_alloc(void) - FUNC_ATTR_NONNULL_RET FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT + FUNC_ATTR_NONNULL_RET FUNC_ATTR_WARN_UNUSED_RESULT { dict_T *const d = xmalloc(sizeof(dict_T)); From 82ba2891ae905fabacafc58daebedc80533b8334 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Apr 2017 19:19:22 +0300 Subject: [PATCH 051/257] eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_alloc_ret Same as tv_list_alloc, but additionally ret_tv receives pointer to the newly allocated list. --- src/nvim/eval/typval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 9e954be9b3..70ec3dfe39 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1576,7 +1576,7 @@ void tv_dict_set_keys_readonly(dict_T *const dict) /// /// @return [allocated] pointer to the created list. list_T *tv_list_alloc_ret(typval_T *const ret_tv) - FUNC_ATTR_NONNULL_ALL FUNC_ATTR_MALLOC + FUNC_ATTR_NONNULL_ALL { list_T *const l = tv_list_alloc(); ret_tv->vval.v_list = l; From d191ba1db38cf4bad3e4ed3e3346f3f8a9c015cf Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Apr 2017 19:23:00 +0300 Subject: [PATCH 052/257] option: Remove FUNC_ATTR_MALLOC from get_winbuf_options Same as tv_dict_alloc() and additionally it saves some strings inside a dictionary. --- src/nvim/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/option.c b/src/nvim/option.c index 458d80716c..0070a0056d 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -6974,7 +6974,7 @@ bool signcolumn_on(win_T *wp) /// Get window or buffer local options dict_T *get_winbuf_options(const int bufopt) - FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_MALLOC + FUNC_ATTR_WARN_UNUSED_RESULT { dict_T *const d = tv_dict_alloc(); From ac47e64ecad6b21d4d29066b37ab4018fcd8da48 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Apr 2017 19:25:00 +0300 Subject: [PATCH 053/257] ops: Remove FUNC_ATTR_MALLOC from copy_register Returned storage has a pointer to a newly allocated array. --- src/nvim/ops.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nvim/ops.c b/src/nvim/ops.c index f11d6b69b2..5212ec45ab 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -802,7 +802,6 @@ static bool is_append_register(int regname) /// Returns a copy of contents in register `name` /// for use in do_put. Should be freed by caller. yankreg_T *copy_register(int name) - FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_RET { yankreg_T *reg = get_yank_register(name, YREG_PASTE); From d76a13bb65574f4811313ada6454f7d34cde2a2c Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 15 Apr 2017 19:39:53 +0300 Subject: [PATCH 054/257] os/shell: Remove FUNC_ATTR_MALLOC from shell_build_argv Returns an array of allocated strings. --- src/nvim/os/shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 5cc9d4b79b..29c0431521 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -47,7 +47,7 @@ typedef struct { /// @param extra_args Extra arguments to the shell, or NULL. /// @return Newly allocated argument vector. Must be freed with shell_free_argv. char **shell_build_argv(const char *cmd, const char *extra_args) - FUNC_ATTR_NONNULL_RET FUNC_ATTR_MALLOC + FUNC_ATTR_NONNULL_RET { size_t argc = tokenize(p_sh, NULL) + (cmd ? tokenize(p_shcf, NULL) : 0); char **rv = xmalloc((argc + 4) * sizeof(*rv)); From ec0fabd4d5129c7293c8b8fcf0d0946ae5bd5fd4 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 15 Apr 2017 18:45:47 +0200 Subject: [PATCH 055/257] eval.c: Code style fixes --- src/nvim/eval.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 6a18baf2e2..33a553436f 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -16696,11 +16696,11 @@ static void f_timer_info(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (argvars[0].v_type != VAR_UNKNOWN) { if (argvars[0].v_type != VAR_NUMBER) { EMSG(_(e_number_exp)); - } else { - timer_T *timer = pmap_get(uint64_t)(timers, tv_get_number(&argvars[0])); - if (timer != NULL && !timer->stopped) { - add_timer_info(rettv, timer); - } + return; + } + timer_T *timer = pmap_get(uint64_t)(timers, tv_get_number(&argvars[0])); + if (timer != NULL && !timer->stopped) { + add_timer_info(rettv, timer); } } else { add_timer_info_all(rettv); @@ -16712,12 +16712,12 @@ static void f_timer_pause(typval_T *argvars, typval_T *unused, FunPtr fptr) { if (argvars[0].v_type != VAR_NUMBER) { EMSG(_(e_number_exp)); - } else { - int paused = (bool)tv_get_number(&argvars[1]); - timer_T *timer = pmap_get(uint64_t)(timers, tv_get_number(&argvars[0])); - if (timer != NULL) { - timer->paused = paused; - } + return; + } + int paused = (bool)tv_get_number(&argvars[1]); + timer_T *timer = pmap_get(uint64_t)(timers, tv_get_number(&argvars[0])); + if (timer != NULL) { + timer->paused = paused; } } @@ -16790,7 +16790,7 @@ static void f_timer_stop(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_timer_stopall(typval_T *argvars, typval_T *unused, FunPtr fptr) { - timer_teardown(); + timer_stop_all(); } // invoked on the main loop @@ -16853,7 +16853,7 @@ static void timer_decref(timer_T *timer) } } -void timer_teardown(void) +static void timer_stop_all(void) { timer_T *timer; map_foreach_value(timers, timer, { @@ -16861,6 +16861,11 @@ void timer_teardown(void) }) } +void timer_teardown(void) +{ + timer_stop_all(); +} + /* * "tolower(string)" function */ From 33952a7661927f875ebf40a60e236831c789de58 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 18:53:02 +0300 Subject: [PATCH 056/257] *: Silence some false positives --- src/nvim/api/private/helpers.h | 1 + src/nvim/buffer.h | 3 ++- src/nvim/eval/typval_encode.c.h | 4 ++-- src/nvim/globals.h | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index 9fe8c351cf..20b4015fb5 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -8,6 +8,7 @@ #include "nvim/memory.h" #include "nvim/lib/kvec.h" +// -V:api_set_error:618 #define api_set_error(err, errtype, ...) \ do { \ snprintf((err)->msg, \ diff --git a/src/nvim/buffer.h b/src/nvim/buffer.h index 016c5ce3b7..39b9faf8b1 100644 --- a/src/nvim/buffer.h +++ b/src/nvim/buffer.h @@ -103,7 +103,8 @@ static inline void buf_set_changedtick(buf_T *const buf, const int changedtick) assert(changedtick_di->di_flags == (DI_FLAGS_RO|DI_FLAGS_FIX)); # endif assert(changedtick_di == (dictitem_T *)&buf->changedtick_di); - assert(&buf->b_changedtick == &buf->changedtick_di.di_tv.vval.v_number); + assert(&buf->b_changedtick // -V501 + == &buf->changedtick_di.di_tv.vval.v_number); #endif buf->b_changedtick = changedtick; } diff --git a/src/nvim/eval/typval_encode.c.h b/src/nvim/eval/typval_encode.c.h index ad54eef4a0..3487880bd2 100644 --- a/src/nvim/eval/typval_encode.c.h +++ b/src/nvim/eval/typval_encode.c.h @@ -611,7 +611,7 @@ _convert_one_value_regular_dict: {} typval_encode_stop_converting_one_item: return OK; // Prevent “unused label” warnings. - goto typval_encode_stop_converting_one_item; + goto typval_encode_stop_converting_one_item; // -V779 } TYPVAL_ENCODE_SCOPE int _TYPVAL_ENCODE_ENCODE( @@ -814,6 +814,6 @@ encode_vim_to__error_ret: _mp_destroy(mpstack); return FAIL; // Prevent “unused label” warnings. - goto typval_encode_stop_converting_one_item; + goto typval_encode_stop_converting_one_item; // -V779 } #endif // NVIM_EVAL_TYPVAL_ENCODE_C_H diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 3c705d88a5..df9f418951 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -548,6 +548,7 @@ EXTERN win_T *prevwin INIT(= NULL); /* previous window */ FOR_ALL_TABS(tp) \ FOR_ALL_WINDOWS_IN_TAB(wp, tp) +// -V:FOR_ALL_WINDOWS_IN_TAB:501 # define FOR_ALL_WINDOWS_IN_TAB(wp, tp) \ for (win_T *wp = ((tp) == curtab) \ ? firstwin : (tp)->tp_firstwin; wp != NULL; wp = wp->w_next) From a096766ee3edc1197039d236c3a5c42365d60d4d Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:27:17 +0300 Subject: [PATCH 057/257] diff: Silence -V519 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not exactly a false positive, but previous assignment is a part of the pattern “change global, run code which uses it, change global back”. --- src/nvim/diff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/diff.c b/src/nvim/diff.c index ff76abc01f..49574fbbfc 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -1076,8 +1076,8 @@ void diff_win_options(win_T *wp, int addbuf) if (!wp->w_p_diff) { wp->w_p_wrap_save = wp->w_p_wrap; } - wp->w_p_wrap = FALSE; - curwin = wp; + wp->w_p_wrap = false; + curwin = wp; // -V519 curbuf = curwin->w_buffer; if (!wp->w_p_diff) { From 2901921a1b5bf72cb404fed0ed0510124eaf6e8b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:30:18 +0300 Subject: [PATCH 058/257] digraph: Ignore false positive Reversed order is intentional, digraphs allow swapping characters. --- src/nvim/digraph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 560205fe7d..fb4a8c6d0d 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1569,7 +1569,8 @@ int getdigraph(int char1, int char2, int meta_char) if (((retval = getexactdigraph(char1, char2, meta_char)) == char2) && (char1 != char2) - && ((retval = getexactdigraph(char2, char1, meta_char)) == char1)) { + && ((retval = getexactdigraph(char2, char1, meta_char)) // -V764 + == char1)) { return char2; } return retval; From 4f0fc1f06a6b551c081f1e4abf1a119588c6a386 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:32:38 +0300 Subject: [PATCH 059/257] digraph: Fix errors due to has_mbyte and friends being fixed --- src/nvim/digraph.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index fb4a8c6d0d..66fb525920 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1676,11 +1676,7 @@ static void printdigraph(digr_T *dp) int list_width; - if ((dy_flags & DY_UHEX) || has_mbyte) { - list_width = 13; - } else { - list_width = 11; - } + list_width = 13; if (dp->result != 0) { if (msg_col > Columns - list_width) { @@ -1701,15 +1697,11 @@ static void printdigraph(digr_T *dp) *p++ = dp->char2; *p++ = ' '; - if (has_mbyte) { - // add a space to draw a composing char on - if (enc_utf8 && utf_iscomposing(dp->result)) { - *p++ = ' '; - } - p += (*mb_char2bytes)(dp->result, p); - } else { - *p++ = (char_u)dp->result; + // add a space to draw a composing char on + if (utf_iscomposing(dp->result)) { + *p++ = ' '; } + p += (*mb_char2bytes)(dp->result, p); if (char2cells(dp->result) == 1) { *p++ = ' '; From 9e9ba14e0e443beff4c1418cdaff412c394852c0 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:38:16 +0300 Subject: [PATCH 060/257] edit: Fix strange code Based on the flow it looks like ptr could not be NULL here: if ptr_arg is NULL ptr is compl_leader, if compl_leader is NULL function exits. This also applies to Vim as far as I see. --- src/nvim/edit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nvim/edit.c b/src/nvim/edit.c index fe00027dec..1ca5424736 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -3427,10 +3427,11 @@ static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg) len -= (*mb_head_off)(p, p + len); for (p += len; *p != NUL; mb_ptr_adv(p)) AppendCharToRedobuff(K_BS); - } else + } else { len = 0; - if (ptr != NULL) - AppendToRedobuffLit(ptr + len, -1); + } + assert(ptr != NULL); + AppendToRedobuffLit(ptr + len, -1); } /* From fb4754104b50baa0eb489e5c9b50c1d37523f2d3 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:39:55 +0300 Subject: [PATCH 061/257] macros: Fix excessive check --- src/nvim/macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/macros.h b/src/nvim/macros.h index b816b34b39..214af82422 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -75,7 +75,7 @@ do { \ if (*p_langmap \ && (condition) \ - && (p_lrm || (!p_lrm && KeyTyped)) \ + && (p_lrm || KeyTyped) \ && !KeyStuffed \ && (c) >= 0) \ { \ From dd5b0cc17a1ec6925c6cd7a5be23eb78bf953f76 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:50:23 +0300 Subject: [PATCH 062/257] edit: Copy assert to before the warning --- src/nvim/edit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 1ca5424736..51d0847bc7 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -3419,6 +3419,7 @@ static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg) else return; /* nothing to do */ } + assert(ptr != NULL); if (compl_orig_text != NULL) { p = compl_orig_text; for (len = 0; p[len] != NUL && p[len] == ptr[len]; ++len) From d70a0f6895048a3dcb5ec841afd01daee4866be4 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:51:35 +0300 Subject: [PATCH 063/257] eval/typval_encode: Silence then/else equivalence warning --- src/nvim/eval/typval_encode.c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval/typval_encode.c.h b/src/nvim/eval/typval_encode.c.h index 3487880bd2..b4a70fb188 100644 --- a/src/nvim/eval/typval_encode.c.h +++ b/src/nvim/eval/typval_encode.c.h @@ -489,7 +489,7 @@ static int _TYPVAL_ENCODE_CONVERT_ONE_VALUE( } if (is_string) { TYPVAL_ENCODE_CONV_STR_STRING(tv, buf, len); - } else { + } else { // -V523 TYPVAL_ENCODE_CONV_STRING(tv, buf, len); } xfree(buf); From 05c1829a8ccf2df07927bec502467faa443d90d8 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:55:49 +0300 Subject: [PATCH 064/257] eval: Silence eap->skip false positives `lnum` starts at `eap->line2` in case of skipping, so cycle is always run at least once. --- src/nvim/eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 772994de31..49e3590185 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -2747,7 +2747,7 @@ void ex_call(exarg_T *eap) } else lnum = eap->line1; for (; lnum <= eap->line2; ++lnum) { - if (!eap->skip && eap->addr_count > 0) { + if (!eap->skip && eap->addr_count > 0) { // -V560 curwin->w_cursor.lnum = lnum; curwin->w_cursor.col = 0; curwin->w_cursor.coladd = 0; @@ -2768,7 +2768,7 @@ void ex_call(exarg_T *eap) } tv_clear(&rettv); - if (doesrange || eap->skip) { + if (doesrange || eap->skip) { // -V560 break; } From 97a1ccf8e7470d8c781c86253f8a7795fe50dc50 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 19:56:55 +0300 Subject: [PATCH 065/257] eval: Fix V547: `d == NULL` was already checked at line 2986 --- src/nvim/eval.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 49e3590185..4cc400799d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -2999,8 +2999,7 @@ int do_unlet(const char *const name, const size_t name_len, const int forceit) return FAIL; } - if (d == NULL - || tv_check_lock(d->dv_lock, (const char *)name, STRLEN(name))) { + if (tv_check_lock(d->dv_lock, (const char *)name, STRLEN(name))) { return FAIL; } From 7c9e3d6cadb441aaa40c8539de41e302228196a9 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:02:06 +0300 Subject: [PATCH 066/257] eval: Refactor f_char2nr With has_mbyte equal to 1 and &encoding always UTF-8 second argument is no longer useful: utf_ptr2char is the same as mb_ptr2char. Also changes function behaviour a bit: now if second argument is not a number it immediately returns with error, without bothering to get a character. --- src/nvim/eval.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 4cc400799d..bfc9f6eaa6 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -7305,18 +7305,14 @@ static void f_changenr(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_char2nr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - if (has_mbyte) { - int utf8 = 0; - - if (argvars[1].v_type != VAR_UNKNOWN) { - utf8 = tv_get_number_chk(&argvars[1], NULL); + if (argvars[1].v_type != VAR_UNKNOWN) { + if (!tv_check_num(&argvars[1])) { + return; } - - rettv->vval.v_number = (utf8 ? *utf_ptr2char : *mb_ptr2char)( - (const char_u *)tv_get_string(&argvars[0])); - } else { - rettv->vval.v_number = (uint8_t)(tv_get_string(&argvars[0])[0]); } + + rettv->vval.v_number = utf_ptr2char( + (const char_u *)tv_get_string(&argvars[0])); } /* From 31190879cc85cb3e8a056d544ea0c3ed63ce21df Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:07:54 +0300 Subject: [PATCH 067/257] eval: Fix useless NULL check partial_name() as it is written now really cannot return NULL --- src/nvim/eval.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index bfc9f6eaa6..f8afc03c1c 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8977,13 +8977,10 @@ static void f_get(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (strcmp(what, "func") == 0 || strcmp(what, "name") == 0) { rettv->v_type = (*what == 'f' ? VAR_FUNC : VAR_STRING); const char *const n = (const char *)partial_name(pt); - if (n == NULL) { - rettv->vval.v_string = NULL; - } else { - rettv->vval.v_string = (char_u *)xstrdup(n); - if (rettv->v_type == VAR_FUNC) { - func_ref(rettv->vval.v_string); - } + assert(n != NULL); + rettv->vval.v_string = (char_u *)xstrdup(n); + if (rettv->v_type == VAR_FUNC) { + func_ref(rettv->vval.v_string); } } else if (strcmp(what, "dict") == 0) { rettv->v_type = VAR_DICT; From 3c5f4b382f62d9f3cf5d54720592ff75d3a1f86d Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:08:56 +0300 Subject: [PATCH 068/257] eval: Silence octal constant warning --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index f8afc03c1c..a259bbf0eb 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12538,7 +12538,7 @@ static void f_min(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_mkdir(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - int prot = 0755; + int prot = 0755; // -V536 rettv->vval.v_number = FAIL; if (check_restricted() || check_secure()) From fbdef2e6f2d65d3cc6f3c8a8dcd8b3cddf41c474 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:16:32 +0300 Subject: [PATCH 069/257] eval: Refactor nr2char() Adds error messages, checks type and ignores the second argument. Currently utf_char2bytes is able to handle any 31-bit character, not limited by a unicode range. So checking for INT_MAX and not for something else: function yet uses `int`. --- src/nvim/eval.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index a259bbf0eb..71af801986 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12763,25 +12763,32 @@ static void f_nextnonblank(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_nr2char(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u buf[NUMBUFLEN]; - - if (has_mbyte) { - int utf8 = 0; - - if (argvars[1].v_type != VAR_UNKNOWN) { - utf8 = tv_get_number_chk(&argvars[1], NULL); + if (argvars[1].v_type != VAR_UNKNOWN) { + if (!tv_check_num(&argvars[1])) { + return; } - if (utf8) { - buf[(*utf_char2bytes)((int)tv_get_number(&argvars[0]), buf)] = NUL; - } else { - buf[(*mb_char2bytes)((int)tv_get_number(&argvars[0]), buf)] = NUL; - } - } else { - buf[0] = (char_u)tv_get_number(&argvars[0]); - buf[1] = NUL; } + + bool error = false; + const varnumber_T num = tv_get_number_chk(&argvars[0], &error); + if (error) { + return; + } + if (num < 0) { + emsgf(_("E5070: Character number could not be less then zero")); + return; + } + if (num > INT_MAX) { + emsgf(_("E5071: Character number could not be greater then INT_MAX (%i)"), + INT_MAX); + return; + } + + char buf[MB_MAXBYTES]; + const int len = utf_char2bytes((int)num, (char_u *)buf); + rettv->v_type = VAR_STRING; - rettv->vval.v_string = vim_strsave(buf); + rettv->vval.v_string = xmemdupz(buf, (size_t)len); } /* From 787d71a3afbe619a301ba7898e2c43fdcffdc8ec Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:19:10 +0300 Subject: [PATCH 070/257] eval: Fix condition in f_serverstop --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 71af801986..2a725c49f7 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -14306,7 +14306,7 @@ static void f_serverstop(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } - if (argvars[0].v_type == VAR_UNKNOWN || argvars[0].v_type != VAR_STRING) { + if (argvars[0].v_type != VAR_STRING) { EMSG(_(e_invarg)); return; } From 9b1dd084257fc2b5f50e29b283be698c13d4a509 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:20:38 +0300 Subject: [PATCH 071/257] eval: Remove unneeded varp check --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 2a725c49f7..6e204be481 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -14330,7 +14330,7 @@ static void f_setbufvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) buf_T *const buf = get_buf_tv(&argvars[0], false); typval_T *varp = &argvars[2]; - if (buf != NULL && varname != NULL && varp != NULL) { + if (buf != NULL && varname != NULL) { if (*varname == '&') { long numval; bool error = false; From 9dd1926df01a27c913dd19ef0a4f79d06842508a Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:20:53 +0300 Subject: [PATCH 072/257] eval: Remove unneeded varp check --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 6e204be481..30b776c887 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -14874,7 +14874,7 @@ static void f_settabvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) const char *const varname = tv_get_string_chk(&argvars[1]); typval_T *const varp = &argvars[2]; - if (varname != NULL && varp != NULL && tp != NULL) { + if (varname != NULL && tp != NULL) { tabpage_T *const save_curtab = curtab; goto_tabpage_tp(tp, false, false); From 1bc080078793aafcecfae95620f6dac917c737dc Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:22:12 +0300 Subject: [PATCH 073/257] eval: Remove unneeded !eap->skip check Already checked in the outer if(). --- src/nvim/eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 30b776c887..67d5465896 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19462,8 +19462,9 @@ void ex_function(exarg_T *eap) * interrupt, or an exception. */ if (!aborting()) { - if (!eap->skip && fudi.fd_newkey != NULL) + if (fudi.fd_newkey != NULL) { EMSG2(_(e_dictkey), fudi.fd_newkey); + } xfree(fudi.fd_newkey); return; } else From c5010c98ae8532f7f2778ce0e89a01d9e1ca68f9 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:22:58 +0300 Subject: [PATCH 074/257] eval: Fix position of buf declaration --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 67d5465896..cf55b42bdf 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -21048,8 +21048,8 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, char *s = tofree; emsg_off--; if (s != NULL) { + char buf[MSG_BUF_LEN]; if (vim_strsize((char_u *)s) > MSG_BUF_CLEN) { - char buf[MSG_BUF_LEN]; trunc_string((char_u *)s, (char_u *)buf, MSG_BUF_CLEN, sizeof(buf)); s = buf; From d766607dc9e3c54a7575102ecf025eb184d9f648 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:24:30 +0300 Subject: [PATCH 075/257] farsi: Simplify condition --- src/nvim/farsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/farsi.c b/src/nvim/farsi.c index e7e93f756f..2d37d1284e 100644 --- a/src/nvim/farsi.c +++ b/src/nvim/farsi.c @@ -321,7 +321,7 @@ static void put_curr_and_l_to_X(char_u c) } if ((curwin->w_cursor.col < (colnr_T)STRLEN(get_cursor_line_ptr()))) { - if ((p_ri && curwin->w_cursor.col) || !p_ri) { + if (!p_ri || curwin->w_cursor.col) { if (p_ri) { dec_cursor(); } else { From a894c82defc00fcd0ed14a6d157130d9dc63f314 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:25:00 +0300 Subject: [PATCH 076/257] ex_docmd: Remove excessive assignment --- src/nvim/ex_docmd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 0fd4ae48be..3d1136b7ac 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1304,7 +1304,6 @@ static char_u * do_one_cmd(char_u **cmdlinep, /* * 2. Handle command modifiers. */ - p = ea.cmd; p = skip_range(ea.cmd, NULL); switch (*p) { /* When adding an entry, also modify cmd_exists(). */ From 87e107d92143e108ec3ec5f91851ca3cb3768175 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:27:20 +0300 Subject: [PATCH 077/257] ex_docmd: Remove :Ni! easter egg --- src/nvim/ex_docmd.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 3d1136b7ac..60d3bb07a3 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1726,11 +1726,7 @@ static char_u * do_one_cmd(char_u **cmdlinep, errormsg = (char_u *)_("E464: Ambiguous use of user-defined command"); goto doend; } - /* Check for wrong commands. */ - if (*p == '!' && ea.cmd[1] == 0151 && ea.cmd[0] == 78) { - errormsg = uc_fun_cmd(); - goto doend; - } + // Check for wrong commands. if (ea.cmdidx == CMD_SIZE) { if (!ea.skip) { STRCPY(IObuff, _("E492: Not an editor command")); @@ -4961,20 +4957,6 @@ static void uc_list(char_u *name, size_t name_len) MSG(_("No user-defined commands found")); } -static char_u *uc_fun_cmd(void) -{ - static char_u fcmd[] = {0x84, 0xaf, 0x60, 0xb9, 0xaf, 0xb5, 0x60, 0xa4, - 0xa5, 0xad, 0xa1, 0xae, 0xa4, 0x60, 0xa1, 0x60, - 0xb3, 0xa8, 0xb2, 0xb5, 0xa2, 0xa2, 0xa5, 0xb2, - 0xb9, 0x7f, 0}; - int i; - - for (i = 0; fcmd[i]; ++i) - IObuff[i] = fcmd[i] - 0x40; - IObuff[i] = 0; - return IObuff; -} - static int uc_scan_attr(char_u *attr, size_t len, uint32_t *argt, long *def, int *flags, int * compl, char_u **compl_arg, int *addr_type_arg) From fe01e9c947b8c2fcb328e79b8b91ceebfd8c04cc Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:27:47 +0300 Subject: [PATCH 078/257] ex_docmd: Remove unneeded if() --- src/nvim/ex_docmd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 60d3bb07a3..0e399c9fb3 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4097,12 +4097,11 @@ int expand_filename(exarg_T *eap, char_u **cmdlinep, char_u **errormsgp) options += WILD_ICASE; p = ExpandOne(&xpc, eap->arg, NULL, options, WILD_EXPAND_FREE); - if (p == NULL) + if (p == NULL) { return FAIL; - if (p != NULL) { - (void)repl_cmdline(eap, eap->arg, STRLEN(eap->arg), p, cmdlinep); - xfree(p); } + (void)repl_cmdline(eap, eap->arg, STRLEN(eap->arg), p, cmdlinep); + xfree(p); } } return OK; From d88ae748b51963d0188fe41f0abd6ea208bd2eef Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:29:19 +0300 Subject: [PATCH 079/257] getchar: Fix if block indentation --- src/nvim/getchar.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 3b248c4bc6..e056ff488c 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1849,11 +1849,12 @@ static int vgetorpeek(int advance) mp_match = mp; mp_match_len = keylen; } - } else - /* No match; may have to check for - * termcode at next character. */ - if (max_mlen < mlen) - max_mlen = mlen; + } else { + // No match; may have to check for termcode at next character. + if (max_mlen < mlen) { + max_mlen = mlen; + } + } } } From e3de83a8291cf0ef1481a2631dda04b37b6e3412 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:32:10 +0300 Subject: [PATCH 080/257] hardcopy: Remove unneeded prt_do_conv assignment --- src/nvim/hardcopy.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 4cb05ffc12..b2cbe30a43 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -2576,13 +2576,12 @@ int mch_print_begin(prt_settings_T *psettings) prt_conv.vc_type = CONV_NONE; if (!(enc_canon_props(p_enc) & enc_canon_props(p_encoding) & ENC_8BIT)) { - /* Set up encoding conversion if required */ - if (FAIL == convert_setup(&prt_conv, p_enc, p_encoding)) { - EMSG2(_("E620: Unable to convert to print encoding \"%s\""), - p_encoding); - return FALSE; + // Set up encoding conversion if required + if (convert_setup(&prt_conv, p_enc, p_encoding) == FAIL) { + emsgf(_("E620: Unable to convert to print encoding \"%s\""), + p_encoding); + return false; } - prt_do_conv = TRUE; } prt_do_conv = prt_conv.vc_type != CONV_NONE; From 0f7c260cd873c996da9badb42b9135cd15bee285 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:39:57 +0300 Subject: [PATCH 081/257] fileio: Simlify help files encoding detection Most of code is dead when enc_utf8 is always true. Given that `c` is being reused for other purposes I left it set to 1 just in case. --- src/nvim/fileio.c | 43 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index c1b8203ed1..74fa5aa1de 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -730,43 +730,16 @@ readfile ( fenc = (char_u *)""; /* binary: don't convert */ fenc_alloced = FALSE; } else if (curbuf->b_help) { - char_u firstline[80]; - int fc; + // Help files are either utf-8 or latin1. Try utf-8 first, if this + // fails it must be latin1. + // It is needed when the first line contains non-ASCII characters. + // That is only in *.??x files. + fenc_next = (char_u *)"latin1"; + fenc = (char_u *)"utf-8"; - /* Help files are either utf-8 or latin1. Try utf-8 first, if this - * fails it must be latin1. - * Always do this when 'encoding' is "utf-8". Otherwise only do - * this when needed to avoid [converted] remarks all the time. - * It is needed when the first line contains non-ASCII characters. - * That is only in *.??x files. */ - fenc = (char_u *)"latin1"; - c = enc_utf8; - if (!c && !read_stdin) { - fc = fname[STRLEN(fname) - 1]; - if (TOLOWER_ASC(fc) == 'x') { - /* Read the first line (and a bit more). Immediately rewind to - * the start of the file. If the read() fails "len" is -1. */ - len = read_eintr(fd, firstline, 80); - lseek(fd, (off_t)0L, SEEK_SET); - for (p = firstline; p < firstline + len; ++p) - if (*p >= 0x80) { - c = TRUE; - break; - } - } - } + fenc_alloced = false; - if (c) { - fenc_next = fenc; - fenc = (char_u *)"utf-8"; - - /* When the file is utf-8 but a character doesn't fit in - * 'encoding' don't retry. In help text editing utf-8 bytes - * doesn't make sense. */ - if (!enc_utf8) - keep_dest_enc = TRUE; - } - fenc_alloced = FALSE; + c = 1; } else if (*p_fencs == NUL) { fenc = curbuf->b_p_fenc; /* use format from buffer */ fenc_alloced = FALSE; From 2394c9f2b79e5c9c121c21dcb324f9c18b473853 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:47:06 +0300 Subject: [PATCH 082/257] =?UTF-8?q?memline:=20Silence=20=E2=80=9Cbuffer=20?= =?UTF-8?q?underflow=E2=80=9D=20warning,=20looks=20like=20false=20positive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/memline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 5ea2397db3..45e16554e6 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -616,7 +616,7 @@ static bool ml_check_b0_strings(ZERO_BL *b0p) return (memchr(b0p->b0_version, NUL, 10) && memchr(b0p->b0_uname, NUL, B0_UNAME_SIZE) && memchr(b0p->b0_hname, NUL, B0_HNAME_SIZE) - && memchr(b0p->b0_fname, NUL, B0_FNAME_SIZE_CRYPT)); + && memchr(b0p->b0_fname, NUL, B0_FNAME_SIZE_CRYPT)); // -V512 } /* From 10ce00efa8c9d4e9f2b588063ce04f7d49050d8b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:55:29 +0300 Subject: [PATCH 083/257] =?UTF-8?q?memline:=20Fix=20=E2=80=9CNULL=20pointe?= =?UTF-8?q?r=20dereference=E2=80=9D=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was actually a false positive indicating always-true condition, not real dereference. --- src/nvim/memline.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 45e16554e6..b31ca136dd 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -3362,29 +3362,32 @@ static char *findswapname(buf_T *buf, char **dirp, char *old_fname, } if (swap_exists_action != SEA_NONE && choice == 0) { - char *name; + const char *const sw_msg_1 = _("Swap file \""); + const char *const sw_msg_2 = _("\" already exists!"); const size_t fname_len = strlen(fname); - name = xmalloc(fname_len - + strlen(_("Swap file \"")) - + strlen(_("\" already exists!")) + 5); - STRCPY(name, _("Swap file \"")); - home_replace(NULL, (char_u *) fname, (char_u *)&name[strlen(name)], - fname_len, true); - STRCAT(name, _("\" already exists!")); - choice = do_dialog(VIM_WARNING, - (char_u *)_("VIM - ATTENTION"), - (char_u *)(name == NULL - ? _("Swap file already exists!") - : name), + const size_t sw_msg_1_len = strlen(sw_msg_1); + const size_t sw_msg_2_len = strlen(sw_msg_2); + + const size_t name_len = sw_msg_1_len + fname_len + sw_msg_2_len + 5; + + char *const name = xmalloc(name_len); + memcpy(name, sw_msg_1, sw_msg_1_len + 1); + home_replace(NULL, (char_u *)fname, (char_u *)&name[sw_msg_1_len], + fname_len, true); + xstrlcat(name, sw_msg_2, name_len); + choice = do_dialog(VIM_WARNING, (char_u *)_("VIM - ATTENTION"), + (char_u *)name, # if defined(UNIX) - process_still_running - ? (char_u *)_( - "&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort") : + process_still_running + ? (char_u *)_( + "&Open Read-Only\n&Edit anyway\n&Recover" + "\n&Quit\n&Abort") : # endif - (char_u *)_( - "&Open Read-Only\n&Edit anyway\n&Recover\n&Delete it\n&Quit\n&Abort"), - 1, NULL, FALSE); + (char_u *)_( + "&Open Read-Only\n&Edit anyway\n&Recover" + "\n&Delete it\n&Quit\n&Abort"), + 1, NULL, false); # if defined(UNIX) if (process_still_running && choice >= 4) From 083792e1374100f1b0c48c72987935f56ebbd8ad Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:56:30 +0300 Subject: [PATCH 084/257] =?UTF-8?q?message:=20Remove=20some=20enc=5Futf8/?= =?UTF-8?q?=E2=80=A6=20checks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/message.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/nvim/message.c b/src/nvim/message.c index 3e4a1e10b6..91dfc79e38 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1165,15 +1165,9 @@ int msg_outtrans_len_attr(char_u *msgstr, int len, int attr) * Normal characters are printed several at a time. */ while (--len >= 0) { - if (enc_utf8) { - // Don't include composing chars after the end. - mb_l = utfc_ptr2len_len((char_u *)str, len + 1); - } else if (has_mbyte) { - mb_l = (*mb_ptr2len)((char_u *)str); - } else { - mb_l = 1; - } - if (has_mbyte && mb_l > 1) { + // Don't include composing chars after the end. + mb_l = utfc_ptr2len_len((char_u *)str, len + 1); + if (mb_l > 1) { c = (*mb_ptr2char)((char_u *)str); if (vim_isprintc(c)) { // Printable multi-byte char: count the cells. From 0718d0e6d44536547dac2248c65b15547e56fc10 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:58:19 +0300 Subject: [PATCH 085/257] message: Some more has_mbyte/enc_utf8 removal --- src/nvim/message.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/nvim/message.c b/src/nvim/message.c index 91dfc79e38..42e1fd1cf9 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1657,16 +1657,13 @@ static void msg_puts_display(const char_u *str, int maxlen, int attr, // Display char in last column before showing more-prompt. if (*s >= ' ' && !cmdmsg_rl) { - if (has_mbyte) { - if (enc_utf8 && maxlen >= 0) - /* avoid including composing chars after the end */ - l = utfc_ptr2len_len(s, (int)((str + maxlen) - s)); - else - l = (*mb_ptr2len)(s); - s = screen_puts_mbyte((char_u *)s, l, attr); + if (maxlen >= 0) { + // Avoid including composing chars after the end. + l = utfc_ptr2len_len(s, (int)((str + maxlen) - s)); } else { - msg_screen_putchar(*s++, attr); + l = utfc_ptr2len(s); } + s = screen_puts_mbyte((char_u *)s, l, attr); did_last_char = true; } else { did_last_char = false; From dc523eed8ec2ea238dde21f39fdbb6343227c16e Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 20:59:44 +0300 Subject: [PATCH 086/257] =?UTF-8?q?fileio:=20Silence=20=E2=80=9C!=3D=20ide?= =?UTF-8?q?ntical=20subexpressions=E2=80=9D=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/os/fileio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c index 3c47c66196..27eb448c3d 100644 --- a/src/nvim/os/fileio.c +++ b/src/nvim/os/fileio.c @@ -47,6 +47,7 @@ int file_open(FileDescriptor *const ret_fp, const char *const fname, int os_open_flags = 0; int fd; TriState wr = kNone; + // -V:FLAG:501 #define FLAG(flags, flag, fcntl_flags, wrval, cond) \ do { \ if (flags & flag) { \ From 84aa457ccdf88baeee1e87ba763fafe0ff77095e Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:02:43 +0300 Subject: [PATCH 087/257] =?UTF-8?q?os/env:=20Fix=20=E2=80=9Cinvalid=20poin?= =?UTF-8?q?ter=20to=20local=E2=80=9D=20false=20positive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/os/env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index ad51e598c1..f3187de182 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -641,7 +641,7 @@ char *vim_getenv(const char *name) exe_name, "share" _PATHSEPSTR "nvim" _PATHSEPSTR "runtime" _PATHSEPSTR, MAXPATHL) == OK) { - vim_path = exe_name; + vim_path = exe_name; // -V507 } } } @@ -675,6 +675,7 @@ char *vim_getenv(const char *name) vim_path = NULL; } } + assert(vim_path != exe_name); } #ifdef HAVE_PATHDEF From cdbfff077b23d666036bd9967756938df9044b38 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:05:50 +0300 Subject: [PATCH 088/257] =?UTF-8?q?ops:=20Silence=20=E2=80=9Ccounter=20not?= =?UTF-8?q?=20used=20in=20loop=E2=80=9D=20false=20positive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 5212ec45ab..6ea3a45049 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -2785,7 +2785,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) } if (curbuf->terminal) { - for (int i = 0; i < count; i++) { + for (int i = 0; i < count; i++) { // -V756 // feed the lines to the terminal for (size_t j = 0; j < y_size; j++) { if (j) { From 54bd78b8a8d212a0278b1d9517dd0dcc4df79a0b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:06:22 +0300 Subject: [PATCH 089/257] normal: Remove unneeded assignment --- src/nvim/normal.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 388ddfc8bb..1809b98586 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -694,7 +694,6 @@ static void normal_get_additional_char(NormalState *s) if (langmap_active) { // Undo the decrement done above no_mapping++; - State = NORMAL_BUSY; } State = NORMAL_BUSY; s->need_flushbuf |= add_to_showcmd(*cp); From b5db7cde366ae159aee6826167b68c3aff0cdf19 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:08:12 +0300 Subject: [PATCH 090/257] normal: Clarify the code Current variant works only because of PUT_FIXINDENT being equal to true. --- src/nvim/normal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 1809b98586..d7c7c7d48c 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -2336,7 +2336,8 @@ do_mouse ( if ((State & REPLACE_FLAG) && !yank_register_mline(regname)) insert_reg(regname, true); else { - do_put(regname, NULL, BACKWARD, 1L, fixindent | PUT_CURSEND); + do_put(regname, NULL, BACKWARD, 1L, + (fixindent ? PUT_FIXINDENT : 0) | PUT_CURSEND); /* Repeat it with CTRL-R CTRL-O r or CTRL-R CTRL-P r */ AppendCharToRedobuff(Ctrl_R); @@ -2688,7 +2689,8 @@ do_mouse ( */ if (restart_edit != 0) where_paste_started = curwin->w_cursor; - do_put(regname, NULL, dir, count, fixindent | PUT_CURSEND); + do_put(regname, NULL, dir, count, + (fixindent ? PUT_FIXINDENT : 0)| PUT_CURSEND); } /* * Ctrl-Mouse click or double click in a quickfix window jumps to the From aa3b1f695f699e189d5190c57e6c5e2bce4b0c9e Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:09:31 +0300 Subject: [PATCH 091/257] normal: Add figure braces so that code is clearer --- src/nvim/normal.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nvim/normal.c b/src/nvim/normal.c index d7c7c7d48c..9340a45f62 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -7613,11 +7613,13 @@ static void nv_record(cmdarg_T *cap) if (cap->nchar == ':' || cap->nchar == '/' || cap->nchar == '?') { stuffcharReadbuff(cap->nchar); stuffcharReadbuff(K_CMDWIN); - } else - /* (stop) recording into a named register, unless executing a - * register */ - if (!Exec_reg && do_record(cap->nchar) == false) - clearopbeep(cap->oap); + } else { + // (stop) recording into a named register, unless executing a + // register. + if (!Exec_reg && do_record(cap->nchar) == false) { + clearopbeep(cap->oap); + } + } } } From be9d98cb45aab402b7666776ad1288b9a79bb0c1 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:10:40 +0300 Subject: [PATCH 092/257] quickfix: Remove unneeded condition fmt_ptr was checked for being NULL in if() condition earlier. --- src/nvim/quickfix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 4fa5c85abd..33b832c033 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -856,7 +856,7 @@ restofline: if (fmt_ptr == NULL) { qi->qf_multiline = qi->qf_multiignore = false; } - } else if (fmt_ptr != NULL) { + } else { // honor %> item if (fmt_ptr->conthere) { fmt_start = fmt_ptr; From 4e7150ee94d967ff51cbef24a7e18f71290ed9a2 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:11:37 +0300 Subject: [PATCH 093/257] quicfix: Remove duplicate condition --- src/nvim/quickfix.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 33b832c033..af055e9b75 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -3284,7 +3284,6 @@ void ex_cc(exarg_T *eap) || eap->cmdidx == CMD_lrewind || eap->cmdidx == CMD_lfirst || eap->cmdidx == CMD_llast - || eap->cmdidx == CMD_llast || eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) { qi = GET_LOC_LIST(curwin); @@ -3341,7 +3340,6 @@ void ex_cnext(exarg_T *eap) || eap->cmdidx == CMD_lnfile || eap->cmdidx == CMD_lNfile || eap->cmdidx == CMD_lpfile - || eap->cmdidx == CMD_lpfile || eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) { qi = GET_LOC_LIST(curwin); From b396a3f72edb3fb345e516a12b92991b249da572 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:13:49 +0300 Subject: [PATCH 094/257] quicfix: Avoid possible NULL dereference --- src/nvim/quickfix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index af055e9b75..1241841885 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -984,7 +984,7 @@ qf_init_ext( } // Use the local value of 'errorformat' if it's set. - if (errorformat == p_efm && tv == NULL && *buf->b_p_efm != NUL) { + if (errorformat == p_efm && tv == NULL && buf && *buf->b_p_efm != NUL) { efm = buf->b_p_efm; } else { efm = errorformat; From a65867542d291cda6cdd68e56e0d5d3866dbbb72 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:17:08 +0300 Subject: [PATCH 095/257] screen: Remove unneeded check --- src/nvim/screen.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index febca105e9..79596f73cd 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1016,9 +1016,7 @@ static void win_update(win_T *wp) linenr_T from, to; if (VIsual_active) { - if (VIsual_active - && (VIsual_mode != wp->w_old_visual_mode - || type == INVERTED_ALL)) { + if (VIsual_mode != wp->w_old_visual_mode || type == INVERTED_ALL) { /* * If the type of Visual selection changed, redraw the whole * selection. Also when the ownership of the X selection is From 7cf4b0ac06c7d6675a05924b6aff3850fde3bcf2 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:18:00 +0300 Subject: [PATCH 096/257] =?UTF-8?q?screen:=20Silence=20=E2=80=9Cbuffer=20u?= =?UTF-8?q?nderflow=E2=80=9D=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 79596f73cd..cf116e1930 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2447,7 +2447,7 @@ win_line ( } else { /* Long line, use only the last SPWORDLEN bytes. */ nextlinecol = v - SPWORDLEN; - memmove(nextline, line + nextlinecol, SPWORDLEN); + memmove(nextline, line + nextlinecol, SPWORDLEN); // -V512 nextline_idx = SPWORDLEN + 1; } } From 48ad8e0ff1ba721a5607c20f48e813400041299c Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:22:02 +0300 Subject: [PATCH 097/257] screen: Silence NULL dereference false positive Based on the loop condition when shl_flag is true cur != NULL. --- src/nvim/screen.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index cf116e1930..db757a54f5 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2579,13 +2579,14 @@ win_line ( * Do this for both search_hl and the match list. */ cur = wp->w_match_head; - shl_flag = FALSE; - while (cur != NULL || shl_flag == FALSE) { - if (shl_flag == FALSE) { + shl_flag = false; + while (cur != NULL || !shl_flag) { + if (!shl_flag) { shl = &search_hl; - shl_flag = TRUE; - } else - shl = &cur->hl; + shl_flag = true; + } else { + shl = &cur->hl; // -V595 + } shl->startcol = MAXCOL; shl->endcol = MAXCOL; shl->attr_cur = 0; @@ -5536,13 +5537,14 @@ static void prepare_search_hl(win_T *wp, linenr_T lnum) * Do this both for search_hl and the match list. */ cur = wp->w_match_head; - shl_flag = FALSE; - while (cur != NULL || shl_flag == FALSE) { - if (shl_flag == FALSE) { + shl_flag = false; + while (cur != NULL || shl_flag == false) { + if (shl_flag == false) { shl = &search_hl; - shl_flag = TRUE; - } else - shl = &cur->hl; + shl_flag = true; + } else { + shl = &cur->hl; // -V595 + } if (shl->rm.regprog != NULL && shl->lnum == 0 && re_multiline(shl->rm.regprog)) { From e131194db71c5fc20148ea6e463de997917f6c0a Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:22:46 +0300 Subject: [PATCH 098/257] screen: Remove unneeded condition Already checked in outer if() --- src/nvim/screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index db757a54f5..431f74508d 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2784,8 +2784,8 @@ win_line ( // draw 'breakindent': indent wrapped text accodringly if (draw_state == WL_BRI - 1 && n_extra == 0) { draw_state = WL_BRI; - if (wp->w_p_bri && n_extra == 0 && row != startrow && filler_lines == 0) { - char_attr = 0; // was: hl_attr(HLF_AT); + if (wp->w_p_bri && row != startrow && filler_lines == 0) { + char_attr = 0; // was: hl_attr(HLF_AT); if (diff_hlf != (hlf_T)0) { char_attr = hl_attr(diff_hlf); From c0cbc507202231d5dd9c5c8669e6116f3344d535 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:26:07 +0300 Subject: [PATCH 099/257] screen: Remove another portion of has_mbyte/friends-checking stuff --- src/nvim/screen.c | 95 +++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 52 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 431f74508d..66b52c3b25 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5330,43 +5330,39 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr) c = *ptr; /* check if this is the first byte of a multibyte */ if (l_has_mbyte) { - if (l_enc_utf8 && len > 0) + if (len > 0) { mbyte_blen = utfc_ptr2len_len(ptr, (int)((text + len) - ptr)); - else - mbyte_blen = (*mb_ptr2len)(ptr); - if (l_enc_dbcs == DBCS_JPNU && c == 0x8e) - mbyte_cells = 1; - else if (l_enc_dbcs != 0) - mbyte_cells = mbyte_blen; - else { /* enc_utf8 */ - if (len >= 0) - u8c = utfc_ptr2char_len(ptr, u8cc, - (int)((text + len) - ptr)); - else - u8c = utfc_ptr2char(ptr, u8cc); - mbyte_cells = utf_char2cells(u8c); - if (p_arshape && !p_tbidi && arabic_char(u8c)) { - /* Do Arabic shaping. */ - if (len >= 0 && (int)(ptr - text) + mbyte_blen >= len) { - /* Past end of string to be displayed. */ - nc = NUL; - nc1 = NUL; - } else { - nc = utfc_ptr2char_len(ptr + mbyte_blen, pcc, - (int)((text + len) - ptr - mbyte_blen)); - nc1 = pcc[0]; - } - pc = prev_c; - prev_c = u8c; - u8c = arabic_shape(u8c, &c, &u8cc[0], nc, nc1, pc); - } else - prev_c = u8c; - if (col + mbyte_cells > screen_Columns) { - /* Only 1 cell left, but character requires 2 cells: - * display a '>' in the last column to avoid wrapping. */ - c = '>'; - mbyte_cells = 1; + } else { + mbyte_blen = utfc_ptr2len(ptr); + } + if (len >= 0) { + u8c = utfc_ptr2char_len(ptr, u8cc, (int)((text + len) - ptr)); + } else { + u8c = utfc_ptr2char(ptr, u8cc); + } + mbyte_cells = utf_char2cells(u8c); + if (p_arshape && !p_tbidi && arabic_char(u8c)) { + // Do Arabic shaping. + if (len >= 0 && (int)(ptr - text) + mbyte_blen >= len) { + // Past end of string to be displayed. + nc = NUL; + nc1 = NUL; + } else { + nc = utfc_ptr2char_len(ptr + mbyte_blen, pcc, + (int)((text + len) - ptr - mbyte_blen)); + nc1 = pcc[0]; } + pc = prev_c; + prev_c = u8c; + u8c = arabic_shape(u8c, &c, &u8cc[0], nc, nc1, pc); + } else { + prev_c = u8c; + } + if (col + mbyte_cells > screen_Columns) { + // Only 1 cell left, but character requires 2 cells: + // display a '>' in the last column to avoid wrapping. */ + c = '>'; + mbyte_cells = 1; } } @@ -5374,16 +5370,11 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr) force_redraw_next = FALSE; need_redraw = ScreenLines[off] != c - || (mbyte_cells == 2 - && ScreenLines[off + 1] != (l_enc_dbcs ? ptr[1] : 0)) - || (l_enc_dbcs == DBCS_JPNU - && c == 0x8e - && ScreenLines2[off] != ptr[1]) - || (l_enc_utf8 - && (ScreenLinesUC[off] != - (u8char_T)(c < 0x80 && u8cc[0] == 0 ? 0 : u8c) - || (ScreenLinesUC[off] != 0 - && screen_comp_differs(off, u8cc)))) + || (mbyte_cells == 2 && ScreenLines[off + 1] != 0) + || (ScreenLinesUC[off] != + (u8char_T)(c < 0x80 && u8cc[0] == 0 ? 0 : u8c) + || (ScreenLinesUC[off] != 0 + && screen_comp_differs(off, u8cc))) || ScreenAttrs[off] != attr || exmode_active; @@ -6103,8 +6094,7 @@ retry: if (new_ScreenLinesC[i] == NULL) break; if (new_ScreenLines == NULL - || (l_enc_utf8 && (new_ScreenLinesUC == NULL || i != p_mco)) - || (l_enc_dbcs == DBCS_JPNU && new_ScreenLines2 == NULL) + || (new_ScreenLinesUC == NULL || i != p_mco) || new_ScreenAttrs == NULL || new_LineOffset == NULL || new_LineWraps == NULL @@ -6189,13 +6179,14 @@ retry: ScreenLinesC[i] + LineOffset[old_row], (size_t)len * sizeof(u8char_T)); } - if (l_enc_dbcs == DBCS_JPNU && ScreenLines2 != NULL) + if (ScreenLines2 != NULL) { memmove(new_ScreenLines2 + new_LineOffset[new_row], - ScreenLines2 + LineOffset[old_row], - (size_t)len * sizeof(schar_T)); + ScreenLines2 + LineOffset[old_row], + (size_t)len * sizeof(schar_T)); + } memmove(new_ScreenAttrs + new_LineOffset[new_row], - ScreenAttrs + LineOffset[old_row], - (size_t)len * sizeof(sattr_T)); + ScreenAttrs + LineOffset[old_row], + (size_t)len * sizeof(sattr_T)); } } } From 316789e14c3910c0b4c5dd710a1c82ebd7b01ac2 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:33:10 +0300 Subject: [PATCH 100/257] =?UTF-8?q?tag:=20Silence=20=E2=80=9Cbuffer=20unde?= =?UTF-8?q?rflow=E2=80=9D=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/tag.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nvim/tag.c b/src/nvim/tag.c index f01b8b8ab1..1ce2a4e2eb 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -1222,9 +1222,9 @@ find_tags ( if (has_re && orgpat.regmatch.regprog == NULL) goto findtag_end; - /* This is only to avoid a compiler warning for using search_info - * uninitialised. */ - memset(&search_info, 0, (size_t)1); + // This is only to avoid a compiler warning for using search_info + // uninitialised. + memset(&search_info, 0, 1); // -V512 /* * When finding a specified number of matches, first try with matching From 76783963ebc90ca565311489bb2206b208d2e147 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:34:15 +0300 Subject: [PATCH 101/257] =?UTF-8?q?tag:=20Fix=20=E2=80=9Cinitialized=20twi?= =?UTF-8?q?ce=20successively=E2=80=9D=20false=20positive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 1ce2a4e2eb..0c7244cbb3 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -2534,7 +2534,7 @@ jumpto_tag ( } } p_ws = save_p_ws; - p_ic = save_p_ic; + p_ic = save_p_ic; // -V519 p_scs = save_p_scs; /* A search command may have positioned the cursor beyond the end From 69ebfb8d8ea26061a4fbfe9ee07d7bfff49e6a2b Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:35:50 +0300 Subject: [PATCH 102/257] regexp: Fix warning about octal constant --- src/nvim/regexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 4b5e17b00b..e15a2eebe5 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -2398,7 +2398,7 @@ collection: regc('\b'); break; case CLASS_ESCAPE: - regc('\033'); + regc(ESC); break; } } else { From b7118a008af1f0a15f7cfbe070a1f590310cc7b5 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:36:53 +0300 Subject: [PATCH 103/257] =?UTF-8?q?regexp:=20Remove=20another=20has=5Fmbyt?= =?UTF-8?q?e/=E2=80=A6-checking=20stuff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/regexp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index e15a2eebe5..284cb27c40 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -2923,13 +2923,8 @@ static void skipchr(void) else prevchr_len = 0; if (regparse[prevchr_len] != NUL) { - if (enc_utf8) - /* exclude composing chars that mb_ptr2len does include */ - prevchr_len += utf_ptr2len(regparse + prevchr_len); - else if (has_mbyte) - prevchr_len += (*mb_ptr2len)(regparse + prevchr_len); - else - ++prevchr_len; + // Exclude composing chars that utfc_ptr2len does include. + prevchr_len += utf_ptr2len(regparse + prevchr_len); } regparse += prevchr_len; prev_at_start = at_start; From 30561afe4128ab0c5371af00641d5c5a682d6270 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:38:06 +0300 Subject: [PATCH 104/257] regexp: Silence octal constant warning --- src/nvim/regexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 284cb27c40..7be89c2d7e 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -3047,7 +3047,7 @@ static int getoctchrs(void) int c; int i; - for (i = 0; i < 3 && nr < 040; ++i) { + for (i = 0; i < 3 && nr < 040; i++) { // -V536 c = regparse[0]; if (c < '0' || c > '7') break; From 372b6af8ea09bced16e8c793cbab304d2393bfa6 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:41:55 +0300 Subject: [PATCH 105/257] =?UTF-8?q?regexp=5Fnfa:=20Remove=20another=20has?= =?UTF-8?q?=5Fmbyte/=E2=80=A6-checking=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nvim/regexp_nfa.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index caf26fdd35..67a405daf5 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -2772,15 +2772,10 @@ static int nfa_max_width(nfa_state_T *startstate, int depth) case NFA_ANY: case NFA_START_COLL: case NFA_START_NEG_COLL: - /* matches some character, including composing chars */ - if (enc_utf8) - len += MB_MAXBYTES; - else if (has_mbyte) - len += 2; - else - ++len; + // Matches some character, including composing chars. + len += MB_MAXBYTES; if (state->c != NFA_ANY) { - /* skip over the characters */ + // Skip over the characters. state = state->out1->out; continue; } From 9d302c60f084c33c05b758cae12cc2dfa775e48e Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 21:42:20 +0300 Subject: [PATCH 106/257] regexp_nfa: Remove octal constant --- src/nvim/regexp_nfa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 67a405daf5..506e6277e9 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -4407,8 +4407,9 @@ static int check_char_class(int class, int c) return OK; break; case NFA_CLASS_ESCAPE: - if (c == '\033') + if (c == ESC) { return OK; + } break; default: From 58300d70d26969546e204983f8b4e505771ec8dd Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 22:20:19 +0300 Subject: [PATCH 107/257] *: Fix linter errors --- src/nvim/eval.c | 9 +++++---- src/nvim/ex_docmd.c | 3 +-- src/nvim/normal.c | 6 +++--- src/nvim/screen.c | 10 ++++------ 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index cf55b42bdf..7c5b23f567 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -2742,11 +2742,12 @@ void ex_call(exarg_T *eap) * call, and the loop is broken. */ if (eap->skip) { - ++emsg_skip; - lnum = eap->line2; /* do it once, also with an invalid range */ - } else + emsg_skip++; + lnum = eap->line2; // Do it once, also with an invalid range. + } else { lnum = eap->line1; - for (; lnum <= eap->line2; ++lnum) { + } + for (; lnum <= eap->line2; lnum++) { if (!eap->skip && eap->addr_count > 0) { // -V560 curwin->w_cursor.lnum = lnum; curwin->w_cursor.col = 0; diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 0e399c9fb3..17b3b512ef 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4095,8 +4095,7 @@ int expand_filename(exarg_T *eap, char_u **cmdlinep, char_u **errormsgp) xpc.xp_context = EXPAND_FILES; if (p_wic) options += WILD_ICASE; - p = ExpandOne(&xpc, eap->arg, NULL, - options, WILD_EXPAND_FREE); + p = ExpandOne(&xpc, eap->arg, NULL, options, WILD_EXPAND_FREE); if (p == NULL) { return FAIL; } diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 9340a45f62..7f087dcd20 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -2333,9 +2333,9 @@ do_mouse ( if (regname == 0 && eval_has_provider("clipboard")) { regname = '*'; } - if ((State & REPLACE_FLAG) && !yank_register_mline(regname)) + if ((State & REPLACE_FLAG) && !yank_register_mline(regname)) { insert_reg(regname, true); - else { + } else { do_put(regname, NULL, BACKWARD, 1L, (fixindent ? PUT_FIXINDENT : 0) | PUT_CURSEND); @@ -7616,7 +7616,7 @@ static void nv_record(cmdarg_T *cap) } else { // (stop) recording into a named register, unless executing a // register. - if (!Exec_reg && do_record(cap->nchar) == false) { + if (!Exec_reg && do_record(cap->nchar) == FAIL) { clearopbeep(cap->oap); } } diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 66b52c3b25..a8993be4e5 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1017,11 +1017,9 @@ static void win_update(win_T *wp) if (VIsual_active) { if (VIsual_mode != wp->w_old_visual_mode || type == INVERTED_ALL) { - /* - * If the type of Visual selection changed, redraw the whole - * selection. Also when the ownership of the X selection is - * gained or lost. - */ + // If the type of Visual selection changed, redraw the whole + // selection. Also when the ownership of the X selection is + // gained or lost. if (curwin->w_cursor.lnum < VIsual.lnum) { from = curwin->w_cursor.lnum; to = VIsual.lnum; @@ -5349,7 +5347,7 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr) nc1 = NUL; } else { nc = utfc_ptr2char_len(ptr + mbyte_blen, pcc, - (int)((text + len) - ptr - mbyte_blen)); + (int)((text + len) - ptr - mbyte_blen)); nc1 = pcc[0]; } pc = prev_c; From 2eb9150a4fcb8f43599e5f470cbcb3a12195d910 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 16 Apr 2017 23:58:32 +0300 Subject: [PATCH 108/257] buffer: Adjust where do_buffer call is located It is located there in Vim, but in dd7657c1605246e8f7ade35184069a09dc254e84 position was for some reason swapped. --- src/nvim/buffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 292eb03a16..e48b7846ae 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -741,12 +741,13 @@ static void clear_wininfo(buf_T *buf) */ void goto_buffer(exarg_T *eap, int start, int dir, int count) { - (void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO, - start, dir, count, eap->forceit); bufref_T old_curbuf; set_bufref(&old_curbuf, curbuf); swap_exists_action = SEA_DIALOG; + (void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO, + start, dir, count, eap->forceit); + if (swap_exists_action == SEA_QUIT && *eap->cmd == 's') { cleanup_T cs; From 263849b2dd4dc98bbe0870f5654c77809caeb965 Mon Sep 17 00:00:00 2001 From: Matthew Malcomson Date: Sun, 16 Apr 2017 20:15:50 +0100 Subject: [PATCH 109/257] fold: foldMoveRange(): fix :move bug #6534 Closes #6540 In #6221 there was a mistake in calculating which folds need to be re-ordered. When there are no folds after those that have been adjusted, then `move_end` remains 0. This results in reverse_fold_order() swapping folds that have been adjusted with uninitialised folds in the remainder of the grow array. Add a check in foldMoveRange() to account for this case. --- src/nvim/fold.c | 11 +++++++---- test/functional/normal/fold_spec.lua | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/nvim/fold.c b/src/nvim/fold.c index d810aee0ce..34db4d2171 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -2765,10 +2765,13 @@ void foldMoveRange(garray_T *gap, const linenr_T line1, const linenr_T line2, } dest_index = FOLD_INDEX(fp, gap); - // All folds are now correct, but they are not necessarily in the correct - // order. - // We have to swap folds in the range [move_end, dest_index) with those in - // the range [move_start, move_end). + // All folds are now correct, but not necessarily in the correct order. + // We must swap folds in the range [move_end, dest_index) with those in the + // range [move_start, move_end). + if (move_end == 0) { + // There are no folds after those moved, so none were moved out of order. + return; + } reverse_fold_order(gap, move_start, dest_index - 1); reverse_fold_order(gap, move_start, move_start + dest_index - move_end - 1); reverse_fold_order(gap, move_start + dest_index - move_end, dest_index - 1); diff --git a/test/functional/normal/fold_spec.lua b/test/functional/normal/fold_spec.lua index 85e4631b61..00e83bedc8 100644 --- a/test/functional/normal/fold_spec.lua +++ b/test/functional/normal/fold_spec.lua @@ -232,6 +232,25 @@ a a]], '2,3m0') eq({1, 2, 0, 0, 0}, get_folds()) end) + it('handles shifting all remaining folds', function() + test_move_indent([[ + a + a + a + a + a + a + a + a + a + a + a + a + a + a +a]], '13m7') + eq({1, 2, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 2, 1, 0}, get_folds()) + end) end) it('updates correctly on :read', function() -- luacheck: ignore 621 From 3345382cc2afd3b3a027d9abb5c101507ebb57d7 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 17 Apr 2017 00:00:04 +0200 Subject: [PATCH 110/257] highlight: default Cursor to guibg=fg, guifg=bg Closes #6508 --- src/nvim/syntax.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 1ed65ec52a..d5ff3707e8 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5898,6 +5898,8 @@ static void syntime_report(void) static char *highlight_init_both[] = { "Conceal ctermbg=DarkGrey ctermfg=LightGrey guibg=DarkGrey guifg=LightGrey", + "Cursor guibg=fg guifg=bg", + "lCursor guibg=fg guifg=bg", "DiffText cterm=bold ctermbg=Red gui=bold guibg=Red", "ErrorMsg ctermbg=DarkRed ctermfg=White guibg=Red guifg=White", "IncSearch cterm=reverse gui=reverse", From 45aa465fba73a9422a5c37779666eb59e0616142 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 17 Apr 2017 03:53:29 +0200 Subject: [PATCH 111/257] test: Cursor after `:hi clear|syntax reset` Also enable tests on Windows. --- test/functional/ui/highlight_spec.lua | 45 +++++++++++++++------------ 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 5f8fafef07..2bda907c33 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -2,23 +2,23 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local os = require('os') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local command = helpers.command +local eval = helpers.eval local feed_command, request, eq = helpers.feed_command, helpers.request, helpers.eq -if helpers.pending_win32(pending) then return end - -describe('color scheme compatibility', function() +describe('colorscheme compatibility', function() before_each(function() clear() end) it('t_Co is set to 256 by default', function() - eq('256', request('vim_eval', '&t_Co')) + eq('256', eval('&t_Co')) request('nvim_set_option', 't_Co', '88') - eq('88', request('vim_eval', '&t_Co')) + eq('88', eval('&t_Co')) end) end) -describe('manual syntax highlight', function() +describe('highlight: `:syntax manual`', function() -- When using manual syntax highlighting, it should be preserved even when -- switching buffers... bug did only occur without :set hidden -- Ref: vim patch 7.4.1236 @@ -63,32 +63,32 @@ describe('manual syntax highlight', function() end) it("works with buffer switch and 'nohidden'", function() - feed_command('e tmp1.vim') - feed_command('e Xtest-functional-ui-highlight.tmp.vim') - feed_command('filetype on') - feed_command('syntax manual') - feed_command('set ft=vim') - feed_command('set syntax=ON') + command('e tmp1.vim') + command('e Xtest-functional-ui-highlight.tmp.vim') + command('filetype on') + command('syntax manual') + command('set filetype=vim fileformat=unix') + command('set syntax=ON') feed('iecho 10') - feed_command('set nohidden') - feed_command('w') - feed_command('bn') - feed_command('bp') + command('set nohidden') + command('w') + command('silent bn') + eq("tmp1.vim", eval("fnamemodify(bufname('%'), ':t')")) + feed_command('silent bp') + eq("Xtest-functional-ui-highlight.tmp.vim", eval("fnamemodify(bufname('%'), ':t')")) screen:expect([[ {1:^echo} 1 | {0:~ }| {0:~ }| {0:~ }| - Date: Wed, 19 Apr 2017 03:20:05 +0300 Subject: [PATCH 112/257] doc: fix typo (#6504) --- src/nvim/buffer.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index e48b7846ae..1f44e1adb0 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1839,9 +1839,7 @@ int buflist_getfile(int n, linenr_T lnum, int options, int forceit) return FAIL; } -/* - * go to the last know line number for the current buffer - */ +// Go to the last known line number for the current buffer. void buflist_getfpos(void) { pos_T *fpos; @@ -2339,9 +2337,7 @@ linenr_T buflist_findlnum(buf_T *buf) return buflist_findfpos(buf)->lnum; } -/* - * List all know file names (for :files and :buffers command). - */ +// List all known file names (for :files and :buffers command). void buflist_list(exarg_T *eap) { buf_T *buf; From 440133e0d5d576e46bd5ffa555f6a9c534789b48 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 18 Apr 2017 01:57:19 +0200 Subject: [PATCH 113/257] health.vim: Set 'iskeyword' to that of ft=help. --- runtime/autoload/health.vim | 4 ++-- runtime/autoload/health/provider.vim | 2 +- runtime/autoload/provider/clipboard.vim | 2 +- runtime/autoload/provider/python.vim | 2 +- runtime/autoload/provider/python3.vim | 2 +- runtime/autoload/provider/pythonx.vim | 5 ++--- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index b0791eb19d..05c024f585 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -33,7 +33,7 @@ function! health#check(plugin_names) abort setlocal wrap breakindent setlocal filetype=markdown setlocal conceallevel=2 concealcursor=nc - setlocal keywordprg=:help + setlocal keywordprg=:help iskeyword=@,48-57,_,192-255,-,# call s:enhance_syntax() if empty(healthchecks) @@ -88,7 +88,7 @@ endfunction " Changes ':h clipboard' to ':help |clipboard|'. function! s:help_to_link(s) abort - return substitute(a:s, '\v[''"]?:h%[elp] ([^''"]+)[''"]?', '":help |\1|"', 'g') + return substitute(a:s, '\v:h%[elp] ([^|][^''"\r\n]+)', ':help |\1|', 'g') endfunction " Format a message for a specific report item diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 9f3f492ef6..9db209849b 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -117,7 +117,7 @@ function! s:check_clipboard() abort if empty(clipboard_tool) call health#report_warn( \ "No clipboard tool found. Clipboard registers will not work.", - \ ['See ":help clipboard".']) + \ [':help clipboard']) else call health#report_ok('Clipboard tool found: '. clipboard_tool) endif diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 1bcc1dea74..a3210046b1 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -86,7 +86,7 @@ function! provider#clipboard#Executable() abort return 'win32yank' endif - let s:err = 'clipboard: No clipboard tool available. See :help clipboard' + let s:err = 'clipboard: No clipboard tool available. :help clipboard' return '' endfunction diff --git a/runtime/autoload/provider/python.vim b/runtime/autoload/provider/python.vim index b99a046375..81fe194cb9 100644 --- a/runtime/autoload/provider/python.vim +++ b/runtime/autoload/provider/python.vim @@ -1,5 +1,5 @@ " The Python provider uses a Python host to emulate an environment for running -" python-vim plugins. See ":help provider". +" python-vim plugins. :help provider " " Associating the plugin with the Python host is the first step because plugins " will be passed as command-line arguments diff --git a/runtime/autoload/provider/python3.vim b/runtime/autoload/provider/python3.vim index 4f47a03a9b..0c3b75b73d 100644 --- a/runtime/autoload/provider/python3.vim +++ b/runtime/autoload/provider/python3.vim @@ -1,5 +1,5 @@ " The Python3 provider uses a Python3 host to emulate an environment for running -" python3 plugins. See ":help provider". +" python3 plugins. :help provider " " Associating the plugin with the Python3 host is the first step because " plugins will be passed as command-line arguments diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index 08a0f39b01..2f64c22c71 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -112,15 +112,14 @@ function! s:check_interpreter(prog, major_ver) abort endif if v:shell_error == 2 - return [0, prog_path . ' does not have the neovim module installed. ' - \ . 'See ":help provider-python".'] + return [0, prog_path.' does not have the "neovim" module. :help provider-python'] elseif v:shell_error == 127 " This can happen with pyenv's shims. return [0, prog_path . ' does not exist: ' . prog_ver] elseif v:shell_error return [0, 'Checking ' . prog_path . ' caused an unknown error. ' \ . '(' . v:shell_error . ', output: ' . prog_ver . ')' - \ . ' Please report this at github.com/neovim/neovim.'] + \ . ' Report this at https://github.com/neovim/neovim'] endif return [1, ''] From 29ab8c1ae2b6a13f11f80c9485fa2720f3365b8b Mon Sep 17 00:00:00 2001 From: Nikolai Aleksandrovich Pavlov Date: Fri, 7 Apr 2017 01:31:39 +0300 Subject: [PATCH 114/257] doc/CONTRIBUTING.md: Recommend merge-based workflow. References #6435 --- CONTRIBUTING.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7389ece75..52584c25d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,12 +31,22 @@ Pull requests ("PRs") - Avoid cosmetic changes to unrelated files in the same commit: extra noise makes reviews more difficult. - Use a [feature branch][git-feature-branch] instead of the master branch. -- [Rebase your feature branch][git-rebasing] onto (upstream) master before - opening the PR. -- After addressing the review comments, it's fine to rebase and force-push to - your review. -- Try to [tidy your history][git-history-rewriting]: combine related commits - with interactive rebasing, separate monolithic commits, etc. +- Edit history with `ri` alias: add + + [alias] + ri = "!sh -c 't=\"${1:-master}\" ; s=\"${2:-HEAD}\" ; if git merge-base --is-ancestor \"$t\" \"$s\" ; then o=\"$t\" ; else mb=\"$(git merge-base \"$t\" \"$s\")\" ; if test \"x$mb\" = x ; then o=\"$t\" ; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\" ; if test \"x$lm\" = x ; then o=\"$mb\" ; else o=\"$lm\" ; fi ; fi ; fi ; [ $# -gt 0 ] && shift ; [ $# -gt 0 ] && shift ; git rebase --interactive \"$o\" \"$@\"' -" + + to your `~/.gitconfig`. + + This avoids unnecessary rebases yet still allows you to combine related + commits, separate monolithic commits, etc. +- Rebase relatively small PRs, using `exec make -C build unittest` after + each pick/edit/reword, after all following squash/fixup. +- Merge in `master` of bigger PRs. Do not do excessive merging: merge + in case of merge conflicts or when master introduces changes which break + your PR. + + Do not edit commits which come before the merge commit. ### Stages: WIP, RFC, RDY From 6bc6d94ec8c8f7e291454ebc888c0fa8435908c8 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 17 Apr 2017 23:52:38 +0200 Subject: [PATCH 115/257] doc: api-contract, CONTRIBUTING.md --- CONTRIBUTING.md | 48 ++++++++++++++++++-------------- runtime/doc/api.txt | 25 +++++++++++++++-- runtime/doc/develop.txt | 61 ++++++++++++++++++++++++----------------- runtime/doc/map.txt | 51 ++++++---------------------------- runtime/doc/syntax.txt | 5 +--- 5 files changed, 96 insertions(+), 94 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 52584c25d8..f442ceb672 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,10 +6,15 @@ Getting started If you want to help but don't know where to start, here are some low-risk/isolated tasks: -- Help us [review pull requests](#reviewing)! - Merge a [Vim patch]. - Try a [complexity:low] issue. -- Fix [clang-scan] or [coverity](#coverity) warnings. +- Fix [clang-scan], [coverity](#coverity), and [PVS](#pvs-studio) warnings. + +Developer guidelines +-------------------- + +- Nvim developers should read `:help dev-help`. +- External UI developers should read `:help dev-ui`. Reporting problems ------------------ @@ -26,27 +31,25 @@ Reporting problems Pull requests ("PRs") --------------------- -- To avoid duplicate work, you may want to create a `[WIP]` pull request so that - others know what you are working on. -- Avoid cosmetic changes to unrelated files in the same commit: extra noise - makes reviews more difficult. +- To avoid duplicate work, create a `[WIP]` pull request as soon as possible. +- Avoid cosmetic changes to unrelated files in the same commit: noise makes + reviews take longer. - Use a [feature branch][git-feature-branch] instead of the master branch. -- Edit history with `ri` alias: add - - [alias] - ri = "!sh -c 't=\"${1:-master}\" ; s=\"${2:-HEAD}\" ; if git merge-base --is-ancestor \"$t\" \"$s\" ; then o=\"$t\" ; else mb=\"$(git merge-base \"$t\" \"$s\")\" ; if test \"x$mb\" = x ; then o=\"$t\" ; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\" ; if test \"x$lm\" = x ; then o=\"$mb\" ; else o=\"$lm\" ; fi ; fi ; fi ; [ $# -gt 0 ] && shift ; [ $# -gt 0 ] && shift ; git rebase --interactive \"$o\" \"$@\"' -" - - to your `~/.gitconfig`. - +- Use a **rebase workflow** for small PRs. + - After addressing review comments, it's fine to rebase and force-push. +- Use a **merge workflow** for big, high-risk PRs. + - Merge `master` into your PR when there are conflicts or when master + introduces breaking changes. + - Use the `ri` git alias: + ``` + [alias] + ri = "!sh -c 't=\"${1:-master}\" ; s=\"${2:-HEAD}\" ; if git merge-base --is-ancestor \"$t\" \"$s\" ; then o=\"$t\" ; else mb=\"$(git merge-base \"$t\" \"$s\")\" ; if test \"x$mb\" = x ; then o=\"$t\" ; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\" ; if test \"x$lm\" = x ; then o=\"$mb\" ; else o=\"$lm\" ; fi ; fi ; fi ; [ $# -gt 0 ] && shift ; [ $# -gt 0 ] && shift ; git rebase --interactive \"$o\" \"$@\"' -" + ``` This avoids unnecessary rebases yet still allows you to combine related commits, separate monolithic commits, etc. -- Rebase relatively small PRs, using `exec make -C build unittest` after - each pick/edit/reword, after all following squash/fixup. -- Merge in `master` of bigger PRs. Do not do excessive merging: merge - in case of merge conflicts or when master introduces changes which break - your PR. - - Do not edit commits which come before the merge commit. + - Do not edit commits that come before the merge commit. +- During a squash/fixup, use `exec make -C build unittest` between each + pick/edit/reword. ### Stages: WIP, RFC, RDY @@ -121,6 +124,11 @@ Use this commit-message format for coverity fixes: where `` is the Coverity ID (CID). For example see [#804](https://github.com/neovim/neovim/pull/804). +### PVS-Studio + +Run `scripts/pvscheck.sh` to check the codebase with [PVS +Studio](https://www.viva64.com/en/pvs-studio/). + Reviewing --------- diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 2bcc996d8b..a118690876 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -9,8 +9,7 @@ Nvim API *API* *api* Nvim exposes a powerful API that can be used by plugins and external processes via |msgpack-rpc|, Lua and VimL (|eval-api|). -Nvim can also be embedded in C applications as libnvim, so the application -can control the embedded instance by calling the C API directly. +Applications can also embed libnvim to work with the C API directly. ============================================================================== API Types *api-types* @@ -54,6 +53,28 @@ error_types Possible error types returned by API functions External programs ("clients") can use the metadata to discover the |rpc-api|. +============================================================================== +API contract *api-contract* + +The API is made of functions and events. Clients call functions like those +described at |api-global|, and may "attach" in order to receive rich events, +described at |rpc-remote-ui|. + +As Nvim develops, its API may change only according the following "contract": + +- New functions and events may be added. + - Any such extensions are OPTIONAL: old clients may ignore them. +- Function signatures will NOT CHANGE (after release). + - Functions introduced in the development (unreleased) version MAY CHANGE. + (Clients can dynamically check `api_prerelease`, etc. |api-metadata|) +- Event parameters will not be removed or reordered (after release). +- Events may be EXTENDED: new parameters may be added. +- New items may be ADDED to map/list parameters/results of functions and + events. + - Any such new items are OPTIONAL: old clients may ignore them. + - Existing items will not be removed (after release). +- Deprecated functions will not be removed until Nvim version 2.0 + ============================================================================== Buffer highlighting *api-highlights* diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index 76ccc42546..0e909aac65 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -6,22 +6,20 @@ Development of Nvim. *development* -1. Design goals |design-goals| -2. Design decisions |design-decisions| +1. Design goals |design-goals| +2. Developer guidelines |dev-help| Nvim is open source software. Everybody is encouraged to contribute. https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md -See src/nvim/README.md for a high-level overview of the source code: - https://github.com/neovim/neovim/blob/master/src/nvim/README.md +See src/nvim/README.md for an overview of the source code. ============================================================================== -1. Design goals *design-goals* +Design goals *design-goals* Most important things come first (roughly). -Note that quite a few items are contradicting. This is intentional. A -balance must be found between them. +Note that some items conflict; this is intentional. A balance must be found. NVIM IS... IMPROVED *design-improved* @@ -41,7 +39,7 @@ completely different editor. Extensions are done with a "Vi spirit". - There are many first-time and inexperienced Vim users. Make it easy for them to start using Vim and learn more over time. - There is no limit to the features that can be added. Selecting new features - is one based on (1) what users ask for, (2) how much effort it takes to + is based on (1) what users ask for, (2) how much effort it takes to implement and (3) someone actually implementing it. @@ -56,20 +54,14 @@ Vim tries to help as many users on as many platforms as possible. - Support many compilers and libraries. Not everybody is able or allowed to install another compiler or GUI library. - People switch from one platform to another, and from GUI to terminal - version. Features should be present in all versions, or at least in as many - as possible with a reasonable effort. Try to avoid that users must switch - between platforms to accomplish their work efficiently. -- That a feature is not possible on some platforms, or only possible on one - platform, does not mean it cannot be implemented. [This intentionally - contradicts the previous item, these two must be balanced.] + version. Features should be present in all versions. NVIM IS... WELL DOCUMENTED *design-documented* - A feature that isn't documented is a useless feature. A patch for a new feature must include the documentation. -- Documentation should be comprehensive and understandable. Using examples is - recommended. +- Documentation should be comprehensive and understandable. Use examples. - Don't make the text unnecessarily long. Less documentation means that an item is easier to find. - Do not prefix doc-tags with "nvim-". Use |vim_diff.txt| to document @@ -77,12 +69,12 @@ NVIM IS... WELL DOCUMENTED *design-documented* to mark a specific feature. No other distinction is necessary. - If a feature is removed, delete its doc entry and move its tag to |vim_diff.txt|. +- Move deprecated features to |deprecated.txt|. NVIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size* -Using Vim must not be a big attack on system resources. Keep it small and -fast. +Keep Nvim small and fast. - Computers are becoming faster and bigger each year. Vim can grow too, but no faster than computers are growing. Keep Vim usable on older systems. - Many users start Vim from a shell very often. Startup time must be short. @@ -118,13 +110,14 @@ NVIM IS... NOT *design-not* Nvim is not an operating system; instead it should be composed with other tools or hosted as a component. Marvim once said: "Unlike Emacs, Nvim does not -include the kitchen sink... but you can use it for plumbing." +include the kitchen sink... but it's good for plumbing." ============================================================================== -2. Design decisions *design-decisions* +Developer guidelines *dev-help* -JARGON *dev-jargon* + +JARGON *dev-jargon* API client ~ All external UIs and remote plugins (as opposed to regular Vim plugins) are @@ -150,15 +143,14 @@ the xterm window, a window inside Vim to view a buffer. To avoid confusion, other items that are sometimes called window have been given another name. Here is an overview of the related items: -screen The whole display. For the GUI it's something like 1024x768 - pixels. The Vim shell can use the whole screen or part of it. +screen The whole display. shell The Vim application. This can cover the whole screen (e.g., when running in a console) or part of it (xterm or GUI). window View on a buffer. There can be several windows in Vim, together with the command line, menubar, toolbar, etc. they fit in the shell. -PROVIDERS *dev-provider* +PROVIDERS *dev-provider* A goal of Nvim is to allow extension of the editor without special knowledge in the core. But some Vim components are too tightly coupled; in those cases @@ -202,7 +194,7 @@ Python host isn't installed then the plugin will "think" it is running in a Vim compiled without the |+python| feature. -API *dev-api* +API *dev-api* Use this pattern to name new API functions: nvim_{thing}_{action}_{arbitrary-qualifiers} @@ -233,4 +225,23 @@ _not_ a Buffer). The common {action} "list" indicates that it lists all bufs (plural) in the global context. +EXTERNAL UI *dev-ui* + +External UIs should be aware of the |api-contract|. In particular, future +versions of Nvim may add optional, new items to existing events. The API is +strongly backwards-compatible, but clients must not break if new fields are +added to existing events. + +External UIs are expected to implement some common features. + +- Users may want to configure UI-specific options. The UI should publish the + |GUIEnter| autocmd after attaching to Nvim: > + doautocmd GUIEnter +- Options can be monitored for changes by the |OptionSet| autocmd. E.g. if the + user sets the 'guifont' option, this autocmd notifies channel 42: > + autocmd OptionSet guifont call rpcnotify(42, 'option-changed', 'guifont', &guifont) +- cursor-shape change: 'guicursor' properties are sent in the mode_info_set UI + event. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index db349eca71..3ba1ce1f17 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -720,9 +720,6 @@ special key: > Don't type a real , Vim will recognize the key code and replace it with anyway. -Another problem may be that when keeping ALT or Meta pressed the terminal -prepends ESC instead of setting the 8th bit. See |:map-alt-keys|. - *recursive_mapping* If you include the {lhs} in the {rhs} you have a recursive mapping. When {lhs} is typed, it will be replaced with {rhs}. When the {lhs} which is @@ -762,46 +759,14 @@ in the original Vi, you would get back the text before the first undo). 1.10 MAPPING ALT-KEYS *:map-alt-keys* -In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should -always work. But in a terminal Vim gets a sequence of bytes and has to figure -out whether ALT was pressed or not. - -By default Vim assumes that pressing the ALT key sets the 8th bit of a typed -character. Most decent terminals can work that way, such as xterm, aterm and -rxvt. If your mappings don't work it might be that the terminal is -prefixing the character with an ESC character. But you can just as well type -ESC before a character, thus Vim doesn't know what happened (except for -checking the delay between characters, which is not reliable). - -As of this writing, some mainstream terminals like gnome-terminal and konsole -use the ESC prefix. There doesn't appear a way to have them use the 8th bit -instead. Xterm should work well by default. Aterm and rxvt should work well -when started with the "--meta8" argument. You can also tweak resources like -"metaSendsEscape", "eightBitInput" and "eightBitOutput". - -On the Linux console, this behavior can be toggled with the "setmetamode" -command. Bear in mind that not using an ESC prefix could get you in trouble -with other programs. You should make sure that bash has the "convert-meta" -option set to "on" in order for your Meta keybindings to still work on it -(it's the default readline behavior, unless changed by specific system -configuration). For that, you can add the line: > - - set convert-meta on - -to your ~/.inputrc file. If you're creating the file, you might want to use: > - - $include /etc/inputrc - -as the first line, if that file exists on your system, to keep global options. -This may cause a problem for entering special characters, such as the umlaut. -Then you should use CTRL-V before that character. - -Bear in mind that convert-meta has been reported to have troubles when used in -UTF-8 locales. On terminals like xterm, the "metaSendsEscape" resource can be -toggled on the fly through the "Main Options" menu, by pressing Ctrl-LeftClick -on the terminal; that's a good last resource in case you want to send ESC when -using other applications but not when inside VIM. - +In the GUI Nvim handles the |ALT| key itself, thus mapping keys with ALT +should always work. But in a terminal Nvim gets a sequence of bytes and has +to figure out whether ALT was pressed. Terminals may use ESC to indicate that +ALT was pressed. If ESC is followed by a {key} within 'ttimeoutlen' +milliseconds, the ESC is interpreted as: + +otherwise it is interpreted as two key presses: + {key} 1.11 MAPPING AN OPERATOR *:map-operator* diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index f7c2c0e120..50208640ce 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -4803,10 +4803,7 @@ guisp={color-name} *highlight-guisp* Black White Orange Purple Violet - In the Win32 GUI version, additional system colors are available. See - |win32-colors|. - - You can also specify a color by its Red, Green and Blue values. + You can also specify a color by its RGB (red, green, blue) values. The format is "#rrggbb", where "rr" is the Red value "gg" is the Green value From 38b2bc9a883d88b5257673048f687c5ac1fe7446 Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 19 Apr 2017 18:55:32 +0300 Subject: [PATCH 116/257] scripts: Make pvs do not patch separate directory, add patch mode --- scripts/pvscheck.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index 2e4f990693..faa6f92c9a 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -12,20 +12,24 @@ help() { echo 'Usage:' echo ' pvscheck.sh [target-directory [branch]]' echo ' pvscheck.sh [--recheck] [target-directory]' + echo ' pvscheck.sh --patch' echo - echo ' --recheck: run analysis on a prepared target directory' + echo ' --patch: patch sources in the current directory.' + echo ' Does not run analysis.' echo - echo ' target-directory: Directory where build should occur' + echo ' --recheck: run analysis on a prepared target directory.' + echo + echo ' target-directory: Directory where build should occur.' echo ' Default: ../neovim-pvs' echo - echo ' branch: Branch to check' - echo ' Default: master' + echo ' branch: Branch to check.' + echo ' Default: master.' } get_pvs_comment() { cat > pvs-comment << EOF -// This is an open source non-commercial project. Dear PVS-Studio, please check it. -// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com EOF } @@ -75,6 +79,8 @@ patch_sources() { build/src/nvim/auto build/config \ -name '*.[ch]' -not -name '*.test-include.c' \ -exec /bin/sh -c "$sh_script" - '{}' \; + + rm pvs-comment } run_analysis() { @@ -103,8 +109,6 @@ do_check() { create_compile_commands - patch_sources - run_analysis } @@ -128,6 +132,11 @@ main() { set -x + if test "x$1" = "x--patch" ; then + patch_sources + exit $? + fi + local recheck= if test "x$1" = "x--recheck" ; then recheck=1 From 9fd048d901e1191dc56066e4be70014c3387c9fe Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 19 Apr 2017 19:04:00 +0300 Subject: [PATCH 117/257] scripts: Do not patch already patched sources in patch mode Also do not patch header files, that is not needed. --- scripts/pvscheck.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index faa6f92c9a..e2d2a2eada 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -15,6 +15,7 @@ help() { echo ' pvscheck.sh --patch' echo echo ' --patch: patch sources in the current directory.' + echo ' Does not patch already patched files.' echo ' Does not run analysis.' echo echo ' --recheck: run analysis on a prepared target directory.' @@ -66,18 +67,22 @@ patch_sources() { get_pvs_comment local sh_script=' - cat pvs-comment "$1" > "$1.tmp" - mv "$1.tmp" "$1" + pvs_comment="$(cat pvs-comment ; echo -n EOS)" + filehead="$(head -c $(( ${#pvs_comment} - 3 )) "$1" ; echo -n EOS)" + if test "x$filehead" != "x$pvs_comment" ; then + cat pvs-comment "$1" > "$1.tmp" + mv "$1.tmp" "$1" + fi ' find \ src/nvim test/functional/fixtures test/unit/fixtures \ - -name '*.[ch]' \ + -name '*.c' \ -exec /bin/sh -c "$sh_script" - '{}' \; find \ build/src/nvim/auto build/config \ - -name '*.[ch]' -not -name '*.test-include.c' \ + -name '*.c' -not -name '*.test-include.c' \ -exec /bin/sh -c "$sh_script" - '{}' \; rm pvs-comment From 4555bf9e7f8829053e3a687f814a2036d72ce0e1 Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 19 Apr 2017 19:08:27 +0300 Subject: [PATCH 118/257] scripts: Allow patching only build files --- scripts/pvscheck.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index e2d2a2eada..5020d5f86a 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -12,12 +12,14 @@ help() { echo 'Usage:' echo ' pvscheck.sh [target-directory [branch]]' echo ' pvscheck.sh [--recheck] [target-directory]' - echo ' pvscheck.sh --patch' + echo ' pvscheck.sh --patch [--only-build]' echo echo ' --patch: patch sources in the current directory.' echo ' Does not patch already patched files.' echo ' Does not run analysis.' echo + echo ' --only-build: Only patch files in ./build directory.' + echo echo ' --recheck: run analysis on a prepared target directory.' echo echo ' target-directory: Directory where build should occur.' @@ -75,10 +77,12 @@ patch_sources() { fi ' - find \ - src/nvim test/functional/fixtures test/unit/fixtures \ - -name '*.c' \ - -exec /bin/sh -c "$sh_script" - '{}' \; + if test "x$1" != "x--only-build" ; then + find \ + src/nvim test/functional/fixtures test/unit/fixtures \ + -name '*.c' \ + -exec /bin/sh -c "$sh_script" - '{}' \; + fi find \ build/src/nvim/auto build/config \ @@ -138,7 +142,13 @@ main() { set -x if test "x$1" = "x--patch" ; then - patch_sources + shift + if test "x$1" = "x--only-build" ; then + shift + patch_sources --only-build + else + patch_sources + fi exit $? fi From 3351016dcde8f8d400c247baaca4a5575d94535d Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 19 Apr 2017 19:11:37 +0300 Subject: [PATCH 119/257] scripts: Add newline after the comment --- scripts/pvscheck.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh index 5020d5f86a..32d63646aa 100755 --- a/scripts/pvscheck.sh +++ b/scripts/pvscheck.sh @@ -33,6 +33,7 @@ get_pvs_comment() { cat > pvs-comment << EOF // This is an open source non-commercial project. Dear PVS-Studio, please check // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + EOF } From c2f3e361c52ec4e7149ea1d8c6a1202e0873da8e Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 19 Apr 2017 19:11:50 +0300 Subject: [PATCH 120/257] *: Add comment to all C files --- src/nvim/api/buffer.c | 3 +++ src/nvim/api/private/dispatch.c | 3 +++ src/nvim/api/private/handle.c | 3 +++ src/nvim/api/private/helpers.c | 3 +++ src/nvim/api/tabpage.c | 3 +++ src/nvim/api/ui.c | 3 +++ src/nvim/api/vim.c | 3 +++ src/nvim/api/window.c | 3 +++ src/nvim/arabic.c | 3 +++ src/nvim/buffer.c | 3 +++ src/nvim/charset.c | 3 +++ src/nvim/cursor.c | 3 +++ src/nvim/cursor_shape.c | 3 +++ src/nvim/diff.c | 3 +++ src/nvim/digraph.c | 3 +++ src/nvim/edit.c | 3 +++ src/nvim/eval.c | 3 +++ src/nvim/eval/decode.c | 3 +++ src/nvim/eval/encode.c | 3 +++ src/nvim/eval/executor.c | 3 +++ src/nvim/eval/gc.c | 3 +++ src/nvim/eval/typval.c | 3 +++ src/nvim/event/libuv_process.c | 3 +++ src/nvim/event/loop.c | 3 +++ src/nvim/event/multiqueue.c | 3 +++ src/nvim/event/process.c | 3 +++ src/nvim/event/rstream.c | 3 +++ src/nvim/event/signal.c | 3 +++ src/nvim/event/socket.c | 3 +++ src/nvim/event/stream.c | 3 +++ src/nvim/event/time.c | 3 +++ src/nvim/event/wstream.c | 3 +++ src/nvim/ex_cmds.c | 3 +++ src/nvim/ex_cmds2.c | 3 +++ src/nvim/ex_docmd.c | 3 +++ src/nvim/ex_eval.c | 3 +++ src/nvim/ex_getln.c | 3 +++ src/nvim/farsi.c | 3 +++ src/nvim/file_search.c | 3 +++ src/nvim/fileio.c | 3 +++ src/nvim/fold.c | 3 +++ src/nvim/garray.c | 3 +++ src/nvim/getchar.c | 3 +++ src/nvim/hardcopy.c | 3 +++ src/nvim/hashtab.c | 3 +++ src/nvim/if_cscope.c | 3 +++ src/nvim/indent.c | 3 +++ src/nvim/indent_c.c | 3 +++ src/nvim/keymap.c | 3 +++ src/nvim/log.c | 3 +++ src/nvim/main.c | 3 +++ src/nvim/map.c | 3 +++ src/nvim/mark.c | 3 +++ src/nvim/mbyte.c | 3 +++ src/nvim/memfile.c | 3 +++ src/nvim/memline.c | 3 +++ src/nvim/memory.c | 3 +++ src/nvim/menu.c | 3 +++ src/nvim/message.c | 3 +++ src/nvim/misc1.c | 3 +++ src/nvim/mouse.c | 3 +++ src/nvim/move.c | 3 +++ src/nvim/msgpack_rpc/channel.c | 3 +++ src/nvim/msgpack_rpc/helpers.c | 3 +++ src/nvim/msgpack_rpc/server.c | 3 +++ src/nvim/normal.c | 3 +++ src/nvim/ops.c | 3 +++ src/nvim/option.c | 3 +++ src/nvim/os/dl.c | 3 +++ src/nvim/os/env.c | 3 +++ src/nvim/os/fileio.c | 3 +++ src/nvim/os/fs.c | 3 +++ src/nvim/os/input.c | 3 +++ src/nvim/os/mem.c | 3 +++ src/nvim/os/pty_process_unix.c | 3 +++ src/nvim/os/shell.c | 3 +++ src/nvim/os/signal.c | 3 +++ src/nvim/os/stdpaths.c | 3 +++ src/nvim/os/time.c | 3 +++ src/nvim/os/users.c | 3 +++ src/nvim/os_unix.c | 3 +++ src/nvim/path.c | 3 +++ src/nvim/popupmnu.c | 3 +++ src/nvim/profile.c | 3 +++ src/nvim/quickfix.c | 3 +++ src/nvim/rbuffer.c | 3 +++ src/nvim/regexp.c | 3 +++ src/nvim/regexp_nfa.c | 3 +++ src/nvim/screen.c | 3 +++ src/nvim/search.c | 3 +++ src/nvim/sha256.c | 3 +++ src/nvim/shada.c | 3 +++ src/nvim/spell.c | 3 +++ src/nvim/spellfile.c | 3 +++ src/nvim/state.c | 3 +++ src/nvim/strings.c | 3 +++ src/nvim/syntax.c | 3 +++ src/nvim/tag.c | 3 +++ src/nvim/terminal.c | 3 +++ src/nvim/testdir/samples/memfile_test.c | 3 +++ src/nvim/tui/input.c | 3 +++ src/nvim/tui/tui.c | 3 +++ src/nvim/ugrid.c | 3 +++ src/nvim/ui.c | 3 +++ src/nvim/ui_bridge.c | 3 +++ src/nvim/undo.c | 3 +++ src/nvim/version.c | 3 +++ src/nvim/window.c | 3 +++ test/functional/fixtures/printargs-test.c | 3 +++ test/functional/fixtures/shell-test.c | 3 +++ test/functional/fixtures/tty-test.c | 3 +++ test/unit/fixtures/multiqueue.c | 3 +++ test/unit/fixtures/rbuffer.c | 3 +++ 113 files changed, 339 insertions(+) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 26f9a6f592..1b3592679b 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // Much of this code was adapted from 'if_py_both.h' from the original // vim source #include diff --git a/src/nvim/api/private/dispatch.c b/src/nvim/api/private/dispatch.c index 9b3bcc380a..f8eebcdb10 100644 --- a/src/nvim/api/private/dispatch.c +++ b/src/nvim/api/private/dispatch.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/api/private/handle.c b/src/nvim/api/private/handle.c index acb0fb332a..eb96192af2 100644 --- a/src/nvim/api/private/handle.c +++ b/src/nvim/api/private/handle.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index fe15b28041..5877b848fc 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/api/tabpage.c b/src/nvim/api/tabpage.c index 0f0c33f621..29592408fc 100644 --- a/src/nvim/api/tabpage.c +++ b/src/nvim/api/tabpage.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index de60339e5f..3cc2870792 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 6926436d2f..e5ef4a35c1 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index 3c564ada99..e1bb70ee0d 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/arabic.c b/src/nvim/arabic.c index db97bd9dc4..1ef51d2a2a 100644 --- a/src/nvim/arabic.c +++ b/src/nvim/arabic.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file arabic.c /// /// Functions for Arabic language. diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 1f44e1adb0..46f2cdac79 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * buffer.c: functions for dealing with the buffer structure */ diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 3037cfe669..ee58e0af91 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file charset.c /// /// Code related to character sets. diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index 45abd314fc..60002f3cea 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 34ee53bf75..24a5672d0f 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include "nvim/vim.h" diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 49574fbbfc..0bd3f59cf2 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file diff.c /// /// Code for diff'ing two, three or four buffers. diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 66fb525920..32e71f61f7 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file digraph.c /// /// code for digraphs diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 51d0847bc7..678fa851eb 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * edit.c: functions for Insert mode */ diff --git a/src/nvim/eval.c b/src/nvim/eval.c index dcbd7ab152..16f054957f 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * eval.c: Expression evaluation. */ diff --git a/src/nvim/eval/decode.c b/src/nvim/eval/decode.c index a7dc6b205d..8905317f15 100644 --- a/src/nvim/eval/decode.c +++ b/src/nvim/eval/decode.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c index d74913a481..e32f893faa 100644 --- a/src/nvim/eval/encode.c +++ b/src/nvim/eval/encode.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file encode.c /// /// File containing functions for encoding and decoding VimL values. diff --git a/src/nvim/eval/executor.c b/src/nvim/eval/executor.c index ec6c86ac64..91bb61323f 100644 --- a/src/nvim/eval/executor.c +++ b/src/nvim/eval/executor.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include "nvim/eval/typval.h" #include "nvim/eval/executor.h" #include "nvim/eval.h" diff --git a/src/nvim/eval/gc.c b/src/nvim/eval/gc.c index 5ce52ddd70..2bbf78d827 100644 --- a/src/nvim/eval/gc.c +++ b/src/nvim/eval/gc.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include "nvim/eval/typval.h" #include "nvim/eval/gc.h" diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 70ec3dfe39..a57dd42f6e 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/event/libuv_process.c b/src/nvim/event/libuv_process.c index f5a41d151b..3116adbde8 100644 --- a/src/nvim/event/libuv_process.c +++ b/src/nvim/event/libuv_process.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c index 0e1775d01b..6963978581 100644 --- a/src/nvim/event/loop.c +++ b/src/nvim/event/loop.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c index 79b4dd9458..a17bae31e3 100644 --- a/src/nvim/event/multiqueue.c +++ b/src/nvim/event/multiqueue.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // Multi-level queue for selective async event processing. // Not threadsafe; access must be synchronized externally. // diff --git a/src/nvim/event/process.c b/src/nvim/event/process.c index 4429a65f92..ffda10a494 100644 --- a/src/nvim/event/process.c +++ b/src/nvim/event/process.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/event/rstream.c b/src/nvim/event/rstream.c index 2737dad305..854af474b2 100644 --- a/src/nvim/event/rstream.c +++ b/src/nvim/event/rstream.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/event/signal.c b/src/nvim/event/signal.c index 11ce15a882..fec46da4ff 100644 --- a/src/nvim/event/signal.c +++ b/src/nvim/event/signal.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include "nvim/event/loop.h" diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index 8f9327f3d4..e536d79a2a 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c index 26083c20f4..860a957b3e 100644 --- a/src/nvim/event/stream.c +++ b/src/nvim/event/stream.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/event/time.c b/src/nvim/event/time.c index 77260546db..80289c27d1 100644 --- a/src/nvim/event/time.c +++ b/src/nvim/event/time.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/event/wstream.c b/src/nvim/event/wstream.c index fc7aad8eb9..f453e5898d 100644 --- a/src/nvim/event/wstream.c +++ b/src/nvim/event/wstream.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 9a847a4c0a..117ef6a507 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * ex_cmds.c: some functions for command line commands */ diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index eeace789b2..a1a32d9f52 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file ex_cmds2.c /// /// Some more functions for command line commands diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 17b3b512ef..7568d71ac0 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * ex_docmd.c: functions for executing an Ex command line. */ diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index 65112c4dd8..5d664b94a8 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // TODO(ZyX-I): move to eval/executor /// @file ex_eval.c diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 0b6036ace9..1affdb2fe7 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * ex_getln.c: Functions for entering and editing an Ex command line. */ diff --git a/src/nvim/farsi.c b/src/nvim/farsi.c index 2d37d1284e..1053cb3ac2 100644 --- a/src/nvim/farsi.c +++ b/src/nvim/farsi.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file farsi.c /// /// Functions for Farsi language diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index db745bdd15..8094a1b266 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // File searching functions for 'path', 'tags' and 'cdpath' options. // // External visible functions: diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 74fa5aa1de..3e062aecc0 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * fileio.c: read from and write to a file */ diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 34db4d2171..2aa9a9cb5e 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // vim: set fdm=marker fdl=1 fdc=3 /* diff --git a/src/nvim/garray.c b/src/nvim/garray.c index 9ed3b901ef..2d2af54c95 100644 --- a/src/nvim/garray.c +++ b/src/nvim/garray.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file garray.c /// /// Functions for handling growing arrays. diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index e056ff488c..9d32df5a68 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * getchar.c * diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index b2cbe30a43..abc4773d84 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * hardcopy.c: printing to paper */ diff --git a/src/nvim/hashtab.c b/src/nvim/hashtab.c index 354c9718ba..3397788b00 100644 --- a/src/nvim/hashtab.c +++ b/src/nvim/hashtab.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file hashtab.c /// /// Handling of a hashtable with Vim-specific properties. diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c index b647b8146a..e1c7df9175 100644 --- a/src/nvim/if_cscope.c +++ b/src/nvim/if_cscope.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * CSCOPE support for Vim added by Andy Kahn * Ported to Win32 by Sergey Khorev diff --git a/src/nvim/indent.c b/src/nvim/indent.c index 8fbad38495..5471b41b2c 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/indent_c.c b/src/nvim/indent_c.c index 8f5547544d..4806f46705 100644 --- a/src/nvim/indent_c.c +++ b/src/nvim/indent_c.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c index 72b0d0aa40..0fe2ffe6f2 100644 --- a/src/nvim/keymap.c +++ b/src/nvim/keymap.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/log.c b/src/nvim/log.c index bbb4dfb944..d059e28d5d 100644 --- a/src/nvim/log.c +++ b/src/nvim/log.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/main.c b/src/nvim/main.c index 7ad42d6776..1095d4d3b5 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #define EXTERN #include #include diff --git a/src/nvim/map.c b/src/nvim/map.c index 73af487f90..54a9e559af 100644 --- a/src/nvim/map.c +++ b/src/nvim/map.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/mark.c b/src/nvim/mark.c index ae94ec7ecd..675fe4d57f 100644 --- a/src/nvim/mark.c +++ b/src/nvim/mark.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * mark.c: functions for setting marks and jumping to them */ diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index b18459a2b5..b21ec944c1 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// mbyte.c: Code specifically for handling multi-byte characters. /// Multibyte extensions partly by Sung-Hoon Baek /// diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c index 5d6639c4d0..efaf1f94c5 100644 --- a/src/nvim/memfile.c +++ b/src/nvim/memfile.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// An abstraction to handle blocks of memory which can be stored in a file. /// This is the implementation of a sort of virtual memory. /// diff --git a/src/nvim/memline.c b/src/nvim/memline.c index b31ca136dd..40a6761225 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* for debugging */ /* #define CHECK(c, s) if (c) EMSG(s) */ #define CHECK(c, s) diff --git a/src/nvim/memory.c b/src/nvim/memory.c index 85ec916ba0..0ee4776581 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // Various routines dealing with allocation and deallocation of memory. #include diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 529978e3f0..4e621b49c1 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * Code for menus. Used for the GUI and 'wildmenu'. * GUI/Motif support by Robert Webb diff --git a/src/nvim/message.c b/src/nvim/message.c index 42e1fd1cf9..146937c25a 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * message.c: functions for displaying messages on the command line */ diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 8d93505be3..6de74fddf2 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * misc1.c: functions that didn't seem to fit elsewhere */ diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 2ebe199f47..6088488388 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include "nvim/mouse.h" diff --git a/src/nvim/move.c b/src/nvim/move.c index 4feabf624b..d5be4cb8c3 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * move.c: Functions for moving the cursor and scrolling text. * diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 259dcc523c..b2c6ef852c 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index 4d8a9984e1..967ce31c1b 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/msgpack_rpc/server.c b/src/nvim/msgpack_rpc/server.c index d7c2926a0f..b6958088ca 100644 --- a/src/nvim/msgpack_rpc/server.c +++ b/src/nvim/msgpack_rpc/server.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 7f087dcd20..51da9429b6 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * normal.c: Contains the main routine for processing characters in command * mode. Communicates closely with the code in ops.c to handle diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 6ea3a45049..c77781b1d1 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * ops.c: implementation of various operators: op_shift, op_delete, op_tilde, * op_change, op_yank, do_put, do_join diff --git a/src/nvim/option.c b/src/nvim/option.c index 0070a0056d..bade4af8e3 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // User-settable options. Checklist for adding a new option: // - Put it in options.lua // - For a global option: Add a variable for it in option_defs.h. diff --git a/src/nvim/os/dl.c b/src/nvim/os/dl.c index fef02cc784..267cf5ae4b 100644 --- a/src/nvim/os/dl.c +++ b/src/nvim/os/dl.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// Functions for using external native libraries #include diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index f3187de182..72bd0bf788 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // Environment inspection #include diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c index 27eb448c3d..4309ac723c 100644 --- a/src/nvim/os/fileio.c +++ b/src/nvim/os/fileio.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file fileio.c /// /// Buffered reading/writing to a file. Unlike fileio.c this is not dealing with diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index c33e1140e8..c39ff5d358 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // fs.c -- filesystem access #include #include diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 5f0f2ec677..80457eaa14 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/os/mem.c b/src/nvim/os/mem.c index 871ece7a0e..eccb3c97e5 100644 --- a/src/nvim/os/mem.c +++ b/src/nvim/os/mem.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// Functions for accessing system memory information. #include diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c index 71a5e13de5..eb9335b03c 100644 --- a/src/nvim/os/pty_process_unix.c +++ b/src/nvim/os/pty_process_unix.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // Some of the code came from pangoterm and libuv #include #include diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 29c0431521..fc8ab7dc8f 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c index 1ac6d3f5e1..fd6d3b32e4 100644 --- a/src/nvim/os/signal.c +++ b/src/nvim/os/signal.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/os/stdpaths.c b/src/nvim/os/stdpaths.c index afb9bdec31..a41fb7c621 100644 --- a/src/nvim/os/stdpaths.c +++ b/src/nvim/os/stdpaths.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include "nvim/os/stdpaths_defs.h" diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c index 8ce2ecf4f4..c471352c02 100644 --- a/src/nvim/os/time.c +++ b/src/nvim/os/time.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c index 1c94ef0067..82bb918f70 100644 --- a/src/nvim/os/users.c +++ b/src/nvim/os/users.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // users.c -- operating system user information #include diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c index acd86f06dc..c5a42204be 100644 --- a/src/nvim/os_unix.c +++ b/src/nvim/os_unix.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * os_unix.c -- code for all flavors of Unix (BSD, SYSV, SVR4, POSIX, ...) * diff --git a/src/nvim/path.c b/src/nvim/path.c index 205fc2ed62..12952f49db 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 6346951c05..6e81c5a171 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file popupmnu.c /// /// Popup menu (PUM) diff --git a/src/nvim/profile.c b/src/nvim/profile.c index 97d7d77359..8fb8e92add 100644 --- a/src/nvim/profile.c +++ b/src/nvim/profile.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 1241841885..112498ae20 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * quickfix.c: functions for quickfix mode, using a file with error messages */ diff --git a/src/nvim/rbuffer.c b/src/nvim/rbuffer.c index 111af0d0fb..18d453cbe9 100644 --- a/src/nvim/rbuffer.c +++ b/src/nvim/rbuffer.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 7be89c2d7e..7a00ee27bb 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * Handling of regular expressions: vim_regcomp(), vim_regexec(), vim_regsub() * diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 506e6277e9..139772d51e 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * NFA regular expression implementation. * diff --git a/src/nvim/screen.c b/src/nvim/screen.c index a8993be4e5..818c2c577d 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * screen.c: code for displaying on the screen * diff --git a/src/nvim/search.c b/src/nvim/search.c index 91a558045f..c662e3ba40 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * search.c: code for normal mode searching commands */ diff --git a/src/nvim/sha256.c b/src/nvim/sha256.c index c72dafd08e..a2378cc202 100644 --- a/src/nvim/sha256.c +++ b/src/nvim/sha256.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file sha256.c /// /// FIPS-180-2 compliant SHA-256 implementation diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 8c5d6dff65..a6d8cb6563 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 17016be35f..25ae562e65 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // spell.c: code for spell checking // // See spellfile.c for the Vim spell file format. diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index 1da71dc4f9..d34d69b3a4 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // spellfile.c: code for reading and writing spell files. // // See spell.c for information about spell checking. diff --git a/src/nvim/state.c b/src/nvim/state.c index 44c6441e40..210708c3f4 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include "nvim/lib/kvec.h" diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 8a1a3beddd..743b43c2e5 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index d5ff3707e8..ce48547163 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * syntax.c: code for syntax highlighting */ diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 0c7244cbb3..b8b86bf979 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * Code to handle tags and the tag stack */ diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 85c4950b42..19b9bdc19f 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // VT220/xterm-like terminal emulator. // Powered by libvterm http://www.leonerd.org.uk/code/libvterm // diff --git a/src/nvim/testdir/samples/memfile_test.c b/src/nvim/testdir/samples/memfile_test.c index 0fa1e14c40..3c8f108255 100644 --- a/src/nvim/testdir/samples/memfile_test.c +++ b/src/nvim/testdir/samples/memfile_test.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index 8e5adb14f9..3f2ccd4746 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include "nvim/tui/input.h" #include "nvim/vim.h" diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index f34f5f1bc4..941fdb2570 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // Terminal UI functions. Invoked (by ui_bridge.c) on the TUI thread. #include diff --git a/src/nvim/ugrid.c b/src/nvim/ugrid.c index 127b18feb6..7a0a16687e 100644 --- a/src/nvim/ugrid.c +++ b/src/nvim/ugrid.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 28f71b7ef2..cfa186987c 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c index 9f780663ac..2c70b46c14 100644 --- a/src/nvim/ui_bridge.c +++ b/src/nvim/ui_bridge.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // UI wrapper that sends requests to the UI thread. // Used by the built-in TUI and libnvim-based UIs. diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 571ad7204f..290d5d7553 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * undo.c: multi level undo facility * diff --git a/src/nvim/version.c b/src/nvim/version.c index 9a5d7ce169..29ce741ba0 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file version.c /// /// Nvim was forked from Vim 7.4.160. diff --git a/src/nvim/window.c b/src/nvim/window.c index 6020159af9..60bba19b07 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/test/functional/fixtures/printargs-test.c b/test/functional/fixtures/printargs-test.c index 2c25cf8447..be54605817 100644 --- a/test/functional/fixtures/printargs-test.c +++ b/test/functional/fixtures/printargs-test.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include int main(int argc, char **argv) diff --git a/test/functional/fixtures/shell-test.c b/test/functional/fixtures/shell-test.c index 3f3976ece5..8dbec2aaee 100644 --- a/test/functional/fixtures/shell-test.c +++ b/test/functional/fixtures/shell-test.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/test/functional/fixtures/tty-test.c b/test/functional/fixtures/tty-test.c index 778e7f3cd3..3406b3a202 100644 --- a/test/functional/fixtures/tty-test.c +++ b/test/functional/fixtures/tty-test.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/test/unit/fixtures/multiqueue.c b/test/unit/fixtures/multiqueue.c index da63e55919..a8dca0a844 100644 --- a/test/unit/fixtures/multiqueue.c +++ b/test/unit/fixtures/multiqueue.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include "nvim/event/multiqueue.h" diff --git a/test/unit/fixtures/rbuffer.c b/test/unit/fixtures/rbuffer.c index d587d6b054..3f4062fa18 100644 --- a/test/unit/fixtures/rbuffer.c +++ b/test/unit/fixtures/rbuffer.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include "nvim/rbuffer.h" #include "rbuffer.h" From 5da8bb92fcdd6688c80e803cb557e7b24c6ee391 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 16 Apr 2017 16:52:47 +0200 Subject: [PATCH 121/257] vim-patch:dc1f1645cb49 Updated runtime files. https://github.com/vim/vim/commit/dc1f1645cb495fa6bfbe216d7359f23539a0e25d --- runtime/doc/eval.txt | 18 +++++++++--------- runtime/doc/index.txt | 2 +- runtime/doc/options.txt | 2 +- runtime/doc/syntax.txt | 2 +- runtime/doc/vi_diff.txt | 12 +++++++++++- runtime/indent/yaml.vim | 35 ++++++++++++++++++++++++++++++----- 6 files changed, 53 insertions(+), 18 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index b68f121b74..ca247f1c65 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1214,7 +1214,7 @@ The arguments are optional. Example: > *closure* Lambda expressions can access outer scope variables and arguments. This is often called a closure. Example where "i" a and "a:arg" are used in a lambda -while they exists in the function scope. They remain valid even after the +while they exist in the function scope. They remain valid even after the function returns: > :function Foo(arg) : let i = 3 @@ -1991,7 +1991,7 @@ cos({expr}) Float cosine of {expr} cosh({expr}) Float hyperbolic cosine of {expr} count({list}, {expr} [, {ic} [, {start}]]) Number count how many {expr} are in {list} -cscope_connection([{num} , {dbpath} [, {prepend}]]) +cscope_connection([{num}, {dbpath} [, {prepend}]]) Number checks existence of cscope connection cursor({lnum}, {col} [, {off}]) Number move cursor to {lnum}, {col}, {off} @@ -4278,7 +4278,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* The result is a String, which is the contents of register {regname}. Example: > :let cliptext = getreg('*') -< When {regname} was not set the result is a empty string. +< When {regname} was not set the result is an empty string. getreg('=') returns the last evaluated value of the expression register. (For use in maps.) @@ -4317,7 +4317,7 @@ gettabinfo([{arg}]) *gettabinfo()* nr tab page number. variables a reference to the dictionary with tabpage-local variables - windows List of window IDs in the tag page. + windows List of window IDs in the tab page. gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Get the value of a tab-local variable {varname} in tab page @@ -7404,7 +7404,7 @@ systemlist({cmd} [, {input} [, {keepempty}]]) *systemlist()* tabpagebuflist([{arg}]) *tabpagebuflist()* The result is a |List|, where each item is the number of the buffer associated with each window in the current tab page. - {arg} specifies the number of tab page to be used. When + {arg} specifies the number of the tab page to be used. When omitted the current tab page is used. When {arg} is invalid the number zero is returned. To get a list of all buffers in all tabs use this: > @@ -7553,9 +7553,9 @@ timer_info([{id}]) timer_pause({timer}, {paused}) *timer_pause()* Pause or unpause a timer. A paused timer does not invoke its - callback, while the time it would is not changed. Unpausing a - timer may cause the callback to be invoked almost immediately - if enough time has passed. + callback when its time expires. Unpausing a timer may cause + the callback to be invoked almost immediately if enough time + has passed. Pausing a timer is useful to avoid the callback to be called for a short time. @@ -7564,7 +7564,7 @@ timer_pause({timer}, {paused}) *timer_pause()* String, then the timer is paused, otherwise it is unpaused. See |non-zero-arg|. - *timer_start()* + *timer_start()* *timer* *timers* timer_start({time}, {callback} [, {options}]) Create a timer and return the timer ID. diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index bab15bcbb6..b06baa6497 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1202,7 +1202,7 @@ tag command action ~ |:display| :di[splay] display registers |:djump| :dj[ump] jump to #define |:dl| :dl short for |:delete| with the 'l' flag -|:dl| :del[ete]l short for |:delete| with the 'l' flag +|:del| :del[ete]l short for |:delete| with the 'l' flag |:dlist| :dli[st] list #defines |:doautocmd| :do[autocmd] apply autocommands to current buffer |:doautoall| :doautoa[ll] apply autocommands for all loaded buffers diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 9be7dae84d..e269fd30c5 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3499,7 +3499,7 @@ A jump table for the options with a short description can be found at |Q_op|. if you want to use Vim as a modeless editor. These Insert mode commands will be useful: - Use the cursor keys to move around. - - Use CTRL-O to execute one Normal mode command |i_CTRL-O|). When + - Use CTRL-O to execute one Normal mode command |i_CTRL-O|. When this is a mapping, it is executed as if 'insertmode' was off. Normal mode remains active until the mapping is finished. - Use CTRL-L to execute a number of Normal mode commands, then use diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 50208640ce..3b54f9f268 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -3739,7 +3739,7 @@ Whether or not it is actually concealed depends on the value of the 'conceallevel' option. The 'concealcursor' option is used to decide whether concealable items in the current line are displayed unconcealed to be able to edit the line. -Another way to conceal text with with |matchadd()|. +Another way to conceal text is with |matchadd()|. concealends *:syn-concealends* diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index 1a108caeaf..1fbd96f749 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -60,7 +60,7 @@ Support for different systems. - Windows (XP SP 2 or greater) - OS X -Multi level undo. |undo| +Multi level persistent undo. |undo| 'u' goes backward in time, 'CTRL-R' goes forward again. Set option 'undolevels' to the number of changes to be remembered (default 1000). Set 'undolevels' to 0 for a Vi-compatible one level undo. Set it to @@ -71,6 +71,9 @@ Multi level undo. |undo| create a branch in the undo tree. This means you can go back to any state of the text, there is no risk of a change causing text to be lost forever. |undo-tree| + The undo information is stored in a file when the 'undofile' option is + set. This means you can exit Vim, start Vim on a previously edited + file and undo changes that were made before exiting Vim. Graphical User Interface (GUI). |gui| Included support for GUI: menu's, mouse, scrollbars, etc. You can @@ -124,6 +127,13 @@ Plugins. |add-plugin| right directory. That's an easy way to start using Vim scripts written by others. Plugins can be for all kind of files, or specifically for a filetype. + Packages make this even easier. |packages| + +Asynchronous communication and timers. |job-control| |timer| + Vim can exchange messages with other processes in the background. + Vim can start a job, communicate with it and stop it. |job-control| + Timers can fire once or repeatedly and invoke a function to do any + work. |timer| Repeat a series of commands. |q| "q{c}" starts recording typed characters into named register {c}. diff --git a/runtime/indent/yaml.vim b/runtime/indent/yaml.vim index aa4906ce0a..3201462fbc 100644 --- a/runtime/indent/yaml.vim +++ b/runtime/indent/yaml.vim @@ -37,7 +37,7 @@ function s:FindPrevLessIndentedLine(lnum, ...) let curindent = a:0 ? a:1 : indent(a:lnum) while prevlnum \&& indent(prevlnum) >= curindent - \&& getline(prevlnum) !~# '^\s*#' + \&& getline(prevlnum) =~# '^\s*#' let prevlnum = prevnonblank(prevlnum-1) endwhile return prevlnum @@ -51,11 +51,33 @@ function s:FindPrevLEIndentedLineMatchingRegex(lnum, regex) return plilnum endfunction -let s:mapkeyregex='\v^\s*%(\''%([^'']|'''')*\'''. - \ '|\"%([^"\\]|\\.)*\"'. - \ '|%(%(\:\ )@!.)*)\:%(\ |$)' +let s:mapkeyregex='\v^\s*\#@!\S@=%(\''%([^'']|\''\'')*\'''. + \ '|\"%([^"\\]|\\.)*\"'. + \ '|%(%(\:\ )@!.)*)\:%(\ |$)' let s:liststartregex='\v^\s*%(\-%(\ |$))' +let s:c_ns_anchor_char = '\v%([\n\r\uFEFF \t,[\]{}]@!\p)' +let s:c_ns_anchor_name = s:c_ns_anchor_char.'+' +let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name + +let s:ns_word_char = '\v[[:alnum:]_\-]' +let s:ns_tag_char = '\v%(%\x\x|'.s:ns_word_char.'|[#/;?:@&=+$.~*''()])' +let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!' +let s:c_secondary_tag_handle = '\v\!\!' +let s:c_primary_tag_handle = '\v\!' +let s:c_tag_handle = '\v%('.s:c_named_tag_handle. + \ '|'.s:c_secondary_tag_handle. + \ '|'.s:c_primary_tag_handle.')' +let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+' +let s:c_non_specific_tag = '\v\!' +let s:ns_uri_char = '\v%(%\x\x|'.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])' +let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>' +let s:c_ns_tag_property = '\v'.s:c_verbatim_tag. + \ '\v|'.s:c_ns_shorthand_tag. + \ '\v|'.s:c_non_specific_tag + +let s:block_scalar_header = '\v[|>]%([+-]?[1-9]|[1-9]?[+-])?' + function GetYAMLIndent(lnum) if a:lnum == 1 || !prevnonblank(a:lnum-1) return 0 @@ -127,7 +149,10 @@ function GetYAMLIndent(lnum) " - List with " multiline scalar return previndent+2 - elseif prevline =~# s:mapkeyregex + elseif prevline =~# s:mapkeyregex . '\v\s*%(%('.s:c_ns_tag_property. + \ '\v|'.s:c_ns_anchor_property. + \ '\v|'.s:block_scalar_header. + \ '\v)%(\s+|\s*%(\#.*)?$))*' " Mapping with: value " that is multiline scalar return previndent+s:shiftwidth() From c1edb4c39a7267226d48ef034c0fea62f11ea5b3 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 16 Apr 2017 17:08:35 +0200 Subject: [PATCH 122/257] vim-patch:7571d55f7dcc Updated runtime files. https://github.com/vim/vim/commit/7571d55f7dcc009a375b2124cce2c8b21f361234 --- runtime/doc/eval.txt | 92 ++++++++++++++------------- runtime/doc/sign.txt | 6 +- runtime/doc/windows.txt | 2 +- runtime/filetype.vim | 5 +- runtime/indent/teraterm.vim | 10 ++- runtime/keymap/russian-jcukenmac.vim | 94 ++++++++++++++++++++++++++++ runtime/syntax/rst.vim | 14 ++--- runtime/syntax/teraterm.vim | 6 +- 8 files changed, 164 insertions(+), 65 deletions(-) create mode 100644 runtime/keymap/russian-jcukenmac.vim diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index ca247f1c65..44b82ef67e 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -38,7 +38,7 @@ done, the features in this document are not available. See |+eval| and There are six types of variables: Number A 32 or 64 bit signed number. |expr-number| *Number* - Examples: -123 0x10 0177 + Examples: -123 0x10 0177 0b1011 Float A floating point number. |floating-point-format| *Float* Examples: 123.456 1.15e-6 -1.1e3 @@ -1022,9 +1022,10 @@ When expr8 is a |Funcref| type variable, invoke the function it refers to. number ------ number number constant *expr-number* - *hex-number* *octal-number* + *hex-number* *octal-number* *binary-number* -Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0). +Decimal, Hexadecimal (starting with 0x or 0X), Binary (starting with 0b or 0B) +and Octal (starting with 0). *floating-point-format* Floating point numbers can be written in two forms: @@ -1425,8 +1426,8 @@ v:beval_winnr The number of the window, over which the mouse pointer is. Only window gets a number). *v:beval_winid* *beval_winid-variable* -v:beval_winid The window ID of the window, over which the mouse pointer is. - Otherwise like v:beval_winnr. +v:beval_winid The |window-ID| of the window, over which the mouse pointer + is. Otherwise like v:beval_winnr. *v:char* *char-variable* v:char Argument for evaluating 'formatexpr' and used for the typed @@ -1686,7 +1687,7 @@ v:mouse_win Window number for a mouse click obtained with |getchar()|. zero when there was no mouse button click. *v:mouse_winid* *mouse_winid-variable* -v:mouse_winid Window ID for a mouse click obtained with |getchar()|. +v:mouse_winid |window-ID| for a mouse click obtained with |getchar()|. The value is zero when there was no mouse button click. *v:mouse_lnum* *mouse_lnum-variable* @@ -1922,9 +1923,10 @@ v:vim_did_enter Zero until most of startup is done. It is set to one just v:warningmsg Last given warning message. It's allowed to set this variable. *v:windowid* *windowid-variable* -v:windowid Application-specific window ID ("window handle" in MS-Windows) - which may be set by any attached UI. Defaults to zero. - Note: for windows inside Vim use |winnr()| or |win_getid()|. +v:windowid Application-specific window "handle" which may be set by any + attached UI. Defaults to zero. + Note: For Nvim |windows| use |winnr()| or |win_getid()|, see + |window-ID|. ============================================================================== 4. Builtin Functions *functions* @@ -1968,7 +1970,7 @@ buflisted({expr}) Number |TRUE| if buffer {expr} is listed bufloaded({expr}) Number |TRUE| if buffer {expr} is loaded bufname({expr}) String Name of the buffer {expr} bufnr({expr} [, {create}]) Number Number of the buffer {expr} -bufwinid({expr}) Number window ID of buffer {expr} +bufwinid({expr}) Number |window-ID| of buffer {expr} bufwinnr({expr}) Number window number of buffer {expr} byte2line({byte}) Number line number at byte count {byte} byteidx({expr}, {nr}) Number byte index of {nr}'th char in {expr} @@ -2323,10 +2325,10 @@ virtcol({expr}) Number screen column of cursor or mark visualmode([expr]) String last visual mode used wildmenumode() Number whether 'wildmenu' mode is active win_findbuf({bufnr}) List find windows containing {bufnr} -win_getid([{win} [, {tab}]]) Number get window ID for {win} in {tab} -win_gotoid({expr}) Number go to window with ID {expr} -win_id2tabwin({expr}) List get tab and window nr from window ID -win_id2win({expr}) Number get window nr from window ID +win_getid([{win} [, {tab}]]) Number get |window-ID| for {win} in {tab} +win_gotoid({expr}) Number go to |window-ID| {expr} +win_id2tabwin({expr}) List get tab and window nr from |window-ID| +win_id2win({expr}) Number get window nr from |window-ID| winbufnr({nr}) Number buffer number of window {nr} wincol() Number window column of the cursor winheight({nr}) Number height of window {nr} @@ -2417,7 +2419,7 @@ arglistid([{winnr} [, {tabnr}]]) With {winnr} only use this window in the current tab page. With {winnr} and {tabnr} use the window in the specified tab page. - {winnr} can be the window number or the window ID. + {winnr} can be the window number or the |window-ID|. *argv()* argv([{nr}]) The result is the {nr}th file in the argument list of the @@ -2652,7 +2654,7 @@ bufnr({expr} [, {create}]) them. Use bufexists() to test for the existence of a buffer. bufwinid({expr}) *bufwinid()* - The result is a Number, which is the window ID of the first + The result is a Number, which is the |window-ID| of the first window associated with buffer {expr}. For the use of {expr}, see |bufname()| above. If buffer {expr} doesn't exist or there is no such window, -1 is returned. Example: > @@ -4071,7 +4073,7 @@ getcwd([{winnr}[, {tabnr}]]) *getcwd()* getcwd(0) getcwd(0, 0) < If {winnr} is -1 it is ignored, only the tab is resolved. - {winnr} can be the window number or the window ID. + {winnr} can be the window number or the |window-ID|. getfsize({fname}) *getfsize()* @@ -4166,7 +4168,7 @@ getline({lnum} [, {end}]) getloclist({nr},[, {what}]) *getloclist()* Returns a list with all the entries in the location list for - window {nr}. {nr} can be the window number or the window ID. + window {nr}. {nr} can be the window number or the |window-ID|. When {nr} is zero the current window is used. For a location list window, the displayed location list is @@ -4241,7 +4243,7 @@ getqflist([{what}]) *getqflist()* type type of the error, 'E', '1', etc. valid |TRUE|: recognized error message - When there is no error list or it's empty an empty list is + When there is no error list or it's empty, an empty list is returned. Quickfix list entries with non-existing buffer number are returned with "bufnr" set to zero. @@ -4256,8 +4258,8 @@ getqflist([{what}]) *getqflist()* returns only the items listed in {what} as a dictionary. The following string items are supported in {what}: nr get information for this quickfix list - title get list title - winid get window id (if opened) + title get the list title + winid get the |window-ID| (if opened) all all of the above quickfix properties Non-string items in {what} are ignored. If "nr" is not present then the current quickfix list is used. @@ -4267,7 +4269,7 @@ getqflist([{what}]) *getqflist()* The returned dictionary contains the following entries: nr quickfix list number title quickfix list title text - winid quickfix window id (if opened) + winid quickfix |window-ID| (if opened) Examples: > :echo getqflist({'all': 1}) @@ -4314,10 +4316,10 @@ gettabinfo([{arg}]) *gettabinfo()* empty List is returned. Each List item is a Dictionary with the following entries: - nr tab page number. + tabnr tab page number. variables a reference to the dictionary with tabpage-local variables - windows List of window IDs in the tab page. + windows List of |window-ID|s in the tag page. gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Get the value of a tab-local variable {varname} in tab page @@ -4341,7 +4343,7 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* Note that {varname} must be the name without "w:". Tabs are numbered starting with one. For the current tabpage use |getwinvar()|. - {winnr} can be the window number or the window ID. + {winnr} can be the window number or the |window-ID|. When {winnr} is zero the current window is used. This also works for a global option, buffer-local option and window-local option, but it doesn't work for a global variable @@ -4369,20 +4371,20 @@ getwininfo([{winid}]) *getwininfo()* is returned. If the window does not exist the result is an empty list. - Without an information about all the windows in all the tab - pages is returned. + Without {winid} information about all the windows in all the + tab pages is returned. Each List item is a Dictionary with the following entries: - bufnum number of buffer in the window + bufnr number of buffer in the window height window height loclist 1 if showing a location list - nr window number quickfix 1 if quickfix or location list window - tpnr tab page number + tabnr tab page number variables a reference to the dictionary with window-local variables width window width - winid window ID + winid |window-ID| + winnr window number To obtain all window-local variables use: > gettabwinvar({tabnr}, {winnr}, '&') @@ -4486,9 +4488,8 @@ has_key({dict}, {key}) *has_key()* an entry with key {key}. Zero otherwise. haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()* - The result is a Number, which is 1 when the specified tabpage - or window has a local path set via |:lcd| or |:tcd|, and - 0 otherwise. + The result is a Number, which is 1 when the tabpage or window + has set a local path via |:tcd| or |:lcd|, otherwise 0. Tabs and windows are identified by their respective numbers, 0 means current tab or window. Missing argument implies 0. @@ -4496,7 +4497,9 @@ haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()* haslocaldir() haslocaldir(0) haslocaldir(0, 0) -< {winnr} can be the window number or the window ID. +< With {winnr} use that window in the current tabpage. + With {winnr} and {tabnr} use the window in that tabpage. + {winnr} can be the window number or the |window-ID|. If {winnr} is -1 it is ignored, only the tab is resolved. hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* @@ -5814,6 +5817,9 @@ printf({fmt}, {expr1} ...) *printf()* s The text of the String argument is used. If a precision is specified, no more bytes than the number specified are used. + If the argument is not a String type, it is + automatically converted to text with the same format + as ":echo". *printf-S* S The text of the String argument is used. If a precision is specified, no more display cells than the @@ -6537,7 +6543,7 @@ setline({lnum}, {text}) *setline()* setloclist({nr}, {list} [, {action}[, {what}]]) *setloclist()* Create or replace or add to the location list for window {nr}. - {nr} can be the window number or the window ID. + {nr} can be the window number or the |window-ID|. When {nr} is zero the current window is used. For a location list window, the displayed location list is @@ -6729,7 +6735,7 @@ settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()* {val}. Tabs are numbered starting with one. For the current tabpage use |setwinvar()|. - {winnr} can be the window number or the window ID. + {winnr} can be the window number or the |window-ID|. When {winnr} is zero the current window is used. This also works for a global or local buffer option, but it doesn't work for a global or local buffer variable. @@ -7800,11 +7806,11 @@ wildmenumode() *wildmenumode()* win_findbuf({bufnr}) *win_findbuf()* - Returns a list with window IDs for windows that contain buffer - {bufnr}. When there is none the list is empty. + Returns a list with |window-ID|s for windows that contain + buffer {bufnr}. When there is none the list is empty. win_getid([{win} [, {tab}]]) *win_getid()* - Get the window ID for the specified window. + Get the |window-ID| for the specified window. When {win} is missing use the current window. With {win} this is the window number. The top window has number 1. @@ -7829,7 +7835,7 @@ win_id2win({expr}) *win_id2win()* *winbufnr()* winbufnr({nr}) The result is a Number, which is the number of the buffer associated with window {nr}. {nr} can be the window number or - the window ID. + the |window-ID|. When {nr} is zero, the number of the buffer in the current window is returned. When window {nr} doesn't exist, -1 is returned. @@ -7843,7 +7849,7 @@ wincol() The result is a Number, which is the virtual column of the winheight({nr}) *winheight()* The result is a Number, which is the height of window {nr}. - {nr} can be the window number or the window ID. + {nr} can be the window number or the |window-ID|. When {nr} is zero, the height of the current window is returned. When window {nr} doesn't exist, -1 is returned. An existing window always has a height of zero or more. @@ -7923,7 +7929,7 @@ winsaveview() Returns a |Dictionary| that contains information to restore winwidth({nr}) *winwidth()* The result is a Number, which is the width of window {nr}. - {nr} can be the window number or the window ID. + {nr} can be the window number or the |window-ID|. When {nr} is zero, the width of the current window is returned. When window {nr} doesn't exist, -1 is returned. An existing window always has a width of zero or more. diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt index e5a6b0be39..466a030e0c 100644 --- a/runtime/doc/sign.txt +++ b/runtime/doc/sign.txt @@ -188,7 +188,9 @@ JUMPING TO A SIGN *:sign-jump* *E157* If the file isn't displayed in window and the current file can not be |abandon|ed this fails. -:sign jump {id} buffer={nr} - Same, but use buffer {nr}. +:sign jump {id} buffer={nr} *E934* + Same, but use buffer {nr}. This fails if buffer {nr} does not + have a name. + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 4ed7b68194..2719517db9 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -69,7 +69,7 @@ places where a Normal mode command can't be used or is inconvenient. The main Vim window can hold several split windows. There are also tab pages |tab-page|, each of which can hold multiple windows. - + *window-ID* Each window has a unique identifier called the window ID. This identifier will not change within a Vim session. The |win_getid()| and |win_id2tabwin()| functions can be used to convert between the window/tab number and the diff --git a/runtime/filetype.vim b/runtime/filetype.vim index f9d7f86a97..f891ebe35c 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2016 Jul 21 +" Last Change: 2016 Aug 18 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -775,8 +775,7 @@ au BufNewFile,BufRead *.mo,*.gdmo setf gdmo au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom " Git -au BufNewFile,BufRead COMMIT_EDITMSG setf gitcommit -au BufNewFile,BufRead MERGE_MSG setf gitcommit +au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit au BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig au BufNewFile,BufRead *.git/modules/*/config setf gitconfig au BufNewFile,BufRead */.config/git/config setf gitconfig diff --git a/runtime/indent/teraterm.vim b/runtime/indent/teraterm.vim index ba24257b02..8467cefcc0 100644 --- a/runtime/indent/teraterm.vim +++ b/runtime/indent/teraterm.vim @@ -1,9 +1,9 @@ " Vim indent file " Language: Tera Term Language (TTL) -" Based on Tera Term Version 4.86 +" Based on Tera Term Version 4.92 " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-teraterm -" Last Change: 2015 Jun 4 +" Last Change: 2016 Aug 17 " Filenames: *.ttl " License: VIM License @@ -25,9 +25,7 @@ endif " The shiftwidth() function is relatively new. " Don't require it to exist. if exists('*shiftwidth') - function s:sw() abort - return shiftwidth() - endfunction + let s:sw = function('shiftwidth') else function s:sw() abort return &shiftwidth @@ -48,7 +46,7 @@ function! GetTeraTermIndent(lnum) let l:ind = l:previ - if l:prevl =~ '^\s*if\>.*\.*\' " previous line opened a block let l:ind += s:sw() endif diff --git a/runtime/keymap/russian-jcukenmac.vim b/runtime/keymap/russian-jcukenmac.vim new file mode 100644 index 0000000000..e2120ca1d4 --- /dev/null +++ b/runtime/keymap/russian-jcukenmac.vim @@ -0,0 +1,94 @@ +" Vim Keymap file for russian characters, layout 'jcuken', Mac variant + +" Derived from russian-jcuken.vim by Artem Chuprina +" Maintainer: Anton Fonarev +" Last Changed: 2016 August 17 + +" All characters are given literally, conversion to another encoding (e.g., +" UTF-8) should work. + +scriptencoding utf-8 + +let b:keymap_name = "ru" + +loadkeymap + +\| Ё CYRILLIC CAPITAL LETTER IO +\\ ё CYRILLIC SMALL LETTER IO + +F А CYRILLIC CAPITAL LETTER A +< Б CYRILLIC CAPITAL LETTER BE +D В CYRILLIC CAPITAL LETTER VE +U Г CYRILLIC CAPITAL LETTER GHE +L Д CYRILLIC CAPITAL LETTER DE +T Е CYRILLIC CAPITAL LETTER IE +: Ж CYRILLIC CAPITAL LETTER ZHE +P З CYRILLIC CAPITAL LETTER ZE +B И CYRILLIC CAPITAL LETTER I +Q Й CYRILLIC CAPITAL LETTER SHORT I +R К CYRILLIC CAPITAL LETTER KA +K Л CYRILLIC CAPITAL LETTER EL +V М CYRILLIC CAPITAL LETTER EM +Y Н CYRILLIC CAPITAL LETTER EN +J О CYRILLIC CAPITAL LETTER O +G П CYRILLIC CAPITAL LETTER PE +H Р CYRILLIC CAPITAL LETTER ER +C С CYRILLIC CAPITAL LETTER ES +N Т CYRILLIC CAPITAL LETTER TE +E У CYRILLIC CAPITAL LETTER U +A Ф CYRILLIC CAPITAL LETTER EF +{ Х CYRILLIC CAPITAL LETTER HA +W Ц CYRILLIC CAPITAL LETTER TSE +X Ч CYRILLIC CAPITAL LETTER CHE +I Ш CYRILLIC CAPITAL LETTER SHA +O Щ CYRILLIC CAPITAL LETTER SHCHA +} Ъ CYRILLIC CAPITAL LETTER HARD SIGN +S Ы CYRILLIC CAPITAL LETTER YERU +M Ь CYRILLIC CAPITAL LETTER SOFT SIGN +\" Э CYRILLIC CAPITAL LETTER E +> Ю CYRILLIC CAPITAL LETTER YU +Z Я CYRILLIC CAPITAL LETTER YA +f а CYRILLIC SMALL LETTER A +, б CYRILLIC SMALL LETTER BE +d в CYRILLIC SMALL LETTER VE +u г CYRILLIC SMALL LETTER GHE +l д CYRILLIC SMALL LETTER DE +t е CYRILLIC SMALL LETTER IE +; ж CYRILLIC SMALL LETTER ZHE +p з CYRILLIC SMALL LETTER ZE +b и CYRILLIC SMALL LETTER I +q й CYRILLIC SMALL LETTER SHORT I +r к CYRILLIC SMALL LETTER KA +k л CYRILLIC SMALL LETTER EL +v м CYRILLIC SMALL LETTER EM +y н CYRILLIC SMALL LETTER EN +j о CYRILLIC SMALL LETTER O +g п CYRILLIC SMALL LETTER PE +h р CYRILLIC SMALL LETTER ER +c с CYRILLIC SMALL LETTER ES +n т CYRILLIC SMALL LETTER TE +e у CYRILLIC SMALL LETTER U +a ф CYRILLIC SMALL LETTER EF +[ х CYRILLIC SMALL LETTER HA +w ц CYRILLIC SMALL LETTER TSE +x ч CYRILLIC SMALL LETTER CHE +i ш CYRILLIC SMALL LETTER SHA +o щ CYRILLIC SMALL LETTER SHCHA +] ъ CYRILLIC SMALL LETTER HARD SIGN +s ы CYRILLIC SMALL LETTER YERU +m ь CYRILLIC SMALL LETTER SOFT SIGN +' э CYRILLIC SMALL LETTER E +. ю CYRILLIC SMALL LETTER YU +z я CYRILLIC SMALL LETTER YA + +§ > +± < +@ " +# № +$ % +% : +^ , +& . +* ; +` ] +~ [ diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim index ef07b22676..232d2a7de3 100644 --- a/runtime/syntax/rst.vim +++ b/runtime/syntax/rst.vim @@ -2,7 +2,8 @@ " Language: reStructuredText documentation format " Maintainer: Marshall Ward " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2016-06-17 +" Website: https://github.com/marshallward/vim-restructuredtext +" Latest Revision: 2016-08-18 if exists("b:current_syntax") finish @@ -89,7 +90,7 @@ function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_righ \ ' start=+' . a:char_left . '\zs' . a:start . \ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' . \ a:middle . - \ ' end=+\S' . a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' + \ ' end=+\S' . a:end . '\ze\%($\|\s\|[''"’)\]}>/:.,;!?\\-]\)+' endfunction function! s:DefineInlineMarkup(name, start, middle, end) @@ -103,6 +104,8 @@ function! s:DefineInlineMarkup(name, start, middle, end) call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]') call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}') call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>') + call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '’', '’') + " TODO: Additional Unicode Pd, Po, Pi, Pf, Ps characters call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|[/:]\)', '') @@ -186,11 +189,8 @@ hi def link rstHyperlinkTarget String hi def link rstExDirective String hi def link rstSubstitutionDefinition rstDirective hi def link rstDelimiter Delimiter -hi def link rstEmphasis Underlined -hi def link rstStrongEmphasis Special -" TODO Append these atttributes somehow -"hi def rstEmphasis term=italic cterm=italic gui=italic -"hi def rstStrongEmphasis term=bold cterm=bold gui=bold +hi def rstEmphasis ctermfg=13 term=italic cterm=italic gui=italic +hi def rstStrongEmphasis ctermfg=1 term=bold cterm=bold gui=bold hi def link rstInterpretedTextOrHyperlinkReference Identifier hi def link rstInlineLiteral String hi def link rstSubstitutionReference PreProc diff --git a/runtime/syntax/teraterm.vim b/runtime/syntax/teraterm.vim index 521331d8ce..1924996738 100644 --- a/runtime/syntax/teraterm.vim +++ b/runtime/syntax/teraterm.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: Tera Term Language (TTL) -" Based on Tera Term Version 4.86 +" Based on Tera Term Version 4.92 " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-teraterm -" Last Change: 2015 Jun 24 +" Last Change: 2016 Aug 17 " Filenames: *.ttl " License: VIM License @@ -33,7 +33,7 @@ syn keyword ttlOperator and or xor not syn match ttlVar "\" syn match ttlVar "\" -syn keyword ttlVar inputstr matchstr paramcnt result timeout mtimeout +syn keyword ttlVar inputstr matchstr paramcnt params result timeout mtimeout syn match ttlLine nextgroup=ttlStatement "^" From d194380de93023c8901eb77b2820b0f74e8a5283 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 16 Apr 2017 17:42:41 +0200 Subject: [PATCH 123/257] vim-patch:e4a3bcf28d92 Updated runtime files. Add Scala files. https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5 --- runtime/doc/eval.txt | 2 +- runtime/doc/index.txt | 1 + runtime/doc/options.txt | 4 + runtime/doc/quickref.txt | 2 +- runtime/doc/tagsrch.txt | 38 +- runtime/doc/windows.txt | 6 +- runtime/filetype.vim | 13 +- runtime/ftplugin/rmd.vim | 16 +- runtime/ftplugin/scala.vim | 37 + runtime/indent/fortran.vim | 10 +- runtime/indent/javascript.vim | 96 +- runtime/indent/rnoweb.vim | 14 +- runtime/indent/scala.vim | 609 +++ runtime/keymap/pinyin.vim | 2 +- runtime/optwin.vim | 6 +- runtime/plugin/matchit.vim | 24 +- runtime/syntax/fortran.vim | 34 +- runtime/syntax/muttrc.vim | 346 +- runtime/syntax/python.vim | 31 +- runtime/syntax/r.vim | 6 +- runtime/syntax/rhelp.vim | 3 +- runtime/syntax/rmd.vim | 4 +- runtime/syntax/rrst.vim | 4 +- runtime/syntax/scala.vim | 231 + runtime/syntax/sh.vim | 48 +- runtime/syntax/vim.vim | 4 +- src/nvim/po/fi.po | 8629 ++++++++++++++++----------------- 27 files changed, 5420 insertions(+), 4800 deletions(-) create mode 100644 runtime/ftplugin/scala.vim create mode 100644 runtime/indent/scala.vim create mode 100644 runtime/syntax/scala.vim diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 44b82ef67e..107dd28ecd 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -7186,7 +7186,7 @@ strwidth({expr}) *strwidth()* Ambiguous, this function's return value depends on 'ambiwidth'. Also see |strlen()|, |strdisplaywidth()| and |strchars()|. -submatch({nr}[, {list}]) *submatch()* +submatch({nr}[, {list}]) *submatch()* *E935* Only for an expression in a |:substitute| command or substitute() function. Returns the {nr}'th submatch of the matched text. When {nr} diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index b06baa6497..0dc8fff975 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1234,6 +1234,7 @@ tag command action ~ |:file| :f[ile] show or set the current file name |:files| :files list all files in the buffer list |:filetype| :filet[ype] switch file type detection on/off +|:filter| :filt[er] filter output of following command |:find| :fin[d] find file in 'path' and edit it |:finally| :fina[lly] part of a :try command |:finish| :fini[sh] quit sourcing a Vim script diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index e269fd30c5..6b96271c4a 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3689,6 +3689,8 @@ A jump table for the options with a short description can be found at |Q_op|. be able to execute Normal mode commands. This is the opposite of the 'keymap' option, where characters are mapped in Insert mode. + Also consider resetting 'langremap' to avoid 'langmap' applies to + characters resulting from a mapping. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -5025,6 +5027,8 @@ A jump table for the options with a short description can be found at |Q_op|. "inclusive" means that the last character of the selection is included in an operation. For example, when "x" is used to delete the selection. + When "old" is used and 'virtualedit' allows the cursor to move past + the end of line the line break still isn't included. Note that when "exclusive" is used and selecting from the end backwards, you cannot include the last character of a line, when starting in Normal mode and 'virtualedit' empty. diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index a918a4d34a..420f570c99 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -751,7 +751,7 @@ Short explanation of each option: *option-list* 'keywordprg' 'kp' program to use for the "K" command 'langmap' 'lmap' alphabetic characters for other language mode 'langmenu' 'lm' language to be used for the menus -'langnoremap' 'lnr' do not apply 'langmap' to mapped characters +'langremap' 'lrm' do apply 'langmap' to mapped characters 'laststatus' 'ls' tells when last window has status lines 'lazyredraw' 'lz' don't redraw while executing macros 'linebreak' 'lbr' wrap long lines at a blank diff --git a/runtime/doc/tagsrch.txt b/runtime/doc/tagsrch.txt index 2c090a66fa..b47053e17b 100644 --- a/runtime/doc/tagsrch.txt +++ b/runtime/doc/tagsrch.txt @@ -90,7 +90,7 @@ The ignore-case matches are not found for a ":tag" command when: - 'tagcase' is "followscs" and 'smartcase' option is on and the pattern contains an upper case character. -The gnore-case matches are found when: +The ignore-case matches are found when: - a pattern is used (starting with a "/") - for ":tselect" - when 'tagcase' is "followic" and 'ignorecase' is off @@ -432,9 +432,9 @@ The next file in the list is not used when: This also depends on whether case is ignored. Case is ignored when: - 'tagcase' is "followic" and 'ignorecase' is set - 'tagcase' is "ignore" -- 'tagcase' is "smart" and and the pattern only contains lower case +- 'tagcase' is "smart" and the pattern only contains lower case characters. -- 'tagcase' is "followscs" and 'smartcase' is set and and the pattern only +- 'tagcase' is "followscs" and 'smartcase' is set and the pattern only contains lower case characters. If case is not ignored, and the tags file only has a match without matching case, the next tags file is searched for a match with matching case. If no @@ -803,24 +803,24 @@ CTRL-W d Open a new window, with the cursor on the first *:search-args* Common arguments for the commands above: -[!] When included, find matches in lines that are recognized as comments. - When excluded, a match is ignored when the line is recognized as a - comment (according to 'comments'), or the match is in a C comment (after - "//" or inside /* */). Note that a match may be missed if a line is - recognized as a comment, but the comment ends halfway through the line. - And if the line is a comment, but it is not recognized (according to - 'comments') a match may be found in it anyway. Example: > +[!] When included, find matches in lines that are recognized as comments. + When excluded, a match is ignored when the line is recognized as a + comment (according to 'comments'), or the match is in a C comment + (after "//" or inside /* */). Note that a match may be missed if a + line is recognized as a comment, but the comment ends halfway the line. + And if the line is a comment, but it is not recognized (according to + 'comments') a match may be found in it anyway. Example: > /* comment foobar */ -< A match for "foobar" is found, because this line is not recognized as a - comment (even though syntax highlighting does recognize it). - Note: Since a macro definition mostly doesn't look like a comment, the - [!] makes no difference for ":dlist", ":dsearch" and ":djump". -[/] A pattern can be surrounded by '/'. Without '/' only whole words are - matched, using the pattern "\". Only after the second '/' a - next command can be appended with '|'. Example: > +< A match for "foobar" is found, because this line is not recognized as + a comment (even though syntax highlighting does recognize it). + Note: Since a macro definition mostly doesn't look like a comment, the + [!] makes no difference for ":dlist", ":dsearch" and ":djump". +[/] A pattern can be surrounded by '/'. Without '/' only whole words are + matched, using the pattern "\". Only after the second '/' a + next command can be appended with '|'. Example: > :isearch /string/ | echo "the last one" -< For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern - is used as a literal string, not as a search pattern. +< For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern + is used as a literal string, not as a search pattern. vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 2719517db9..fa7a7f2a81 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -69,7 +69,7 @@ places where a Normal mode command can't be used or is inconvenient. The main Vim window can hold several split windows. There are also tab pages |tab-page|, each of which can hold multiple windows. - *window-ID* + *window-ID* *winid* *windowid* Each window has a unique identifier called the window ID. This identifier will not change within a Vim session. The |win_getid()| and |win_id2tabwin()| functions can be used to convert between the window/tab number and the @@ -1026,6 +1026,10 @@ list of buffers. |unlisted-buffer| h+ hidden buffers which are modified a+ active buffers which are modified + When using |:filter| the pattern is matched against the + displayed buffer name, e.g.: > + filter /\.vim/ ls +< *:bad* *:badd* :bad[d] [+lnum] {fname} Add file name {fname} to the buffer list, without loading it. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index f891ebe35c..43155aa27e 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2016 Aug 18 +" Last Change: 2016 Aug 26 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -688,8 +688,8 @@ func! s:FTe() let n = 1 while n < 100 && n < line("$") if getline(n) =~ "^\\s*\\(<'\\|'>\\)\\s*$" - setf specman - return + setf specman + return endif let n = n + 1 endwhile @@ -1776,6 +1776,9 @@ au BufNewFile,BufRead *.sass setf sass " Sather au BufNewFile,BufRead *.sa setf sather +" Scala +au BufNewFile,BufRead *.scala setf scala + " Scilab au BufNewFile,BufRead *.sci,*.sce setf scilab @@ -2048,7 +2051,7 @@ func! s:FTRules() if line =~ s:ft_rules_udev_rules_pattern let udev_rules = substitute(line, s:ft_rules_udev_rules_pattern, '\1', "") if dir == udev_rules - setf udevrules + setf udevrules endif break endif @@ -2300,7 +2303,7 @@ au BufNewFile,BufRead */etc/updatedb.conf setf updatedb au BufNewFile,BufRead */usr/share/upstart/*.conf setf upstart au BufNewFile,BufRead */usr/share/upstart/*.override setf upstart au BufNewFile,BufRead */etc/init/*.conf,*/etc/init/*.override setf upstart -au BufNewFile,BufRead */.init/*.conf,*/.init/*.override setf upstart +au BufNewFile,BufRead */.init/*.conf,*/.init/*.override setf upstart au BufNewFile,BufRead */.config/upstart/*.conf setf upstart au BufNewFile,BufRead */.config/upstart/*.override setf upstart diff --git a/runtime/ftplugin/rmd.vim b/runtime/ftplugin/rmd.vim index ec64a07675..8c092ac13f 100644 --- a/runtime/ftplugin/rmd.vim +++ b/runtime/ftplugin/rmd.vim @@ -1,9 +1,9 @@ " Vim filetype plugin file -" Language: R help file +" Language: R Markdown file " Maintainer: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Tue Apr 07, 2015 04:37PM -" Original work by Alex Zvoleff (adjusted for rmd by Michel Kuhlmann) +" Last Change: Mon Jun 06, 2016 09:41PM +" Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann) " Only do this when not yet done for this buffer if exists("b:did_ftplugin") @@ -12,6 +12,16 @@ endif runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim +" Nvim-R plugin needs this +if exists("*CompleteR") + if &omnifunc == "CompleteR" + let b:rplugin_nonr_omnifunc = "" + else + let b:rplugin_nonr_omnifunc = &omnifunc + endif + set omnifunc=CompleteR +endif + setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s setlocal formatoptions+=tcqln setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+ diff --git a/runtime/ftplugin/scala.vim b/runtime/ftplugin/scala.vim new file mode 100644 index 0000000000..e409950107 --- /dev/null +++ b/runtime/ftplugin/scala.vim @@ -0,0 +1,37 @@ +" Vim filetype plugin file +" Language: Scala +" Maintainer: Derek Wyatt +" URL: https://github.com/derekwyatt/vim-scala +" License: Same as Vim +" Last Change: 02 August 2016 +" ---------------------------------------------------------------------------- + +if exists('b:did_ftplugin') || &cp + finish +endif +let b:did_ftplugin = 1 + +" j is fairly new in Vim, so don't complain if it's not there +setlocal formatoptions-=t formatoptions+=croqnl +silent! setlocal formatoptions+=j + +" Just like c.vim, but additionally doesn't wrap text onto /** line when +" formatting. Doesn't bungle bulleted lists when formatting. +if get(g:, 'scala_scaladoc_indent', 0) + setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s2:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,:// +else + setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,:// +endif +setlocal commentstring=//\ %s + +setlocal shiftwidth=2 softtabstop=2 expandtab + +setlocal include='^\s*import' +setlocal includeexpr='substitute(v:fname,"\\.","/","g")' + +setlocal path+=src/main/scala,src/test/scala +setlocal suffixesadd=.scala + +compiler sbt + +" vim:set sw=2 sts=2 ts=8 et: diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim index e19a19fb1f..be2f0866d5 100644 --- a/runtime/indent/fortran.vim +++ b/runtime/indent/fortran.vim @@ -1,7 +1,7 @@ " Vim indent file " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77) -" Version: 0.44 -" Last Change: 2016 Jan. 26 +" Version: 0.45 +" Last Change: 2016 Aug. 18 " Maintainer: Ajit J. Thakkar ; " Usage: For instructions, do :help fortran-indent from Vim " Credits: @@ -121,7 +121,7 @@ function FortranGetIndent(lnum) let prefix='\(\(pure\|impure\|elemental\|recursive\)\s\+\)\{,2}' let type='\(\(integer\|real\|double\s\+precision\|complex\|logical' \.'\|character\|type\|class\)\s*\S*\s\+\)\=' - if prevstat =~? '^\s*\(module\|contains\|program\)\>' + if prevstat =~? '^\s*\(module\|contains\/submodule\|program\)\>' \ ||prevstat =~? '^\s*'.prefix.'subroutine\>' \ ||prevstat =~? '^\s*'.prefix.type.'function\>' \ ||prevstat =~? '^\s*'.type.prefix.'function\>' @@ -129,14 +129,14 @@ function FortranGetIndent(lnum) endif if getline(v:lnum) =~? '^\s*contains\>' \ ||getline(v:lnum)=~? '^\s*end\s*' - \ .'\(function\|subroutine\|module\|program\)\>' + \ .'\(function\|subroutine\|module\/submodule\|program\)\>' let ind = ind - shiftwidth() endif endif "Subtract a shiftwidth from else, else if, elsewhere, case, end if, " end where, end select, end forall, end interface, end associate, - " end enum, and end type statements + " end enum, end type, end block and end type statements if getline(v:lnum) =~? '^\s*\(\d\+\s\)\=\s*' \. '\(else\|else\s*if\|else\s*where\|case\|' \. 'end\s*\(if\|where\|select\|interface\|' diff --git a/runtime/indent/javascript.vim b/runtime/indent/javascript.vim index 3507e305ed..0d6c11d151 100644 --- a/runtime/indent/javascript.vim +++ b/runtime/indent/javascript.vim @@ -1,8 +1,8 @@ " Vim indent file " Language: Javascript -" Maintainer: vim-javascript community +" Maintainer: Chris Paul ( https://github.com/bounceme ) " URL: https://github.com/pangloss/vim-javascript -" Last Change: August 12, 2016 +" Last Change: August 25, 2016 " Only load this indent file when no other was loaded. if exists('b:did_indent') @@ -12,11 +12,11 @@ let b:did_indent = 1 " Now, set up our indentation expression and keys that trigger it. setlocal indentexpr=GetJavascriptIndent() -setlocal nolisp +setlocal nolisp noautoindent nosmartindent setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e setlocal cinoptions+=j1,J1 -let b:undo_indent = 'setlocal indentexpr< indentkeys< cinoptions<' +let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys< cinoptions<' " Only define the function once. if exists('*GetJavascriptIndent') @@ -37,7 +37,7 @@ else endfunction endif -let s:line_pre = '^\s*\%(\/\*.\{-}\*\/\s*\)*' +let s:line_pre = '^\s*\%(\%(\%(\/\*.\{-}\)\=\*\+\/\s*\)\=\)\@>' let s:expr_case = s:line_pre . '\%(\%(case\>.\+\)\|default\)\s*:' " Regex of syntax group names that are or delimit string or are comments. let s:syng_strcom = '\%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)' @@ -46,63 +46,63 @@ let s:syng_strcom = '\%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)' let s:syng_comment = '\%(comment\|doc\)' " Expression used to check whether we should skip a match with searchpair(). -let s:skip_expr = "line('.') < (prevnonblank(v:lnum) - 2000) ? dummy : synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'" +let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'" -function s:lookForParens(start,end,flags,time) - if has('reltime') - return searchpair(a:start,'',a:end,a:flags,s:skip_expr,0,a:time) - else - return searchpair(a:start,'',a:end,a:flags,0,0) - endif -endfunction +if has('reltime') + function s:GetPair(start,end,flags,time) + return searchpair(a:start,'',a:end,a:flags,s:skip_expr,max([prevnonblank(v:lnum) - 2000,0]),a:time) + endfunction +else + function s:GetPair(start,end,flags,n) + return searchpair(a:start,'',a:end,a:flags,0,max([prevnonblank(v:lnum) - 2000,0])) + endfunction +endif -let s:line_term = '\%(\s*\%(\/\*.\{-}\*\/\s*\)\=\)\@>$' +let s:line_term = '\s*\%(\%(\/\%(\%(\*.\{-}\*\/\)\|\%(\*\+\)\)\)\s*\)\=$' " configurable regexes that define continuation lines, not including (, {, or [. if !exists('g:javascript_opfirst') - let g:javascript_opfirst = '\%([<>,:?^%]\|\([-/.+]\)\%(\1\|\*\|\/\)\@!\|\*\/\@!\|=>\@!\||\|&\|in\%(stanceof\)\=\>\)' + let g:javascript_opfirst = '\%([<>,:?^%|*&]\|\/[^/*]\|\([-.+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)' endif -let g:javascript_opfirst = s:line_pre . g:javascript_opfirst - if !exists('g:javascript_continuation') - let g:javascript_continuation = '\%([<*,.?:^%]\|+\@\|\*\@\|\' . (a:add ? '\|\\)' . s:line_term ? 'no b' : \ ((a:add && a:text =~ s:line_pre . '$' && search('\%' . s:PrevCodeLine(a:lnum - 1) . 'l.)' . s:line_term)) || \ cursor(a:lnum, match(a:text, ')' . s:line_term)) > -1) && - \ s:lookForParens('(', ')', 'cbW', 100) > 0 && search((a:add ? - \ '\%(function\*\|[[:lower:][:upper:]_$][[:digit:][:lower:][:upper:]_$]*\)' : - \ '\<\%(for\%(\s\+each\)\=\|if\|let\|w\%(hile\|ith\)\)') . '\_s*\%#\C','bW') && - \ (a:add || (expand('') ==# 'while' ? !s:lookForParens('\\C', '\\C','bW',100) : 1)) + \ s:GetPair('(', ')', 'cbW', 100) > 0 && search('\C\l\+\_s*\%#','bW') && + \ (a:add || ((expand('') !=# 'while' || !s:GetPair('\C\', '\C\','nbW',100)) && + \ (expand('') !=# 'each' || search('\C\') : '' +endfunction + +" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader +function s:IsBlock() + return getline(line('.'))[col('.')-1] == '{' && !search( + \ '\C\%(\\|\*\@ 0 + while l:lnum if synIDattr(synID(l:lnum,matchend(getline(l:lnum), '^\s*[^''"]'),0),'name') !~? s:syng_strcom - break + return l:lnum endif let l:lnum = prevnonblank(l:lnum - 1) endwhile - return l:lnum endfunction " Check if line 'lnum' has a balanced amount of parentheses. function s:Balanced(lnum) - let open_0 = 0 - let open_2 = 0 - let open_4 = 0 + let [open_0,open_2,open_4] = [0,0,0] let l:line = getline(a:lnum) let pos = match(l:line, '[][(){}]', 0) while pos != -1 @@ -129,7 +129,7 @@ function GetJavascriptIndent() let syns = synIDattr(synID(v:lnum, 1, 0), 'name') " start with strings,comments,etc.{{{2 - if (l:line !~ '^[''"`]' && syns =~? 'string\|template') || + if (l:line !~ '^[''"`]' && syns =~? '\%(string\|template\)') || \ (l:line !~ '^\s*[/*]' && syns =~? s:syng_comment) return -1 endif @@ -153,15 +153,15 @@ function GetJavascriptIndent() " the containing paren, bracket, curly. Memoize, last lineNr either has the " same scope or starts a new one, unless if it closed a scope. call cursor(v:lnum,1) - if b:js_cache[0] >= l:lnum && b:js_cache[0] <= v:lnum && b:js_cache[0] && + if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum && b:js_cache[0] && \ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum) > 0) let num = b:js_cache[1] elseif syns != '' && l:line[0] =~ '\s' let pattern = syns =~? 'block' ? ['{','}'] : syns =~? 'jsparen' ? ['(',')'] : \ syns =~? 'jsbracket'? ['\[','\]'] : ['[({[]','[])}]'] - let num = s:lookForParens(pattern[0],pattern[1],'bW',2000) + let num = s:GetPair(pattern[0],pattern[1],'bW',2000) else - let num = s:lookForParens('[({[]','[])}]','bW',2000) + let num = s:GetPair('[({[]','[])}]','bW',2000) endif let b:js_cache = [v:lnum,num,line('.') == v:lnum ? b:js_cache[2] : col('.')] @@ -169,17 +169,19 @@ function GetJavascriptIndent() return indent(num) endif - let pline = s:StripLine(getline(l:lnum)) - let inb = num == 0 ? 1 : (s:Onescope(num, s:StripLine(strpart(getline(num),0,b:js_cache[2] - 1)),1) || - \ (l:line !~ s:line_pre . ',' && pline !~ ',' . s:line_term)) && num < l:lnum - let switch_offset = (!inb || num == 0) || expand("") !=# 'switch' ? 0 : &cino !~ ':' || !has('float') ? s:sw() : + call cursor(b:js_cache[1],b:js_cache[2]) + + let swcase = getline(l:lnum) =~# s:expr_case + let pline = swcase ? getline(l:lnum) : substitute(getline(l:lnum), '\%(:\@')))) || - \ (num < l:lnum && s:Onescope(l:lnum,pline,0) && l:line !~ s:line_pre . '{') + if inb && !swcase && ((l:line =~# g:javascript_opfirst || pline =~# g:javascript_continuation) || + \ num < l:lnum && s:OneScope(l:lnum,pline,0) =~# '\<\%(for\|each\|if\|let\|no\sb\|w\%(hile\|ith\)\)\>' && + \ l:line !~ s:line_pre . '{') return (num > 0 ? indent(num) : -s:sw()) + (s:sw() * 2) + switch_offset elseif num > 0 return indent(num) + s:sw() + switch_offset diff --git a/runtime/indent/rnoweb.vim b/runtime/indent/rnoweb.vim index 29fa5bc78f..8c11e85cb3 100644 --- a/runtime/indent/rnoweb.vim +++ b/runtime/indent/rnoweb.vim @@ -2,7 +2,7 @@ " Language: Rnoweb " Author: Jakson Alves de Aquino " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Tue Apr 07, 2015 04:38PM +" Last Change: Fri Apr 15, 2016 10:58PM " Only load this indent file when no other was loaded. @@ -10,7 +10,17 @@ if exists("b:did_indent") finish endif runtime indent/tex.vim -let s:TeXIndent = function(substitute(&indentexpr, "()", "", "")) + +function! s:NoTeXIndent() + return indent(line(".")) +endfunction + +if &indentexpr == "" || &indentexpr == "GetRnowebIndent()" + let s:TeXIndent = function("s:NoTeXIndent") +else + let s:TeXIndent = function(substitute(&indentexpr, "()", "", "")) +endif + unlet b:did_indent runtime indent/r.vim let s:RIndent = function(substitute(&indentexpr, "()", "", "")) diff --git a/runtime/indent/scala.vim b/runtime/indent/scala.vim new file mode 100644 index 0000000000..f97c79bbab --- /dev/null +++ b/runtime/indent/scala.vim @@ -0,0 +1,609 @@ +" Vim indent file +" Language: Scala (http://scala-lang.org/) +" Original Author: Stefan Matthias Aust +" Modifications By: Derek Wyatt +" URL: https://github.com/derekwyatt/vim-scala +" Last Change: 2016 Aug 26 + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal autoindent +setlocal indentexpr=GetScalaIndent() +setlocal indentkeys=0{,0},0),!^F,<>>,o,O,e,=case, + +if exists("*GetScalaIndent") + finish +endif +let s:keepcpo= &cpo +set cpo&vim + +let s:defMatcher = '\%(\%(private\|protected\)\%(\[[^\]]*\]\)\?\s\+\|abstract\s\+\|override\s\+\)*\' +let s:funcNameMatcher = '\w\+' +let s:typeSpecMatcher = '\%(\s*\[\_[^\]]*\]\)' +let s:defArgMatcher = '\%((\_.\{-})\)' +let s:returnTypeMatcher = '\%(:\s*\w\+' . s:typeSpecMatcher . '\?\)' +let g:fullDefMatcher = '^\s*' . s:defMatcher . '\s\+' . s:funcNameMatcher . '\s*' . s:typeSpecMatcher . '\?\s*' . s:defArgMatcher . '\?\s*' . s:returnTypeMatcher . '\?\s*[={]' + +function! scala#ConditionalConfirm(msg) + if 0 + call confirm(a:msg) + endif +endfunction + +function! scala#GetLine(lnum) + let line = substitute(getline(a:lnum), '//.*$', '', '') + let line = substitute(line, '"\(.\|\\"\)\{-}"', '""', 'g') + return line +endfunction + +function! scala#CountBrackets(line, openBracket, closedBracket) + let line = substitute(a:line, '"\(.\|\\"\)\{-}"', '', 'g') + let open = substitute(line, '[^' . a:openBracket . ']', '', 'g') + let close = substitute(line, '[^' . a:closedBracket . ']', '', 'g') + return strlen(open) - strlen(close) +endfunction + +function! scala#CountParens(line) + return scala#CountBrackets(a:line, '(', ')') +endfunction + +function! scala#CountCurlies(line) + return scala#CountBrackets(a:line, '{', '}') +endfunction + +function! scala#LineEndsInIncomplete(line) + if a:line =~ '[.,]\s*$' + return 1 + else + return 0 + endif +endfunction + +function! scala#LineIsAClosingXML(line) + if a:line =~ '^\s*]*\)>.*$', '\1', '') + let [lineNum, colnum] = searchpairpos('<' . tag . '>', '', '', 'Wbn') + call setpos('.', savedpos) + let pline = scala#GetLine(prevnonblank(lineNum - 1)) + if pline =~ '=\s*$' + return 1 + else + return 0 + endif +endfunction + +function! scala#IsParentCase() + let savedpos = getpos('.') + call setpos('.', [savedpos[0], savedpos[1], 0, savedpos[3]]) + let [l, c] = searchpos('^\s*\%(' . s:defMatcher . '\|\%(\\)\)', 'bnW') + let retvalue = -1 + if l != 0 && search('\%' . l . 'l\s*\', 'bnW') + let retvalue = l + endif + call setpos('.', savedpos) + return retvalue +endfunction + +function! scala#CurlyMatcher() + let matchline = scala#GetLineThatMatchesBracket('{', '}') + if scala#CountParens(scala#GetLine(matchline)) < 0 + let savedpos = getpos('.') + call setpos('.', [savedpos[0], matchline, 9999, savedpos[3]]) + call searchpos('{', 'Wbc') + call searchpos(')', 'Wb') + let [lnum, colnum] = searchpairpos('(', '', ')', 'Wbn') + call setpos('.', savedpos) + let line = scala#GetLine(lnum) + if line =~ '^\s*' . s:defMatcher + return lnum + else + return matchline + endif + else + return matchline + endif +endfunction + +function! scala#GetLineAndColumnThatMatchesCurly() + return scala#GetLineAndColumnThatMatchesBracket('{', '}') +endfunction + +function! scala#GetLineAndColumnThatMatchesParen() + return scala#GetLineAndColumnThatMatchesBracket('(', ')') +endfunction + +function! scala#GetLineAndColumnThatMatchesBracket(openBracket, closedBracket) + let savedpos = getpos('.') + let curline = scala#GetLine(line('.')) + if curline =~ a:closedBracket . '.*' . a:openBracket . '.*' . a:closedBracket + call setpos('.', [savedpos[0], savedpos[1], 0, savedpos[3]]) + call searchpos(a:closedBracket . '\ze[^' . a:closedBracket . a:openBracket . ']*' . a:openBracket, 'W') + else + call setpos('.', [savedpos[0], savedpos[1], 9999, savedpos[3]]) + call searchpos(a:closedBracket, 'Wbc') + endif + let [lnum, colnum] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbn') + call setpos('.', savedpos) + return [lnum, colnum] +endfunction + +function! scala#GetLineThatMatchesCurly() + return scala#GetLineThatMatchesBracket('{', '}') +endfunction + +function! scala#GetLineThatMatchesParen() + return scala#GetLineThatMatchesBracket('(', ')') +endfunction + +function! scala#GetLineThatMatchesBracket(openBracket, closedBracket) + let [lnum, colnum] = scala#GetLineAndColumnThatMatchesBracket(a:openBracket, a:closedBracket) + return lnum +endfunction + +function! scala#NumberOfBraceGroups(line) + let line = substitute(a:line, '[^()]', '', 'g') + if strlen(line) == 0 + return 0 + endif + let line = substitute(line, '^)*', '', 'g') + if strlen(line) == 0 + return 0 + endif + let line = substitute(line, '^(', '', 'g') + if strlen(line) == 0 + return 0 + endif + let c = 1 + let counter = 0 + let groupCount = 0 + while counter < strlen(line) + let char = strpart(line, counter, 1) + if char == '(' + let c = c + 1 + elseif char == ')' + let c = c - 1 + endif + if c == 0 + let groupCount = groupCount + 1 + endif + let counter = counter + 1 + endwhile + return groupCount +endfunction + +function! scala#MatchesIncompleteDefValr(line) + if a:line =~ '^\s*\%(' . s:defMatcher . '\|\\).*[=({]\s*$' + return 1 + else + return 0 + endif +endfunction + +function! scala#LineIsCompleteIf(line) + if scala#CountBrackets(a:line, '{', '}') == 0 && + \ scala#CountBrackets(a:line, '(', ')') == 0 && + \ a:line =~ '^\s*\\s*([^)]*)\s*\S.*$' + return 1 + else + return 0 + endif +endfunction + +function! scala#LineCompletesIfElse(lnum, line) + if a:line =~ '^\s*\%(\\|\%(}\s*\)\?\\)' + return 0 + endif + let result = search('^\%(\s*\\s*(.*).*\n\|\s*\\s*(.*)\s*\n.*\n\)\%(\s*\\s*\\s*(.*)\s*\n.*\n\)*\%(\s*\\s*\n\|\s*\[^{]*\n\)\?\%' . a:lnum . 'l', 'Wbn') + if result != 0 && scala#GetLine(prevnonblank(a:lnum - 1)) !~ '{\s*$' + return result + endif + return 0 +endfunction + +function! scala#GetPrevCodeLine(lnum) + " This needs to skip comment lines + return prevnonblank(a:lnum - 1) +endfunction + +function! scala#InvertBracketType(openBracket, closedBracket) + if a:openBracket == '(' + return [ '{', '}' ] + else + return [ '(', ')' ] + endif +endfunction + +function! scala#Testhelper(lnum, line, openBracket, closedBracket, iteration) + let bracketCount = scala#CountBrackets(a:line, a:openBracket, a:closedBracket) + " There are more '}' braces than '{' on this line so it may be completing the function definition + if bracketCount < 0 + let [matchedLNum, matchedColNum] = scala#GetLineAndColumnThatMatchesBracket(a:openBracket, a:closedBracket) + if matchedLNum == a:lnum + return -1 + endif + let matchedLine = scala#GetLine(matchedLNum) + if ! scala#MatchesIncompleteDefValr(matchedLine) + let bracketLine = substitute(substitute(matchedLine, '\%' . matchedColNum . 'c.*$', '', ''), '[^{}()]', '', 'g') + if bracketLine =~ '}$' + return scala#Testhelper(matchedLNum, matchedLine, '{', '}', a:iteration + 1) + elseif bracketLine =~ ')$' + return scala#Testhelper(matchedLNum, matchedLine, '(', ')', a:iteration + 1) + else + let prevCodeLNum = scala#GetPrevCodeLine(matchedLNum) + if scala#MatchesIncompleteDefValr(scala#GetLine(prevCodeLNum)) + return prevCodeLNum + else + return -1 + endif + endif + else + " return indent value instead + return matchedLNum + endif + " There's an equal number of '{' and '}' on this line so it may be a single line function definition + elseif bracketCount == 0 + if a:iteration == 0 + let otherBracketType = scala#InvertBracketType(a:openBracket, a:closedBracket) + return scala#Testhelper(a:lnum, a:line, otherBracketType[0], otherBracketType[1], a:iteration + 1) + else + let prevCodeLNum = scala#GetPrevCodeLine(a:lnum) + let prevCodeLine = scala#GetLine(prevCodeLNum) + if scala#MatchesIncompleteDefValr(prevCodeLine) && prevCodeLine !~ '{\s*$' + return prevCodeLNum + else + let possibleIfElse = scala#LineCompletesIfElse(a:lnum, a:line) + if possibleIfElse != 0 + let defValrLine = prevnonblank(possibleIfElse - 1) + let possibleDefValr = scala#GetLine(defValrLine) + if scala#MatchesIncompleteDefValr(possibleDefValr) && possibleDefValr =~ '^.*=\s*$' + return possibleDefValr + else + return -1 + endif + else + return -1 + endif + endif + endif + else + return -1 + endif +endfunction + +function! scala#Test(lnum, line, openBracket, closedBracket) + return scala#Testhelper(a:lnum, a:line, a:openBracket, a:closedBracket, 0) +endfunction + +function! scala#LineCompletesDefValr(lnum, line) + let bracketCount = scala#CountBrackets(a:line, '{', '}') + if bracketCount < 0 + let matchedBracket = scala#GetLineThatMatchesBracket('{', '}') + if ! scala#MatchesIncompleteDefValr(scala#GetLine(matchedBracket)) + let possibleDefValr = scala#GetLine(prevnonblank(matchedBracket - 1)) + if matchedBracket != -1 && scala#MatchesIncompleteDefValr(possibleDefValr) + return 1 + else + return 0 + endif + else + return 0 + endif + elseif bracketCount == 0 + let bracketCount = scala#CountBrackets(a:line, '(', ')') + if bracketCount < 0 + let matchedBracket = scala#GetLineThatMatchesBracket('(', ')') + if ! scala#MatchesIncompleteDefValr(scala#GetLine(matchedBracket)) + let possibleDefValr = scala#GetLine(prevnonblank(matchedBracket - 1)) + if matchedBracket != -1 && scala#MatchesIncompleteDefValr(possibleDefValr) + return 1 + else + return 0 + endif + else + return 0 + endif + elseif bracketCount == 0 + let possibleDefValr = scala#GetLine(prevnonblank(a:lnum - 1)) + if scala#MatchesIncompleteDefValr(possibleDefValr) && possibleDefValr =~ '^.*=\s*$' + return 1 + else + let possibleIfElse = scala#LineCompletesIfElse(a:lnum, a:line) + if possibleIfElse != 0 + let possibleDefValr = scala#GetLine(prevnonblank(possibleIfElse - 1)) + if scala#MatchesIncompleteDefValr(possibleDefValr) && possibleDefValr =~ '^.*=\s*$' + return 2 + else + return 0 + endif + else + return 0 + endif + endif + else + return 0 + endif + endif +endfunction + +function! scala#SpecificLineCompletesBrackets(lnum, openBracket, closedBracket) + let savedpos = getpos('.') + call setpos('.', [savedpos[0], a:lnum, 9999, savedpos[3]]) + let retv = scala#LineCompletesBrackets(a:openBracket, a:closedBracket) + call setpos('.', savedpos) + + return retv +endfunction + +function! scala#LineCompletesBrackets(openBracket, closedBracket) + let savedpos = getpos('.') + let offline = 0 + while offline == 0 + let [lnum, colnum] = searchpos(a:closedBracket, 'Wb') + let [lnumA, colnumA] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbn') + if lnum != lnumA + let [lnumB, colnumB] = searchpairpos(a:openBracket, '', a:closedBracket, 'Wbnr') + let offline = 1 + endif + endwhile + call setpos('.', savedpos) + if lnumA == lnumB && colnumA == colnumB + return lnumA + else + return -1 + endif +endfunction + +function! GetScalaIndent() + " Find a non-blank line above the current line. + let prevlnum = prevnonblank(v:lnum - 1) + + " Hit the start of the file, use zero indent. + if prevlnum == 0 + return 0 + endif + + let ind = indent(prevlnum) + let originalIndentValue = ind + let prevline = scala#GetLine(prevlnum) + let curlnum = v:lnum + let curline = scala#GetLine(curlnum) + if get(g:, 'scala_scaladoc_indent', 0) + let star_indent = 2 + else + let star_indent = 1 + end + + if prevline =~ '^\s*/\*\*' + if prevline =~ '\*/\s*$' + return ind + else + return ind + star_indent + endif + endif + + if curline =~ '^\s*\*' + return cindent(curlnum) + endif + + " If this line starts with a { then make it indent the same as the previous line + if curline =~ '^\s*{' + call scala#ConditionalConfirm("1") + " Unless, of course, the previous one is a { as well + if prevline !~ '^\s*{' + call scala#ConditionalConfirm("2") + return indent(prevlnum) + endif + endif + + " '.' continuations + if curline =~ '^\s*\.' + if prevline =~ '^\s*\.' + return ind + else + return ind + &shiftwidth + endif + endif + + " Indent html literals + if prevline !~ '/>\s*$' && prevline =~ '^\s*<[a-zA-Z][^>]*>\s*$' + call scala#ConditionalConfirm("3") + return ind + &shiftwidth + endif + + " assumes curly braces around try-block + if curline =~ '^\s*}\s*\' + return ind - &shiftwidth + elseif curline =~ '^\s*\' + return ind + endif + + " Add a 'shiftwidth' after lines that start a block + " If 'if', 'for' or 'while' end with ), this is a one-line block + " If 'val', 'var', 'def' end with =, this is a one-line block + if (prevline =~ '^\s*\<\%(\%(}\?\s*else\s\+\)\?if\|for\|while\)\>.*[)=]\s*$' && scala#NumberOfBraceGroups(prevline) <= 1) + \ || prevline =~ '^\s*' . s:defMatcher . '.*=\s*$' + \ || prevline =~ '^\s*\.*[=]\s*$' + \ || prevline =~ '^\s*\%(}\s*\)\?\\s*$' + \ || prevline =~ '=\s*$' + call scala#ConditionalConfirm("4") + let ind = ind + &shiftwidth + elseif prevline =~ '^\s*\<\%(}\?\s*else\s\+\)\?if\>' && curline =~ '^\s*}\?\s*\' + return ind + endif + + let lineCompletedBrackets = 0 + let bracketCount = scala#CountBrackets(prevline, '{', '}') + if bracketCount > 0 || prevline =~ '.*{\s*$' + call scala#ConditionalConfirm("5b") + let ind = ind + &shiftwidth + elseif bracketCount < 0 + call scala#ConditionalConfirm("6b") + " if the closing brace actually completes the braces entirely, then we + " have to indent to line that started the whole thing + let completeLine = scala#LineCompletesBrackets('{', '}') + if completeLine != -1 + call scala#ConditionalConfirm("8b") + let prevCompleteLine = scala#GetLine(prevnonblank(completeLine - 1)) + " However, what actually started this part looks like it was a function + " definition, so we need to indent to that line instead. This is + " actually pretty weak at the moment. + if prevCompleteLine =~ '=\s*$' + call scala#ConditionalConfirm("9b") + let ind = indent(prevnonblank(completeLine - 1)) + else + call scala#ConditionalConfirm("10b") + let ind = indent(completeLine) + endif + else + let lineCompletedBrackets = 1 + endif + endif + + if ind == originalIndentValue + let bracketCount = scala#CountBrackets(prevline, '(', ')') + if bracketCount > 0 || prevline =~ '.*(\s*$' + call scala#ConditionalConfirm("5a") + let ind = ind + &shiftwidth + elseif bracketCount < 0 + call scala#ConditionalConfirm("6a") + " if the closing brace actually completes the braces entirely, then we + " have to indent to line that started the whole thing + let completeLine = scala#LineCompletesBrackets('(', ')') + if completeLine != -1 && prevline !~ '^.*{\s*$' + call scala#ConditionalConfirm("8a") + let prevCompleteLine = scala#GetLine(prevnonblank(completeLine - 1)) + " However, what actually started this part looks like it was a function + " definition, so we need to indent to that line instead. This is + " actually pretty weak at the moment. + if prevCompleteLine =~ '=\s*$' + call scala#ConditionalConfirm("9a") + let ind = indent(prevnonblank(completeLine - 1)) + else + call scala#ConditionalConfirm("10a") + let ind = indent(completeLine) + endif + else + " This is the only part that's different from from the '{', '}' one below + " Yup... some refactoring is necessary at some point. + let ind = ind + (bracketCount * &shiftwidth) + let lineCompletedBrackets = 1 + endif + endif + endif + + if curline =~ '^\s*}\?\s*\\%(\s\+\\s*(.*)\)\?\s*{\?\s*$' && + \ ! scala#LineIsCompleteIf(prevline) && + \ prevline !~ '^.*}\s*$' + let ind = ind - &shiftwidth + endif + + " Subtract a 'shiftwidth' on '}' or html + let curCurlyCount = scala#CountCurlies(curline) + if curCurlyCount < 0 + call scala#ConditionalConfirm("14a") + let matchline = scala#CurlyMatcher() + return indent(matchline) + elseif curline =~ '^\s*]*>' + call scala#ConditionalConfirm("14c") + return ind - &shiftwidth + endif + + let prevParenCount = scala#CountParens(prevline) + if prevline =~ '^\s*\.*$' && prevParenCount > 0 + call scala#ConditionalConfirm("15") + let ind = indent(prevlnum) + 5 + endif + + let prevCurlyCount = scala#CountCurlies(prevline) + if prevCurlyCount == 0 && prevline =~ '^.*\%(=>\|⇒\)\s*$' && prevline !~ '^\s*this\s*:.*\%(=>\|⇒\)\s*$' && curline !~ '^\s*\' + call scala#ConditionalConfirm("16") + let ind = ind + &shiftwidth + endif + + if ind == originalIndentValue && curline =~ '^\s*\' + call scala#ConditionalConfirm("17") + let parentCase = scala#IsParentCase() + if parentCase != -1 + call scala#ConditionalConfirm("17a") + return indent(parentCase) + endif + endif + + if prevline =~ '^\s*\*/' + \ || prevline =~ '*/\s*$' + call scala#ConditionalConfirm("18") + let ind = ind - star_indent + endif + + if scala#LineEndsInIncomplete(prevline) + call scala#ConditionalConfirm("19") + return ind + endif + + if scala#LineIsAClosingXML(prevline) + if scala#LineCompletesXML(prevlnum, prevline) + call scala#ConditionalConfirm("20a") + return ind - &shiftwidth + else + call scala#ConditionalConfirm("20b") + return ind + endif + endif + + if ind == originalIndentValue + "let indentMultiplier = scala#LineCompletesDefValr(prevlnum, prevline) + "if indentMultiplier != 0 + " call scala#ConditionalConfirm("19a") + " let ind = ind - (indentMultiplier * &shiftwidth) + let defValrLine = scala#Test(prevlnum, prevline, '{', '}') + if defValrLine != -1 + call scala#ConditionalConfirm("21a") + let ind = indent(defValrLine) + elseif lineCompletedBrackets == 0 + call scala#ConditionalConfirm("21b") + if scala#GetLine(prevnonblank(prevlnum - 1)) =~ '^.*\\s*\%(//.*\)\?$' + call scala#ConditionalConfirm("21c") + let ind = ind - &shiftwidth + elseif scala#LineCompletesIfElse(prevlnum, prevline) + call scala#ConditionalConfirm("21d") + let ind = ind - &shiftwidth + elseif scala#CountParens(curline) < 0 && curline =~ '^\s*)' && scala#GetLine(scala#GetLineThatMatchesBracket('(', ')')) =~ '.*(\s*$' + " Handles situations that look like this: + " + " val a = func( + " 10 + " ) + " + " or + " + " val a = func( + " 10 + " ).somethingHere() + call scala#ConditionalConfirm("21e") + let ind = ind - &shiftwidth + endif + endif + endif + + call scala#ConditionalConfirm("returning " . ind) + + return ind +endfunction + +let &cpo = s:keepcpo +unlet s:keepcpo + +" vim:set sw=2 sts=2 ts=8 et: +" vim600:fdm=marker fdl=1 fdc=0: diff --git a/runtime/keymap/pinyin.vim b/runtime/keymap/pinyin.vim index 757850b83f..253814c753 100644 --- a/runtime/keymap/pinyin.vim +++ b/runtime/keymap/pinyin.vim @@ -1,5 +1,5 @@ " Vim Keymap file for Hanyu Pinyin tone marks through numbers. -" Maintainer: Fredrik Roubert +" Maintainer: Fredrik Roubert " Last Changed: February 15, 2004 " All characters are given literally. diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 2053b2d860..36d1741362 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: Bram Moolenaar -" Last Change: 2016 Aug 12 +" Last Change: 2016 Aug 21 " If there already is an option window, jump to that one. if bufwinnr("option-window") > 0 @@ -1146,8 +1146,8 @@ endif if has("langmap") call append("$", "langmap\tlist of characters that are translated in Normal mode") call OptionG("lmap", &lmap) - call append("$", "langnoremap\tdon't apply 'langmap' to mapped characters") - call BinOptionG("lnr", &lnr) + call append("$", "langremap\tapply 'langmap' to mapped characters") + call BinOptionG("lrm", &lrm) endif if has("xim") call append("$", "imdisable\twhen set never use IM; overrules following IM options") diff --git a/runtime/plugin/matchit.vim b/runtime/plugin/matchit.vim index c0f1f08027..f275f7b36d 100644 --- a/runtime/plugin/matchit.vim +++ b/runtime/plugin/matchit.vim @@ -1,8 +1,10 @@ " matchit.vim: (global plugin) Extended "%" matching -" Last Change: Fri Jul 29 01:20 AM 2016 EST +" Last Change: 2016 Aug 21 " Maintainer: Benji Fisher PhD " Version: 1.13.2, for Vim 6.3+ " Fix from Tommy Allen included. +" Fix from Fernando Torres included. +" Improvement from Ken Takata included. " URL: http://www.vim.org/script.php?script_id=39 " Documentation: @@ -44,6 +46,7 @@ endif let loaded_matchit = 1 let s:last_mps = "" let s:last_words = ":" +let s:patBR = "" let s:save_cpo = &cpo set cpo&vim @@ -121,8 +124,8 @@ function! s:Match_wrapper(word, forward, mode) range execute "let match_words =" b:match_words endif " Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion! - if (match_words != s:last_words) || (&mps != s:last_mps) || - \ exists("b:match_debug") + if (match_words != s:last_words) || (&mps != s:last_mps) + \ || exists("b:match_debug") let s:last_mps = &mps " The next several lines were here before " BF started messing with this script. @@ -148,6 +151,10 @@ function! s:Match_wrapper(word, forward, mode) range if exists("b:match_debug") let b:match_pat = s:pat endif + " Reconstruct the version with unresolved backrefs. + let s:patBR = substitute(match_words.',', + \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g') + let s:patBR = substitute(s:patBR, s:notslash.'\zs:\{2,}', ':', 'g') endif " Second step: set the following local variables: @@ -192,14 +199,10 @@ function! s:Match_wrapper(word, forward, mode) range " group = colon-separated list of patterns, one of which matches " = ini:mid:fin or ini:fin " - " Reconstruct the version with unresolved backrefs. - let patBR = substitute(match_words.',', - \ s:notslash.'\zs[,:]*,[,:]*', ',', 'g') - let patBR = substitute(patBR, s:notslash.'\zs:\{2,}', ':', 'g') " Now, set group and groupBR to the matching group: 'if:endif' or " 'while:endwhile' or whatever. A bit of a kluge: s:Choose() returns " group . "," . groupBR, and we pick it apart. - let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR) + let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, s:patBR) let i = matchend(group, s:notslash . ",") let groupBR = strpart(group, i) let group = strpart(group, 0, i-1) @@ -656,6 +659,7 @@ fun! s:MultiMatch(spflag, mode) \ exists("b:match_debug") let s:last_words = match_words let s:last_mps = &mps + let match_words = match_words . (strlen(match_words) ? "," : "") . default if match_words !~ s:notslash . '\\\d' let s:do_BR = 0 let s:pat = match_words @@ -663,8 +667,8 @@ fun! s:MultiMatch(spflag, mode) let s:do_BR = 1 let s:pat = s:ParseWords(match_words) endif - let s:all = '\%(' . substitute(s:pat . (strlen(s:pat)?",":"") . default, - \ '[,:]\+','\\|','g') . '\)' + let s:all = '\%(' . substitute(s:pat . (strlen(s:pat) ? "," : "") . default, + \ '[,:]\+', '\\|', 'g') . '\)' if exists("b:match_debug") let b:match_pat = s:pat endif diff --git a/runtime/syntax/fortran.vim b/runtime/syntax/fortran.vim index b470e56f60..06e5390c60 100644 --- a/runtime/syntax/fortran.vim +++ b/runtime/syntax/fortran.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77) -" Version: 0.97 -" Last Change: 2016 Feb. 26 +" Version: 0.98 +" Last Change: 2016 Aug. 26 " Maintainer: Ajit J. Thakkar ; " Usage: For instructions, do :help fortran-syntax from Vim " Credits: @@ -10,7 +10,8 @@ " in chronological order, by: " Andrej Panjkov, Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile, " Walter Dieudonn, Alexander Wagner, Roman Bertle, Charles Rendleman, -" Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, and Jan Hermann. +" Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, Jan Hermann, +" Stefano Zaghi and Vishnu Krishnan. if exists("b:current_syntax") finish @@ -108,6 +109,7 @@ syn match fortranUnitHeader "\" syn keyword fortranCall call syn match fortranUnitHeader "\" syn match fortranUnitHeader "\" +syn match fortranUnitHeader "\" syn keyword fortranKeyword return stop syn keyword fortranConditional else then syn match fortranConditional "\" @@ -208,6 +210,7 @@ syn match fortranStorageClass "\" +syn match fortranUnitHeader "\" syn keyword fortranUnitHeader use only contains syn keyword fortranUnitHeader result operator assignment syn match fortranUnitHeader "\" @@ -231,8 +234,10 @@ syn match fortranIntrinsic "\\s*[(,]"me=s+4 syn match fortranUnitHeader "\" syn match fortranType "\" +syn match fortranType "\" if exists("fortran_more_precise") syn match fortranConstructName "\(\" endif @@ -286,8 +292,9 @@ if b:fortran_dialect == "f08" syn keyword fortranReadWrite flush wait syn keyword fortranIO decimal round iomsg - syn keyword fortranType asynchronous nopass non_overridable pass protected volatile abstract extends import + syn keyword fortranType asynchronous nopass non_overridable pass protected volatile extends import syn keyword fortranType non_intrinsic value bind deferred generic final enumerator + syn match fortranType "\" syn match fortranType "\" syn match fortranType "\" syn match fortranType "\" @@ -383,20 +391,22 @@ if exists("fortran_fold") if (b:fortran_fixed_source == 1) syn region fortranProgram transparent fold keepend start="^\s*program\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\|$\)" contains=ALLBUT,fortranModule + syn region fortranModule transparent fold keepend start="^\s*submodule\s\+(\a\w*\s*\(:\a\w*\s*\)*)\s*\z\(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\|$\)" contains=ALLBUT,fortranProgram,fortranModule syn region fortranModule transparent fold keepend start="^\s*module\s\+\(procedure\)\@!\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\|$\)" contains=ALLBUT,fortranProgram - syn region fortranFunction transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*\(\(\(real \|integer \|logical \|complex \|double \s*precision \)\s*\((\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\|type\s\+(\s*\w\+\s*) \|character \((\(\s*len\s*=\)\=\s*\d\+\s*)\|(\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\=\s*function\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\)" contains=ALLBUT,fortranProgram,fortranModule - syn region fortranSubroutine transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*subroutine\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\)" contains=ALLBUT,fortranProgram,fortranModule + syn region fortranFunction transparent fold keepend extend start="^\s*\(elemental \|pure \|impure \|module \|recursive \)\=\s*\(\(\(real \|integer \|logical \|complex \|double \s*precision \)\s*\((\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\|type\s\+(\s*\w\+\s*) \|character \((\(\s*len\s*=\)\=\s*\d\+\s*)\|(\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\=\s*function\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\)" contains=ALLBUT,fortranProgram,fortranModule + syn region fortranSubroutine transparent fold keepend extend start="^\s*\(elemental \|pure \|impure \|module \|recursive \)\=\s*subroutine\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\)" contains=ALLBUT,fortranProgram,fortranModule syn region fortranBlockData transparent fold keepend start="\ " Maintainer: Kyle Wheeler -" Last Change: 2 Feb 2012 +" Last Change: 18 August 2016 -" This file covers mutt version 1.5.21 (and most of the mercurial tip) -" Included are also a few features from 1.4.2.1 +" This file covers mutt version 1.7.0 " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded @@ -98,7 +97,7 @@ syn match muttrcSetNumAssignment contained skipwhite /=\s*'\d\+'/hs=s+1 nextgrou " Now catch some email addresses and headers (purified version from mail.vim) syn match muttrcEmail "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+" -syn match muttrcHeader "\<\%(From\|To\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\=" +syn match muttrcHeader "\<\c\%(From\|To\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\=" syn match muttrcKeySpecial contained +\%(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+ syn match muttrcKey contained "\S\+" contains=muttrcKeySpecial,muttrcKeyName @@ -109,143 +108,146 @@ syn match muttrcKeyName contained "\\[trne]" syn match muttrcKeyName contained "\c<\%(BackSpace\|BackTab\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>" syn match muttrcKeyName contained "" -syn keyword muttrcVarBool skipwhite contained allow_8bit allow_ansi arrow_cursor ascii_chars askbcc askcc attach_split auto_tag autoedit beep beep_new nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained bounce_delivered braille_friendly check_new check_mbox_size nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained collapse_unread confirmappend confirmcreate crypt_autoencrypt nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained crypt_autopgp crypt_autosign crypt_autosmime crypt_replyencrypt nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained crypt_replysign crypt_replysignencrypted crypt_timestamp nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained crypt_use_gpgme crypt_use_pka delete_untag digest_collapse duplicate_threads nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained edit_hdrs edit_headers encode_from envelope_from fast_reply nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained fcc_clear followup_to force_name forw_decode nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained forw_decrypt forw_quote forward_decode forward_decrypt nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained forward_quote hdrs header help hidden_host hide_limited nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained hide_missing hide_thread_subject hide_top_limited nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained hide_top_missing honor_disposition ignore_linear_white_space ignore_list_reply_to imap_check_subscribed nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained imap_list_subscribed imap_passive imap_peek imap_servernoise nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained implicit_autoview include_onlyfirst keep_flagged nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained mailcap_sanitize maildir_header_cache_verify maildir_trash nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained mark_old markers menu_move_off menu_scroll message_cache_clean meta_key nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained metoo mh_purge mime_forward_decode narrow_tree pager_stop nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained pgp_auto_decode pgp_auto_traditional pgp_autoencrypt nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained pgp_autoinline pgp_autosign pgp_check_exit nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained pgp_create_traditional pgp_ignore_subkeys pgp_long_ids nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained pgp_replyencrypt pgp_replyinline pgp_replysign nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained pgp_replysignencrypted pgp_retainable_sigs pgp_show_unusable nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained pgp_strict_enc pgp_use_gpg_agent pipe_decode pipe_split nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained pop_auth_try_all pop_last print_decode print_split nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained prompt_after read_only reply_self resolve reverse_alias nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained reverse_name reverse_realname rfc2047_parameters save_address nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained save_empty save_name score sig_dashes sig_on_top nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained smart_wrap smime_ask_cert_label smime_decrypt_use_default_key nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained smime_is_default sort_re ssl_force_tls ssl_use_sslv2 nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained ssl_use_sslv3 ssl_use_tlsv1 ssl_usesystemcerts ssl_verify_dates ssl_verify_host status_on_top nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained strict_mime strict_threads suspend text_flowed thorough_search nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained thread_received tilde uncollapse_jump use_8bitmime nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained use_domain use_envelope_from use_from use_idn use_ipv6 nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained user_agent wait_key weed wrap_search write_bcc nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn keyword muttrcVarBool skipwhite contained + \ allow_8bit allow_ansi arrow_cursor ascii_chars askbcc askcc attach_split + \ auto_tag autoedit beep beep_new bounce_delivered braille_friendly + \ check_mbox_size check_new collapse_unread confirmappend confirmcreate + \ crypt_autoencrypt crypt_autopgp crypt_autosign crypt_autosmime + \ crypt_confirmhook crypt_opportunistic_encrypt crypt_replyencrypt + \ crypt_replysign crypt_replysignencrypted crypt_timestamp crypt_use_gpgme + \ crypt_use_pka delete_untag digest_collapse duplicate_threads edit_hdrs + \ edit_headers encode_from envelope_from fast_reply fcc_clear followup_to + \ force_name forw_decode forw_decrypt forw_quote forward_decode forward_decrypt + \ forward_quote hdrs header help hidden_host hide_limited hide_missing + \ hide_thread_subject hide_top_limited hide_top_missing honor_disposition + \ idn_decode idn_encode ignore_linear_white_space ignore_list_reply_to + \ imap_check_subscribed imap_list_subscribed imap_passive imap_peek + \ imap_servernoise implicit_autoview include_onlyfirst keep_flagged + \ mail_check_recent mail_check_stats mailcap_sanitize maildir_check_cur + \ maildir_header_cache_verify maildir_trash mark_old markers menu_move_off + \ menu_scroll message_cache_clean meta_key metoo mh_purge mime_forward_decode + \ narrow_tree pager_stop pgp_auto_decode pgp_auto_traditional pgp_autoencrypt + \ pgp_autoinline pgp_autosign pgp_check_exit pgp_create_traditional + \ pgp_ignore_subkeys pgp_long_ids pgp_replyencrypt pgp_replyinline pgp_replysign + \ pgp_replysignencrypted pgp_retainable_sigs pgp_show_unusable pgp_strict_enc + \ pgp_use_gpg_agent pipe_decode pipe_split pop_auth_try_all pop_last + \ postpone_encrypt postpone_encrypt_as print_decode print_split prompt_after + \ read_only reflow_space_quotes reflow_text reflow_wrap reply_self resolve + \ resume_draft_files resume_edited_draft_files reverse_alias reverse_name + \ reverse_realname rfc2047_parameters save_address save_empty save_name score + \ sidebar_folder_indent sidebar_new_mail_only sidebar_next_new_wrap + \ sidebar_short_path sidebar_sort sidebar_visible sig_dashes sig_on_top + \ smart_wrap smime_ask_cert_label smime_decrypt_use_default_key smime_is_default + \ sort_re ssl_force_tls ssl_use_sslv2 ssl_use_sslv3 ssl_use_tlsv1 + \ ssl_usesystemcerts ssl_verify_dates ssl_verify_host status_on_top strict_mime + \ strict_threads suspend text_flowed thorough_search thread_received tilde + \ ts_enabled uncollapse_jump use_8bitmime use_domain use_envelope_from use_from + \ use_idn use_ipv6 user_agent wait_key weed wrap_search write_bcc + \ nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noallow_8bit noallow_ansi noarrow_cursor noascii_chars noaskbcc nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noaskcc noattach_split noauto_tag noautoedit nobeep nobeep_new nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nobounce_delivered nobraille_friendly nocheck_new nocollapse_unread nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noconfirmappend noconfirmcreate nocrypt_autoencrypt nocrypt_autopgp nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nocrypt_autosign nocrypt_autosmime nocrypt_replyencrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nocrypt_replysign nocrypt_replysignencrypted nocrypt_timestamp nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nocrypt_use_gpgme nodelete_untag nodigest_collapse noduplicate_threads nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noedit_hdrs noedit_headers noencode_from noenvelope_from nofast_reply nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nofcc_clear nofollowup_to noforce_name noforw_decode nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noforw_decrypt noforw_quote noforward_decode noforward_decrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noforward_quote nohdrs noheader nohelp nohidden_host nohide_limited nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nohide_missing nohide_thread_subject nohide_top_limited nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nohide_top_missing nohonor_disposition noignore_list_reply_to noimap_check_subscribed nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noimap_list_subscribed noimap_passive noimap_peek noimap_servernoise nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noimplicit_autoview noinclude_onlyfirst nokeep_flagged nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nomailcap_sanitize nomaildir_header_cache_verify nomaildir_trash nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nomark_old nomarkers nomenu_move_off nomenu_scroll nometa_key nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nometoo nomh_purge nomime_forward_decode nonarrow_tree nopager_stop nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nopgp_auto_decode nopgp_auto_traditional nopgp_autoencrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nopgp_autoinline nopgp_autosign nopgp_check_exit nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nopgp_create_traditional nopgp_ignore_subkeys nopgp_long_ids nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nopgp_replyencrypt nopgp_replyinline nopgp_replysign nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nopgp_replysignencrypted nopgp_retainable_sigs nopgp_show_unusable nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nopgp_strict_enc nopgp_use_gpg_agent nopipe_decode nopipe_split nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nopop_auth_try_all nopop_last noprint_decode noprint_split nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noprompt_after noread_only noreply_self noresolve noreverse_alias nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained noreverse_name noreverse_realname norfc2047_parameters nosave_address nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nosave_empty nosave_name noscore nosig_dashes nosig_on_top nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nosmart_wrap nosmime_ask_cert_label nosmime_decrypt_use_default_key nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nosmime_is_default nosort_re nossl_force_tls nossl_use_sslv2 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nossl_use_sslv3 nossl_use_tlsv1 nossl_usesystemcerts nostatus_on_top nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nostrict_threads nosuspend notext_flowed nothorough_search nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nothread_received notilde nouncollapse_jump nouse_8bitmime nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nouse_domain nouse_envelope_from nouse_from nouse_idn nouse_ipv6 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained nouser_agent nowait_key noweed nowrap_search nowrite_bcc nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn keyword muttrcVarBool skipwhite contained + \ noallow_8bit noallow_ansi noarrow_cursor noascii_chars noaskbcc noaskcc noattach_split + \ noauto_tag noautoedit nobeep nobeep_new nobounce_delivered nobraille_friendly + \ nocheck_mbox_size nocheck_new nocollapse_unread noconfirmappend noconfirmcreate + \ nocrypt_autoencrypt nocrypt_autopgp nocrypt_autosign nocrypt_autosmime + \ nocrypt_confirmhook nocrypt_opportunistic_encrypt nocrypt_replyencrypt + \ nocrypt_replysign nocrypt_replysignencrypted nocrypt_timestamp nocrypt_use_gpgme + \ nocrypt_use_pka nodelete_untag nodigest_collapse noduplicate_threads noedit_hdrs + \ noedit_headers noencode_from noenvelope_from nofast_reply nofcc_clear nofollowup_to + \ noforce_name noforw_decode noforw_decrypt noforw_quote noforward_decode noforward_decrypt + \ noforward_quote nohdrs noheader nohelp nohidden_host nohide_limited nohide_missing + \ nohide_thread_subject nohide_top_limited nohide_top_missing nohonor_disposition + \ noidn_decode noidn_encode noignore_linear_white_space noignore_list_reply_to + \ noimap_check_subscribed noimap_list_subscribed noimap_passive noimap_peek + \ noimap_servernoise noimplicit_autoview noinclude_onlyfirst nokeep_flagged + \ nomail_check_recent nomail_check_stats nomailcap_sanitize nomaildir_check_cur + \ nomaildir_header_cache_verify nomaildir_trash nomark_old nomarkers nomenu_move_off + \ nomenu_scroll nomessage_cache_clean nometa_key nometoo nomh_purge nomime_forward_decode + \ nonarrow_tree nopager_stop nopgp_auto_decode nopgp_auto_traditional nopgp_autoencrypt + \ nopgp_autoinline nopgp_autosign nopgp_check_exit nopgp_create_traditional + \ nopgp_ignore_subkeys nopgp_long_ids nopgp_replyencrypt nopgp_replyinline nopgp_replysign + \ nopgp_replysignencrypted nopgp_retainable_sigs nopgp_show_unusable nopgp_strict_enc + \ nopgp_use_gpg_agent nopipe_decode nopipe_split nopop_auth_try_all nopop_last + \ nopostpone_encrypt nopostpone_encrypt_as noprint_decode noprint_split noprompt_after + \ noread_only noreflow_space_quotes noreflow_text noreflow_wrap noreply_self noresolve + \ noresume_draft_files noresume_edited_draft_files noreverse_alias noreverse_name + \ noreverse_realname norfc2047_parameters nosave_address nosave_empty nosave_name noscore + \ nosidebar_folder_indent nosidebar_new_mail_only nosidebar_next_new_wrap + \ nosidebar_short_path nosidebar_sort nosidebar_visible nosig_dashes nosig_on_top + \ nosmart_wrap nosmime_ask_cert_label nosmime_decrypt_use_default_key nosmime_is_default + \ nosort_re nossl_force_tls nossl_use_sslv2 nossl_use_sslv3 nossl_use_tlsv1 + \ nossl_usesystemcerts nossl_verify_dates nossl_verify_host nostatus_on_top nostrict_mime + \ nostrict_threads nosuspend notext_flowed nothorough_search nothread_received notilde + \ nots_enabled nouncollapse_jump nouse_8bitmime nouse_domain nouse_envelope_from nouse_from + \ nouse_idn nouse_ipv6 nouser_agent nowait_key noweed nowrap_search nowrite_bcc + \ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invallow_8bit invallow_ansi invarrow_cursor invascii_chars invaskbcc nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invaskcc invattach_split invauto_tag invautoedit invbeep invbeep_new nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invbounce_delivered invbraille_friendly invcheck_new invcollapse_unread nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invconfirmappend invconfirmcreate invcrypt_autoencrypt invcrypt_autopgp nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invcrypt_autosign invcrypt_autosmime invcrypt_replyencrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invcrypt_replysign invcrypt_replysignencrypted invcrypt_timestamp nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invcrypt_use_gpgme invdelete_untag invdigest_collapse invduplicate_threads nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invedit_hdrs invedit_headers invencode_from invenvelope_from invfast_reply nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invfcc_clear invfollowup_to invforce_name invforw_decode nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invforw_decrypt invforw_quote invforward_decode invforward_decrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invforward_quote invhdrs invheader invhelp invhidden_host invhide_limited nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invhide_missing invhide_thread_subject invhide_top_limited nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invhide_top_missing invhonor_disposition invignore_list_reply_to invimap_check_subscribed nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invimap_list_subscribed invimap_passive invimap_peek invimap_servernoise nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invimplicit_autoview invinclude_onlyfirst invkeep_flagged nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invmailcap_sanitize invmaildir_header_cache_verify invmaildir_trash nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invmark_old invmarkers invmenu_move_off invmenu_scroll invmeta_key nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invmetoo invmh_purge invmime_forward_decode invnarrow_tree invpager_stop nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invpgp_auto_decode invpgp_auto_traditional invpgp_autoencrypt nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invpgp_autoinline invpgp_autosign invpgp_check_exit nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invpgp_create_traditional invpgp_ignore_subkeys invpgp_long_ids nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invpgp_replyencrypt invpgp_replyinline invpgp_replysign nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invpgp_replysignencrypted invpgp_retainable_sigs invpgp_show_unusable nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invpgp_strict_enc invpgp_use_gpg_agent invpipe_decode invpipe_split nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invpop_auth_try_all invpop_last invprint_decode invprint_split nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invprompt_after invread_only invreply_self invresolve invreverse_alias nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invreverse_name invreverse_realname invrfc2047_parameters invsave_address nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invsave_empty invsave_name invscore invsig_dashes invsig_on_top nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invsmart_wrap invsmime_ask_cert_label invsmime_decrypt_use_default_key nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invsmime_is_default invsort_re invssl_force_tls invssl_use_sslv2 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invssl_use_sslv3 invssl_use_tlsv1 invssl_usesystemcerts invstatus_on_top nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invstrict_threads invsuspend invtext_flowed invthorough_search nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invthread_received invtilde invuncollapse_jump invuse_8bitmime nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invuse_domain invuse_envelope_from invuse_from invuse_idn invuse_ipv6 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarBool skipwhite contained invuser_agent invwait_key invweed invwrap_search invwrite_bcc nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -if use_mutt_sidebar == 1 - syn keyword muttrcVarBool skipwhite contained sidebar_visible sidebar_sort nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -endif +syn keyword muttrcVarBool skipwhite contained + \ invallow_8bit invallow_ansi invarrow_cursor invascii_chars invaskbcc invaskcc invattach_split + \ invauto_tag invautoedit invbeep invbeep_new invbounce_delivered invbraille_friendly + \ invcheck_mbox_size invcheck_new invcollapse_unread invconfirmappend invconfirmcreate + \ invcrypt_autoencrypt invcrypt_autopgp invcrypt_autosign invcrypt_autosmime + \ invcrypt_confirmhook invcrypt_opportunistic_encrypt invcrypt_replyencrypt + \ invcrypt_replysign invcrypt_replysignencrypted invcrypt_timestamp invcrypt_use_gpgme + \ invcrypt_use_pka invdelete_untag invdigest_collapse invduplicate_threads invedit_hdrs + \ invedit_headers invencode_from invenvelope_from invfast_reply invfcc_clear invfollowup_to + \ invforce_name invforw_decode invforw_decrypt invforw_quote invforward_decode invforward_decrypt + \ invforward_quote invhdrs invheader invhelp invhidden_host invhide_limited invhide_missing + \ invhide_thread_subject invhide_top_limited invhide_top_missing invhonor_disposition + \ invidn_decode invidn_encode invignore_linear_white_space invignore_list_reply_to + \ invimap_check_subscribed invimap_list_subscribed invimap_passive invimap_peek + \ invimap_servernoise invimplicit_autoview invinclude_onlyfirst invkeep_flagged + \ invmail_check_recent invmail_check_stats invmailcap_sanitize invmaildir_check_cur + \ invmaildir_header_cache_verify invmaildir_trash invmark_old invmarkers invmenu_move_off + \ invmenu_scroll invmessage_cache_clean invmeta_key invmetoo invmh_purge invmime_forward_decode + \ invnarrow_tree invpager_stop invpgp_auto_decode invpgp_auto_traditional invpgp_autoencrypt + \ invpgp_autoinline invpgp_autosign invpgp_check_exit invpgp_create_traditional + \ invpgp_ignore_subkeys invpgp_long_ids invpgp_replyencrypt invpgp_replyinline invpgp_replysign + \ invpgp_replysignencrypted invpgp_retainable_sigs invpgp_show_unusable invpgp_strict_enc + \ invpgp_use_gpg_agent invpipe_decode invpipe_split invpop_auth_try_all invpop_last + \ invpostpone_encrypt invpostpone_encrypt_as invprint_decode invprint_split invprompt_after + \ invread_only invreflow_space_quotes invreflow_text invreflow_wrap invreply_self invresolve + \ invresume_draft_files invresume_edited_draft_files invreverse_alias invreverse_name + \ invreverse_realname invrfc2047_parameters invsave_address invsave_empty invsave_name invscore + \ invsidebar_folder_indent invsidebar_new_mail_only invsidebar_next_new_wrap + \ invsidebar_short_path invsidebar_sort invsidebar_visible invsig_dashes invsig_on_top + \ invsmart_wrap invsmime_ask_cert_label invsmime_decrypt_use_default_key invsmime_is_default + \ invsort_re invssl_force_tls invssl_use_sslv2 invssl_use_sslv3 invssl_use_tlsv1 + \ invssl_usesystemcerts invssl_verify_dates invssl_verify_host invstatus_on_top invstrict_mime + \ invstrict_threads invsuspend invtext_flowed invthorough_search invthread_received invtilde + \ invts_enabled invuncollapse_jump invuse_8bitmime invuse_domain invuse_envelope_from invuse_from + \ invuse_idn invuse_ipv6 invuser_agent invwait_key invweed invwrap_search invwrite_bcc + \ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained abort_nosubject abort_unmodified bounce copy nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained crypt_verify_sig delete fcc_attach forward_edit honor_followup_to nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained include mime_forward mime_forward_rest mime_fwd move nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained pgp_mime_auto pgp_verify_sig pop_delete pop_reconnect nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained postpone print quit recall reply_to ssl_starttls nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn keyword muttrcVarQuad skipwhite contained + \ abort_nosubject abort_unmodified bounce copy crypt_verify_sig delete + \ fcc_attach forward_edit honor_followup_to include mime_forward + \ mime_forward_rest mime_fwd move pgp_mime_auto pgp_verify_sig pop_delete + \ pop_reconnect postpone print quit recall reply_to ssl_starttls + \ nextgroup=muttrcSetQuadAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained noabort_nosubject noabort_unmodified nobounce nocopy nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained nocrypt_verify_sig nodelete nofcc_attach noforward_edit nohonor_followup_to nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained noinclude nomime_forward nomime_forward_rest nomime_fwd nomove nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained nopgp_mime_auto nopgp_verify_sig nopop_delete nopop_reconnect nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained nopostpone noprint noquit norecall noreply_to nossl_starttls nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn keyword muttrcVarQuad skipwhite contained + \ noabort_nosubject noabort_unmodified nobounce nocopy nocrypt_verify_sig nodelete + \ nofcc_attach noforward_edit nohonor_followup_to noinclude nomime_forward + \ nomime_forward_rest nomime_fwd nomove nopgp_mime_auto nopgp_verify_sig nopop_delete + \ nopop_reconnect nopostpone noprint noquit norecall noreply_to nossl_starttls + \ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained invabort_nosubject invabort_unmodified invbounce invcopy nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained invcrypt_verify_sig invdelete invfcc_attach invforward_edit invhonor_followup_to nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained invinclude invmime_forward invmime_forward_rest invmime_fwd invmove nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained invpgp_mime_auto invpgp_verify_sig invpop_delete invpop_reconnect nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarQuad skipwhite contained invpostpone invprint invquit invrecall invreply_to invssl_starttls nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syn keyword muttrcVarQuad skipwhite contained + \ invabort_nosubject invabort_unmodified invbounce invcopy invcrypt_verify_sig invdelete + \ invfcc_attach invforward_edit invhonor_followup_to invinclude invmime_forward + \ invmime_forward_rest invmime_fwd invmove invpgp_mime_auto invpgp_verify_sig invpop_delete + \ invpop_reconnect invpostpone invprint invquit invrecall invreply_to invssl_starttls + \ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarNum skipwhite contained connect_timeout history imap_keepalive imap_pipeline_depth mail_check nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarNum skipwhite contained menu_context net_inc pager_context pager_index_lines pgp_timeout nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarNum skipwhite contained pop_checkinterval read_inc save_history score_threshold_delete nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarNum skipwhite contained score_threshold_flag score_threshold_read search_context sendmail_wait sleep_time nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarNum skipwhite contained smime_timeout ssl_min_dh_prime_bits timeout time_inc wrap wrapmargin nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarNum skipwhite contained write_inc nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -if use_mutt_sidebar == 1 - syn keyword muttrcVarNum skipwhite contained sidebar_width nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -endif +syn keyword muttrcVarNum skipwhite contained + \ connect_timeout history imap_keepalive imap_pipeline_depth mail_check + \ mail_check_stats_interval menu_context net_inc pager_context pager_index_lines + \ pgp_timeout pop_checkinterval read_inc save_history score_threshold_delete + \ score_threshold_flag score_threshold_read search_context sendmail_wait + \ sidebar_width sleep_time smime_timeout ssl_min_dh_prime_bits time_inc timeout + \ wrap wrap_headers wrapmargin write_inc + \ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcFormatErrors contained /%./ @@ -349,7 +351,7 @@ syn keyword muttrcVarStr contained skipwhite query_format nextgroup=muttrcVarEqu syn match muttrcVarEqualsQueryFmt contained skipwhite "=" nextgroup=muttrcQueryFormatStr syn keyword muttrcVarStr contained skipwhite pgp_decode_command pgp_verify_command pgp_decrypt_command pgp_clearsign_command pgp_sign_command pgp_encrypt_sign_command pgp_encrypt_only_command pgp_import_command pgp_export_command pgp_verify_key_command pgp_list_secring_command pgp_list_pubring_command nextgroup=muttrcVarEqualsPGPCmdFmt syn match muttrcVarEqualsPGPCmdFmt contained skipwhite "=" nextgroup=muttrcPGPCmdFormatStr -syn keyword muttrcVarStr contained skipwhite status_format nextgroup=muttrcVarEqualsStatusFmt +syn keyword muttrcVarStr contained skipwhite ts_icon_format ts_status_format status_format nextgroup=muttrcVarEqualsStatusFmt syn match muttrcVarEqualsStatusFmt contained skipwhite "=" nextgroup=muttrcStatusFormatStr syn keyword muttrcVarStr contained skipwhite pgp_getkeys_command nextgroup=muttrcVarEqualsPGPGetKeysFmt syn match muttrcVarEqualsPGPGetKeysFmt contained skipwhite "=" nextgroup=muttrcPGPGetKeysFormatStr @@ -361,34 +363,29 @@ syn match muttrcVarEqualsStrftimeFmt contained skipwhite "=" nextgroup=muttrcStr syn match muttrcVPrefix contained /[?&]/ nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr syn match muttrcVarStr contained skipwhite 'my_[a-zA-Z0-9_]\+' nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite alias_file assumed_charset attach_charset attach_sep nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite certificate_file charset config_charset content_type nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite default_hook display_filter dotlock_program dsn_notify nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite dsn_return editor entropy_file envelope_from_address escape folder nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite forw_format forward_format from gecos_mask hdr_format nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite header_cache header_cache_compress header_cache_pagesize nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite history_file hostname imap_authenticators nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite imap_delim_chars imap_headers imap_idle imap_login imap_pass nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite imap_user indent_str indent_string ispell locale mailcap_path nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite mask mbox mbox_type message_cachedir mh_seq_flagged mh_seq_replied nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite mh_seq_unseen mixmaster msg_format pager nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite pgp_good_sign nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite pgp_mime_signature_filename nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite pgp_mime_signature_description pgp_sign_as nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite pgp_sort_keys nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite pipe_sep pop_authenticators pop_host pop_pass pop_user post_indent_str nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite post_indent_string postponed preconnect print_cmd print_command nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite query_command quote_regexp realname record reply_regexp send_charset nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite sendmail shell signature simple_search smileys smime_ca_location nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite smime_certificates smime_default_key nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite smime_encrypt_with nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite smime_keys smime_sign_as nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite smtp_url smtp_authenticators smtp_pass sort sort_alias sort_aux nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite sort_browser spam_separator spoolfile ssl_ca_certificates_file ssl_client_cert nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -syn keyword muttrcVarStr contained skipwhite status_chars tmpdir to_chars tunnel visual nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -if use_mutt_sidebar == 1 - syn keyword muttrcVarStr skipwhite contained sidebar_delim nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr -endif +syn keyword muttrcVarStr contained skipwhite + \ alias_file assumed_charset attach_charset attach_sep certificate_file charset + \ config_charset content_type default_hook display_filter dotlock_program + \ dsn_notify dsn_return editor entropy_file envelope_from_address escape folder + \ forw_format forward_format from gecos_mask hdr_format header_cache + \ header_cache_compress header_cache_pagesize history_file hostname + \ imap_authenticators imap_delim_chars imap_headers imap_idle imap_login + \ imap_pass imap_user indent_str indent_string ispell locale mailcap_path mask + \ mbox mbox_type message_cachedir mh_seq_flagged mh_seq_replied mh_seq_unseen + \ mixmaster msg_format pager pgp_decryption_okay pgp_good_sign + \ pgp_mime_signature_description pgp_mime_signature_filename pgp_sign_as + \ pgp_sort_keys pipe_sep pop_authenticators pop_host pop_pass pop_user + \ post_indent_str post_indent_string postpone_encrypt_as postponed preconnect + \ print_cmd print_command query_command quote_regexp realname record + \ reply_regexp send_charset sendmail shell sidebar_delim sidebar_delim_chars + \ sidebar_divider_char sidebar_format sidebar_indent_string sidebar_sort_method + \ signature simple_search smileys smime_ca_location smime_certificates + \ smime_default_key smime_encrypt_with smime_keys smime_sign_as + \ smime_sign_digest_alg smtp_authenticators smtp_pass smtp_url sort sort_alias + \ sort_aux sort_browser spam_separator spoolfile ssl_ca_certificates_file + \ ssl_ciphers ssl_client_cert status_chars tmpdir to_chars trash ts_icon_format + \ ts_status_format tunnel visual + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr " Present in 1.4.2.1 (pgp_create_traditional was a bool then) syn keyword muttrcVarBool contained skipwhite imap_force_ssl noimap_force_ssl invimap_force_ssl nextgroup=muttrcSetBoolAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr @@ -401,12 +398,11 @@ syn match muttrcMenuCommas /,/ contained syn keyword muttrcHooks contained skipwhite account-hook charset-hook iconv-hook message-hook folder-hook mbox-hook save-hook fcc-hook fcc-save-hook send-hook send2-hook reply-hook crypt-hook -syn keyword muttrcCommand auto_view alternative_order exec unalternative_order -syn keyword muttrcCommand hdr_order iconv-hook ignore mailboxes my_hdr unmailboxes -syn keyword muttrcCommand pgp-hook push score source unauto_view unhdr_order -syn keyword muttrcCommand unignore unmono unmy_hdr unscore -syn keyword muttrcCommand mime_lookup unmime_lookup ungroup -syn keyword muttrcCommand unalternative_order +syn keyword muttrcCommand skipwhite + \ alternative_order auto_view exec hdr_order iconv-hook ignore mailboxes + \ mailto_allow mime_lookup my_hdr pgp-hook push score sidebar_whitelist source + \ unalternative_order unalternative_order unauto_view ungroup unhdr_order + \ unignore unmailboxes unmailto_allow unmime_lookup unmono unmy_hdr unscore syn keyword muttrcCommand skipwhite charset-hook nextgroup=muttrcRXString syn keyword muttrcCommand skipwhite unhook nextgroup=muttrcHooks @@ -441,7 +437,7 @@ syn match muttrcVariableInner contained "\$[a-zA-Z_-]\+" syn match muttrcEscapedVariable contained "\\\$[a-zA-Z_-]\+" syn match muttrcBadAction contained "[^<>]\+" contains=muttrcEmail -syn match muttrcFunction contained "\<\%(attach\|bounce\|copy\|delete\|display\|flag\|forward\|parent\|pipe\|postpone\|print\|recall\|resend\|save\|send\|tag\|undelete\)-message\>" +syn match muttrcFunction contained "\<\%(attach\|bounce\|copy\|delete\|display\|flag\|forward\|parent\|pipe\|postpone\|print\|purge\|recall\|resend\|save\|send\|tag\|undelete\)-message\>" syn match muttrcFunction contained "\<\%(delete\|next\|previous\|read\|tag\|break\|undelete\)-thread\>" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\<\%(backward\|capitalize\|downcase\|forward\|kill\|upcase\)-word\>" @@ -465,11 +461,13 @@ syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" +syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\" syn match muttrcFunction contained "\<\%(backspace\|backward-char\|bol\|bottom\|bottom-page\|buffy-cycle\|clear-flag\|complete\%(-query\)\?\|copy-file\|create-alias\|detach-file\|eol\|exit\|extract-keys\|\%(imap-\)\?fetch-mail\|forget-passphrase\|forward-char\|group-reply\|help\|ispell\|jump\|limit\|list-reply\|mail\|mail-key\|mark-as-new\|middle-page\|new-mime\|noop\|pgp-menu\|query\|query-append\|quit\|quote-char\|read-subthread\|redraw-screen\|refresh\|rename-file\|reply\|select-new\|set-flag\|shell-escape\|skip-quoted\|sort\|subscribe\|sync-mailbox\|top\|top-page\|transpose-chars\|unsubscribe\|untag-pattern\|verify-key\|what-key\|write-fcc\)\>" +syn keyword muttrcFunction contained imap-logout-all if use_mutt_sidebar == 1 syn match muttrcFunction contained "\" if use_mutt_sidebar == 1 syn keyword muttrcColorField contained sidebar_new diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim index fa42b3e2d2..f0f03a8c8d 100644 --- a/runtime/syntax/python.vim +++ b/runtime/syntax/python.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Python " Maintainer: Zvezdan Petkovic -" Last Change: 2016 Jul 21 +" Last Change: 2016 Aug 14 " Credits: Neil Schemenauer " Dmitry Vasiliev " @@ -84,14 +84,30 @@ syn keyword pythonInclude from import syn keyword pythonAsync async await " Decorators (new in Python 2.4) -syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite -" The zero-length non-grouping match before the function name is -" extremely important in pythonFunction. Without it, everything is -" interpreted as a function inside the contained environment of -" doctests. +" Python 3.5 introduced the use of the same symbol for matrix +" multiplication. We now have to exclude the symbol from being +" highlighted when used in that context. Hence, the check that it's +" preceded by empty space only (possibly in a docstring/doctest) and +" followed by decorator name, optional parenthesized list of arguments, +" and the next line with either def, class, or another decorator. +syn match pythonDecorator + \ "\%(\%(^\s*\)\%(\%(>>>\|\.\.\.\)\s\+\)\=\)\zs@\%(\s*\h\%(\w\|\.\)*\%(([^)]*)\)\=\s*\n\s*\%(\.\.\.\s\+\)\=\%(@\s*\h\|\%(def\|class\)\s\+\)\)\@=" + \ display nextgroup=pythonDecoratorName skipwhite + " A dot must be allowed because of @MyClass.myfunc decorators. +" It must be preceded by a decorator symbol and on a separate line from +" a function/class it decorates. +syn match pythonDecoratorName + \ "\%(@\s*\)\@<=\h\%(\w\|\.\)*\%(\%(([^)]*)\)\=\s*\n\)\@=" + \ contained display nextgroup=pythonFunction skipnl + +" The zero-length non-grouping match of def or class before the function +" name is extremely important in pythonFunction. Without it, everything +" is interpreted as a function inside the contained environment of +" doctests. syn match pythonFunction - \ "\%(\%(def\s\|class\s\|@\)\s*\)\@<=\h\%(\w\|\.\)*" contained + \ "\%(\%(^\s*\)\%(\%(>>>\|\.\.\.\)\s\+\)\=\%(def\|class\)\s\+\)\@<=\h\w*" + \ contained syn match pythonComment "#.*$" contains=pythonTodo,@Spell syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained @@ -293,6 +309,7 @@ if version >= 508 || !exists("did_python_syn_inits") HiLink pythonInclude Include HiLink pythonAsync Statement HiLink pythonDecorator Define + HiLink pythonDecoratorName Function HiLink pythonFunction Function HiLink pythonComment Comment HiLink pythonTodo Todo diff --git a/runtime/syntax/r.vim b/runtime/syntax/r.vim index d96bf96acb..30a5b23f84 100644 --- a/runtime/syntax/r.vim +++ b/runtime/syntax/r.vim @@ -5,7 +5,7 @@ " Tom Payne " Contributor: Johannes Ranke " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Thu Mar 10, 2016 12:26PM +" Last Change: Thu Aug 25, 2016 08:52PM " Filenames: *.R *.r *.Rhistory *.Rt " " NOTE: The highlighting of R functions is defined in @@ -26,7 +26,7 @@ if exists("b:current_syntax") finish endif -setlocal iskeyword=@,48-57,_,. +syn iskeyword @,48-57,_,. if exists("g:r_syntax_folding") && g:r_syntax_folding setlocal foldmethod=syntax @@ -174,8 +174,6 @@ endif if g:R_hi_fun " Nvim-R: runtime R/functions.vim - " Vim-R-plugin: - runtime r-plugin/functions.vim endif syn match rDollar display contained "\$" diff --git a/runtime/syntax/rhelp.vim b/runtime/syntax/rhelp.vim index 47c764e296..8cac585bb0 100644 --- a/runtime/syntax/rhelp.vim +++ b/runtime/syntax/rhelp.vim @@ -3,7 +3,7 @@ " Maintainer: Jakson Aquino " Former Maintainer: Johannes Ranke " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Feb 06, 2016 11:34AM +" Last Change: Tue Jun 28, 2016 08:53AM " Remarks: - Includes R syntax highlighting in the appropriate " sections if an r.vim file is in the same directory or in the " default debian location. @@ -17,7 +17,6 @@ if exists("b:current_syntax") endif scriptencoding utf-8 -setlocal iskeyword=@,48-57,_,. syn case match diff --git a/runtime/syntax/rmd.vim b/runtime/syntax/rmd.vim index 4cde7441d3..48fb5e079c 100644 --- a/runtime/syntax/rmd.vim +++ b/runtime/syntax/rmd.vim @@ -1,7 +1,7 @@ " markdown Text with R statements " Language: markdown with R code chunks " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Feb 06, 2016 06:45AM +" Last Change: Tue Jun 28, 2016 10:09AM " " CONFIGURATION: " To highlight chunk headers as R code, put in your vimrc: @@ -72,8 +72,6 @@ if rmdIsPandoc == 0 hi def link rmdLaTeXRegDelim Special endif -setlocal iskeyword=@,48-57,_,. - syn sync match rmdSyncChunk grouphere rmdChunk "^[ \t]*``` *{r" hi def link rmdChunkDelim Special diff --git a/runtime/syntax/rrst.vim b/runtime/syntax/rrst.vim index 24d3844df0..b643af3285 100644 --- a/runtime/syntax/rrst.vim +++ b/runtime/syntax/rrst.vim @@ -2,7 +2,7 @@ " Language: reST with R code chunks " Maintainer: Alex Zvoleff, azvoleff@mail.sdsu.edu " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Feb 06, 2016 06:45AM +" Last Change: Tue Jun 28, 2016 08:53AM " " CONFIGURATION: " To highlight chunk headers as R code, put in your vimrc: @@ -19,8 +19,6 @@ unlet b:current_syntax " load all of the r syntax highlighting rules into @R syntax include @R syntax/r.vim -setlocal iskeyword=@,48-57,_,. - " highlight R chunks if exists("g:rrst_syn_hl_chunk") " highlight R code inside chunk header diff --git a/runtime/syntax/scala.vim b/runtime/syntax/scala.vim new file mode 100644 index 0000000000..b04af3be5b --- /dev/null +++ b/runtime/syntax/scala.vim @@ -0,0 +1,231 @@ +" Vim syntax file +" Language: Scala +" Maintainer: Derek Wyatt +" URL: https://github.com/derekwyatt/vim-scala +" License: Same as Vim +" Last Change: 20 May 2016 +" ---------------------------------------------------------------------------- + +if !exists('main_syntax') + if version < 600 + syntax clear + elseif exists("b:current_syntax") + finish + endif + let main_syntax = 'scala' +endif + +scriptencoding utf-8 + +let b:current_syntax = "scala" + +" Allows for embedding, see #59; main_syntax convention instead? Refactor TOP +" +" The @Spell here is a weird hack, it means *exclude* if the first group is +" TOP. Otherwise we get spelling errors highlighted on code elements that +" match scalaBlock, even with `syn spell notoplevel`. +function! s:ContainedGroup() + try + silent syn list @scala + return '@scala,@NoSpell' + catch /E392/ + return 'TOP,@Spell' + endtry +endfunction + +unlet! b:current_syntax + +syn case match +syn sync minlines=200 maxlines=1000 + +syn keyword scalaKeyword catch do else final finally for forSome if +syn keyword scalaKeyword match return throw try while yield macro +syn keyword scalaKeyword class trait object extends with nextgroup=scalaInstanceDeclaration skipwhite +syn keyword scalaKeyword case nextgroup=scalaKeyword,scalaCaseFollowing skipwhite +syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skipwhite +syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite +hi link scalaKeyword Keyword + +exe 'syn region scalaBlock start=/{/ end=/}/ contains=' . s:ContainedGroup() . ' fold' + +syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome +hi link scalaAkkaSpecialWord PreProc + +syn keyword scalatestSpecialWord shouldBe +syn match scalatestShouldDSLA /^\s\+\zsit should/ +syn match scalatestShouldDSLB /\/ +hi link scalatestSpecialWord PreProc +hi link scalatestShouldDSLA PreProc +hi link scalatestShouldDSLB PreProc + +syn match scalaSymbol /'[_A-Za-z0-9$]\+/ +hi link scalaSymbol Number + +syn match scalaChar /'.'/ +syn match scalaChar /'\\[\\"'ntbrf]'/ contains=scalaEscapedChar +syn match scalaChar /'\\u[A-Fa-f0-9]\{4}'/ contains=scalaUnicodeChar +syn match scalaEscapedChar /\\[\\"'ntbrf]/ +syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/ +hi link scalaChar Character +hi link scalaEscapedChar Function +hi link scalaUnicodeChar Special + +syn match scalaOperator "||" +syn match scalaOperator "&&" +hi link scalaOperator Special + +syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition,scalaVariableDeclarationList +syn match scalaNameDefinition /`[^`]\+`/ contained nextgroup=scalaPostNameDefinition +syn match scalaVariableDeclarationList /\s*,\s*/ contained nextgroup=scalaNameDefinition +syn match scalaPostNameDefinition /\_s*:\_s*/ contained nextgroup=scalaTypeDeclaration +hi link scalaNameDefinition Function + +syn match scalaInstanceDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaInstanceHash +syn match scalaInstanceDeclaration /`[^`]\+`/ contained +syn match scalaInstanceHash /#/ contained nextgroup=scalaInstanceDeclaration +hi link scalaInstanceDeclaration Special +hi link scalaInstanceHash Type + +syn match scalaUnimplemented /???/ +hi link scalaUnimplemented ERROR + +syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/ +hi link scalaCapitalWord Special + +" Handle type declarations specially +syn region scalaTypeStatement matchgroup=Keyword start=/\\)\ze/ contained nextgroup=scalaTypeTypeDeclaration contains=scalaTypeTypeExtension skipwhite +syn match scalaTypeTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals skipwhite +syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite +syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeTypeDeclaration skipwhite +syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite +syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite +hi link scalaTypeTypeDeclaration Type +hi link scalaTypeTypeExtension Keyword +hi link scalaTypeTypePostDeclaration Special +hi link scalaTypeTypePostExtension Keyword + +syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite +syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite +syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite +syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeDeclaration skipwhite +hi link scalaTypeDeclaration Type +hi link scalaTypeExtension Keyword +hi link scalaTypePostExtension Keyword + +syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$\s]:\_s*\)\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration contains=scalaRoundBrackets +syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration +hi link scalaTypeAnnotation Normal + +syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained +syn match scalaCaseFollowing /`[^`]\+`/ contained +hi link scalaCaseFollowing Special + +syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super +hi link scalaKeywordModifier Function + +syn keyword scalaSpecial this true false ne eq +syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite +syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)" +syn match scalaSpecial /`[^`]\+`/ " Backtick literals +hi link scalaSpecial PreProc + +syn keyword scalaExternal package import +hi link scalaExternal Include + +syn match scalaStringEmbeddedQuote /\\"/ contained +syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar +hi link scalaString String +hi link scalaStringEmbeddedQuote String + +syn region scalaIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar +syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar +hi link scalaIString String +hi link scalaTripleIString String + +syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained +exe 'syn region scalaInterpolationB matchgroup=scalaInterpolationBoundary start=/\${/ end=/}/ contained contains=' . s:ContainedGroup() +hi link scalaInterpolation Function +hi link scalaInterpolationB Normal + +syn region scalaFString matchgroup=scalaInterpolationBrackets start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar +syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained +exe 'syn region scalaFInterpolationB matchgroup=scalaInterpolationBoundary start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup() +hi link scalaFString String +hi link scalaFInterpolation Function +hi link scalaFInterpolationB Normal + +syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar +syn region scalaTripleFString matchgroup=scalaInterpolationBrackets start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar +hi link scalaTripleString String +hi link scalaTripleFString String + +hi link scalaInterpolationBrackets Special +hi link scalaInterpolationBoundary Function + +syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0 +syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala +syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number +syn match scalaNumber /\%(\<\d\+\.\d*\|\.\d\+\)\%([eE][-+]\=\d\+\)\=[fFdD]\=/ " exponential notation 1 +syn match scalaNumber /\<\d\+[eE][-+]\=\d\+[fFdD]\=\>/ " exponential notation 2 +syn match scalaNumber /\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>/ " exponential notation 3 +hi link scalaNumber Number + +syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets + +syn region scalaSquareBrackets matchgroup=scalaSquareBracketsBrackets start="\[" end="\]" skipwhite nextgroup=scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter +syn match scalaTypeOperator /[-+=:<>]\+/ contained +syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained +hi link scalaSquareBracketsBrackets Type +hi link scalaTypeOperator Keyword +hi link scalaTypeAnnotationParameter Function + +syn match scalaShebang "\%^#!.*" display +syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@Spell keepend fold +syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained +syn match scalaParameterAnnotation "\%(@tparam\|@param\|@see\)" nextgroup=scalaParamAnnotationValue skipwhite contained +syn match scalaParamAnnotationValue /[.`_A-Za-z0-9$]\+/ contained +syn region scalaDocLinks start="\[\[" end="\]\]" contained +syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained +syn match scalaTodo "\vTODO|FIXME|XXX" contained +hi link scalaShebang Comment +hi link scalaMultilineComment Comment +hi link scalaDocLinks Function +hi link scalaParameterAnnotation Function +hi link scalaParamAnnotationValue Keyword +hi link scalaCommentAnnotation Function +hi link scalaCommentCodeBlockBrackets String +hi link scalaCommentCodeBlock String +hi link scalaTodo Todo + +syn match scalaAnnotation /@\<[`_A-Za-z0-9$]\+\>/ +hi link scalaAnnotation PreProc + +syn match scalaTrailingComment "//.*$" contains=scalaTodo,@Spell +hi link scalaTrailingComment Comment + +syn match scalaAkkaFSM /goto([^)]*)\_s\+\/ contains=scalaAkkaFSMGotoUsing +syn match scalaAkkaFSM /stay\_s\+using/ +syn match scalaAkkaFSM /^\s*stay\s*$/ +syn match scalaAkkaFSM /when\ze([^)]*)/ +syn match scalaAkkaFSM /startWith\ze([^)]*)/ +syn match scalaAkkaFSM /initialize\ze()/ +syn match scalaAkkaFSM /onTransition/ +syn match scalaAkkaFSM /onTermination/ +syn match scalaAkkaFSM /whenUnhandled/ +syn match scalaAkkaFSMGotoUsing /\/ +syn match scalaAkkaFSMGotoUsing /\/ +hi link scalaAkkaFSM PreProc +hi link scalaAkkaFSMGotoUsing PreProc + +let b:current_syntax = 'scala' + +if main_syntax ==# 'scala' + unlet main_syntax +endif + +" vim:set sw=2 sts=2 ts=8 et: diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 34b8ab79e4..2fe13fbde6 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Jul 29, 2016 -" Version: 155 +" Last Change: Aug 23, 2016 +" Version: 161 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) @@ -127,11 +127,11 @@ syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsa if exists("b:is_kornshell") syn cluster ErrorList add=shDTestError endif -syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor +syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shHereString,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor syn cluster shArithList contains=@shArithParenList,shParenError syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange -syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq -syn cluster shCommandSubList contains=shAlias,shArithmetic,shComment,shCmdParenRegion,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable +syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq +syn cluster shCommandSubList contains=shAlias,shArithmetic,shComment,shCmdParenRegion,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS @@ -139,7 +139,7 @@ syn cluster shDerefVarList contains=shDerefOff,shDerefOp,shDerefVarArray,shDeref syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shEscape,shExpr,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest -syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq +syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq if exists("b:is_kornshell") || exists("b:is_bash") syn cluster shFunctionList add=shRepeat syn cluster shFunctionList add=shDblBrace,shDblParen @@ -147,11 +147,11 @@ endif syn cluster shHereBeginList contains=@shCommandSubList syn cluster shHereList contains=shBeginHere,shHerePayload syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload -syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr -syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo +syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shHereString,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr +syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo,shParen syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shForPP,shIf,shOption,shSet,shTest,shTestOpr,shTouch syn cluster shPPSRightList contains=shComment,shDeref,shDerefSimple,shEscape,shPosnParm -syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator +syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator syn cluster shTestList contains=shCharClass,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr " Echo: {{{1 @@ -216,8 +216,8 @@ syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSin " Subshells: {{{1 " ========== -syn region shExpr transparent matchgroup=shExprRegion start="{" end="}" contains=@shExprList2 nextgroup=shMoreSpecial -syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")" contains=@shSubShList nextgroup=shMoreSpecial +syn region shExpr transparent matchgroup=shExprRegion start="{" end="}" contains=@shExprList2 nextgroup=shSpecialNxt +syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")" contains=@shSubShList nextgroup=shSpecialNxt " Tests: {{{1 "======= @@ -339,8 +339,8 @@ if exists("b:is_bash") syn match shSpecial "^\(\\\\\)*\zs\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained endif if exists("b:is_bash") - syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial - syn region shExDoubleQuote matchgroup=shQuote start=+\$"+ skip=+\\\\\|\\.\|\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,shSpecial + syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial nextgroup=shSpecialNxt + syn region shExDoubleQuote matchgroup=shQuote start=+\$"+ skip=+\\\\\|\\.\|\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,shSpecial nextgroup=shSpecialNxt elseif !exists("g:sh_no_error") syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial syn region shExDoubleQuote matchGroup=Error start=+\$"+ skip=+\\\\\|\\.+ end=+"+ contains=shStringSpecial @@ -351,7 +351,7 @@ syn match shStringSpecial "[^[:print:] \t]" contained syn match shStringSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shBkslshSnglQuote,shBkslshDblQuote syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]" -syn match shMoreSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial contained +syn match shSpecialNxt contained "\\[\\"'`$()#]" syn region shBkslshSnglQuote contained matchgroup=shQuote start=+'+ end=+'+ contains=@Spell syn region shBkslshDblQuote contained matchgroup=shQuote start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell @@ -386,7 +386,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \ " ============= " available for: bash; ksh (really should be ksh93 only) but not if its a posix if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("g:is_posix")) - syn match shRedir "<<<" skipwhite nextgroup=shCmdParenRegion + syn match shHereString "<<<" skipwhite nextgroup=shCmdParenRegion endif " Identifiers: {{{1 @@ -431,6 +431,7 @@ syn match shDerefSimple "\$\%(\h\w*\|\d\)" syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray syn match shDerefSimple "\$[-#*@!?]" syn match shDerefSimple "\$\$" +syn match shDerefSimple "\${\d}" if exists("b:is_bash") || exists("b:is_kornshell") syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList @@ -455,6 +456,7 @@ endif syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp syn match shDerefVar contained "{\@<=\h\w*" nextgroup=@shDerefVarList +syn match shDerefVar contained '\d' nextgroup=@shDerefVarList if exists("b:is_kornshell") syn match shDerefVar contained "{\@<=\h\w*[[:alnum:]_.]*" nextgroup=@shDerefVarList endif @@ -482,24 +484,24 @@ endif syn match shDerefOp contained ":\=[-=?]" nextgroup=@shDerefPatternList syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList if exists("b:is_bash") || exists("b:is_kornshell") - syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList - syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList - syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern + syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList + syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList + syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern syn match shDerefEscape contained '\%(\\\\\)*\\.' endif if exists("b:is_bash") syn match shDerefOp contained "[,^]\{1,2}" nextgroup=@shDerefPatternList endif -syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@ +# 2007-2016, Flammie Pirinen # -# Vimin kyttjt on nrttej. Sanasto on jargonia :-p -# -# Lhinn latin-1:t, sill vim pit portata ilmeisen obskuureille -# alustoille. Mys: pluralit puuttuu, ohjelman kyttliittymn fontti -# tasavlinen, tila rajattu, jne. jne., luovia ratkaisuja edess. +# Jargonia ei ole yritetty suotta kotoperäistää missä teknisempi lainasanasto +# tulee paremmin kyseeseen. # # Sanastosta: -# Fold on sellainen moderneissa ohjelmointi-IDE:iss oleva toiminto, jolla -# lohko koodia esim. funktio piilotetaan nkymst: suom. taitos alkup. +# * Fold on sellainen moderneissa ohjelmointi-IDE:issä oleva toiminto, jolla +# lohko koodia esim. funktio piilotetaan näkymästä: suom. taitos alkup. # analogian mukaan -# source v. lataa tiedoston, kuten bash-komento source (tai .) +# * source, v. lataa tiedoston, kuten bash-komento source (tai .) +# * dictionary (dict) on vaihtelevasti sanakirja tai tietorakenne # msgid "" msgstr "" "Project-Id-Version: Vim 7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-05-26 14:21+0200\n" -"PO-Revision-Date: 2010-08-09 02:35+0300\n" -"Last-Translator: Flammie Pirinen \n" +"POT-Creation-Date: 2017-04-19 16:46+0200\n" +"PO-Revision-Date: 2016-08-29 11:27+0200\n" +"Last-Translator: Flammie A Pirinen \n" "Language-Team: Finnish \n" "Language: fi\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../api/private/helpers.c:201 #, fuzzy -msgid "Unable to get option value" -msgstr "Roskaa argumentin perss" +#~ msgid "Index out of bounds" +#~ msgstr "ei löytynyt " -#: ../api/private/helpers.c:204 -msgid "internal error: unknown option type" -msgstr "" +#, fuzzy +#~ msgid "Line index is too high" +#~ msgstr "ikkunan indeksi alueen ulkopuolella" + +#~ msgid "Argument \"start\" is higher than \"end\"" +#~ msgstr "" + +#~ msgid "All items in the replacement array must be strings" +#~ msgstr "" + +msgid "string cannot contain newlines" +msgstr "merkkijono ei saa sisältää rivinvaihtoja" + +#, fuzzy +#~ msgid "Failed to save undo information" +#~ msgstr "ei voitu tallentaa kumoustietoja" + +#, fuzzy +#~ msgid "Failed to delete line" +#~ msgstr "ei voitu poistaa riviä" + +#~ msgid "Index value is too high" +#~ msgstr "" + +#, fuzzy +#~ msgid "Failed to replace line" +#~ msgstr "ei voitu korvata riviä" + +#, fuzzy +#~ msgid "Failed to insert line" +#~ msgstr "ei voitu lisätä riviä" + +#, fuzzy +#~ msgid "Failed to rename buffer" +#~ msgstr "ei voity uudelleennimetä puskuria" + +#, fuzzy +#~ msgid "Mark name must be a single character" +#~ msgstr "merkin nimen pitää olla yksi merkki" + +#, fuzzy +#~ msgid "Invalid mark name" +#~ msgstr "virheellinen merkin nimi" + +#, fuzzy +#~ msgid "Line number outside range" +#~ msgstr "rivinumero arvoalueen ulkopuolella" + +#, fuzzy +#~ msgid "Column value outside range" +#~ msgstr "rivinumero arvoalueen ulkopuolella" + +#, fuzzy +#~ msgid "Keyboard interrupt" +#~ msgstr "näppäimistökeskeytys" + +#, fuzzy +#~ msgid "Key not found" +#~ msgstr "ei löytynyt " + +#, fuzzy +#~ msgid "Dictionary is locked" +#~ msgstr "dictionary on lukittu" + +#, fuzzy +#~ msgid "Empty variable names aren't allowed" +#~ msgstr "tyhjiä avaimia ei voi käyttää" + +#, fuzzy +#~ msgid "Key length is too high" +#~ msgstr "Liian pitkä polku" + +#, c-format +#~ msgid "Key is read-only: %s" +#~ msgstr "" + +#, c-format +#~ msgid "Key is fixed: %s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "Key is locked: %s" +#~ msgstr "E741: Arvo on lukittu: %s" + +#. Doesn't exist, fail +#, fuzzy, c-format +#~ msgid "Key \"%s\" doesn't exist" +#~ msgstr "Tiedostoa %s ei ole" + +#, fuzzy +#~ msgid "Empty option name" +#~ msgstr "E792: tyhjä valikkonimi" + +#, fuzzy, c-format +#~ msgid "Invalid option name \"%s\"" +#~ msgstr "E755: Virheellinen alue kohteelle %s" + +#, fuzzy, c-format +#~ msgid "Unable to get value for option \"%s\"" +#~ msgstr "ei voi tyhjentää yleistä asetusta %s" + +#, fuzzy, c-format +#~ msgid "Unknown type for option \"%s\"" +#~ msgstr "E113: Tuntematon asetus: %s" + +#, fuzzy, c-format +#~ msgid "Unable to unset option \"%s\"" +#~ msgstr "ei voi tyhjentää yleistä asetusta %s" + +#, fuzzy, c-format +#~ msgid "Cannot unset option \"%s\" because it doesn't have a global value" +#~ msgstr "ei voi tyhjentää asetusta %s jolla ei ole yleistä arvoa" + +#, c-format +#~ msgid "Option \"%s\" requires a boolean value" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "Option \"%s\" requires an integer value" +#~ msgstr "E709: [:] toimii vain listalla" + +#, c-format +#~ msgid "Value for option \"%s\" is outside range" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "Option \"%s\" requires a string value" +#~ msgstr "E709: [:] toimii vain listalla" + +#, fuzzy +#~ msgid "Invalid buffer id" +#~ msgstr "virheellinen puskurinumero" + +#, fuzzy +#~ msgid "Invalid window id" +#~ msgstr "E534: Viallinen leveä fontti" + +#, fuzzy +#~ msgid "Invalid tabpage id" +#~ msgstr "Väärä argumentti valitsimelle" + +#~ msgid "Integer value outside range" +#~ msgstr "" + +#, fuzzy +#~ msgid "Empty dictionary keys aren't allowed" +#~ msgstr "tyhjiä avaimia ei voi käyttää" + +#, fuzzy +#~ msgid "Problem while switching windows" +#~ msgstr "virhe ikkunaa vaihtaessa" + +#, fuzzy +#~ msgid "UI already attached for channel" +#~ msgstr "Vanhimmassa muutoksessa" + +#~ msgid "Expected width > 0 and height > 0" +#~ msgstr "" + +#~ msgid "UI is not attached for channel" +#~ msgstr "" + +#~ msgid "rgb must be a Boolean" +#~ msgstr "" + +#~ msgid "popupmenu_external must be a Boolean" +#~ msgstr "" + +#, fuzzy +#~ msgid "No such ui option" +#~ msgstr "E24: Lyhennettä ei ole" + +#~ msgid "Function called with too many arguments." +#~ msgstr "" + +#~ msgid "Error calling function." +#~ msgstr "" + +#, fuzzy +#~ msgid "String length is too high" +#~ msgstr "Liian pitkä polku" + +#~ msgid "Directory string is too long" +#~ msgstr "" + +#, fuzzy +#~ msgid "Failed to change directory" +#~ msgstr "hakemistoa ei voitu muuttaa" + +#, fuzzy, c-format +#~ msgid "Failed to switch to buffer %d" +#~ msgstr "ei voitu vaihtaa puskuriin %d" + +#, fuzzy, c-format +#~ msgid "Failed to switch to window %d" +#~ msgstr "ei voitu vaihtaa puskuriin %d" + +#, fuzzy, c-format +#~ msgid "Failed to switch to tabpage %d" +#~ msgstr "ei voitu vaihtaa puskuriin %d" + +#~ msgid "All items in calls array must be arrays" +#~ msgstr "" + +#~ msgid "All items in calls array must be arrays of size 2" +#~ msgstr "" + +#~ msgid "name must be String" +#~ msgstr "" + +#~ msgid "args must be Array" +#~ msgstr "" + +# datarakenteita +#, fuzzy +#~ msgid "Argument \"pos\" must be a [row, col] array" +#~ msgstr "E712: Argumentin %s pitää olla lista tai sanakirja" + +#, fuzzy +#~ msgid "Cursor position outside buffer" +#~ msgstr "kursorin sijainti puskurin ulkopuolella" + +#~ msgid "Height value outside range" +#~ msgstr "" + +#~ msgid "Width value outside range" +#~ msgstr "" -#: ../buffer.c:92 msgid "[Location List]" msgstr "[Sijaintiluettelo]" -#: ../buffer.c:93 msgid "[Quickfix List]" msgstr "[Pikakorjausluettelo]" -#: ../buffer.c:94 -#, fuzzy msgid "E855: Autocommands caused command to abort" -msgstr "E812: Autocommands muutti puskurin tai sen nimen" +msgstr "E855: Autocommands lopetti komennon" -#: ../buffer.c:135 msgid "E82: Cannot allocate any buffer, exiting..." -msgstr "E82: Mitn puskuria ei voitu varata, lopetetaan..." +msgstr "E82: Mitään puskuria ei voitu varata, lopetetaan..." -#: ../buffer.c:138 msgid "E83: Cannot allocate buffer, using other one..." -msgstr "E83: Puskuria ei voitu varata, kytetn toista..." +msgstr "E83: Puskuria ei voitu varata, käytetään toista..." + +#, fuzzy +#~ msgid "E937: Attempt to delete a buffer that is in use" +#~ msgstr "E934: Ei voida hypätä puskuriin jolla ei ole nimeä" -#: ../buffer.c:763 msgid "E515: No buffers were unloaded" msgstr "E515: Puskureita ei vapautettu" -#: ../buffer.c:765 msgid "E516: No buffers were deleted" msgstr "E516: Puskureita ei poistettu" -#: ../buffer.c:767 msgid "E517: No buffers were wiped out" msgstr "E517: Puskureita ei pyyhitty" -#: ../buffer.c:772 msgid "1 buffer unloaded" msgstr "1 puskuri vapautettiin" -#: ../buffer.c:774 #, c-format msgid "%d buffers unloaded" msgstr "%d puskuria vapautettiin" -#: ../buffer.c:777 msgid "1 buffer deleted" msgstr "1 puskuri poistettu" -#: ../buffer.c:779 #, c-format msgid "%d buffers deleted" msgstr "%d puskuria poistettu" -#: ../buffer.c:782 msgid "1 buffer wiped out" msgstr "1 puskuri pyyhitty" -#: ../buffer.c:784 #, c-format msgid "%d buffers wiped out" msgstr "%d puskuria pyyhitty" -#: ../buffer.c:806 msgid "E90: Cannot unload last buffer" -msgstr "E90: Ei voi vapauttaa viimeist puskuria" +msgstr "E90: Ei voi vapauttaa viimeistä puskuria" -#: ../buffer.c:874 msgid "E84: No modified buffer found" msgstr "E84: Ei muokattuja puskureita" #. back where we started, didn't find anything. -#: ../buffer.c:903 msgid "E85: There is no listed buffer" msgstr "E85: Luetteloitua puskuria ei ole" -#: ../buffer.c:913 -#, c-format -msgid "E86: Buffer % does not exist" -msgstr "E86: Puskuria % ei ole" - -#: ../buffer.c:915 msgid "E87: Cannot go beyond last buffer" -msgstr "E87: Viimeisen puskurin ohi ei voi edet" +msgstr "E87: Viimeisen puskurin ohi ei voi edetä" -#: ../buffer.c:917 msgid "E88: Cannot go before first buffer" -msgstr "E88: Ensimmisen puskurin ohi ei voi edet" +msgstr "E88: Ensimmäisen puskurin ohi ei voi edetä" -#: ../buffer.c:945 -#, c-format +#, fuzzy, c-format +#~ msgid "E89: %s will be killed(add ! to override)" +#~ msgstr "E189: %s on jo olemassa (lisää komentoon ! ohittaaksesi)" + +#, fuzzy, c-format msgid "" "E89: No write since last change for buffer % (add ! to override)" msgstr "" -"E89: Puskurin % muutoksia ei ole tallennettu (lis komentoon ! " +"E89: Puskurin %ld muutoksia ei ole tallennettu (lisää komentoon ! " "ohittaaksesi)" #. wrap around (may cause duplicates) -#: ../buffer.c:1423 msgid "W14: Warning: List of file names overflow" msgstr "W14: Varoitus: Tiedostonimiluettelon ylivuoto" -#: ../buffer.c:1555 ../quickfix.c:3361 -#, c-format -msgid "E92: Buffer % not found" -msgstr "E92: Puskuria % ei lydy" +#, fuzzy, c-format +#~ msgid "E92: Buffer % not found" +#~ msgstr "E92: Puskuria %ld ei löydy" -#: ../buffer.c:1798 #, c-format msgid "E93: More than one match for %s" -msgstr "E93: %s tsm useampaan kuin yhteen puskuriin" +msgstr "E93: %s täsmää useampaan kuin yhteen puskuriin" -#: ../buffer.c:1800 #, c-format msgid "E94: No matching buffer for %s" -msgstr "E94: %s ei tsm yhteenkn puskuriin" +msgstr "E94: %s ei täsmää yhteenkään puskuriin" -#: ../buffer.c:2161 -#, c-format -msgid "line %" -msgstr "rivi %" +#, fuzzy, c-format +#~ msgid "line %" +#~ msgstr "rivi %ld" -#: ../buffer.c:2233 msgid "E95: Buffer with this name already exists" msgstr "E95: Samanniminen puskuri on jo olemassa" -#: ../buffer.c:2498 msgid " [Modified]" msgstr " [Muokattu]" -#: ../buffer.c:2501 msgid "[Not edited]" msgstr "[Muokkaamaton]" -#: ../buffer.c:2504 msgid "[New file]" msgstr "[Uusi tiedosto]" -#: ../buffer.c:2505 msgid "[Read errors]" -msgstr "[Lukuvirheit]" +msgstr "[Lukuvirheitä]" -#: ../buffer.c:2506 ../buffer.c:3217 ../fileio.c:1807 ../screen.c:4895 msgid "[RO]" msgstr "[Luku]" -#: ../buffer.c:2507 ../fileio.c:1807 msgid "[readonly]" msgstr "[kirjoitussuojattu]" -#: ../buffer.c:2524 #, c-format msgid "1 line --%d%%--" msgstr "1 rivi --%d %%--" -#: ../buffer.c:2526 -#, c-format -msgid "% lines --%d%%--" -msgstr "% rivi --%d %%--" +#, fuzzy, c-format +#~ msgid "% lines --%d%%--" +#~ msgstr "%ld riviä --%d %%--" -#: ../buffer.c:2530 -#, c-format -msgid "line % of % --%d%%-- col " -msgstr "rivi %/% --%d %%-- sarake " +#, fuzzy, c-format +#~ msgid "line % of % --%d%%-- col " +#~ msgstr "rivi %ld/%ld --%d %%-- sarake " -#: ../buffer.c:2632 ../buffer.c:4292 ../memline.c:1554 msgid "[No Name]" -msgstr "[Nimetn]" +msgstr "[Nimetön]" #. must be a help buffer -#: ../buffer.c:2667 msgid "help" msgstr "ohje" -#: ../buffer.c:3225 ../screen.c:4883 msgid "[Help]" msgstr "[Ohje]" -#: ../buffer.c:3254 ../screen.c:4887 msgid "[Preview]" msgstr "[Esikatselu]" # sijainti tiedostossa -indikaattoreja: -# 4 merkki sais riitt -#: ../buffer.c:3528 +# 4 merkkiä sais riittää msgid "All" msgstr "Kaik" -#: ../buffer.c:3528 msgid "Bot" msgstr "Loppu" -#: ../buffer.c:3531 msgid "Top" msgstr "Alku" -#: ../buffer.c:4244 -msgid "" -"\n" -"# Buffer list:\n" -msgstr "" -"\n" -"# Puskuriluettelo:\n" - -#: ../buffer.c:4289 msgid "[Scratch]" msgstr "[Raapust]" -#: ../buffer.c:4529 msgid "" "\n" "--- Signs ---" @@ -249,795 +421,669 @@ msgstr "" "\n" "--- Merkit ---" -#: ../buffer.c:4538 #, c-format msgid "Signs for %s:" msgstr "Merkit kohteelle %s:" -#: ../buffer.c:4543 -#, c-format -msgid " line=% id=%d name=%s" -msgstr " rivi=% id=%d nimi=%s" +#, fuzzy, c-format +#~ msgid " line=% id=%d name=%s" +#~ msgstr " rivi=%ld id=%d nimi=%s" -#: ../cursor_shape.c:68 msgid "E545: Missing colon" msgstr "E545: Kaksoispiste puuttuu" -#: ../cursor_shape.c:70 ../cursor_shape.c:94 msgid "E546: Illegal mode" msgstr "E546: Virheellinen tila" -#: ../cursor_shape.c:134 msgid "E548: digit expected" -msgstr "E548: pit olla numero" +msgstr "E548: pitää olla numero" -#: ../cursor_shape.c:138 msgid "E549: Illegal percentage" msgstr "E549: Virheellinen prosenttiluku" -#: ../diff.c:146 -#, c-format -msgid "E96: Can not diff more than % buffers" -msgstr "E96: Ei voi diffata enemp kuin % puskuria" +#, fuzzy, c-format +#~ msgid "E96: Cannot diff more than % buffers" +#~ msgstr "E96: Ei voi diffata enempää kuin %ld puskuria" -#: ../diff.c:753 msgid "E810: Cannot read or write temp files" -msgstr "E810: Ei voi lukea tai kirjoittaa vliaikaistiedostoja" +msgstr "E810: Ei voi lukea tai kirjoittaa väliaikaistiedostoja" -#: ../diff.c:755 msgid "E97: Cannot create diffs" -msgstr "E97: Ei voi luoda diffej" +msgstr "E97: Ei voi luoda diffejä" -#: ../diff.c:966 msgid "E816: Cannot read patch output" msgstr "E816: Ei voi lukea patchin tulostetta" -#: ../diff.c:1220 msgid "E98: Cannot read diff output" msgstr "E98: Ei voi lukea diffin tulostetta" -#: ../diff.c:2081 msgid "E99: Current buffer is not in diff mode" -msgstr "E99: Tm puskuri ei ole diff-tilassa" +msgstr "E99: Tämä puskuri ei ole diff-tilassa" -#: ../diff.c:2100 msgid "E793: No other buffer in diff mode is modifiable" -msgstr "E793: Yksikn muu diff-tilan puskurit ei ole muokattavissa" +msgstr "E793: Yksikään muu diff-tilan puskurit ei ole muokattavissa" -#: ../diff.c:2102 msgid "E100: No other buffer in diff mode" -msgstr "E100: Yksikn muu puskuri ei ole diff-tilassa" +msgstr "E100: Yksikään muu puskuri ei ole diff-tilassa" -#: ../diff.c:2112 msgid "E101: More than two buffers in diff mode, don't know which one to use" -msgstr "E101: Monta puskuria on diff-tilassa, kytettvn valinta ei onnistu" +msgstr "E101: Monta puskuria on diff-tilassa, käytettävän valinta ei onnistu" -#: ../diff.c:2141 #, c-format msgid "E102: Can't find buffer \"%s\"" -msgstr "E102: Puskuria %s ei lydy" +msgstr "E102: Puskuria %s ei löydy" -#: ../diff.c:2152 #, c-format msgid "E103: Buffer \"%s\" is not in diff mode" msgstr "E103: Puskuri %s ei ole diff-tilassa" -#: ../diff.c:2193 msgid "E787: Buffer changed unexpectedly" msgstr "E787: Puskuri vaihtui odottamatta" -#: ../digraph.c:1598 msgid "E104: Escape not allowed in digraph" -msgstr "E104: Escapea ei voi kytt digraafissa" +msgstr "E104: Escapea ei voi käyttää digraafissa" -#: ../digraph.c:1760 msgid "E544: Keymap file not found" -msgstr "E544: Nppinkarttaa ei lydy" +msgstr "E544: Näppäinkarttaa ei löydy" -#: ../digraph.c:1785 msgid "E105: Using :loadkeymap not in a sourced file" -msgstr "E105: Kytetn :loadkeymapia ladatun tiedoston ulkopuolella" +msgstr "E105: Käytetään :loadkeymapia ladatun tiedoston ulkopuolella" -#: ../digraph.c:1821 msgid "E791: Empty keymap entry" -msgstr "E791: Tyhj keymap-kentt" +msgstr "E791: Tyhjä keymap-kenttä" -#: ../edit.c:82 msgid " Keyword completion (^N^P)" -msgstr " Avainsanatydennys (^N^P)" +msgstr " Avainsanatäydennys (^N^P)" #. ctrl_x_mode == 0, ^P/^N compl. -#: ../edit.c:83 msgid " ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" msgstr " ^X-tila (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" -#: ../edit.c:85 msgid " Whole line completion (^L^N^P)" -msgstr " Tysrivitydennys (^L^N^P)" +msgstr " Täysrivitäydennys (^L^N^P)" -#: ../edit.c:86 msgid " File name completion (^F^N^P)" -msgstr " Tiedostonimitydennys (^F^N^P)" +msgstr " Tiedostonimitäydennys (^F^N^P)" -#: ../edit.c:87 msgid " Tag completion (^]^N^P)" -msgstr " Tgitydennys (^]^N^P)" +msgstr " Tägitäydennys (^]^N^P)" -#: ../edit.c:88 msgid " Path pattern completion (^N^P)" -msgstr " Polkukuviotydennys (^N^P)" +msgstr " Polkukuviotäydennys (^N^P)" -#: ../edit.c:89 msgid " Definition completion (^D^N^P)" -msgstr " Mritelmtydennys (^D^N^P)" +msgstr " Määritelmätäydennys (^D^N^P)" -#: ../edit.c:91 msgid " Dictionary completion (^K^N^P)" -msgstr " Sanakirjatydennys (^K^N^P)" +msgstr " Sanakirjatäydennys (^K^N^P)" -#: ../edit.c:92 msgid " Thesaurus completion (^T^N^P)" -msgstr " Thesaurus-tydennys (^T^N^P)" +msgstr " Thesaurus-täydennys (^T^N^P)" -#: ../edit.c:93 msgid " Command-line completion (^V^N^P)" -msgstr " Komentorivitydennys (^V^N^P)" +msgstr " Komentorivitäydennys (^V^N^P)" -#: ../edit.c:94 msgid " User defined completion (^U^N^P)" -msgstr " Kyttjn mrittelem tydennys (^U^N^P)" +msgstr " Käyttäjän määrittelemä täydennys (^U^N^P)" -#: ../edit.c:95 msgid " Omni completion (^O^N^P)" -msgstr " Omnitydennys (^O^N^P)" +msgstr " Omnitäydennys (^O^N^P)" -#: ../edit.c:96 msgid " Spelling suggestion (s^N^P)" msgstr " Oikaisulukuehdotus (s^N^P)" -#: ../edit.c:97 msgid " Keyword Local completion (^N^P)" -msgstr " Avainsanan paikallinen tydennys (^N^P)" +msgstr " Avainsanan paikallinen täydennys (^N^P)" -#: ../edit.c:100 msgid "Hit end of paragraph" msgstr "Kappaleen loppu tuli vastaan" -#: ../edit.c:101 -#, fuzzy msgid "E839: Completion function changed window" -msgstr "E813: Ei voi sulkea autocmd-ikkunaa" +msgstr "E839: Täydennys vaihtoi ikkunaa" -#: ../edit.c:102 msgid "E840: Completion function deleted text" -msgstr "" +msgstr "E840: Täydennys poisti tekstiä" -#: ../edit.c:1847 msgid "'dictionary' option is empty" -msgstr "dictionary-asetus on tyhj" +msgstr "dictionary-asetus on tyhjä" -#: ../edit.c:1848 msgid "'thesaurus' option is empty" -msgstr "thesaurus-asetus on tyhj" +msgstr "thesaurus-asetus on tyhjä" -#: ../edit.c:2655 #, c-format msgid "Scanning dictionary: %s" msgstr "Luetaan sanakirjaa: %s" -#: ../edit.c:3079 msgid " (insert) Scroll (^E/^Y)" -msgstr " (sytt) Vieritys (^E/^Y)" +msgstr " (syöttö) Vieritys (^E/^Y)" -#: ../edit.c:3081 msgid " (replace) Scroll (^E/^Y)" msgstr " (korvaus) Vieritys (^E/^Y)" -#: ../edit.c:3587 #, c-format msgid "Scanning: %s" msgstr "Luetaan: %s" -#: ../edit.c:3614 msgid "Scanning tags." -msgstr "Luetaan tgej." +msgstr "Luetaan tägejä." -#: ../edit.c:4519 msgid " Adding" -msgstr " Listn" +msgstr " Lisätään" #. showmode might reset the internal line pointers, so it must #. * be called before line = ml_get(), or when this address is no #. * longer needed. -- Acevedo. #. -#: ../edit.c:4562 msgid "-- Searching..." msgstr "-- Haetaan..." -#: ../edit.c:4618 msgid "Back at original" -msgstr "Takaisin lhtpisteess" +msgstr "Takaisin lähtöpisteessä" -#: ../edit.c:4621 msgid "Word from other line" -msgstr "Sana toisella rivill" +msgstr "Sana toisella rivillä" -#: ../edit.c:4624 msgid "The only match" -msgstr "Ainoa tsmys" +msgstr "Ainoa täsmäys" -#: ../edit.c:4680 #, c-format msgid "match %d of %d" -msgstr "tsmys %d/%d" +msgstr "täsmäys %d/%d" -#: ../edit.c:4684 #, c-format msgid "match %d" -msgstr "tsmys %d" +msgstr "täsmäys %d" -#: ../eval.c:137 msgid "E18: Unexpected characters in :let" -msgstr "E18: Odottamattomia merkkej komennossa :let" +msgstr "E18: Odottamattomia merkkejä komennossa :let" -#: ../eval.c:138 -#, c-format -msgid "E684: list index out of range: %" -msgstr "E684: Indeksi % luettelon rajojen ulkopuolella" - -#: ../eval.c:139 -#, c-format -msgid "E121: Undefined variable: %s" -msgstr "E121: Mrittelemtn muuttuja: %s" - -#: ../eval.c:140 msgid "E111: Missing ']'" msgstr "E111: ] puuttuu" -#: ../eval.c:141 #, c-format msgid "E686: Argument of %s must be a List" -msgstr "E686: Argumentin %s pit olla lista" +msgstr "E686: Argumentin %s pitää olla lista" # datarakenteita -#: ../eval.c:143 #, c-format msgid "E712: Argument of %s must be a List or Dictionary" -msgstr "E712: Argumentin %s pit olla lista tai sanakirja" +msgstr "E712: Argumentin %s pitää olla lista tai sanakirja" -#: ../eval.c:144 -msgid "E713: Cannot use empty key for Dictionary" -msgstr "E713: Sanakirjassa ei voi olla tyhji avaimia" - -#: ../eval.c:145 msgid "E714: List required" msgstr "E714: Lista tarvitaan" -#: ../eval.c:146 msgid "E715: Dictionary required" msgstr "E715: Sanakirja tarvitaan" -#: ../eval.c:147 +msgid "E928: String required" +msgstr "E928: Merkkijono puuttuu" + #, c-format msgid "E118: Too many arguments for function: %s" msgstr "E118: Liikaa argumentteja funktiolle: %s" -#: ../eval.c:148 #, c-format msgid "E716: Key not present in Dictionary: %s" msgstr "E716: Avainta %s ei ole sanakirjassa" -#: ../eval.c:150 #, c-format msgid "E122: Function %s already exists, add ! to replace it" -msgstr "E122: Funktio %s on jo olemassa, lis ! korvataksesi" +msgstr "E122: Funktio %s on jo olemassa, lisää ! korvataksesi" -#: ../eval.c:151 msgid "E717: Dictionary entry already exists" msgstr "E717: Sanakirja-alkio on jo olemassa" -#: ../eval.c:152 msgid "E718: Funcref required" msgstr "E718: Funcref tarvitaan" -#: ../eval.c:153 msgid "E719: Cannot use [:] with a Dictionary" -msgstr "E719: Sanakirjassa ei voi kytt merkint [:]" +msgstr "E719: Sanakirjassa ei voi käyttää merkintää [:]" -#: ../eval.c:154 -#, c-format -msgid "E734: Wrong variable type for %s=" -msgstr "E734: Vr muuttujatyyppi muuttujalle %s=" - -#: ../eval.c:155 #, c-format msgid "E130: Unknown function: %s" msgstr "E130: Tuntematon funktio: %s" -#: ../eval.c:156 #, c-format msgid "E461: Illegal variable name: %s" msgstr "E461: Virheellinen muuttujanimi: %s" -#: ../eval.c:157 -msgid "E806: using Float as a String" -msgstr "E806: Float ei ky merkkijonosta" +#, fuzzy, c-format +#~ msgid "E46: Cannot change read-only variable \"%.*s\"" +#~ msgstr "E46: Kirjoitussuojattua muuttujaa %s ei voi muuttaa" + +#. TODO(ZyX-I): move to eval/executor +#, c-format +msgid "E734: Wrong variable type for %s=" +msgstr "E734: Väärä muuttujatyyppi muuttujalle %s=" -#: ../eval.c:1830 msgid "E687: Less targets than List items" -msgstr "E687: Kohteita on vhemmn kuin listan alkioita" +msgstr "E687: Kohteita on vähemmän kuin listan alkioita" -#: ../eval.c:1834 msgid "E688: More targets than List items" -msgstr "E688: Kohteita on enemmn kuin listan alkioita" +msgstr "E688: Kohteita on enemmän kuin listan alkioita" -#: ../eval.c:1906 msgid "Double ; in list of variables" -msgstr "Kaksi ;:tt listan muuttujissa" +msgstr "Kaksi ;:ttä listan muuttujissa" -#: ../eval.c:2078 #, c-format msgid "E738: Can't list variables for %s" msgstr "E738: Kohteen %s muuttujia ei voi listata" -#: ../eval.c:2391 +#, fuzzy, c-format +#~ msgid "E121: Undefined variable: %.*s" +#~ msgstr "E121: Määrittelemätön muuttuja: %s" + msgid "E689: Can only index a List or Dictionary" -msgstr "E689: Vain listalla ja sanakirjalla voi olla indeksej" +msgstr "E689: Vain listalla ja sanakirjalla voi olla indeksejä" -#: ../eval.c:2396 msgid "E708: [:] must come last" -msgstr "E708: [:]:n pit olla viimeisen" +msgstr "E708: [:]:n pitää olla viimeisenä" + +#, fuzzy +#~ msgid "E713: Cannot use empty key after ." +#~ msgstr "E713: Sanakirjassa ei voi olla tyhjiä avaimia" -#: ../eval.c:2439 msgid "E709: [:] requires a List value" msgstr "E709: [:] toimii vain listalla" -#: ../eval.c:2674 msgid "E710: List value has more items than target" -msgstr "E710: Listalla on enemmn alkioita kuin kohteella" +msgstr "E710: Listalla on enemmän alkioita kuin kohteella" -#: ../eval.c:2678 msgid "E711: List value has not enough items" msgstr "E711: Listalla ei ole tarpeeksi alkioita" -#: ../eval.c:2867 msgid "E690: Missing \"in\" after :for" msgstr "E690: :for-kommenolta puuttuu in" -#: ../eval.c:3063 #, c-format msgid "E107: Missing parentheses: %s" msgstr "E107: Sulkeita puuttuu: %s" -#: ../eval.c:3263 #, c-format msgid "E108: No such variable: \"%s\"" msgstr "E108: Muuttujaa %s ei ole" -#: ../eval.c:3333 -msgid "E743: variable nested too deep for (un)lock" -msgstr "E743: muuttujassa liian monta tasoa lukituksen ksittelyyn" +#. For historical reasons this error is not given for Lists and +#. Dictionaries. E.g. b: dictionary may be locked/unlocked. +#, fuzzy, c-format +#~ msgid "E940: Cannot lock or unlock variable %s" +#~ msgstr "E46: Kirjoitussuojattua muuttujaa %s ei voi muuttaa" -#: ../eval.c:3630 msgid "E109: Missing ':' after '?'" -msgstr "E109: ?:n jlkeen puuttuu :" +msgstr "E109: ?:n jälkeen puuttuu :" -#: ../eval.c:3893 msgid "E691: Can only compare List with List" msgstr "E691: Listaa voi verrata vain listaan" -#: ../eval.c:3895 -msgid "E692: Invalid operation for Lists" +msgid "E692: Invalid operation for List" msgstr "E692: Virheellinen toiminto listalle" -#: ../eval.c:3915 msgid "E735: Can only compare Dictionary with Dictionary" msgstr "E735: Sanakirjaa voi verrata vain sanakirjaan" -#: ../eval.c:3917 msgid "E736: Invalid operation for Dictionary" msgstr "E736: Virheellinen toiminto sanakirjalle" -#: ../eval.c:3932 -msgid "E693: Can only compare Funcref with Funcref" -msgstr "E693: Funcrefi voi verrata vain funcrefiin" - -#: ../eval.c:3934 msgid "E694: Invalid operation for Funcrefs" msgstr "E694: Virheellinen toiminto funcrefille" -#: ../eval.c:4277 msgid "E804: Cannot use '%' with Float" -msgstr "E804: Ei voi kytt '%':a Floatin kanssa" +msgstr "E804: Ei voi käyttää '%':a Floatin kanssa" -#: ../eval.c:4478 msgid "E110: Missing ')'" msgstr "E110: ) puuttuu" -#: ../eval.c:4609 msgid "E695: Cannot index a Funcref" -msgstr "E695: Funcrefi ei voi indeksoida" +msgstr "E695: Funcrefiä ei voi indeksoida" + +msgid "E909: Cannot index a special variable" +msgstr "E909: erikoismuuttujaa ei voi indeksoida" -#: ../eval.c:4839 #, c-format msgid "E112: Option name missing: %s" msgstr "E112: Asetuksen nimi puuttuu: %s" -#: ../eval.c:4855 #, c-format msgid "E113: Unknown option: %s" msgstr "E113: Tuntematon asetus: %s" -#: ../eval.c:4904 #, c-format msgid "E114: Missing quote: %s" msgstr "E114: Puuttuva lainausmerkki: %s" -#: ../eval.c:5020 #, c-format msgid "E115: Missing quote: %s" msgstr "E115: Puuttuva lainausmerkki: %s" -#: ../eval.c:5084 #, c-format msgid "E696: Missing comma in List: %s" msgstr "E696: Listasta puuttuu pilkku: %s" -#: ../eval.c:5091 #, c-format msgid "E697: Missing end of List ']': %s" msgstr "E697: Listan lopusta puuttuu ]: %s" -#: ../eval.c:6475 +msgid "Not enough memory to set references, garbage collection aborted!" +msgstr "" +"Ei tarpeeksi muistia viitteiden asettamista varten, roskiekeruu peruttiin." + #, c-format msgid "E720: Missing colon in Dictionary: %s" msgstr "E720: Sanakirjasta puuttuu kaksoispiste: %s" -#: ../eval.c:6499 #, c-format msgid "E721: Duplicate key in Dictionary: \"%s\"" msgstr "E721: Kaksi samaa avainta sanakirjassa: %s" -#: ../eval.c:6517 #, c-format msgid "E722: Missing comma in Dictionary: %s" msgstr "E722: Sanakirjasta puuttuu pilkku: %s" -#: ../eval.c:6524 #, c-format msgid "E723: Missing end of Dictionary '}': %s" msgstr "E723: Sanakirjan lopusta puuttuu }: %s" -#: ../eval.c:6555 -msgid "E724: variable nested too deep for displaying" -msgstr "E724: muuttuja on upotettu liian syvlle nytettvksi" - -#: ../eval.c:7188 -#, c-format -msgid "E740: Too many arguments for function %s" -msgstr "E740: Liikaa argumentteja funktiolle %s" - -#: ../eval.c:7190 -#, c-format -msgid "E116: Invalid arguments for function %s" -msgstr "E116: Vri argumentteja funktiolle %s" - -#: ../eval.c:7377 -#, c-format -msgid "E117: Unknown function: %s" -msgstr "E117: Tuntematon funktio: %s" - -#: ../eval.c:7383 -#, c-format -msgid "E119: Not enough arguments for function: %s" -msgstr "E119: Liikaa argumentteja funktiolle %s" - -#: ../eval.c:7387 -#, c-format -msgid "E120: Using not in a script context: %s" -msgstr "E120: skriptin ulkopuolella: %s" - -#: ../eval.c:7391 -#, c-format -msgid "E725: Calling dict function without Dictionary: %s" -msgstr "E725: dict-funktio ilman sanakirjaa: %s" - -#: ../eval.c:7453 -msgid "E808: Number or Float required" -msgstr "E808: Number tai Float vaaditaan" - -#: ../eval.c:7503 -#, fuzzy -msgid "add() argument" -msgstr "-c-argumentti" - -#: ../eval.c:7907 -msgid "E699: Too many arguments" -msgstr "E699: Liikaa argumentteja" - -#: ../eval.c:8073 -msgid "E785: complete() can only be used in Insert mode" -msgstr "E785: complete() toimii vain sytttilassa" - -#: ../eval.c:8156 -msgid "&Ok" -msgstr "&Ok" - -#: ../eval.c:8676 -#, c-format -msgid "E737: Key already exists: %s" -msgstr "E737: Avain on jo olemassa: %s" - -#: ../eval.c:8692 -#, fuzzy -msgid "extend() argument" -msgstr "--cmd-argumentti" - -#: ../eval.c:8915 -#, fuzzy -msgid "map() argument" -msgstr "-c-argumentti" - -#: ../eval.c:8916 -#, fuzzy -msgid "filter() argument" -msgstr "-c-argumentti" - -#: ../eval.c:9229 -#, c-format -msgid "+-%s%3ld lines: " -msgstr "+-%s%3ld rivi: " - -#: ../eval.c:9291 -#, c-format -msgid "E700: Unknown function: %s" -msgstr "E700: Tuntematon funktio: %s" - -#: ../eval.c:10729 -msgid "called inputrestore() more often than inputsave()" -msgstr "inputrestore() suoritettu useammin kuin inputsave()" - -#: ../eval.c:10771 -#, fuzzy -msgid "insert() argument" -msgstr "-c-argumentti" - -#: ../eval.c:10841 -msgid "E786: Range not allowed" -msgstr "E786: Aluetta ei voi kytt" - -#: ../eval.c:11140 -msgid "E701: Invalid type for len()" -msgstr "E701: Virheellinen tyyppi funktiolle len()" - -#: ../eval.c:11980 -msgid "E726: Stride is zero" -msgstr "E726: Stride on nolla" - -#: ../eval.c:11982 -msgid "E727: Start past end" -msgstr "E727: Alku on lopun jlkeen" - -#: ../eval.c:12024 ../eval.c:15297 -msgid "" -msgstr "" - -#: ../eval.c:12282 -#, fuzzy -msgid "remove() argument" -msgstr "--cmd-argumentti" - -#: ../eval.c:12466 -msgid "E655: Too many symbolic links (cycle?)" -msgstr "E655: Liikaa symbolisia linkkej (mahdollinen sykli)" - -#: ../eval.c:12593 -#, fuzzy -msgid "reverse() argument" -msgstr "-c-argumentti" - -#: ../eval.c:13721 -#, fuzzy -msgid "sort() argument" -msgstr "-c-argumentti" - -#: ../eval.c:13721 -#, fuzzy -msgid "uniq() argument" -msgstr "-c-argumentti" - -#: ../eval.c:13776 -msgid "E702: Sort compare function failed" -msgstr "E702: Lajittelun vertausfunktio ei onnistunut" - -#: ../eval.c:13806 -#, fuzzy -msgid "E882: Uniq compare function failed" -msgstr "E702: Lajittelun vertausfunktio ei onnistunut" - -#: ../eval.c:14085 -msgid "(Invalid)" -msgstr "(Virheellinen)" - -#: ../eval.c:14590 -msgid "E677: Error writing temp file" -msgstr "E677: Vliaikaistiedostoon kirjoittaminen ei onnistunut" - -#: ../eval.c:16159 -msgid "E805: Using a Float as a Number" -msgstr "E805: Float ei ky Numberista" - -#: ../eval.c:16162 -msgid "E703: Using a Funcref as a Number" -msgstr "E703: Funcref ei ky Numberista" - -#: ../eval.c:16170 -msgid "E745: Using a List as a Number" -msgstr "E745: Lista ei ky Numberista" - -#: ../eval.c:16173 -msgid "E728: Using a Dictionary as a Number" -msgstr "E728: Sanakirja ei ky Numberista" - -#: ../eval.c:16259 -msgid "E729: using Funcref as a String" -msgstr "E729: Funcref ei ky merkkijonosta" - -#: ../eval.c:16262 -msgid "E730: using List as a String" -msgstr "E730: Lista ei ky merkkijonosta" - -#: ../eval.c:16265 -msgid "E731: using Dictionary as a String" -msgstr "E731: Sanakirja ei ky merkkijonosta" - -#: ../eval.c:16619 -#, c-format -msgid "E706: Variable type mismatch for: %s" -msgstr "E706: Muuttujatyyppi ei tsm: %s" - -#: ../eval.c:16705 -#, c-format -msgid "E795: Cannot delete variable %s" -msgstr "E795: Muuttujaa %s ei voi poistaa" - -#: ../eval.c:16724 -#, c-format -msgid "E704: Funcref variable name must start with a capital: %s" -msgstr "E704: Funcrefin muuttujanimen pit alkaa suuraakkosella: %s" - -#: ../eval.c:16732 -#, c-format -msgid "E705: Variable name conflicts with existing function: %s" -msgstr "E705: Muuttujanimi on sama kuin olemassaolevan funktion: %s" - -#: ../eval.c:16763 -#, c-format -msgid "E741: Value is locked: %s" -msgstr "E741: Arvo on lukittu: %s" - -#: ../eval.c:16764 ../eval.c:16769 ../message.c:1839 -msgid "Unknown" -msgstr "Tuntematon" - -#: ../eval.c:16768 -#, c-format -msgid "E742: Cannot change value of %s" -msgstr "E742: Ei voi muuttaa muuttujan %s arvoa" - -#: ../eval.c:16838 -msgid "E698: variable nested too deep for making a copy" -msgstr "E698: muuttuja on upotettu liian syvlle kopioitavaksi" - -#: ../eval.c:17249 -#, c-format -msgid "E123: Undefined function: %s" -msgstr "E123: Tuntematon funktio: %s" - -#: ../eval.c:17260 -#, c-format -msgid "E124: Missing '(': %s" -msgstr "E124: ( puuttuu: %s" - -#: ../eval.c:17293 -#, fuzzy -msgid "E862: Cannot use g: here" -msgstr "E284: Ei voi asettaa IC-arvoja" - -#: ../eval.c:17312 #, c-format msgid "E125: Illegal argument: %s" msgstr "E125: Virheellinen argumentti: %s" -#: ../eval.c:17323 -#, fuzzy, c-format +#, c-format msgid "E853: Duplicate argument name: %s" -msgstr "Kaksoiskappale kentn nimest: %s" +msgstr "E853: Kaksoiskappale argumentin nimestä: %s" + +#, c-format +msgid "E740: Too many arguments for function %s" +msgstr "E740: Liikaa argumentteja funktiolle %s" + +#, c-format +msgid "E116: Invalid arguments for function %s" +msgstr "E116: Vääriä argumentteja funktiolle %s" + +#, c-format +msgid "E117: Unknown function: %s" +msgstr "E117: Tuntematon funktio: %s" + +#, c-format +msgid "E933: Function was deleted: %s" +msgstr "E933: Funktion nimi poistettu: %s" + +#, c-format +msgid "E119: Not enough arguments for function: %s" +msgstr "E119: Liikaa argumentteja funktiolle %s" + +#, c-format +msgid "E120: Using not in a script context: %s" +msgstr "E120: skriptin ulkopuolella: %s" + +#, c-format +msgid "E725: Calling dict function without Dictionary: %s" +msgstr "E725: dict-funktio ilman sanakirjaa: %s" + +#, fuzzy, c-format +#~ msgid "Error converting the call result: %s" +#~ msgstr "virhe Schemestä Vimiin konversiossa" + +msgid "add() argument" +msgstr "add()-argumentti" + +msgid "E699: Too many arguments" +msgstr "E699: Liikaa argumentteja" + +msgid "E785: complete() can only be used in Insert mode" +msgstr "E785: complete() toimii vain syöttötilassa" + +msgid "&Ok" +msgstr "&Ok" + +#, fuzzy +#~ msgid "dictwatcheradd() argument" +#~ msgstr "add()-argumentti" + +msgid "extend() argument" +msgstr "extend()-argumentti" + +msgid "map() argument" +msgstr "map()-argumentti" + +msgid "filter() argument" +msgstr "filter()-argumentti" + +#, fuzzy, c-format +#~ msgid "+-%s%3ld lines: " +#~ msgstr "+-%s%3ld rivi: " + +#, c-format +msgid "E700: Unknown function: %s" +msgstr "E700: Tuntematon funktio: %s" + +msgid "E922: expected a dict" +msgstr "E922: odotettiin dictiä" + +# datarakenteita +msgid "E923: Second argument of function() must be a list or a dict" +msgstr "E923: toisen function()-argumentin pitää olla lista tai sanakirja" + +#, fuzzy +#~ msgid "E5000: Cannot find tab number." +#~ msgstr "E695: Funcrefiä ei voi indeksoida" + +#~ msgid "E5001: Higher scope cannot be -1 if lower scope is >= 0." +#~ msgstr "" + +#, fuzzy +#~ msgid "E5002: Cannot find window number." +#~ msgstr "E671: Ikkunan otsikkoa ei löydy %s" + +msgid "called inputrestore() more often than inputsave()" +msgstr "inputrestore() suoritettu useammin kuin inputsave()" + +msgid "insert() argument" +msgstr "insert()-argumentti" + +msgid "E786: Range not allowed" +msgstr "E786: Aluetta ei voi käyttää" + +#~ msgid "Invalid stream on rpc job, use jobclose(id, 'rpc')" +#~ msgstr "" + +#~ msgid "Invalid job stream: Not an rpc job" +#~ msgstr "" + +#, c-format +#~ msgid "Invalid job stream \"%s\"" +#~ msgstr "" + +#~ msgid "Can't send data to the job: stdin is closed" +#~ msgstr "" + +#~ msgid "Can't send raw data to rpc channel" +#~ msgstr "" + +#, fuzzy +#~ msgid "E474: Failed to convert list to string" +#~ msgstr "ei voitu konvertoida tyypistä %s vim-listaksi" + +#, fuzzy, c-format +#~ msgid "E474: Failed to parse %.*s" +#~ msgstr "E241: Kohteeseen %s lähettäminen ei onnistunut" + +msgid "E701: Invalid type for len()" +msgstr "E701: Virheellinen tyyppi funktiolle len()" + +#, fuzzy, c-format +#~ msgid "msgpackdump() argument, index %i" +#~ msgstr "map()-argumentti" + +#, fuzzy +#~ msgid "E5070: Character number must not be less than zero" +#~ msgstr "luvun on oltava nollaa suurempi" + +#, fuzzy, c-format +#~ msgid "E5071: Character number must not be greater than INT_MAX (%i)" +#~ msgstr "luvun on oltava nollaa suurempi" + +msgid "E726: Stride is zero" +msgstr "E726: Stride on nolla" + +msgid "E727: Start past end" +msgstr "E727: Alku on lopun jälkeen" + +msgid "" +msgstr "" + +msgid "remove() argument" +msgstr "remove()-argumentti" + +msgid "E655: Too many symbolic links (cycle?)" +msgstr "E655: Liikaa symbolisia linkkejä (mahdollinen sykli)" + +msgid "reverse() argument" +msgstr "reverse()-argumentti" + +#, c-format +msgid "E927: Invalid action: '%s'" +msgstr "E927: Viallinen toiminto: %s" + +msgid "sort() argument" +msgstr "sort()-argumentti" + +msgid "uniq() argument" +msgstr "uniq()-argumentti" + +msgid "E702: Sort compare function failed" +msgstr "E702: Lajittelun vertausfunktio ei onnistunut" + +msgid "E882: Uniq compare function failed" +msgstr "E882: Uniqin vertausfunktio ei onnistunut" + +msgid "(Invalid)" +msgstr "(Virheellinen)" + +#, c-format +msgid "E935: invalid submatch number: %d" +msgstr "E935: Virheellinen alitäsmäyksen numero: %d" + +#~ msgid "Can only call this function in an unmodified buffer" +#~ msgstr "" + +msgid "E921: Invalid callback argument" +msgstr "E921: Virheellinen callback-argumentti" + +#, fuzzy, c-format +#~ msgid "E80: Error while writing: %s" +#~ msgstr "E80: Kirjoitusvirhe" + +#. Using %s, p and not %c, *p to preserve multibyte characters +#, fuzzy, c-format +#~ msgid "E5060: Unknown flag: %s" +#~ msgstr "E235: Tuntematon fontti: %s" + +#, fuzzy +#~ msgid "E482: Can't open file with an empty name" +#~ msgstr "E212: Tiedoston avaus kirjoittamista varten ei onnistu" + +#, fuzzy, c-format +#~ msgid "E482: Can't open file %s for writing: %s" +#~ msgstr "E212: Tiedoston avaus kirjoittamista varten ei onnistu" + +#, fuzzy, c-format +#~ msgid "E80: Error when closing file %s: %s" +#~ msgstr "E209: Virhe suljettaessa tiedostoa %s" + +#, fuzzy, c-format +#~ msgid "E794: Cannot set variable in the sandbox: \"%.*s\"" +#~ msgstr "E794: Muuttujaa ei voi asettaa hiekkalaatikossa: %s" + +#, fuzzy, c-format +#~ msgid "E795: Cannot delete variable %.*s" +#~ msgstr "E795: Muuttujaa %s ei voi poistaa" + +#, c-format +msgid "E704: Funcref variable name must start with a capital: %s" +msgstr "E704: Funcrefin muuttujanimen pitää alkaa suuraakkosella: %s" + +#, c-format +msgid "E705: Variable name conflicts with existing function: %s" +msgstr "E705: Muuttujanimi on sama kuin olemassaolevan funktion: %s" + +msgid "E698: variable nested too deep for making a copy" +msgstr "E698: muuttuja on upotettu liian syvälle kopioitavaksi" + +#, c-format +msgid "E123: Undefined function: %s" +msgstr "E123: Tuntematon funktio: %s" + +#, c-format +msgid "E124: Missing '(': %s" +msgstr "E124: ( puuttuu: %s" + +msgid "E862: Cannot use g: here" +msgstr "E862: g: ei toimi täällä" + +#, fuzzy, c-format +#~ msgid "E932: Closure function should not be at top level: %s" +#~ msgstr "E932 Sulkeumafunktio ei voi olla uloimmalla tasolla: %s" -#: ../eval.c:17416 msgid "E126: Missing :endfunction" msgstr "E126: :endfunction puuttuu" -#: ../eval.c:17537 #, c-format msgid "E707: Function name conflicts with variable: %s" msgstr "E707: Funktion nimi on ristiriidassa muuttujan kanssa: %s" -#: ../eval.c:17549 #, c-format msgid "E127: Cannot redefine function %s: It is in use" -msgstr "E127: Funktiota %s ei voi mritell uudestaan, koska se on kytss" +msgstr "E127: Funktiota %s ei voi määritellä uudestaan, koska se on käytössä" -#: ../eval.c:17604 #, c-format msgid "E746: Function name does not match script file name: %s" msgstr "E746: Funktion nimi ei ole sama kuin skriptin tiedostonnimi: %s" -#: ../eval.c:17716 msgid "E129: Function name required" msgstr "E129: Funktion nimi puuttuu" -#: ../eval.c:17824 -#, fuzzy, c-format +#, c-format msgid "E128: Function name must start with a capital or \"s:\": %s" -msgstr "" -"E128: Funktion nimen pit alkaa suuraakkosella tai sislt kaksoispisteen: " -"%s" +msgstr "E128: Funktion nimen pitää alkaa suuraakkosella tai merkeillä ’s:’: %s" -#: ../eval.c:17833 -#, fuzzy, c-format +#, c-format msgid "E884: Function name cannot contain a colon: %s" -msgstr "" -"E128: Funktion nimen pit alkaa suuraakkosella tai sislt kaksoispisteen: " -"%s" +msgstr "E884: Funktion nimessä ei saa olla kaksoispistettä: %s" -#: ../eval.c:18336 #, c-format msgid "E131: Cannot delete function %s: It is in use" msgstr "E131: Funktiota %s ei voi poistaa" -#: ../eval.c:18441 -msgid "E132: Function call depth is higher than 'maxfuncdepth'" -msgstr "E132: Funktiokutsujen syvyys on enemmn kuin maxfuncdepth" +#, fuzzy, c-format +#~ msgid "Cannot delete function %s: It is being used internally" +#~ msgstr "E131: Funktiota %s ei voi poistaa" + +msgid "E132: Function call depth is higher than 'maxfuncdepth'" +msgstr "E132: Funktiokutsujen syvyys on enemmän kuin maxfuncdepth" -#: ../eval.c:18568 #, c-format msgid "calling %s" msgstr "kutsutaan funktiota %s" -#: ../eval.c:18651 #, c-format msgid "%s aborted" msgstr "%s keskeytettiin" -#: ../eval.c:18653 -#, c-format -msgid "%s returning #%" -msgstr "%s palaa kohdassa #%" +#, fuzzy, c-format +#~ msgid "%s returning #%" +#~ msgstr "%s palaa kohdassa #%ld" -#: ../eval.c:18670 #, c-format msgid "%s returning %s" msgstr "%s palaa kohdassa %s" -#: ../eval.c:18691 ../ex_cmds2.c:2695 #, c-format msgid "continuing in %s" msgstr "jatkaa kohdassa %s" -#: ../eval.c:18795 msgid "E133: :return not inside a function" -msgstr "E133: :return ei ole funktion sisll" +msgstr "E133: :return ei ole funktion sisällä" -#: ../eval.c:19159 -msgid "" -"\n" -"# global variables:\n" -msgstr "" -"\n" -"# globaalit muuttujat:\n" - -#: ../eval.c:19254 msgid "" "\n" "\tLast set from " @@ -1045,154 +1091,396 @@ msgstr "" "\n" "\tViimeksi asetettu kohteesta " -#: ../eval.c:19272 msgid "No old files" msgstr "Ei vanhoja tiedostoja" +#, c-format +#~ msgid "E474: Expected comma before list item: %s" +#~ msgstr "" + +#, c-format +#~ msgid "E474: Expected colon before dictionary value: %s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E474: Expected string key: %s" +#~ msgstr "E415: odotuksenvastainen =-merkki: %s" + +#, fuzzy, c-format +#~ msgid "E474: Expected comma before dictionary key: %s" +#~ msgstr "E722: Sanakirjasta puuttuu pilkku: %s" + +#, fuzzy, c-format +#~ msgid "E474: Unfinished escape sequence: %.*s" +#~ msgstr "E540: Sulkematon lausekesarja" + +#, c-format +#~ msgid "E474: Unfinished unicode escape sequence: %.*s" +#~ msgstr "" + +#, c-format +#~ msgid "E474: Expected four hex digits after \\u: %.*s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E474: Unknown escape sequence: %.*s" +#~ msgstr "E409: Tuntematon ryhmän nimi: %s" + +#, c-format +#~ msgid "E474: ASCII control characters cannot be present inside string: %.*s" +#~ msgstr "" + +#, c-format +#~ msgid "E474: Only UTF-8 strings allowed: %.*s" +#~ msgstr "" + +#, c-format +#~ msgid "" +#~ "E474: Only UTF-8 code points up to U+10FFFF are allowed to appear unescaped: " +#~ "%.*s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E474: Expected string end: %.*s" +#~ msgstr "E415: odotuksenvastainen =-merkki: %s" + +#, fuzzy, c-format +#~ msgid "E474: Leading zeroes are not allowed: %.*s" +#~ msgstr "E786: Aluetta ei voi käyttää" + +#, fuzzy, c-format +#~ msgid "E474: Missing number after minus sign: %.*s" +#~ msgstr "E526: Lukuarvo puuttuu merkkijonon <%s> jälkeen" + +#, fuzzy, c-format +#~ msgid "E474: Missing number after decimal dot: %.*s" +#~ msgstr "E526: Lukuarvo puuttuu merkkijonon <%s> jälkeen" + +#, fuzzy, c-format +#~ msgid "E474: Missing exponent: %.*s" +#~ msgstr "E114: Puuttuva lainausmerkki: %s" + +#, c-format +#~ msgid "" +#~ "E685: internal error: while converting number \"%.*s\" to float string2float " +#~ "consumed %zu bytes in place of %zu" +#~ msgstr "" + +#, c-format +#~ msgid "" +#~ "E685: internal error: while converting number \"%.*s\" to integer vim_str2nr " +#~ "consumed %i bytes in place of %zu" +#~ msgstr "" + +#~ msgid "E474: Attempt to decode a blank string" +#~ msgstr "" + +#, c-format +#~ msgid "E474: No container to close: %.*s" +#~ msgstr "" + +#, c-format +#~ msgid "E474: Closing list with curly bracket: %.*s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E474: Closing dictionary with square bracket: %.*s" +#~ msgstr "E725: dict-funktio ilman sanakirjaa: %s" + +#, fuzzy, c-format +#~ msgid "E474: Trailing comma: %.*s" +#~ msgstr "E488: Ylimääräisiä merkkejä perässä" + +#, c-format +#~ msgid "E474: Expected value after colon: %.*s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E474: Expected value: %.*s" +#~ msgstr "E415: odotuksenvastainen =-merkki: %s" + +#, c-format +#~ msgid "E474: Comma not inside container: %.*s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E474: Duplicate comma: %.*s" +#~ msgstr "E721: Kaksi samaa avainta sanakirjassa: %s" + +#, fuzzy, c-format +#~ msgid "E474: Comma after colon: %.*s" +#~ msgstr "E254: Väriä %s ei voi määritellä" + +#, fuzzy, c-format +#~ msgid "E474: Using comma in place of colon: %.*s" +#~ msgstr "E722: Sanakirjasta puuttuu pilkku: %s" + +#, c-format +#~ msgid "E474: Leading comma: %.*s" +#~ msgstr "" + +#, c-format +#~ msgid "E474: Colon not inside container: %.*s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E474: Using colon not in dictionary: %.*s" +#~ msgstr "E720: Sanakirjasta puuttuu kaksoispiste: %s" + +#, fuzzy, c-format +#~ msgid "E474: Unexpected colon: %.*s" +#~ msgstr "E415: odotuksenvastainen =-merkki: %s" + +#, c-format +#~ msgid "E474: Colon after comma: %.*s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E474: Duplicate colon: %.*s" +#~ msgstr "E721: Kaksi samaa avainta sanakirjassa: %s" + +#, fuzzy, c-format +#~ msgid "E474: Expected null: %.*s" +#~ msgstr "E415: odotuksenvastainen =-merkki: %s" + +#, fuzzy, c-format +#~ msgid "E474: Expected true: %.*s" +#~ msgstr "E270: odotuksenvastainen redo" + +#, fuzzy, c-format +#~ msgid "E474: Expected false: %.*s" +#~ msgstr "E415: odotuksenvastainen =-merkki: %s" + +#, fuzzy, c-format +#~ msgid "E474: Unidentified byte: %.*s" +#~ msgstr "E121: Määrittelemätön muuttuja: %s" + +#, fuzzy, c-format +#~ msgid "E474: Trailing characters: %.*s" +#~ msgstr "E488: Ylimääräisiä merkkejä perässä" + +#, fuzzy, c-format +#~ msgid "E474: Unexpected end of input: %.*s" +#~ msgstr "E415: odotuksenvastainen =-merkki: %s" + +#, c-format +#~ msgid "key %s" +#~ msgstr "" + +#, c-format +#~ msgid "key %s at index %i from special map" +#~ msgstr "" + +#, c-format +#~ msgid "index %i" +#~ msgstr "" + +#~ msgid "partial" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "argument %i" +#~ msgstr "-c-argumentti" + +#, fuzzy +#~ msgid "partial self dictionary" +#~ msgstr "ei voida muuttaa kiinnitettyä sanakirjaa" + +#~ msgid "itself" +#~ msgstr "" + +#. Only give this message once for a recursive call to avoid +#. flooding the user with errors. +#~ msgid "E724: unable to correctly dump variable with self-referencing container" +#~ msgstr "" + +#~ msgid "E474: Unable to represent NaN value in JSON" +#~ msgstr "" + +#~ msgid "E474: Unable to represent infinity in JSON" +#~ msgstr "" + +#, c-format +#~ msgid "" +#~ "E474: String \"%.*s\" contains byte that does not start any UTF-8 character" +#~ msgstr "" + +#, c-format +#~ msgid "" +#~ "E474: UTF-8 string contains code point which belongs to a surrogate pair: " +#~ "%.*s" +#~ msgstr "" + +#, fuzzy +#~ msgid "E474: Unable to convert EXT string to JSON" +#~ msgstr "E620: Tulostuskoodaukseen %s muunto ei onnistu" + +#, c-format +#~ msgid "E474: Error while dumping %s, %s: attempt to dump function reference" +#~ msgstr "" + +#, fuzzy +#~ msgid "E474: Invalid key in special dictionary" +#~ msgstr "E736: Virheellinen toiminto sanakirjalle" + +#, c-format +#~ msgid "E5004: Error while dumping %s, %s: attempt to dump function reference" +#~ msgstr "" + +#, c-format +#~ msgid "E5005: Unable to dump %s: container references itself in %s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E684: list index out of range: %" +#~ msgstr "E684: Indeksi %ld luettelon rajojen ulkopuolella" + +#~ msgid "E6000: Argument is not a function or function name" +#~ msgstr "" + +#, c-format +msgid "E737: Key already exists: %s" +msgstr "E737: Avain on jo olemassa: %s" + +#, fuzzy +#~ msgid "tv_clear() argument" +#~ msgstr "filter()-argumentti" + +msgid "E743: variable nested too deep for (un)lock" +msgstr "E743: muuttujassa liian monta tasoa lukituksen käsittelyyn" + +#, fuzzy, c-format +#~ msgid "E741: Value is locked: %.*s" +#~ msgstr "E741: Arvo on lukittu: %s" + +#, fuzzy, c-format +#~ msgid "E742: Cannot change value of %.*s" +#~ msgstr "E742: Ei voi muuttaa muuttujan %s arvoa" + +msgid "Unknown" +msgstr "Tuntematon" + +#, fuzzy +#~ msgid "E805: Expected a Number or a String, Float found" +#~ msgstr "E807: Odotettiin Float-argumenttia printf():lle" + +#~ msgid "E703: Expected a Number or a String, Funcref found" +#~ msgstr "" + +#, fuzzy +#~ msgid "E745: Expected a Number or a String, List found" +#~ msgstr "E807: Odotettiin Float-argumenttia printf():lle" + +#~ msgid "E728: Expected a Number or a String, Dictionary found" +#~ msgstr "" + +#, fuzzy +#~ msgid "E5300: Expected a Number or a String" +#~ msgstr "E807: Odotettiin Float-argumenttia printf():lle" + +msgid "E745: Using a List as a Number" +msgstr "E745: Lista ei käy Numberista" + +msgid "E728: Using a Dictionary as a Number" +msgstr "E728: Sanakirja ei käy Numberista" + +msgid "E805: Using a Float as a Number" +msgstr "E805: Float ei käy Numberista" + +#, fuzzy +#~ msgid "E685: using an invalid value as a Number" +#~ msgstr "E908: huono arvo merkkijonolle" + +msgid "E730: using List as a String" +msgstr "E730: Lista ei käy merkkijonosta" + +msgid "E731: using Dictionary as a String" +msgstr "E731: Sanakirja ei käy merkkijonosta" + +msgid "E908: using an invalid value as a String" +msgstr "E908: huono arvo merkkijonolle" + +msgid "E891: Using a Funcref as a Float" +msgstr "E891: Funcref ei käy Floatista" + +msgid "E892: Using a String as a Float" +msgstr "E892: String ei käy Floatista" + +msgid "E893: Using a List as a Float" +msgstr "E893: Lista ei käy Floatista" + +msgid "E894: Using a Dictionary as a Float" +msgstr "E894: Sanakirja ei käy Floatista" + +msgid "E907: Using a special value as a Float" +msgstr "E907: Käytettiin erikoisarvoa Floattina" + +msgid "E808: Number or Float required" +msgstr "E808: Number tai Float vaaditaan" + # puhutaan merkin ulkoasusta snprintf(..., c, c, c, c) -#: ../ex_cmds.c:122 #, c-format msgid "<%s>%s%s %d, Hex %02x, Octal %03o" msgstr "<%s>%s%s %d, heksana %02x, oktaalina %03o" -#: ../ex_cmds.c:145 #, c-format msgid "> %d, Hex %04x, Octal %o" msgstr "> %d, heksana %04x, oktaalina %o" -#: ../ex_cmds.c:146 #, c-format msgid "> %d, Hex %08x, Octal %o" msgstr "> %d, hekdana %08x, oktaalina %o" -#: ../ex_cmds.c:684 msgid "E134: Move lines into themselves" -msgstr "E134: Rivien siirto itsejens plle" +msgstr "E134: Rivien siirto itsejensä päälle" -#: ../ex_cmds.c:747 msgid "1 line moved" msgstr "1 rivi siirretty" -#: ../ex_cmds.c:749 -#, c-format -msgid "% lines moved" -msgstr "% rivi siirretty" +#, fuzzy, c-format +#~ msgid "% lines moved" +#~ msgstr "%ld riviä siirretty" -#: ../ex_cmds.c:1175 #, c-format -msgid "% lines filtered" -msgstr "% rivi suodatettu" +msgid "E482: Can't create file %s" +msgstr "E482: Tiedostoa %s ei voi luoda" + +#, fuzzy, c-format +#~ msgid "% lines filtered" +#~ msgstr "%ld riviä suodatettu" -#: ../ex_cmds.c:1194 msgid "E135: *Filter* Autocommands must not change current buffer" msgstr "E135: *Filter*-autocommand ei voi vaihtaa puskuria" -#: ../ex_cmds.c:1244 msgid "[No write since last change]\n" -msgstr "[Viimeisint muutosta ei ole kirjoitettu]\n" +msgstr "[Viimeisintä muutosta ei ole kirjoitettu]\n" -#: ../ex_cmds.c:1424 -#, c-format -msgid "%sviminfo: %s in line: " -msgstr "%sviminfo: %s rivill: " - -#: ../ex_cmds.c:1431 -msgid "E136: viminfo: Too many errors, skipping rest of file" -msgstr "E136: viminfo: liikaa virheit, ohitetaan lopputiedosto" - -#: ../ex_cmds.c:1458 -#, c-format -msgid "Reading viminfo file \"%s\"%s%s%s" -msgstr "Luetaan viminfo-tiedostoa \"%s\"%s%s%s" - -#: ../ex_cmds.c:1460 -msgid " info" -msgstr " info" - -#: ../ex_cmds.c:1461 -msgid " marks" -msgstr " merkit" - -#: ../ex_cmds.c:1462 -msgid " oldfiles" -msgstr " vanhaatiedostoa" - -#: ../ex_cmds.c:1463 -msgid " FAILED" -msgstr " EPONNISTUI" - -#. avoid a wait_return for this message, it's annoying -#: ../ex_cmds.c:1541 -#, c-format -msgid "E137: Viminfo file is not writable: %s" -msgstr "E137: Viminfo-tiedostoon ei voitu kirjoittaa: %s" - -#: ../ex_cmds.c:1626 -#, c-format -msgid "E138: Can't write viminfo file %s!" -msgstr "E138: Viminfo-tiedoston kirjoittaminen ei onnistu %s" - -#: ../ex_cmds.c:1635 -#, c-format -msgid "Writing viminfo file \"%s\"" -msgstr "Kirjoitetaan viminfo-tiedostoa %s" - -#. Write the info: -#: ../ex_cmds.c:1720 -#, c-format -msgid "# This viminfo file was generated by Vim %s.\n" -msgstr "# Vimin %s generoima viminfo-tiedosto.\n" - -#: ../ex_cmds.c:1722 -msgid "" -"# You may edit it if you're careful!\n" -"\n" -msgstr "" -"# Muokkaa varovasti!\n" -"\n" - -#: ../ex_cmds.c:1723 -msgid "# Value of 'encoding' when this file was written\n" -msgstr "# encoding-muuttujan arvo tiedostoa kirjoitettaessa\n" - -#: ../ex_cmds.c:1800 -msgid "Illegal starting char" -msgstr "Virheellinen aloitusmerkki" - -#: ../ex_cmds.c:2162 msgid "Write partial file?" msgstr "Kirjoita osittainen tiedosto" -#: ../ex_cmds.c:2166 msgid "E140: Use ! to write partial buffer" -msgstr "E140: Kyt !-komentoa osittaisen puskurin kirjoittamiseen" +msgstr "E140: Käytä !-komentoa osittaisen puskurin kirjoittamiseen" -#: ../ex_cmds.c:2281 #, c-format msgid "Overwrite existing file \"%s\"?" msgstr "Ylikirjoitetaanko olemassaoleva tiedosto %s?" -#: ../ex_cmds.c:2317 #, c-format msgid "Swap file \"%s\" exists, overwrite anyway?" msgstr "Swap-tiedosto %s on olemassa, ylikirjoitetaanko?" -#: ../ex_cmds.c:2326 #, c-format msgid "E768: Swap file exists: %s (:silent! overrides)" msgstr "E768: Swap-tiedosto on jo olemassa: %s (komento :silent! ohittaa)" -#: ../ex_cmds.c:2381 -#, c-format -msgid "E141: No file name for buffer %" -msgstr "E141: Ei tiedostonime puskurille %" +#, fuzzy, c-format +#~ msgid "E141: No file name for buffer %" +#~ msgstr "E141: Ei tiedostonimeä puskurille %ld" -#: ../ex_cmds.c:2412 msgid "E142: File not written: Writing is disabled by 'write' option" msgstr "" -"E142: Tiedostoa ei kirjoitettu; write-asetus poistaa kirjoituksen kytst" +"E142: Tiedostoa ei kirjoitettu; write-asetus poistaa kirjoituksen käytöstä" -#: ../ex_cmds.c:2434 #, c-format msgid "" "'readonly' option is set for \"%s\".\n" @@ -1201,7 +1489,6 @@ msgstr "" "readonly asetettu tiedostolle \"%s\".\n" "Kirjoitetaanko?" -#: ../ex_cmds.c:2439 #, c-format msgid "" "File permissions of \"%s\" are read-only.\n" @@ -1210,799 +1497,599 @@ msgid "" msgstr "" "Tiedosto %s on kirjoitussuojattu.\n" "Siihen saattaa voida silti kirjoittaa.\n" -"Yritetnk?" +"Yritetäänkö?" -#: ../ex_cmds.c:2451 #, c-format msgid "E505: \"%s\" is read-only (add ! to override)" -msgstr "E505: %s on kirjoitussuojattu (lis komentoon ! ohittaaksesi)" +msgstr "E505: %s on kirjoitussuojattu (lisää komentoon ! ohittaaksesi)" -#: ../ex_cmds.c:3120 #, c-format msgid "E143: Autocommands unexpectedly deleted new buffer %s" msgstr "E143: Autocommand poisti uuden puskurin odotuksen vastaisesti %s" -#: ../ex_cmds.c:3313 msgid "E144: non-numeric argument to :z" msgstr "E144: :z:n argumentti ei ole numero" -#: ../ex_cmds.c:3404 -msgid "E145: Shell commands not allowed in rvim" -msgstr "E145: Kuoren komennot eivt toimi rvimiss" +#, fuzzy +#~ msgid "E145: Shell commands not allowed in restricted mode" +#~ msgstr "E145: Kuoren komennot eivät toimi rvimissä" -#: ../ex_cmds.c:3498 msgid "E146: Regular expressions can't be delimited by letters" -msgstr "E146: Snnllist ilmausta ei voi rajata kirjaimilla" +msgstr "E146: Säännöllistä ilmausta ei voi rajata kirjaimilla" -#: ../ex_cmds.c:3964 #, c-format msgid "replace with %s (y/n/a/q/l/^E/^Y)?" msgstr "korvaa kohteella %s (y/n/a/q/l/^E/^Y)?" -#: ../ex_cmds.c:4379 msgid "(Interrupted) " msgstr "(Keskeytetty)" -#: ../ex_cmds.c:4384 msgid "1 match" -msgstr "1 tsmys" +msgstr "1 täsmäys" -#: ../ex_cmds.c:4384 msgid "1 substitution" msgstr "1 korvaus" -#: ../ex_cmds.c:4387 -#, c-format -msgid "% matches" -msgstr "% tsmyst" +#, fuzzy, c-format +#~ msgid "% matches" +#~ msgstr "%ld täsmäystä" -#: ../ex_cmds.c:4388 -#, c-format -msgid "% substitutions" -msgstr "% korvausta" +#, fuzzy, c-format +#~ msgid "% substitutions" +#~ msgstr "%ld korvausta" -#: ../ex_cmds.c:4392 msgid " on 1 line" -msgstr " 1 rivill" +msgstr " 1 rivillä" -#: ../ex_cmds.c:4395 -#, c-format -msgid " on % lines" -msgstr " % rivill" +#, fuzzy, c-format +#~ msgid " on % lines" +#~ msgstr " %ld rivillä" -#: ../ex_cmds.c:4438 msgid "E147: Cannot do :global recursive" msgstr "E147: :globalia ei voi suorittaa rekursiivisesti" -#: ../ex_cmds.c:4467 msgid "E148: Regular expression missing from global" -msgstr "E148: Snnllinen ilmaus puuttuu globaalista" +msgstr "E148: Säännöllinen ilmaus puuttuu globaalista" -#: ../ex_cmds.c:4508 #, c-format msgid "Pattern found in every line: %s" -msgstr "Kuvio lytyi joka rivilt: %s" +msgstr "Kuvio löytyi joka riviltä: %s" -#: ../ex_cmds.c:4510 -#, fuzzy, c-format +#, c-format msgid "Pattern not found: %s" -msgstr "Kuviota ei lydy" +msgstr "Kuviota ei löydy: %s" -#: ../ex_cmds.c:4587 -msgid "" -"\n" -"# Last Substitute String:\n" -"$" -msgstr "" -"\n" -"# Viimeisin korvausmerkkijono:\n" -"$" - -#: ../ex_cmds.c:4679 msgid "E478: Don't panic!" -msgstr "E478: l panikoi." +msgstr "E478: Älä panikoi." -#: ../ex_cmds.c:4717 #, c-format msgid "E661: Sorry, no '%s' help for %s" -msgstr "E661: Sori, ei lydy %s-ohjetta kohteelle %s" +msgstr "E661: ei löydy %s-ohjetta kohteelle %s" -#: ../ex_cmds.c:4719 #, c-format msgid "E149: Sorry, no help for %s" -msgstr "E149: Sori, ei lydy ohjetta kohteelle %s" +msgstr "E149: ei löydy ohjetta kohteelle %s" -#: ../ex_cmds.c:4751 #, c-format msgid "Sorry, help file \"%s\" not found" -msgstr "Sori, ohjetiedostoa %s ei lydy" +msgstr "ohjetiedostoa %s ei löydy" -#: ../ex_cmds.c:5323 -#, c-format -msgid "E150: Not a directory: %s" -msgstr "E150: Ei ole hakemisto: %s" - -#: ../ex_cmds.c:5446 #, c-format msgid "E152: Cannot open %s for writing" msgstr "E152: Ei voi avata tiedostoa %s kirjoittamista varten" -#: ../ex_cmds.c:5471 #, c-format msgid "E153: Unable to open %s for reading" msgstr "E153: Ei voi avata tiedostoa %s lukemista varten" -#: ../ex_cmds.c:5500 #, c-format msgid "E670: Mix of help file encodings within a language: %s" -msgstr "E670: Monia ohjetiedostokoodauksia kieless: %s" +msgstr "E670: Monia ohjetiedostokoodauksia kielessä: %s" -#: ../ex_cmds.c:5565 #, c-format msgid "E154: Duplicate tag \"%s\" in file %s/%s" -msgstr "E154: Kaksoiskappale tgist %s tiedostossa %s/%s" +msgstr "E154: Kaksoiskappale tägistä %s tiedostossa %s/%s" + +#, c-format +msgid "E150: Not a directory: %s" +msgstr "E150: Ei ole hakemisto: %s" -#: ../ex_cmds.c:5687 #, c-format msgid "E160: Unknown sign command: %s" msgstr "E160: Tuntematon merkkikomento: %s" -#: ../ex_cmds.c:5704 msgid "E156: Missing sign name" msgstr "E156: Merkki puuttuu" -#: ../ex_cmds.c:5746 msgid "E612: Too many signs defined" -msgstr "E612: Liikaa merkkej mritelty" +msgstr "E612: Liikaa merkkejä määritelty" -#: ../ex_cmds.c:5813 #, c-format msgid "E239: Invalid sign text: %s" msgstr "E239: Virheellinen merkkiteksti: %s" -#: ../ex_cmds.c:5844 ../ex_cmds.c:6035 #, c-format msgid "E155: Unknown sign: %s" msgstr "E155: Tuntematon merkki: %s" -#: ../ex_cmds.c:5877 msgid "E159: Missing sign number" msgstr "E159: Merkin numero puuttuu" -#: ../ex_cmds.c:5971 #, c-format msgid "E158: Invalid buffer name: %s" msgstr "E158: Virheellinen puskurin nimi: %s" -#: ../ex_cmds.c:6008 -#, c-format -msgid "E157: Invalid sign ID: %" -msgstr "E157: Virheellinen merkin tunnus: %" +msgid "E934: Cannot jump to a buffer that does not have a name" +msgstr "E934: Ei voida hypätä puskuriin jolla ei ole nimeä" + +#, fuzzy, c-format +#~ msgid "E157: Invalid sign ID: %" +#~ msgstr "E157: Virheellinen merkin tunnus: %ld" + +#, c-format +msgid "E885: Not possible to change sign %s" +msgstr "E885: Ei voida muuttaa merkkiä %s" -#: ../ex_cmds.c:6066 msgid " (not supported)" msgstr " (ei tuettu)" -#: ../ex_cmds.c:6169 msgid "[Deleted]" msgstr "[Poistettu]" -#: ../ex_cmds2.c:139 msgid "Entering Debug mode. Type \"cont\" to continue." -msgstr "Siirrytn vianetsinttilaan, kirjoita cont jatkaaksesi." +msgstr "Siirrytään vianetsintätilaan, kirjoita cont jatkaaksesi." -#: ../ex_cmds2.c:143 ../ex_docmd.c:759 -#, c-format -msgid "line %: %s" -msgstr "rivi %: %s" +#, fuzzy, c-format +#~ msgid "line %: %s" +#~ msgstr "rivi %ld: %s" -#: ../ex_cmds2.c:145 #, c-format msgid "cmd: %s" msgstr "kmnt: %s" -#: ../ex_cmds2.c:322 -#, c-format -msgid "Breakpoint in \"%s%s\" line %" -msgstr "Katkaisukohta %s%s rivill %" +msgid "frame is zero" +msgstr "kehys on nolla" + +#, c-format +msgid "frame at highest level: %d" +msgstr "kehys ylimmällä tasolla: %d" + +#, fuzzy, c-format +#~ msgid "Breakpoint in \"%s%s\" line %" +#~ msgstr "Katkaisukohta %s%s rivillä %ld" -#: ../ex_cmds2.c:581 #, c-format msgid "E161: Breakpoint not found: %s" msgstr "E161: Katkaisukohta puuttuu: %s" -#: ../ex_cmds2.c:611 msgid "No breakpoints defined" msgstr "Ei katkaisukohtia" -#: ../ex_cmds2.c:617 -#, c-format -msgid "%3d %s %s line %" -msgstr "%3d %s %s rivi %" +#, fuzzy, c-format +#~ msgid "%3d %s %s line %" +#~ msgstr "%3d %s %s rivi %ld" -#: ../ex_cmds2.c:942 msgid "E750: First use \":profile start {fname}\"" -msgstr "E750: Aloita kskyll :profile start {fname}" +msgstr "E750: Aloita käskyllä :profile start {fname}" -#: ../ex_cmds2.c:1269 #, c-format msgid "Save changes to \"%s\"?" msgstr "Tallennetaanko muutokset tiedostoon %s?" -#: ../ex_cmds2.c:1271 ../ex_docmd.c:8851 msgid "Untitled" -msgstr "Nimetn" +msgstr "Nimetön" -#: ../ex_cmds2.c:1421 #, c-format msgid "E162: No write since last change for buffer \"%s\"" -msgstr "E162: Muutoksia ei ole kirjoitettu puskurin %s viime muutoksen jlkeen" +msgstr "E162: Muutoksia ei ole kirjoitettu puskurin %s viime muutoksen jälkeen" -#: ../ex_cmds2.c:1480 msgid "Warning: Entered other buffer unexpectedly (check autocommands)" msgstr "Varoitus: Puskuri vaihtui odottamatta (tarkista autocommands)" -#: ../ex_cmds2.c:1826 msgid "E163: There is only one file to edit" msgstr "E163: Vain yksi tiedosto muokattavana" -#: ../ex_cmds2.c:1828 msgid "E164: Cannot go before first file" -msgstr "E164: Ensimmisen tiedoston ohi ei voi menn" +msgstr "E164: Ensimmäisen tiedoston ohi ei voi mennä" -#: ../ex_cmds2.c:1830 msgid "E165: Cannot go beyond last file" -msgstr "E165: Viimeisen tiedoston ohi ei voi menn" +msgstr "E165: Viimeisen tiedoston ohi ei voi mennä" -#: ../ex_cmds2.c:2175 #, c-format msgid "E666: compiler not supported: %s" -msgstr "E666: kntj ei tueta: %s" +msgstr "E666: kääntäjää ei tueta: %s" -#: ../ex_cmds2.c:2257 #, c-format msgid "Searching for \"%s\" in \"%s\"" -msgstr "Etsitn ilmausta %s kohteesta %s" +msgstr "Etsitään ilmausta %s kohteesta %s" -#: ../ex_cmds2.c:2284 #, c-format msgid "Searching for \"%s\"" -msgstr "Etsitn ilmausta %s" +msgstr "Etsitään ilmausta %s" -#: ../ex_cmds2.c:2307 #, c-format -msgid "not found in 'runtimepath': \"%s\"" -msgstr "ei lydy runtimepathista: %s" +msgid "not found in '%s': \"%s\"" +msgstr "'%s' ei löydy kohteesta: %s" -#: ../ex_cmds2.c:2472 #, c-format msgid "Cannot source a directory: \"%s\"" msgstr "Hakemistoa ei voi ladata: %s" -#: ../ex_cmds2.c:2518 #, c-format msgid "could not source \"%s\"" msgstr "ei voitu ladata %s" -#: ../ex_cmds2.c:2520 -#, c-format -msgid "line %: could not source \"%s\"" -msgstr "rivi %: ei voitu ladata %s" +#, fuzzy, c-format +#~ msgid "line %: could not source \"%s\"" +#~ msgstr "rivi %ld: ei voitu ladata %s" -#: ../ex_cmds2.c:2535 #, c-format msgid "sourcing \"%s\"" msgstr "ladataan %s" -#: ../ex_cmds2.c:2537 -#, c-format -msgid "line %: sourcing \"%s\"" -msgstr "rivi %: ladataan %s" +#, fuzzy, c-format +#~ msgid "line %: sourcing \"%s\"" +#~ msgstr "rivi %ld: ladataan %s" -#: ../ex_cmds2.c:2693 #, c-format msgid "finished sourcing %s" msgstr "ladattu %s" -#: ../ex_cmds2.c:2765 msgid "modeline" msgstr "mode-rivi" -#: ../ex_cmds2.c:2767 msgid "--cmd argument" msgstr "--cmd-argumentti" -#: ../ex_cmds2.c:2769 msgid "-c argument" msgstr "-c-argumentti" -#: ../ex_cmds2.c:2771 msgid "environment variable" -msgstr "ympristmuuttuja" +msgstr "ympäristömuuttuja" -#: ../ex_cmds2.c:2773 msgid "error handler" -msgstr "virheksittelin" +msgstr "virhekäsittelin" -#: ../ex_cmds2.c:3020 msgid "W15: Warning: Wrong line separator, ^M may be missing" -msgstr "W15: Varoitus: Vr rivierotin, ^M saattaa puuttua" +msgstr "W15: Varoitus: Väärä rivierotin, ^M saattaa puuttua" -#: ../ex_cmds2.c:3139 msgid "E167: :scriptencoding used outside of a sourced file" msgstr "E167: :scriptencoding ladatun tiedoston ulkopuolella" -#: ../ex_cmds2.c:3166 msgid "E168: :finish used outside of a sourced file" msgstr "E168: :finish ladatun tiedoston ulkopuolella" -#: ../ex_cmds2.c:3389 #, c-format msgid "Current %slanguage: \"%s\"" -msgstr "Kytss oleva %skieli: %s" +msgstr "Käytössä oleva %skieli: %s" -#: ../ex_cmds2.c:3404 #, c-format msgid "E197: Cannot set language to \"%s\"" -msgstr "E197: Kieleksi ei voitu asettaa kielt %s" +msgstr "E197: Kieleksi ei voitu asettaa kieltä %s" #. don't redisplay the window #. don't wait for return -#: ../ex_docmd.c:387 msgid "Entering Ex mode. Type \"visual\" to go to Normal mode." -msgstr "Siirrytn Ex-tilaan, kirjoita visual palataksesi normaaliin tilaan." +msgstr "Siirrytään Ex-tilaan, kirjoita visual palataksesi normaaliin tilaan." -#: ../ex_docmd.c:428 msgid "E501: At end-of-file" msgstr "E501: Tiedoston lopussa" -#: ../ex_docmd.c:513 msgid "E169: Command too recursive" msgstr "E169: Liian rekursiivinen komento" -#: ../ex_docmd.c:1006 +#, fuzzy +#~ msgid "line %" +#~ msgstr "rivi %ld" + #, c-format msgid "E605: Exception not caught: %s" msgstr "E605: Kiinniottamaton poikkeus: %s" -#: ../ex_docmd.c:1085 msgid "End of sourced file" msgstr "Ladatun tiedoston loppu" -#: ../ex_docmd.c:1086 msgid "End of function" msgstr "Funktion loppu" -#: ../ex_docmd.c:1628 msgid "E464: Ambiguous use of user-defined command" -msgstr "E464: Kyttjn mrittelemn komennon monimerkityksinen kytt" +msgstr "E464: Käyttäjän määrittelemän komennon monimerkityksinen käyttö" -#: ../ex_docmd.c:1638 msgid "E492: Not an editor command" msgstr "E492: Ei ole editorikomento" -#: ../ex_docmd.c:1729 msgid "E493: Backwards range given" msgstr "E493: Takaperoinen arvoalue annettu" -#: ../ex_docmd.c:1733 msgid "Backwards range given, OK to swap" -msgstr "Takaperoinen arvoalue annettu, OK knt" +msgstr "Takaperoinen arvoalue annettu, OK kääntää" #. append #. typed wrong -#: ../ex_docmd.c:1787 msgid "E494: Use w or w>>" -msgstr "E494: Kyt w:t tai w>>:aa" +msgstr "E494: Käytä w:tä tai w>>:aa" -#: ../ex_docmd.c:3454 -msgid "E319: The command is not available in this version" -msgstr "E319: Komento ei ole kytettviss tss versiossa" +#, fuzzy +#~ msgid "E319: The command is not available in this version" +#~ msgstr "E319: Komento ei ole käytettävissä tässä versiossa" -#: ../ex_docmd.c:3752 -msgid "E172: Only one file name allowed" -msgstr "E172: Vain yksi tiedostonimi sallitaan" - -#: ../ex_docmd.c:4238 msgid "1 more file to edit. Quit anyway?" -msgstr "viel 1 tiedosto muokattavana, lopetaanko silti?" +msgstr "vielä 1 tiedosto muokattavana, lopetaanko silti?" -#: ../ex_docmd.c:4242 #, c-format msgid "%d more files to edit. Quit anyway?" -msgstr "viel %d tiedostoa muokattavana, lopetetaanko silti?" +msgstr "vielä %d tiedostoa muokattavana, lopetetaanko silti?" -#: ../ex_docmd.c:4248 msgid "E173: 1 more file to edit" -msgstr "E173: viel 1 tiedosto muokattavana" +msgstr "E173: vielä 1 tiedosto muokattavana" -#: ../ex_docmd.c:4250 -#, c-format -msgid "E173: % more files to edit" -msgstr "E173: viel % tiedostoa muokattavana" +#, fuzzy, c-format +#~ msgid "E173: % more files to edit" +#~ msgstr "E173: vielä %ld tiedostoa muokattavana" -#: ../ex_docmd.c:4320 msgid "E174: Command already exists: add ! to replace it" -msgstr "E174: Komento on jo olemassa, kyt !: korvataksesi" +msgstr "E174: Komento on jo olemassa, käytä !:ä korvataksesi" -#: ../ex_docmd.c:4432 msgid "" "\n" -" Name Args Range Complete Definition" +" Name Args Address Complete Definition" msgstr "" "\n" -" Nimi Arg Arvot Valmis Mritelm" +" Nimi Argumentit Osoite Valmis Määritelmä" -#: ../ex_docmd.c:4516 msgid "No user-defined commands found" -msgstr "Ei kyttjn mrittelemi komentoja" +msgstr "Ei käyttäjän määrittelemiä komentoja" -#: ../ex_docmd.c:4538 msgid "E175: No attribute specified" -msgstr "E175: Ei attribuutteja mriteltyn" +msgstr "E175: Ei attribuutteja määriteltynä" -#: ../ex_docmd.c:4583 msgid "E176: Invalid number of arguments" -msgstr "E176: Vr mr attribuutteja" +msgstr "E176: Väärä määrä attribuutteja" -#: ../ex_docmd.c:4594 msgid "E177: Count cannot be specified twice" -msgstr "E177: Lukumr ei voi mritell kahdesti" +msgstr "E177: Lukumäärää ei voi määritellä kahdesti" -#: ../ex_docmd.c:4603 msgid "E178: Invalid default value for count" -msgstr "E178: Lukumrn oletusarvo on vr" +msgstr "E178: Lukumäärän oletusarvo on väärä" -#: ../ex_docmd.c:4625 msgid "E179: argument required for -complete" msgstr "E179: -complete vaatii argumentin" -#: ../ex_docmd.c:4635 +msgid "E179: argument required for -addr" +msgstr "E179: -addr vaatii argumentin" + #, c-format msgid "E181: Invalid attribute: %s" msgstr "E181: Virheellinen attribuutti: %s" -#: ../ex_docmd.c:4678 msgid "E182: Invalid command name" msgstr "E182: Virheellinen komennon nimi" -#: ../ex_docmd.c:4691 msgid "E183: User defined commands must start with an uppercase letter" -msgstr "E183: Kyttjn mrittelemn komennon pit alkaa suuraakkosella" +msgstr "E183: Käyttäjän määrittelemän komennon pitää alkaa suuraakkosella" -#: ../ex_docmd.c:4696 -#, fuzzy msgid "E841: Reserved name, cannot be used for user defined command" -msgstr "E464: Kyttjn mrittelemn komennon monimerkityksinen kytt" +msgstr "E841: Varattua nimeä ei voi käyttää käyttäjän määrittelemänä komentona" -#: ../ex_docmd.c:4751 #, c-format msgid "E184: No such user-defined command: %s" -msgstr "E184: Kyttjn komentoa ei ole olemassa: %s" +msgstr "E184: Käyttäjän komentoa ei ole olemassa: %s" + +#, c-format +msgid "E180: Invalid address type value: %s" +msgstr "E180: Virheellinen osoitetyyppiarvo: %s" -#: ../ex_docmd.c:5219 #, c-format msgid "E180: Invalid complete value: %s" -msgstr "E180: Virheellinen tydennysarvo: %s" +msgstr "E180: Virheellinen täydennysarvo: %s" -#: ../ex_docmd.c:5225 msgid "E468: Completion argument only allowed for custom completion" -msgstr "E468: Tydennysargumentti sopii vain itse mriteltyyn tydennykseen" +msgstr "E468: Täydennysargumentti sopii vain itse määriteltyyn täydennykseen" -#: ../ex_docmd.c:5231 msgid "E467: Custom completion requires a function argument" -msgstr "E467: Itse mritelty tydennys vaatii funktioargumentin" +msgstr "E467: Itse määritelty täydennys vaatii funktioargumentin" -#: ../ex_docmd.c:5257 -#, fuzzy, c-format +#, c-format msgid "E185: Cannot find color scheme '%s'" -msgstr "E185: Vriteemaa %s ei lydy" +msgstr "E185: Väriteemaa %s ei löydy" -#: ../ex_docmd.c:5263 msgid "Greetings, Vim user!" -msgstr "Tervehdys, Vimin kyttj." +msgstr "Tervehdys, Vimin käyttäjä." -#: ../ex_docmd.c:5431 msgid "E784: Cannot close last tab page" -msgstr "E784: Viimeist vlilehte ei voi sulkea" +msgstr "E784: Viimeistä välilehteä ei voi sulkea" -#: ../ex_docmd.c:5462 msgid "Already only one tab page" -msgstr "Vain yksi vlilehti jljell en" +msgstr "Vain yksi välilehti jäljellä enää" -#: ../ex_docmd.c:6004 #, c-format msgid "Tab page %d" msgstr "Tabisivu %d" -#: ../ex_docmd.c:6295 msgid "No swap file" msgstr "Ei swap-tiedostoa" -#: ../ex_docmd.c:6478 -msgid "E747: Cannot change directory, buffer is modified (add ! to override)" -msgstr "" -"E747: Hakemistoa ei voida muuttaa, puskuria on muokattu (lis komentoon ! " -"ohittaaksesi" - -#: ../ex_docmd.c:6485 msgid "E186: No previous directory" -msgstr "E186: Ei edellist hakemistoa" +msgstr "E186: Ei edellistä hakemistoa" -#: ../ex_docmd.c:6530 msgid "E187: Unknown" msgstr "E187: Tuntematon" -#: ../ex_docmd.c:6610 msgid "E465: :winsize requires two number arguments" msgstr "E465: :winsize vaatii kaksi numeroargumenttia" -#: ../ex_docmd.c:6655 -msgid "E188: Obtaining window position not implemented for this platform" -msgstr "E188: Ikkunan sijainnin selvitys ei toimi tll alustalla" - -#: ../ex_docmd.c:6662 -msgid "E466: :winpos requires two number arguments" -msgstr "E466: :winpos vaatii kaksi lukuargumenttia" - -#: ../ex_docmd.c:7241 -#, c-format -msgid "E739: Cannot create directory: %s" -msgstr "E739: hakemistoa ei voi luoda: %s" - -#: ../ex_docmd.c:7268 #, c-format msgid "E189: \"%s\" exists (add ! to override)" -msgstr "E189: %s on jo olemassa (lis komentoon ! ohittaaksesi)" +msgstr "E189: %s on jo olemassa (lisää komentoon ! ohittaaksesi)" -#: ../ex_docmd.c:7273 #, c-format msgid "E190: Cannot open \"%s\" for writing" msgstr "E190: Tiedostoa %s ei voitu avata kirjoittamista varten" #. set mark -#: ../ex_docmd.c:7294 msgid "E191: Argument must be a letter or forward/backward quote" -msgstr "E191: Argumentin eteen- tai taaksepin lainaukseen pit olla kirjain" +msgstr "E191: Argumentin eteen- tai taaksepäin lainaukseen pitää olla kirjain" -#: ../ex_docmd.c:7333 msgid "E192: Recursive use of :normal too deep" -msgstr "E192: :normalin liian syv rekursio" +msgstr "E192: :normalin liian syvä rekursio" -#: ../ex_docmd.c:7807 msgid "E194: No alternate file name to substitute for '#'" -msgstr "E194: Ei vaihtoehtoista tiedostonime #:lle" +msgstr "E194: Ei vaihtoehtoista tiedostonimeä #:lle" -#: ../ex_docmd.c:7841 msgid "E495: no autocommand file name to substitute for \"\"" msgstr "E495: ei autocommand-tiedostoa kohteelle " -#: ../ex_docmd.c:7850 msgid "E496: no autocommand buffer number to substitute for \"\"" msgstr "E496: ei autocommand-puskurinumeroa kohteelle " -#: ../ex_docmd.c:7861 msgid "E497: no autocommand match name to substitute for \"\"" -msgstr "E497: ei autocommand-tsmysnime kohteella " +msgstr "E497: ei autocommand-täsmäysnimeä kohteella " -#: ../ex_docmd.c:7870 msgid "E498: no :source file name to substitute for \"\"" -msgstr "E498: ei :source-tiedostonime kohteelle " +msgstr "E498: ei :source-tiedostonimeä kohteelle " -#: ../ex_docmd.c:7876 -#, fuzzy msgid "E842: no line number to use for \"\"" -msgstr "E498: ei :source-tiedostonime kohteelle " +msgstr "E842: ei rivinumeroa kohteelle " -#: ../ex_docmd.c:7903 #, fuzzy, c-format -msgid "E499: Empty file name for '%' or '#', only works with \":p:h\"" -msgstr "E499: Tyhj tiedostonimi kohteissa % tai # toimii vain :p:h" +#~ msgid "E499: Empty file name for '%' or '#', only works with \":p:h\"" +#~ msgstr "E499: Tyhjä tiedostonimi kohteissa % tai # toimii vain :p:h" -#: ../ex_docmd.c:7905 msgid "E500: Evaluates to an empty string" -msgstr "E500: Loppuarvo on tyhj merkkijono" +msgstr "E500: Loppuarvo on tyhjä merkkijono" -#: ../ex_docmd.c:8838 -msgid "E195: Cannot open viminfo file for reading" -msgstr "E195: Viminfoa ei voi avata lukemista varten" - -#: ../ex_eval.c:464 msgid "E608: Cannot :throw exceptions with 'Vim' prefix" -msgstr "E608: Vim-alkuisia poikkeuksia ei voi heitt :throw-komennolla" +msgstr "E608: Vim-alkuisia poikkeuksia ei voi heittää :throw-komennolla" #. always scroll up, don't overwrite -#: ../ex_eval.c:496 #, c-format msgid "Exception thrown: %s" msgstr "Poikkeus heitetty: %s" -#: ../ex_eval.c:545 +#. always scroll up, don't overwrite #, c-format msgid "Exception finished: %s" msgstr "Poikkeus lopeteltu: %s" -#: ../ex_eval.c:546 #, c-format msgid "Exception discarded: %s" msgstr "Poikkeus poistettu: %s" -#: ../ex_eval.c:588 ../ex_eval.c:634 -#, c-format -msgid "%s, line %" -msgstr "%s, rivi %" +#, fuzzy, c-format +#~ msgid "%s, line %" +#~ msgstr "%s, rivi %ld" #. always scroll up, don't overwrite -#: ../ex_eval.c:608 #, c-format msgid "Exception caught: %s" msgstr "Poikkeus otettu kiinni: %s" -#: ../ex_eval.c:676 #, c-format msgid "%s made pending" msgstr "%s odotutettu" -#: ../ex_eval.c:679 #, c-format msgid "%s resumed" msgstr "%s palautettu" -#: ../ex_eval.c:683 #, c-format msgid "%s discarded" msgstr "%s poistettu" -#: ../ex_eval.c:708 msgid "Exception" msgstr "Poikkeus" -#: ../ex_eval.c:713 msgid "Error and interrupt" msgstr "Virhe ja keskeytys" -#: ../ex_eval.c:715 msgid "Error" msgstr "Virhe" #. if (pending & CSTP_INTERRUPT) -#: ../ex_eval.c:717 msgid "Interrupt" msgstr "Keskeytys" -#: ../ex_eval.c:795 msgid "E579: :if nesting too deep" msgstr "E579: liian monta kerrosta :if-komennossa" -#: ../ex_eval.c:830 msgid "E580: :endif without :if" msgstr "E580: :endif ilman komentoa :if" -#: ../ex_eval.c:873 msgid "E581: :else without :if" msgstr "E581: :else ilman komentoa :if" -#: ../ex_eval.c:876 msgid "E582: :elseif without :if" msgstr "E582: :elseif ilman komentoa :if" -#: ../ex_eval.c:880 msgid "E583: multiple :else" msgstr "E583: :else monta kertaa" -#: ../ex_eval.c:883 msgid "E584: :elseif after :else" -msgstr "E584: :elseif komennon :else jlkeen" +msgstr "E584: :elseif komennon :else jälkeen" -#: ../ex_eval.c:941 msgid "E585: :while/:for nesting too deep" msgstr "E585: liian monta tasoa :while- tai :for-komennoissa" -#: ../ex_eval.c:1028 msgid "E586: :continue without :while or :for" msgstr "E586: :continue ilman komentoa :while tai :for" -#: ../ex_eval.c:1061 msgid "E587: :break without :while or :for" msgstr "E587: :break ilman komentoa :while tai :for" -#: ../ex_eval.c:1102 msgid "E732: Using :endfor with :while" msgstr "E732: :endfor ilman komentoa :while" -#: ../ex_eval.c:1104 msgid "E733: Using :endwhile with :for" msgstr "E733: :endwhile ilman komentoa :for" -#: ../ex_eval.c:1247 msgid "E601: :try nesting too deep" msgstr "E601: liian monta tasoa :try-komennossa" -#: ../ex_eval.c:1317 msgid "E603: :catch without :try" msgstr "E603: :catch ilman komentoa :try" #. Give up for a ":catch" after ":finally" and ignore it. #. * Just parse. -#: ../ex_eval.c:1332 msgid "E604: :catch after :finally" msgstr "E604: :catch ilman komentoa :finally" -#: ../ex_eval.c:1451 msgid "E606: :finally without :try" msgstr "E606: :finally ilman komentoa :try" #. Give up for a multiple ":finally" and ignore it. -#: ../ex_eval.c:1467 msgid "E607: multiple :finally" msgstr "E607: :finally monta kertaa" -#: ../ex_eval.c:1571 msgid "E602: :endtry without :try" msgstr "E602: :endtry ilman komentoa :try" -#: ../ex_eval.c:2026 msgid "E193: :endfunction not inside a function" msgstr "E193: :endfunction funktion ulkopuolella" -#: ../ex_getln.c:1643 msgid "E788: Not allowed to edit another buffer now" msgstr "E788: Puskuria ei voi muokata nyt" -#: ../ex_getln.c:1656 msgid "E811: Not allowed to change buffer information now" msgstr "E811: Puskuria ei voi vaihtaa nyt" -#: ../ex_getln.c:3178 msgid "tagname" -msgstr "tginimi" +msgstr "täginimi" -#: ../ex_getln.c:3181 msgid " kind file\n" msgstr " -tiedostotyyppi\n" -#: ../ex_getln.c:4799 msgid "'history' option is zero" msgstr "history-asetus on nolla" -#: ../ex_getln.c:5046 -#, c-format -msgid "" -"\n" -"# %s History (newest to oldest):\n" -msgstr "" -"\n" -"# %s Historia (uusimmasta alkaen):\n" - -#: ../ex_getln.c:5047 -msgid "Command Line" -msgstr "Komentorivi" - -#: ../ex_getln.c:5048 -msgid "Search String" -msgstr "Hakujono" - -#: ../ex_getln.c:5049 -msgid "Expression" -msgstr "Ilmaus" - -#: ../ex_getln.c:5050 -msgid "Input Line" -msgstr "Syterivi" - -#: ../ex_getln.c:5117 msgid "E198: cmd_pchar beyond the command length" msgstr "E198: cmd_pchar komennon pituuden ulkopuolella" -#: ../ex_getln.c:5279 msgid "E199: Active window or buffer deleted" msgstr "E199: Aktiivinen ikkuna tai puskuri poistettu" -#: ../file_search.c:203 msgid "E854: path too long for completion" -msgstr "" +msgstr "E854: polku on liian pitkä täydennykseen" -#: ../file_search.c:446 #, c-format msgid "" "E343: Invalid path: '**[number]' must be at the end of the path or be " @@ -2011,376 +2098,296 @@ msgstr "" "E343: Virheellinen polku: '**[numero]' kuuluu polun loppuun tai ennen kohtaa " "%s." -#: ../file_search.c:1505 #, c-format msgid "E344: Can't find directory \"%s\" in cdpath" -msgstr "E344: Hakemistoa %s ei lydy cdpathista" +msgstr "E344: Hakemistoa %s ei löydy cdpathista" -#: ../file_search.c:1508 #, c-format msgid "E345: Can't find file \"%s\" in path" -msgstr "E345: Tiedostoa %s ei lydy polulta" +msgstr "E345: Tiedostoa %s ei löydy polulta" -#: ../file_search.c:1512 #, c-format msgid "E346: No more directory \"%s\" found in cdpath" -msgstr "E346: Hakemisto %s ei ole en cdpathissa" +msgstr "E346: Hakemisto %s ei ole enää cdpathissa" -#: ../file_search.c:1515 #, c-format msgid "E347: No more file \"%s\" found in path" -msgstr "E347: Tiedosto %s ei ole en polulla" +msgstr "E347: Tiedosto %s ei ole enää polulla" -#: ../fileio.c:137 msgid "E812: Autocommands changed buffer or buffer name" msgstr "E812: Autocommands muutti puskurin tai sen nimen" -#: ../fileio.c:368 msgid "Illegal file name" msgstr "Virheellinen tiedostonimi" -#: ../fileio.c:395 ../fileio.c:476 ../fileio.c:2543 ../fileio.c:2578 msgid "is a directory" msgstr "on hakemisto" -#: ../fileio.c:397 msgid "is not a file" msgstr "ei ole tiedosto" -#: ../fileio.c:508 ../fileio.c:3522 msgid "[New File]" msgstr "[Uusi tiedosto]" -#: ../fileio.c:511 msgid "[New DIRECTORY]" msgstr "[uusi HAKEMISTO]" -#: ../fileio.c:529 ../fileio.c:532 +#. libuv only returns -errno in Unix and in Windows open() does not +#. set EOVERFLOW msgid "[File too big]" msgstr "[Liian iso tiedosto]" -#: ../fileio.c:534 msgid "[Permission Denied]" msgstr "[Lupa kielletty]" -#: ../fileio.c:653 msgid "E200: *ReadPre autocommands made the file unreadable" msgstr "" -"E200: *ReadPre-autocommand-komennot tekivt tiedostosta lukukelvottoman" +"E200: *ReadPre-autocommand-komennot tekivät tiedostosta lukukelvottoman" -#: ../fileio.c:655 msgid "E201: *ReadPre autocommands must not change current buffer" -msgstr "E201: *ReadPre-autocommand-komennot eivt saa muuttaa puskuria" - -#: ../fileio.c:672 -msgid "Nvim: Reading from stdin...\n" -msgstr "Vim: Luetaan vakiosytteest...\n" +msgstr "E201: *ReadPre-autocommand-komennot eivät saa muuttaa puskuria" #. Re-opening the original file failed! -#: ../fileio.c:909 msgid "E202: Conversion made file unreadable!" msgstr "E202: Muunnos teki tiedostosta lukukelvottoman." #. fifo or socket -#: ../fileio.c:1782 msgid "[fifo/socket]" msgstr "[fifo t. soketti]" #. fifo -#: ../fileio.c:1788 msgid "[fifo]" msgstr "[fifo]" #. or socket -#: ../fileio.c:1794 msgid "[socket]" msgstr "[soketti]" #. or character special -#: ../fileio.c:1801 msgid "[character special]" msgstr "[merkki erikoinen]" -# Carriage Return elikk rivinvaihtomerkin ers muoto/osa (vrt. LF) -#: ../fileio.c:1815 +# Carriage Return elikkä rivinvaihtomerkin eräs muoto/osa (vrt. LF) msgid "[CR missing]" msgstr "[CR puuttuu]" -#: ../fileio.c:1819 msgid "[long lines split]" -msgstr "[pitkt rivit hajotettu]" +msgstr "[pitkät rivit hajotettu]" -#: ../fileio.c:1823 ../fileio.c:3512 msgid "[NOT converted]" msgstr "[EI muunnettu]" -#: ../fileio.c:1826 ../fileio.c:3515 msgid "[converted]" msgstr "[muunnettu]" -#: ../fileio.c:1831 -#, c-format -msgid "[CONVERSION ERROR in line %]" -msgstr "[MUUNNOSVIRHE rivill %]" +#, fuzzy, c-format +#~ msgid "[CONVERSION ERROR in line %]" +#~ msgstr "[MUUNNOSVIRHE rivillä %ld]" -#: ../fileio.c:1835 -#, c-format -msgid "[ILLEGAL BYTE in line %]" -msgstr "[VIRHEELLINEN OKTETTI rivill %]" +#, fuzzy, c-format +#~ msgid "[ILLEGAL BYTE in line %]" +#~ msgstr "[VIRHEELLINEN OKTETTI rivillä %ld]" -#: ../fileio.c:1838 msgid "[READ ERRORS]" -msgstr "[LUKUVIRHEIT]" +msgstr "[LUKUVIRHEITÄ]" -#: ../fileio.c:2104 msgid "Can't find temp file for conversion" -msgstr "Ei voi lyt vliaikaistiedstoa muuntamiseksi" +msgstr "Ei voi löytää väliaikaistiedstoa muuntamiseksi" -#: ../fileio.c:2110 msgid "Conversion with 'charconvert' failed" -msgstr "Muunnos charconvert eponnistui" +msgstr "Muunnos charconvert epäonnistui" -#: ../fileio.c:2113 msgid "can't read output of 'charconvert'" msgstr "charconvertin tulostetta ei voida lukea" -#: ../fileio.c:2437 msgid "E676: No matching autocommands for acwrite buffer" msgstr "E676: Ei autocommand-komentoa acwrite-puskurille" -#: ../fileio.c:2466 msgid "E203: Autocommands deleted or unloaded buffer to be written" msgstr "" "E203: Autocommand-komennot poistivat tai vapauttivat puskurin, johon piti " "kirjoittaa" -#: ../fileio.c:2486 msgid "E204: Autocommand changed number of lines in unexpected way" -msgstr "E204: Autocommand-komento muutti rivien mr odottamatta" +msgstr "E204: Autocommand-komento muutti rivien määrä odottamatta" -#: ../fileio.c:2548 ../fileio.c:2565 msgid "is not a file or writable device" msgstr "ei ole tiedosto tai kirjoitettava laite" -#: ../fileio.c:2601 msgid "is read-only (add ! to override)" -msgstr "on kirjoitussuojattu (lis komentoon ! ohittaaksesi)" +msgstr "on kirjoitussuojattu (lisää komentoon ! ohittaaksesi)" -#: ../fileio.c:2886 msgid "E506: Can't write to backup file (add ! to override)" msgstr "" -"E506: Ei voi kirjoittaa varmuuskopiotiedostoon (lis komentoon ! " +"E506: Ei voi kirjoittaa varmuuskopiotiedostoon (lisää komentoon ! " "ohittaaksesi)" -#: ../fileio.c:2898 -msgid "E507: Close error for backup file (add ! to override)" -msgstr "" -"E507: Varmuuskopiotiedoston sulkeminen ei onnistu (lis komentoon ! " -"ohittaaksesi)" +#, fuzzy, c-format +#~ msgid "E507: Close error for backup file (add ! to override): %s" +#~ msgstr "" +#~ "E507: Varmuuskopiotiedoston sulkeminen ei onnistu (lisää komentoon ! " +#~ "ohittaaksesi)" -#: ../fileio.c:2901 msgid "E508: Can't read file for backup (add ! to override)" msgstr "" -"E508: Varmuuskopiotiedostoa ei voi lukea (lis komentoon ! ohittaaksesi)" +"E508: Varmuuskopiotiedostoa ei voi lukea (lisää komentoon ! ohittaaksesi)" -#: ../fileio.c:2923 msgid "E509: Cannot create backup file (add ! to override)" msgstr "" -"E509: Ei voi luoda varmuuskopiotiedostoa (lis komentoon ! ohittaaksesi)" +"E509: Ei voi luoda varmuuskopiotiedostoa (lisää komentoon ! ohittaaksesi)" -#: ../fileio.c:3008 msgid "E510: Can't make backup file (add ! to override)" msgstr "" -"E510: Ei voi tehd varmuuskopiotiedostoa (lis komentoon ! ohittaaksesi)" +"E510: Ei voi tehdä varmuuskopiotiedostoa (lisää komentoon ! ohittaaksesi)" #. Can't write without a tempfile! -#: ../fileio.c:3121 msgid "E214: Can't find temp file for writing" -msgstr "E214: Ei voi lyt vliaikaistiedostoa kirjoitettavaksi" +msgstr "E214: Ei voi löytää väliaikaistiedostoa kirjoitettavaksi" -#: ../fileio.c:3134 msgid "E213: Cannot convert (add ! to write without conversion)" msgstr "" -"E213: Muunnos ei onnistu (lis komentoon ! kirjoittaaksesi muuntamatta)" +"E213: Muunnos ei onnistu (lisää komentoon ! kirjoittaaksesi muuntamatta)" -#: ../fileio.c:3169 msgid "E166: Can't open linked file for writing" msgstr "E166: Linkitetyn tiedoston avaus kirjoittamista varten ei onnistu" -#: ../fileio.c:3173 -msgid "E212: Can't open file for writing" -msgstr "E212: Tiedoston avaus kirjoittamista varten ei onnistu" +#, fuzzy, c-format +#~ msgid "E212: Can't open file for writing: %s" +#~ msgstr "E212: Tiedoston avaus kirjoittamista varten ei onnistu" -#: ../fileio.c:3363 -msgid "E667: Fsync failed" -msgstr "E667: Fsync ei onnistunut" +#, fuzzy, c-format +#~ msgid "E667: Fsync failed: %s" +#~ msgstr "E667: Fsync ei onnistunut" -#: ../fileio.c:3398 -msgid "E512: Close failed" -msgstr "E512: Sulkeminen ei onnistunut" +#, fuzzy, c-format +#~ msgid "E512: Close failed: %s" +#~ msgstr "E512: Sulkeminen ei onnistunut" -#: ../fileio.c:3436 msgid "E513: write error, conversion failed (make 'fenc' empty to override)" -msgstr "E513: kirjoitusvirhe, muunnos eponnistui (tyhj fenc ohittaaksesi)" +msgstr "E513: kirjoitusvirhe, muunnos epäonnistui (tyhjää fenc ohittaaksesi)" -#: ../fileio.c:3441 -#, c-format -msgid "" -"E513: write error, conversion failed in line % (make 'fenc' empty to " -"override)" -msgstr "" -"E513: kirjoitusvirhe, muunnos eponnistui rivill %(tyhj fenc " -"ohittaaksesi)" +#, fuzzy +#~ msgid "E513: write error, conversion failed in line %" +#~ msgstr "" +#~ "E513: kirjoitusvirhe, muunnos epäonnistui rivillä %ld(tyhjää fenc " +#~ "ohittaaksesi)" -#: ../fileio.c:3448 msgid "E514: write error (file system full?)" -msgstr "E514: kirjoitusvirhe (tiedostojrjestelm tysi)" +msgstr "E514: kirjoitusvirhe (tiedostojärjestelmä täysi)" -#: ../fileio.c:3506 msgid " CONVERSION ERROR" msgstr " MUUNNOSVIRHE" -#: ../fileio.c:3509 -#, c-format -msgid " in line %;" -msgstr " rivill %" +#, fuzzy, c-format +#~ msgid " in line %;" +#~ msgstr " rivillä %ld" -#: ../fileio.c:3519 msgid "[Device]" msgstr "[Laite]" -#: ../fileio.c:3522 msgid "[New]" msgstr "[Uusi]" -#: ../fileio.c:3535 msgid " [a]" msgstr " [a]" -#: ../fileio.c:3535 msgid " appended" -msgstr " listty" +msgstr " lisätty" -#: ../fileio.c:3537 msgid " [w]" msgstr " [w]" -#: ../fileio.c:3537 msgid " written" msgstr " kirjoitettu" -#: ../fileio.c:3579 msgid "E205: Patchmode: can't save original file" -msgstr "E205: Patch-tilassa ei voi tallentaa alkuperistiedostoa" +msgstr "E205: Patch-tilassa ei voi tallentaa alkuperäistiedostoa" -#: ../fileio.c:3602 msgid "E206: patchmode: can't touch empty original file" -msgstr "E206: patch-tilassa ei voi muuttaa tyhj alkuperistiedostoa" +msgstr "E206: patch-tilassa ei voi muuttaa tyhjää alkuperäistiedostoa" -#: ../fileio.c:3616 msgid "E207: Can't delete backup file" msgstr "E207: Ei voi poistaa varmuuskopiota" -#: ../fileio.c:3672 +#. Set highlight for error messages. msgid "" "\n" "WARNING: Original file may be lost or damaged\n" msgstr "" "\n" -"VAROITUS: Alkuperistiedosto voi hvit tai vahingoittua\n" +"VAROITUS: Alkuperäistiedosto voi hävitä tai vahingoittua\n" -#: ../fileio.c:3675 msgid "don't quit the editor until the file is successfully written!" -msgstr "l lopeta editoria kesken tallentamisen." +msgstr "älä lopeta editoria kesken tallentamisen." -#: ../fileio.c:3795 -msgid "[dos]" -msgstr "[dos]" - -#: ../fileio.c:3795 msgid "[dos format]" msgstr "[dos-muoto]" -#: ../fileio.c:3801 -msgid "[mac]" -msgstr "[mac]" +msgid "[dos]" +msgstr "[dos]" -#: ../fileio.c:3801 msgid "[mac format]" msgstr "[mac-muoto]" -#: ../fileio.c:3807 -msgid "[unix]" -msgstr "[unix]" +msgid "[mac]" +msgstr "[mac]" -#: ../fileio.c:3807 msgid "[unix format]" msgstr "[unix-muoto]" -#: ../fileio.c:3831 +msgid "[unix]" +msgstr "[unix]" + msgid "1 line, " msgstr "1 rivi, " -#: ../fileio.c:3833 -#, c-format -msgid "% lines, " -msgstr "% rivi, " +#, fuzzy, c-format +#~ msgid "% lines, " +#~ msgstr "%ld riviä, " -#: ../fileio.c:3836 msgid "1 character" msgstr "1 merkki" -#: ../fileio.c:3838 -#, c-format -msgid "% characters" -msgstr "% merkki" +#, fuzzy, c-format +#~ msgid "% characters" +#~ msgstr "%lld merkkiä" -# ei rivinvaihtoja -#: ../fileio.c:3849 -msgid "[noeol]" -msgstr "[eiriviv.]" - -#: ../fileio.c:3849 msgid "[Incomplete last line]" msgstr "[Vajaa viimeinen rivi]" -# Jos aukiolevaa tiedostoa srkkii toisella ohjelmalla -#. don't overwrite messages here -#. must give this prompt -#. don't use emsg() here, don't want to flush the buffers -#: ../fileio.c:3865 -msgid "WARNING: The file has been changed since reading it!!!" -msgstr "VAROITUS: tiedosto on muuttunut viime lukukerran jlkeen!" +# ei rivinvaihtoja +msgid "[noeol]" +msgstr "[eiriviv.]" + +# Jos aukiolevaa tiedostoa sörkkii toisella ohjelmalla +#. Don't overwrite messages here. +#. Must give this prompt. +#. Don't use emsg() here, don't want to flush the buffers. +msgid "WARNING: The file has been changed since reading it!!!" +msgstr "VAROITUS: tiedosto on muuttunut viime lukukerran jälkeen!" -#: ../fileio.c:3867 msgid "Do you really want to write to it" msgstr "Kirjoitetaanko" -#: ../fileio.c:4648 #, c-format msgid "E208: Error writing to \"%s\"" msgstr "E208: Virhe kirjoitettaessa tiedostoon %s" -#: ../fileio.c:4655 #, c-format msgid "E209: Error closing \"%s\"" msgstr "E209: Virhe suljettaessa tiedostoa %s" -#: ../fileio.c:4657 #, c-format msgid "E210: Error reading \"%s\"" msgstr "E210: Virhe luettaessa tiedostoa %s" -#: ../fileio.c:4883 msgid "E246: FileChangedShell autocommand deleted buffer" msgstr "E246: FileChangedShell-autocommand poisti puskurin" -#: ../fileio.c:4894 #, c-format msgid "E211: File \"%s\" no longer available" -msgstr "E211: Tiedostoa %s ei ole en" +msgstr "E211: Tiedostoa %s ei ole enää" -#: ../fileio.c:4906 #, c-format msgid "" "W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as " @@ -2389,41 +2396,33 @@ msgstr "" "W12: Varoitus: Tiedostoa %s on muutettu ja Vimin puskurissa on muutoksia " "tiedostoon" -#: ../fileio.c:4907 msgid "See \":help W12\" for more info." -msgstr ":help W12 kertoo listietoja." +msgstr ":help W12 kertoo lisätietoja." -#: ../fileio.c:4910 #, c-format msgid "W11: Warning: File \"%s\" has changed since editing started" -msgstr "W11: Varoitus: Tiedostoa %s on muutettu muokkauksen aloituksen jlkeen" +msgstr "W11: Varoitus: Tiedostoa %s on muutettu muokkauksen aloituksen jälkeen" -#: ../fileio.c:4911 msgid "See \":help W11\" for more info." -msgstr ":help W11 kertoo listietoja." +msgstr ":help W11 kertoo lisätietoja." -#: ../fileio.c:4914 #, c-format msgid "W16: Warning: Mode of file \"%s\" has changed since editing started" msgstr "" "W16: Varoitus: Tiedoston %s oikeuksia on muutettu muokkauksen aloituksen " -"jlkeen" +"jälkeen" -#: ../fileio.c:4915 msgid "See \":help W16\" for more info." -msgstr ":help W16 kertoo listietoja." +msgstr ":help W16 kertoo lisätietoja." -#: ../fileio.c:4927 #, c-format msgid "W13: Warning: File \"%s\" has been created after editing started" -msgstr "W13: Varoitus: Tiedosto %s on luotu muokkauksen aloituksen jlkeen" +msgstr "W13: Varoitus: Tiedosto %s on luotu muokkauksen aloituksen jälkeen" -#: ../fileio.c:4947 msgid "Warning" msgstr "Varoitus" -# yll olevien varoitusten ratkaisut -#: ../fileio.c:4948 +# yllä olevien varoitusten ratkaisut msgid "" "&OK\n" "&Load File" @@ -2431,48 +2430,46 @@ msgstr "" "&OK\n" "&Avaa tiedosto uudelleen" -#: ../fileio.c:5065 #, c-format msgid "E462: Could not prepare for reloading \"%s\"" msgstr "E462: Ei voitu valmistella uudelleen avausta %s" -#: ../fileio.c:5078 #, c-format msgid "E321: Could not reload \"%s\"" msgstr "E321: Ei voitu uudelleenavata %s" -#: ../fileio.c:5601 msgid "--Deleted--" msgstr "--Poistettu--" -#: ../fileio.c:5732 #, c-format msgid "auto-removing autocommand: %s " msgstr "poistetaan autocommand automaattisesti: %s " #. the group doesn't exist -#: ../fileio.c:5772 #, c-format msgid "E367: No such group: \"%s\"" -msgstr "E367: Ryhm ei ole: %s" +msgstr "E367: Ryhmää ei ole: %s" + +#, fuzzy +#~ msgid "E936: Cannot delete the current group" +#~ msgstr "E351: Taitosta ei voi poistaa tällä foldmethodilla" + +msgid "W19: Deleting augroup that is still in use" +msgstr "W19: käytössä oleva augroup poistetaan" -#: ../fileio.c:5897 #, c-format msgid "E215: Illegal character after *: %s" -msgstr "E215: Virheellinen merkki *:n jlkeen: %s" +msgstr "E215: Virheellinen merkki *:n jälkeen: %s" -#: ../fileio.c:5905 #, c-format msgid "E216: No such event: %s" -msgstr "E216: Eventti ei ole: %s" +msgstr "E216: Eventtiä ei ole: %s" -#: ../fileio.c:5907 #, c-format msgid "E216: No such group or event: %s" -msgstr "E216: Ryhm tai eventti ei ole: %s" +msgstr "E216: Ryhmää tai eventtiä ei ole: %s" #. Highlight title -#: ../fileio.c:6090 msgid "" "\n" "--- Auto-Commands ---" @@ -2480,762 +2477,611 @@ msgstr "" "\n" "--- Autocommandit ---" -#: ../fileio.c:6293 #, c-format msgid "E680: : invalid buffer number " msgstr "E680: : virheellinen puskurinumero" -#: ../fileio.c:6370 msgid "E217: Can't execute autocommands for ALL events" msgstr "E217: Ei voi suorittaa autocommandsia kaikille eventeille" -#: ../fileio.c:6393 msgid "No matching autocommands" -msgstr "Ei tsmvi autocommandsia" +msgstr "Ei täsmääviä autocommandsia" -#: ../fileio.c:6831 msgid "E218: autocommand nesting too deep" msgstr "E218: liian monta tasoa autocommandissa" -#: ../fileio.c:7143 #, c-format msgid "%s Auto commands for \"%s\"" msgstr "%s Autocommands kohteelle %s" -#: ../fileio.c:7149 #, c-format msgid "Executing %s" msgstr "Suoritetaan %s" -#: ../fileio.c:7211 #, c-format msgid "autocommand %s" msgstr "autocommand %s" -#: ../fileio.c:7795 msgid "E219: Missing {." msgstr "E219: { puuttuu." -#: ../fileio.c:7797 msgid "E220: Missing }." msgstr "E220: } puuttuu." -#: ../fold.c:93 msgid "E490: No fold found" msgstr "E490: taitos puuttuu" -#: ../fold.c:544 msgid "E350: Cannot create fold with current 'foldmethod'" -msgstr "E350: Taitoksia ei voi tehd tll foldmethodilla" +msgstr "E350: Taitoksia ei voi tehdä tällä foldmethodilla" -#: ../fold.c:546 msgid "E351: Cannot delete fold with current 'foldmethod'" -msgstr "E351: Taitosta ei voi poistaa tll foldmethodilla" +msgstr "E351: Taitosta ei voi poistaa tällä foldmethodilla" -#: ../fold.c:1784 -#, c-format -msgid "+--%3ld lines folded " -msgstr "+--%3ld rivi taitettu pois " +#, fuzzy, c-format +#~ msgid "+--%3ld lines folded " +#~ msgstr "+--%3ld rivi taitettu pois " #. buffer has already been read -#: ../getchar.c:273 msgid "E222: Add to read buffer" -msgstr "E222: Lis lukupuskuriin" +msgstr "E222: Lisää lukupuskuriin" -#: ../getchar.c:2040 msgid "E223: recursive mapping" msgstr "E223: rekursiivinen kuvaus" -#: ../getchar.c:2849 #, c-format msgid "E224: global abbreviation already exists for %s" -msgstr "E224: globaali lyhenne merkinnlle %s on jo olemassa" +msgstr "E224: globaali lyhenne merkinnälle %s on jo olemassa" -#: ../getchar.c:2852 #, c-format msgid "E225: global mapping already exists for %s" -msgstr "E225: globaali kuvaus merkinnlle %s on jo olemassa" +msgstr "E225: globaali kuvaus merkinnälle %s on jo olemassa" -#: ../getchar.c:2952 #, c-format msgid "E226: abbreviation already exists for %s" msgstr "E226: lyhenne on jo olemassa %s" -#: ../getchar.c:2955 #, c-format msgid "E227: mapping already exists for %s" msgstr "E227: kuvaus on jo olemassa %s" -#: ../getchar.c:3008 msgid "No abbreviation found" -msgstr "Lyhennett ei lydy" +msgstr "Lyhennettä ei löydy" -#: ../getchar.c:3010 msgid "No mapping found" -msgstr "Kuvausta ei lydy" +msgstr "Kuvausta ei löydy" -#: ../getchar.c:3974 msgid "E228: makemap: Illegal mode" msgstr "E228: makemap: Virheellinen tila" #. key value of 'cedit' option #. type of cmdline window or 0 #. result of cmdline window or 0 -#: ../globals.h:924 msgid "--No lines in buffer--" -msgstr "--Ei rivej puskurissa--" +msgstr "--Ei rivejä puskurissa--" #. #. * The error messages that can be shared are included here. #. * Excluded are errors that are only used once and debugging messages. #. -#: ../globals.h:996 msgid "E470: Command aborted" msgstr "E470: Komento peruttu" -#: ../globals.h:997 +#, fuzzy +#~ msgid "E905: Cannot set this option after startup" +#~ msgstr "E529: Termiä ei voi asettaa tyhjäksi merkkijonoksi" + +#, fuzzy +#~ msgid "E903: Could not spawn API job" +#~ msgstr "E623: Cscope-prosessin luonti epäonnistui" + msgid "E471: Argument required" msgstr "E471: Argumentti puuttuu" -#: ../globals.h:998 msgid "E10: \\ should be followed by /, ? or &" -msgstr "E10: \\:n jlkeen pit tulla /, ? tai &" +msgstr "E10: \\:n jälkeen pitää tulla /, ? tai &" -#: ../globals.h:1000 msgid "E11: Invalid in command-line window; executes, CTRL-C quits" msgstr "E11: Virheellinen komentorivi-ikkuna, suorittaa, Ctrl C lopettaa" -#: ../globals.h:1002 msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search" msgstr "" -"E12: Komentoa ei tueta exrc:ss tai vimrc:ss tss hakemistossa tai " -"tgihaussa" +"E12: Komentoa ei tueta exrc:ssä tai vimrc:ssä tässä hakemistossa tai " +"tägihaussa" -#: ../globals.h:1003 msgid "E171: Missing :endif" msgstr "E171: :endif puuttuu" -#: ../globals.h:1004 msgid "E600: Missing :endtry" msgstr "E600: :endtry puuttuu" -#: ../globals.h:1005 msgid "E170: Missing :endwhile" msgstr "E170: :endwhile puuttuu" -#: ../globals.h:1006 msgid "E170: Missing :endfor" msgstr "E170: :endfor puuttuu" -#: ../globals.h:1007 msgid "E588: :endwhile without :while" msgstr "E588: :endwhile ilman komentoa :while" -#: ../globals.h:1008 msgid "E588: :endfor without :for" msgstr "E588: :endfor ilman komentoa :for" -#: ../globals.h:1009 msgid "E13: File exists (add ! to override)" -msgstr "E13: Tiedosto on jo olemassa (lis ! ohittaaksesi)" +msgstr "E13: Tiedosto on jo olemassa (lisää ! ohittaaksesi)" -#: ../globals.h:1010 msgid "E472: Command failed" -msgstr "E472: Komento eponnistui" +msgstr "E472: Komento epäonnistui" -#: ../globals.h:1011 msgid "E473: Internal error" -msgstr "E473: Sisinen virhe" +msgstr "E473: Sisäinen virhe" -#: ../globals.h:1012 msgid "Interrupted" msgstr "Keskeytetty" -#: ../globals.h:1013 msgid "E14: Invalid address" msgstr "E14: Virheellinen osoite" -#: ../globals.h:1014 msgid "E474: Invalid argument" msgstr "E474: Virheellinen argumentti" -#: ../globals.h:1015 #, c-format msgid "E475: Invalid argument: %s" msgstr "E475: Virheellinen argumentti: %s" -#: ../globals.h:1016 #, c-format msgid "E15: Invalid expression: %s" msgstr "E15: Virheellinen ilmaus: %s" -#: ../globals.h:1017 msgid "E16: Invalid range" msgstr "E16: Virheellinen arvoalue" -#: ../globals.h:1018 msgid "E476: Invalid command" msgstr "E476: Virheellinen komento" -#: ../globals.h:1019 #, c-format msgid "E17: \"%s\" is a directory" msgstr "E17: %s on hakemisto" -#: ../globals.h:1020 #, fuzzy -msgid "E900: Invalid job id" -msgstr "E49: Virheellinen vierityskoko" +#~ msgid "E900: Invalid job id" +#~ msgstr "E916: ei ole job" -#: ../globals.h:1021 -msgid "E901: Job table is full" -msgstr "" +#~ msgid "E901: Job table is full" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "E903: Process failed to start: %s: \"%s\"" +#~ msgstr "E852: Lapsiprosesi ei voinut käynnistää käyttöliittymää" + +#, fuzzy +#~ msgid "E904: Job is not connected to a pty" +#~ msgstr "E902: Ei voi yhdistää porttiin" -#: ../globals.h:1024 #, c-format msgid "E364: Library call failed for \"%s()\"" -msgstr "E364: Kirjastukutsu %s() eponnistui" +msgstr "E364: Kirjastukutsu %s() epäonnistui" + +#, fuzzy, c-format +#~ msgid "E739: Cannot create directory %s: %s" +#~ msgstr "E739: hakemistoa ei voi luoda: %s" -#: ../globals.h:1026 msgid "E19: Mark has invalid line number" -msgstr "E19: Merkill on virheellinen rivinumero" +msgstr "E19: Merkillä on virheellinen rivinumero" -#: ../globals.h:1027 msgid "E20: Mark not set" -msgstr "E20: Merkki ei asetettu" +msgstr "E20: Merkkiä ei asetettu" -#: ../globals.h:1029 msgid "E21: Cannot make changes, 'modifiable' is off" -msgstr "E21: Ei voi tehd muutoksia, modifiable on pois plt" +msgstr "E21: Ei voi tehdä muutoksia, modifiable on pois päältä" -#: ../globals.h:1030 msgid "E22: Scripts nested too deep" -msgstr "E22: Liian monta tasoa skripteiss" +msgstr "E22: Liian monta tasoa skripteissä" -#: ../globals.h:1031 msgid "E23: No alternate file" msgstr "E23: Eo vaihtoehtoista tiedostoa" -#: ../globals.h:1032 msgid "E24: No such abbreviation" -msgstr "E24: Lyhennett ei ole" +msgstr "E24: Lyhennettä ei ole" -#: ../globals.h:1033 msgid "E477: No ! allowed" msgstr "E477: ! ei sallittu" -#: ../globals.h:1035 -msgid "E25: Nvim does not have a built-in GUI" -msgstr "E25: GUIta ei voi kytt, koska sit ei knnetty mukaan" +#~ msgid "E25: Nvim does not have a built-in GUI" +#~ msgstr "" -#: ../globals.h:1036 #, c-format msgid "E28: No such highlight group name: %s" -msgstr "E28: Korostusryhm ei ole nimell: %s" +msgstr "E28: Korostusryhmää ei ole nimellä: %s" -#: ../globals.h:1037 msgid "E29: No inserted text yet" -msgstr "E29: Teksti ei ole sytetty viel" +msgstr "E29: Tekstiä ei ole syötetty vielä" -#: ../globals.h:1038 msgid "E30: No previous command line" -msgstr "E30: Ei edellist komentorivi" +msgstr "E30: Ei edellistä komentoriviä" -#: ../globals.h:1039 msgid "E31: No such mapping" msgstr "E31: Kuvausta ei ole" -#: ../globals.h:1040 msgid "E479: No match" -msgstr "E479: Ei tsm" +msgstr "E479: Ei täsmää" -#: ../globals.h:1041 #, c-format msgid "E480: No match: %s" -msgstr "E480: Ei tsm: %s" +msgstr "E480: Ei tsämää: %s" -#: ../globals.h:1042 msgid "E32: No file name" -msgstr "E32: Ei tiedostonime" +msgstr "E32: Ei tiedostonimeä" -#: ../globals.h:1044 msgid "E33: No previous substitute regular expression" -msgstr "E33: Ei edellist korvausta snnlliselle ilmaukselle" +msgstr "E33: Ei edellistä korvausta säännölliselle ilmaukselle" -#: ../globals.h:1045 msgid "E34: No previous command" -msgstr "E34: Ei edellist komentoa" +msgstr "E34: Ei edellistä komentoa" -#: ../globals.h:1046 msgid "E35: No previous regular expression" -msgstr "E35: Ei edellist snnllist ilmausta" +msgstr "E35: Ei edellistä säännöllistä ilmausta" -#: ../globals.h:1047 msgid "E481: No range allowed" msgstr "E481: Arvoalue ei sallittu" -#: ../globals.h:1048 msgid "E36: Not enough room" -msgstr "E36: Tila ei riit" +msgstr "E36: Tila ei riitä" -#: ../globals.h:1049 -#, c-format -msgid "E482: Can't create file %s" -msgstr "E482: Tiedostoa %s ei voi luoda" - -#: ../globals.h:1050 msgid "E483: Can't get temp file name" -msgstr "E483: vliaikaistiedoston nime ei saada selville" +msgstr "E483: väliaikaistiedoston nimeä ei saada selville" -#: ../globals.h:1051 #, c-format msgid "E484: Can't open file %s" msgstr "E484: Ei voi avata tiedostoa %s" -#: ../globals.h:1052 #, c-format msgid "E485: Can't read file %s" msgstr "E485: Ei voi lukea tiedostoa %s" -#: ../globals.h:1054 msgid "E37: No write since last change (add ! to override)" msgstr "" -"E37: Viimeisen muutoksen jlkeen ei ole kirjoitettu (lis ! ohittaaksesi)" +"E37: Viimeisen muutoksen jälkeen ei ole kirjoitettu (lisää ! ohittaaksesi)" -#: ../globals.h:1055 -#, fuzzy msgid "E37: No write since last change" -msgstr "[Viimeisint muutosta ei ole kirjoitettu]\n" +msgstr "E37: Viimeisimmän muutoksen jälkeen ei ole kirjoitettu mitään" -#: ../globals.h:1056 msgid "E38: Null argument" msgstr "E38: Null-argumentti" -#: ../globals.h:1057 msgid "E39: Number expected" -msgstr "E39: Pit olla numero" +msgstr "E39: Pitää olla numero" -#: ../globals.h:1058 #, c-format msgid "E40: Can't open errorfile %s" msgstr "E40: virhetiedostoa %s ei voi avata" -#: ../globals.h:1059 msgid "E41: Out of memory!" msgstr "E41: Muisti loppui" -#: ../globals.h:1060 msgid "Pattern not found" -msgstr "Kuviota ei lydy" +msgstr "Kuviota ei löydy" -#: ../globals.h:1061 #, c-format msgid "E486: Pattern not found: %s" -msgstr "E486: Kuviota ei lydy: %s" +msgstr "E486: Kuviota ei löydy: %s" -#: ../globals.h:1062 msgid "E487: Argument must be positive" -msgstr "E487: Argumentin pit olla positiivinen" +msgstr "E487: Argumentin pitää olla positiivinen" -#: ../globals.h:1064 msgid "E459: Cannot go back to previous directory" -msgstr "E459: Ei voi siirty edelliseen hakemistoon" +msgstr "E459: Ei voi siirtyä edelliseen hakemistoon" # ;-) -#: ../globals.h:1066 msgid "E42: No Errors" -msgstr "E42: Ei virheit" +msgstr "E42: Ei virheitä" -#: ../globals.h:1067 msgid "E776: No location list" msgstr "E776: Ei sijaintilistaa" -#: ../globals.h:1068 msgid "E43: Damaged match string" -msgstr "E43: Viallinen tsmysmerkkijono" +msgstr "E43: Viallinen täsmäysmerkkijono" -#: ../globals.h:1069 msgid "E44: Corrupted regexp program" msgstr "E44: Viallinen regexp-ohjelma" -#: ../globals.h:1071 msgid "E45: 'readonly' option is set (add ! to override)" -msgstr "E45: readonly asetettu (lis ! ohittaaksesi)" +msgstr "E45: readonly asetettu (lisää ! ohittaaksesi)" -#: ../globals.h:1073 -#, c-format -msgid "E46: Cannot change read-only variable \"%s\"" -msgstr "E46: Kirjoitussuojattua muuttujaa %s ei voi muuttaa" - -#: ../globals.h:1075 -#, c-format -msgid "E794: Cannot set variable in the sandbox: \"%s\"" -msgstr "E794: Muuttujaa ei voi asettaa hiekkalaatikossa: %s" - -#: ../globals.h:1076 msgid "E47: Error while reading errorfile" msgstr "E47: Virhe virhetiedostoa luettaessa" -#: ../globals.h:1078 msgid "E48: Not allowed in sandbox" msgstr "E48: Ei sallittu hiekkalaatikossa" -#: ../globals.h:1080 msgid "E523: Not allowed here" -msgstr "E523: Ei sallittu tll" +msgstr "E523: Ei sallittu täällä" -#: ../globals.h:1082 msgid "E359: Screen mode setting not supported" -msgstr "E359: Nytttila-asetus ei tuettu" +msgstr "E359: Näyttötila-asetus ei tuettu" -#: ../globals.h:1083 msgid "E49: Invalid scroll size" msgstr "E49: Virheellinen vierityskoko" -#: ../globals.h:1084 msgid "E91: 'shell' option is empty" -msgstr "E91: shell-asetus on tyhj" +msgstr "E91: shell-asetus on tyhjä" -#: ../globals.h:1085 msgid "E255: Couldn't read in sign data!" msgstr "E255: Merkkidatan luku ei onnistu" -#: ../globals.h:1086 msgid "E72: Close error on swap file" msgstr "E72: Swap-tiedoston sulkemisvirhe" -#: ../globals.h:1087 msgid "E73: tag stack empty" -msgstr "E73: tgipino tyhj" +msgstr "E73: tägipino tyhjä" -#: ../globals.h:1088 msgid "E74: Command too complex" msgstr "E74: Liian monimutkainen komento" -#: ../globals.h:1089 msgid "E75: Name too long" -msgstr "E75: Liian pitk nimi" +msgstr "E75: Liian pitkä nimi" -#: ../globals.h:1090 msgid "E76: Too many [" msgstr "E76: Liian monta [:a" -#: ../globals.h:1091 msgid "E77: Too many file names" -msgstr "E77: Liikaa tiedostonimi" +msgstr "E77: Liikaa tiedostonimiä" -#: ../globals.h:1092 msgid "E488: Trailing characters" -msgstr "E488: Ylimrisi merkkej perss" +msgstr "E488: Ylimääräisiä merkkejä perässä" -#: ../globals.h:1093 msgid "E78: Unknown mark" msgstr "E78: Tuntematon merkki" -#: ../globals.h:1094 msgid "E79: Cannot expand wildcards" msgstr "E79: Jokerimerkkien avaus ei onnistu" -#: ../globals.h:1096 msgid "E591: 'winheight' cannot be smaller than 'winminheight'" msgstr "E591: winheight ei voi olla pienempi kuin winminheight" -#: ../globals.h:1098 msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'" msgstr "E592: winwidth ei voi olla pienempi kuin winminwidth" -#: ../globals.h:1099 msgid "E80: Error while writing" msgstr "E80: Kirjoitusvirhe" -#: ../globals.h:1100 msgid "Zero count" msgstr "Nollalaskuri" -#: ../globals.h:1101 msgid "E81: Using not in a script context" msgstr "E81: skriptin ulkopuolella" -#: ../globals.h:1102 #, c-format msgid "E685: Internal error: %s" -msgstr "E685: Sisinen virhe: %s" +msgstr "E685: Sisäinen virhe: %s" -#: ../globals.h:1104 msgid "E363: pattern uses more memory than 'maxmempattern'" -msgstr "E363: kuvio kytt enemmn muistia kuin maxmempattern on" +msgstr "E363: kuvio käyttää enemmän muistia kuin maxmempattern on" -#: ../globals.h:1105 msgid "E749: empty buffer" -msgstr "E749: tyhj puskuri" +msgstr "E749: tyhjä puskuri" + +#, fuzzy, c-format +#~ msgid "E86: Buffer % does not exist" +#~ msgstr "E86: Puskuria %ld ei ole" -#: ../globals.h:1108 msgid "E682: Invalid search pattern or delimiter" msgstr "E682: Virheellinen hakulauseke tai erotin" -#: ../globals.h:1109 msgid "E139: File is loaded in another buffer" msgstr "E139: Tiedosto on ladattu toiseen puskuriin" -#: ../globals.h:1110 #, c-format msgid "E764: Option '%s' is not set" msgstr "E764: Asetus %s on asettamatta" -#: ../globals.h:1111 -#, fuzzy msgid "E850: Invalid register name" -msgstr "E354: Virheellinen rekisterin nimi: %s" +msgstr "E850: Virheellinen rekisterin nimi" + +#, c-format +msgid "E919: Directory not found in '%s': \"%s\"" +msgstr "E919: Hakemisto puuttuu kohteesta %s: %s" + +msgid "E519: Option not supported" +msgstr "E519: Asetusta ei tueta" + +#, fuzzy +#~ msgid "E856: Filename too long" +#~ msgstr "E75: Liian pitkä nimi" + +msgid "E806: using Float as a String" +msgstr "E806: Float ei käy merkkijonosta" -#: ../globals.h:1114 msgid "search hit TOP, continuing at BOTTOM" -msgstr "haku psi ALKUUN, jatketaan LOPUSTA" +msgstr "haku pääsi ALKUUN, jatketaan LOPUSTA" -#: ../globals.h:1115 msgid "search hit BOTTOM, continuing at TOP" -msgstr "haku psi LOPPUUN, jatketaan ALUSTA" +msgstr "haku pääsi LOPPUUN, jatketaan ALUSTA" -#: ../hardcopy.c:240 msgid "E550: Missing colon" msgstr "E550: kaksoispiste puuttuu" -#: ../hardcopy.c:252 msgid "E551: Illegal component" msgstr "E551: Virheellinen komponentti" -#: ../hardcopy.c:259 msgid "E552: digit expected" -msgstr "E552: pitisi olla numero" +msgstr "E552: pitäisi olla numero" -#: ../hardcopy.c:473 #, c-format msgid "Page %d" msgstr "Sivu %d" -#: ../hardcopy.c:597 msgid "No text to be printed" -msgstr "Ei teksti tulostettavaksi" +msgstr "Ei tekstiä tulostettavaksi" -#: ../hardcopy.c:668 -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Tulostetaan sivua %d (%d %%)" +#, fuzzy, c-format +#~ msgid "Printing page %d (%zu%%)" +#~ msgstr "Tulostetaan sivua %d (%d %%)" -#: ../hardcopy.c:680 #, c-format msgid " Copy %d of %d" msgstr " Kopio %d/%d" -#: ../hardcopy.c:733 #, c-format msgid "Printed: %s" msgstr "Tulostettu: %s" -#: ../hardcopy.c:740 msgid "Printing aborted" msgstr "Tulostus peruttu" -#: ../hardcopy.c:1365 msgid "E455: Error writing to PostScript output file" -msgstr "E455: Virhe kirjoitettaessa PostScripti tiedostoon" +msgstr "E455: Virhe kirjoitettaessa PostScriptiä tiedostoon" -#: ../hardcopy.c:1747 #, c-format msgid "E624: Can't open file \"%s\"" msgstr "E624: Ei voi avata tiedostoa %s" -#: ../hardcopy.c:1756 ../hardcopy.c:2470 #, c-format msgid "E457: Can't read PostScript resource file \"%s\"" msgstr "E457: Ei voi lukea PostScript-resurssitiedostoa %s" -#: ../hardcopy.c:1772 #, c-format msgid "E618: file \"%s\" is not a PostScript resource file" msgstr "E618: tiedosto %s ei ole PostScript-resurssitiedosto" -#: ../hardcopy.c:1788 ../hardcopy.c:1805 ../hardcopy.c:1844 #, c-format msgid "E619: file \"%s\" is not a supported PostScript resource file" msgstr "E619: tiedosto %s ei ole tuettu PostScript-resurssitiedosto" -#: ../hardcopy.c:1856 #, c-format msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: resurssitiedoston %s versio on vr" +msgstr "E621: resurssitiedoston %s versio on väärä" -#: ../hardcopy.c:2225 msgid "E673: Incompatible multi-byte encoding and character set." -msgstr "E673: Tukematon monitvauinen merkistkoodaus ja merkist." +msgstr "E673: Tukematon monitvauinen merkistökoodaus ja merkistö." -#: ../hardcopy.c:2238 msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset ei voi olla tyhj monitavuiselle koodaukselle." +msgstr "E674: printmbcharset ei voi olla tyhjä monitavuiselle koodaukselle." -#: ../hardcopy.c:2254 msgid "E675: No default font specified for multi-byte printing." msgstr "E675: Ei oletusfonttia monitavuiseen tulostukseen" -#: ../hardcopy.c:2426 msgid "E324: Can't open PostScript output file" msgstr "E324: PostScript-tulostetiedoston avaus ei onnistu" -#: ../hardcopy.c:2458 #, c-format msgid "E456: Can't open file \"%s\"" msgstr "E456: Tiedoston %s avaus ei onnistu" -#: ../hardcopy.c:2583 msgid "E456: Can't find PostScript resource file \"prolog.ps\"" -msgstr "E456: PostScript-resurssitiedostoa prolog.ps ei lydy" +msgstr "E456: PostScript-resurssitiedostoa prolog.ps ei löydy" -#: ../hardcopy.c:2593 msgid "E456: Can't find PostScript resource file \"cidfont.ps\"" -msgstr "E456: PostScript-resurssitiedostoa cidfont.ps ei lydy" +msgstr "E456: PostScript-resurssitiedostoa cidfont.ps ei löydy" -#: ../hardcopy.c:2622 ../hardcopy.c:2639 ../hardcopy.c:2665 #, c-format msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: Postscript-resurssitiedosta %s.ps ei lydy" +msgstr "E456: Postscript-resurssitiedosta %s.ps ei löydy" -#: ../hardcopy.c:2654 #, c-format msgid "E620: Unable to convert to print encoding \"%s\"" msgstr "E620: Tulostuskoodaukseen %s muunto ei onnistu" -#: ../hardcopy.c:2877 msgid "Sending to printer..." -msgstr "Lhetetn tulostimelle..." +msgstr "Lähetetään tulostimelle..." -#: ../hardcopy.c:2881 msgid "E365: Failed to print PostScript file" -msgstr "E365: PostScript-tiedoston tulostus eponnistui" +msgstr "E365: PostScript-tiedoston tulostus epäonnistui" -#: ../hardcopy.c:2883 msgid "Print job sent." -msgstr "Tulostusty lhetetty." +msgstr "Tulostustyö lähetetty." -#: ../if_cscope.c:85 msgid "Add a new database" -msgstr "Lis uusi tietokanta" +msgstr "Lisää uusi tietokanta" -#: ../if_cscope.c:87 msgid "Query for a pattern" msgstr "Hae kuviota" -#: ../if_cscope.c:89 msgid "Show this message" -msgstr "Nyt tm viesti" +msgstr "Näytä tämä viesti" -#: ../if_cscope.c:91 msgid "Kill a connection" msgstr "Tapa yhteys" -#: ../if_cscope.c:93 msgid "Reinit all connections" msgstr "Alusta uudelleen yhteydet" -#: ../if_cscope.c:95 msgid "Show connections" -msgstr "Nyt yhteydet" +msgstr "Näytä yhteydet" -#: ../if_cscope.c:101 #, c-format msgid "E560: Usage: cs[cope] %s" -msgstr "E560: Kytt: cs[cope] %s" +msgstr "E560: Käyttö: cs[cope] %s" -#: ../if_cscope.c:225 msgid "This cscope command does not support splitting the window.\n" -msgstr "Tm cscope-komento ei tue ikkunan jakamista.\n" +msgstr "Tämä cscope-komento ei tue ikkunan jakamista.\n" -#: ../if_cscope.c:266 msgid "E562: Usage: cstag " -msgstr "E562: Kytt: cstag " +msgstr "E562: Käyttö: cstag " -#: ../if_cscope.c:313 msgid "E257: cstag: tag not found" -msgstr "E257: cstag: tgia ei lydy" +msgstr "E257: cstag: tägia ei löydy" -#: ../if_cscope.c:461 #, c-format msgid "E563: stat(%s) error: %d" msgstr "E563: stat(%s)-virhe: %d" -#: ../if_cscope.c:551 #, c-format msgid "E564: %s is not a directory or a valid cscope database" -msgstr "E564: %s ei ole hakemisto eik cscope-tietokanta" +msgstr "E564: %s ei ole hakemisto eikä cscope-tietokanta" -#: ../if_cscope.c:566 #, c-format msgid "Added cscope database %s" -msgstr "Listty cscope-tietokanta %s" +msgstr "Lisätty cscope-tietokanta %s" -#: ../if_cscope.c:616 -#, c-format -msgid "E262: error reading cscope connection %" -msgstr "E262: Virhe luettaessa cscope-yhteytt %" +#, fuzzy, c-format +#~ msgid "E262: error reading cscope connection %" +#~ msgstr "E262: Virhe luettaessa cscope-yhteyttä %ld" -#: ../if_cscope.c:711 msgid "E561: unknown cscope search type" msgstr "E561: tuntematon cscope-hakutyyppi" -#: ../if_cscope.c:752 ../if_cscope.c:789 msgid "E566: Could not create cscope pipes" msgstr "E566: Ei voitu luoda cscope-putkia" -#: ../if_cscope.c:767 msgid "E622: Could not fork for cscope" msgstr "E622: Ei voitu haarauttaa cscopea" -#: ../if_cscope.c:849 -#, fuzzy msgid "cs_create_connection setpgid failed" -msgstr "cs_create_connection eponnistui" +msgstr "cs_create_connection setpgid epäonnistui" -#: ../if_cscope.c:853 ../if_cscope.c:889 msgid "cs_create_connection exec failed" -msgstr "cs_create_connection eponnistui" +msgstr "cs_create_connection epäonnistui" -#: ../if_cscope.c:863 ../if_cscope.c:902 msgid "cs_create_connection: fdopen for to_fp failed" -msgstr "cs_create_connection: fdopen to_fp eponnistui" +msgstr "cs_create_connection: fdopen to_fp epäonnistui" -#: ../if_cscope.c:865 ../if_cscope.c:906 msgid "cs_create_connection: fdopen for fr_fp failed" -msgstr "cs_create_connection: fdopen fr_fp eponnistui" +msgstr "cs_create_connection: fdopen fr_fp epäonnistui" -#: ../if_cscope.c:890 msgid "E623: Could not spawn cscope process" -msgstr "E623: Cscope-prosessin luonti eponnistui" +msgstr "E623: Cscope-prosessin luonti epäonnistui" -#: ../if_cscope.c:932 msgid "E567: no cscope connections" -msgstr "E567: ei cscope-yhteyksi" +msgstr "E567: ei cscope-yhteyksiä" -#: ../if_cscope.c:1009 #, c-format msgid "E469: invalid cscopequickfix flag %c for %c" msgstr "E469: virheellinen cscopequickfix-asetus %c kohteelle %c" -#: ../if_cscope.c:1058 #, c-format msgid "E259: no matches found for cscope query %s of %s" -msgstr "E259: ei tsmyksi cscope-hakuun %s/%s" +msgstr "E259: ei täsmäyksiä cscope-hakuun %s/%s" -#: ../if_cscope.c:1142 msgid "cscope commands:\n" msgstr "cscope-komennot:\n" -#: ../if_cscope.c:1150 #, c-format msgid "%-5s: %s%*s (Usage: %s)" -msgstr "%-5s: %s%*s (Kytt: %s)" +msgstr "%-5s: %s%*s (Käyttö: %s)" -#: ../if_cscope.c:1155 -#, fuzzy msgid "" "\n" +" a: Find assignments to this symbol\n" " c: Find functions calling this function\n" " d: Find functions called by this function\n" " e: Find this egrep pattern\n" @@ -3246,40 +3092,36 @@ msgid "" " t: Find this text string\n" msgstr "" "\n" -" c: Etsi tt funktiota kutsuvat funktiot\n" -" d: Etsi tmn funktion kutsumat funktiot\n" -" e: Etsi tm egrep-lauseke\n" -" f: Find tm tiedosto\n" -" g: Etsi tm mritys\n" -" i: Etsi tiedostoja jotka #inkluudaavat tmn\n" -" s: Etsi tm C-symboli\n" +" a: Etsi sijotukset tähän symboliin\n" +" c: Etsi tätä funktiota kutsuvat funktiot\n" +" d: Etsi tämän funktion kutsumat funktiot\n" +" e: Etsi tämä egrep-lauseke\n" +" f: Etsi tämä tiedosto\n" +" g: Etsi tämä määritys\n" +" i: Etsi tiedostoja jotka #inkluudaavat tämän\n" +" s: Etsi tämä C-symboli\n" " t: Etsi sijoitukset muuttujaan \n" -#: ../if_cscope.c:1226 msgid "E568: duplicate cscope database not added" -msgstr "E568: kaksoiskappaletta cscope-tietokannasta ei listty" +msgstr "E568: kaksoiskappaletta cscope-tietokannasta ei lisätty" -#: ../if_cscope.c:1335 #, c-format msgid "E261: cscope connection %s not found" msgstr "E261: cscope-yhteys %s puuttuu" -#: ../if_cscope.c:1364 #, c-format msgid "cscope connection %s closed" msgstr "cscope-yhteys %s on katkaistu" #. should not reach here -#: ../if_cscope.c:1486 msgid "E570: fatal error in cs_manage_matches" msgstr "E570: kriittinen virhe cs_manage_matches-funktiossa" -#: ../if_cscope.c:1693 #, c-format msgid "Cscope tag: %s" -msgstr "Cscope-tgi: %s" +msgstr "Cscope-tägi: %s" -#: ../if_cscope.c:1711 +#. Column headers for match number, line number and filename. msgid "" "\n" " # line" @@ -3287,326 +3129,272 @@ msgstr "" "\n" " # rivi" -#: ../if_cscope.c:1713 msgid "filename / context / line\n" msgstr "tiedosto / konteksti / rivi\n" -#: ../if_cscope.c:1809 #, c-format msgid "E609: Cscope error: %s" msgstr "E609: Cscope-virhe: %s" -#: ../if_cscope.c:2053 msgid "All cscope databases reset" msgstr "Kaikki cscope-tietokannat nollattu" -#: ../if_cscope.c:2123 msgid "no cscope connections\n" -msgstr "ei cscope-yhteyksi\n" +msgstr "ei cscope-yhteyksiä\n" -#: ../if_cscope.c:2126 msgid " # pid database name prepend path\n" -msgstr " # pid tietokanta lisyspolku\n" +msgstr " # pid tietokanta lisäyspolku\n" -#: ../main.c:144 -msgid "Unknown option argument" -msgstr "Tuntematon asetusargumentti" - -#: ../main.c:146 -msgid "Too many edit arguments" -msgstr "Liikaa muokkausargumentteja" - -#: ../main.c:148 +#. Error messages msgid "Argument missing after" msgstr "Argumentti puuttuu kohdasta" -#: ../main.c:150 msgid "Garbage after option argument" -msgstr "Roskaa argumentin perss" +msgstr "Roskaa argumentin perässä" + +msgid "Unknown option argument" +msgstr "Tuntematon asetusargumentti" + +msgid "Too many edit arguments" +msgstr "Liikaa muokkausargumentteja" -#: ../main.c:152 msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments" msgstr "Liikaa +komentoja, -c-komentoja tai --cmd-komentoja" -#: ../main.c:154 -msgid "Invalid argument for" -msgstr "Vr argumentti valitsimelle" - -#: ../main.c:294 -#, c-format -msgid "%d files to edit\n" -msgstr "%d tiedostoa muokattavana\n" - -#: ../main.c:1342 msgid "Attempt to open script file again: \"" msgstr "Yritettiin avata skriptitiedostoa uudestaan:" -#: ../main.c:1350 msgid "Cannot open for reading: \"" msgstr "Ei voi avata luettavaksi: " -#: ../main.c:1393 msgid "Cannot open for script output: \"" msgstr "Ei voi avata skriptin tulostetta varten: " -#: ../main.c:1622 msgid "Vim: Warning: Output is not to a terminal\n" msgstr "Vim: Varoitus: Tuloste ei mene terminaalille\n" -#: ../main.c:1624 msgid "Vim: Warning: Input is not from a terminal\n" -msgstr "Vim: Varoitus: Syte ei tule terminaalilta\n" +msgstr "Vim: Varoitus: Syöte ei tule terminaalilta\n" #. just in case.. -#: ../main.c:1891 msgid "pre-vimrc command line" msgstr "esi-vimrc-komentorivi" -#: ../main.c:1964 #, c-format msgid "E282: Cannot read from \"%s\"" msgstr "E282: Ei voida lukea kohteesta %s" -#: ../main.c:2149 +#, fuzzy msgid "" "\n" -"More info with: \"vim -h\"\n" +"More info with \"" msgstr "" "\n" -"Listietoja: \"vim -h\"\n" +"Lisätietoja: \"vim -h\"\n" -#: ../main.c:2178 -msgid "[file ..] edit specified file(s)" -msgstr "[tiedosto ..] muokkaa tiedostoja" +#. kill us with CTRL-C here, if you like +#, fuzzy +#~ msgid "Usage:\n" +#~ msgstr "" +#~ "\n" +#~ "\n" +#~ "käyttö:" -#: ../main.c:2179 -msgid "- read text from stdin" -msgstr "- lue vakiosytteest" +#, fuzzy +#~ msgid " nvim [arguments] [file ...] Edit specified file(s)\n" +#~ msgstr "[tiedosto ..] muokkaa tiedostoja" -#: ../main.c:2180 -msgid "-t tag edit file where tag is defined" -msgstr "-t tgi muokkaa tiedostoa tgist" +#, fuzzy +#~ msgid " nvim [arguments] - Read text from stdin\n" +#~ msgstr "- lue vakiosyötteestä" -#: ../main.c:2181 -msgid "-q [errorfile] edit file with first error" -msgstr "-q [virhetiedosto] muokkaa tiedostoa ensimmisest virheest" +#, fuzzy +#~ msgid " nvim [arguments] -t Edit file where tag is defined\n" +#~ msgstr "-t tägi muokkaa tiedostoa tägistä" -#: ../main.c:2187 +#, fuzzy +#~ msgid " nvim [arguments] -q [errorfile] Edit file with first error\n" +#~ msgstr "-q [virhetiedosto] muokkaa tiedostoa ensimmäisestä virheestä" + +#, fuzzy msgid "" "\n" -"\n" -"usage:" -msgstr "" -"\n" -"\n" -"kytt:" - -#: ../main.c:2189 -msgid " vim [arguments] " -msgstr " vim [argumentit] " - -#: ../main.c:2193 -msgid "" -"\n" -" or:" -msgstr "" -"\n" -" tai:" - -#: ../main.c:2196 -msgid "" -"\n" -"\n" "Arguments:\n" msgstr "" "\n" "\n" "Argumentit:\n" -#: ../main.c:2197 -msgid "--\t\t\tOnly file names after this" -msgstr "--\t\t\tvain tiedostonimi tmn jlkeen" +#, fuzzy +#~ msgid " -- Only file names after this\n" +#~ msgstr "--\t\t\tvain tiedostonimiä tämän jälkeen" -#: ../main.c:2199 -msgid "--literal\t\tDon't expand wildcards" -msgstr "--literal\t\tl ksittele jokerimerkkej " +#, fuzzy +#~ msgid " --literal Don't expand wildcards\n" +#~ msgstr "--literal\t\tÄlä käsittele jokerimerkkejä " -#: ../main.c:2201 -msgid "-v\t\t\tVi mode (like \"vi\")" -msgstr "-v\t\t\tVi-tila (kuten vill)" +#, fuzzy +#~ msgid " -e Ex mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2202 -msgid "-e\t\t\tEx mode (like \"ex\")" -msgstr "-e\t\t\tEx-tila (kute exill)" +#, fuzzy +#~ msgid " -E Improved Ex mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2203 -msgid "-E\t\t\tImproved Ex mode" -msgstr "" +#, fuzzy +#~ msgid " -s Silent (batch) mode (only for ex mode)\n" +#~ msgstr "-s\t\t\tHiljainen (eräajo)tila (vain exillä)" -#: ../main.c:2204 -msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")" -msgstr "-s\t\t\tHiljainen (erajo)tila (vain exill)" +#, fuzzy +#~ msgid " -d Diff mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2205 -msgid "-d\t\t\tDiff mode (like \"vimdiff\")" -msgstr "-d\t\t\tDiff-tila (kuten vimdiffill)" +#, fuzzy +#~ msgid " -R Read-only mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2206 -msgid "-y\t\t\tEasy mode (like \"evim\", modeless)" -msgstr "-y\t\t\tHelppokytttila (kuten evimiss, ilman tiloja)" +#, fuzzy +#~ msgid " -Z Restricted mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2207 -msgid "-R\t\t\tReadonly mode (like \"view\")" -msgstr "-R\t\t\tKirjoitussuojattu tila (kuten view'lla)" +#, fuzzy +#~ msgid " -m Modifications (writing files) not allowed\n" +#~ msgstr "-m\t\t\tMuokkaukset (kirjoittaminen tiedostoon) pois käytöstä" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tRajoitettu tila (kuten rvimill)" +#, fuzzy +#~ msgid " -M Modifications in text not allowed\n" +#~ msgstr "-M\t\t\tTekstin muokkaus pois käytöstä" -#: ../main.c:2209 -msgid "-m\t\t\tModifications (writing files) not allowed" -msgstr "-m\t\t\tMuokkaukset (kirjoittaminen tiedostoon) pois kytst" +#, fuzzy +#~ msgid " -b Binary mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2210 -msgid "-M\t\t\tModifications in text not allowed" -msgstr "-M\t\t\tTekstin muokkaus pois kytst" +#, fuzzy +#~ msgid " -l Lisp mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2211 -msgid "-b\t\t\tBinary mode" -msgstr "-b\t\t\tBinritila" +#, fuzzy +#~ msgid " -A Arabic mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2212 -msgid "-l\t\t\tLisp mode" -msgstr "-l\t\t\tLisp-tila" +#, fuzzy +#~ msgid " -F Farsi mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2213 -msgid "-C\t\t\tCompatible with Vi: 'compatible'" -msgstr "-C\t\t\tVi-yhteensopivuustila: compatible" +#, fuzzy +#~ msgid " -H Hebrew mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2214 -msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'" -msgstr "-N\t\t\tEi Vi-yhteensopivuutta: nocompatible" +#, fuzzy +#~ msgid " -V[N][file] Be verbose [level N][log messages to file]\n" +#~ msgstr "" +#~ "-V[N][tnimi]\t\tMonisanainen tuloste [Taso N] [kirjoita tuloste tnimeen] " -#: ../main.c:2215 -msgid "-V[N][fname]\t\tBe verbose [level N] [log messages to fname]" -msgstr "" -"-V[N][tnimi]\t\tMonisanainen tuloste [Taso N] [kirjoita tuloste tnimeen] " +#, fuzzy +#~ msgid " -D Debugging mode\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2216 -msgid "-D\t\t\tDebugging mode" -msgstr "-D\t\t\tVianetsinttila" +#, fuzzy +#~ msgid " -n No swap file, use memory only\n" +#~ msgstr "-n\t\t\tEi swap-tiedostoja, käytä muistia" -#: ../main.c:2217 -msgid "-n\t\t\tNo swap file, use memory only" -msgstr "-n\t\t\tEi swap-tiedostoja, kyt muistia" +#, fuzzy +#~ msgid " -r, -L List swap files and exit\n" +#~ msgstr "-r\t\t\tLuetteloi swap-tiedostot ja poistu" -#: ../main.c:2218 -msgid "-r\t\t\tList swap files and exit" -msgstr "-r\t\t\tLuetteloi swap-tiedostot ja poistu" +#, fuzzy +#~ msgid " -r Recover crashed session\n" +#~ msgstr "-r (tiedostonimi)\tPalauta kaatunut sessio" -#: ../main.c:2219 -msgid "-r (with file name)\tRecover crashed session" -msgstr "-r (tiedostonimi)\tPalauta kaatunut sessio" +#, fuzzy +#~ msgid " -u Use instead of the default\n" +#~ msgstr "-u \t\tKäytä -tiedostoa .vimrc:iden sijasta" -#: ../main.c:2220 -msgid "-L\t\t\tSame as -r" -msgstr "-L\t\t\tkuten -r" +#~ msgid " -i Use instead of the default\n" +#~ msgstr "" -#: ../main.c:2221 -msgid "-A\t\t\tstart in Arabic mode" -msgstr "-A\t\t\tkynnist arabia-tilassa" +#, fuzzy +#~ msgid " --noplugin Don't load plugin scripts\n" +#~ msgstr "--noplugin\t\tÄlä lataa liitännäisiä" -#: ../main.c:2222 -msgid "-H\t\t\tStart in Hebrew mode" -msgstr "-H\t\t\tkynnist heprea-tilassa" +#, fuzzy +#~ msgid " -o[N] Open N windows (default: one for each file)\n" +#~ msgstr "-o[N]\t\tAvaa N ikkunaa (oletus: yksi per tiedosto)" -#: ../main.c:2223 -msgid "-F\t\t\tStart in Farsi mode" -msgstr "-F\t\t\tkynnist farsi-tilassa" +#, fuzzy +#~ msgid " -O[N] Like -o but split vertically\n" +#~ msgstr "-O[N]\t\tKuten -o, mutta jaa pystysuunnassa" -#: ../main.c:2224 -msgid "-T \tSet terminal type to " -msgstr "-T \tAseta terminaalin tyypiksi " +#, fuzzy +#~ msgid " -p[N] Open N tab pages (default: one for each file)\n" +#~ msgstr "-p[N]\t\tAvaa N välilehteä (oletus: yksi per tiedosto)" -#: ../main.c:2225 -msgid "-u \t\tUse instead of any .vimrc" -msgstr "-u \t\tKyt -tiedostoa .vimrc:iden sijasta" +#, fuzzy +#~ msgid " + Start at end of file\n" +#~ msgstr " kahta tilaa varten " -#: ../main.c:2226 -msgid "--noplugin\t\tDon't load plugin scripts" -msgstr "--noplugin\t\tl lataa liitnnisi" +#, fuzzy +#~ msgid " + Start at line \n" +#~ msgstr "+\t\t\tAloita riviltä " -#: ../main.c:2227 -msgid "-p[N]\t\tOpen N tab pages (default: one for each file)" -msgstr "-p[N]\t\tAvaa N vlilehte (oletus: yksi per tiedosto)" +#~ msgid " +/ Start at first occurrence of \n" +#~ msgstr "" -#: ../main.c:2228 -msgid "-o[N]\t\tOpen N windows (default: one for each file)" -msgstr "-o[N]\t\tAvaa N ikkunaa (oletus: yksi per tiedosto)" +#, fuzzy +#~ msgid " --cmd Execute before loading any vimrc\n" +#~ msgstr "--cmd \tSuorita ennen vimrc:iden latausta" -#: ../main.c:2229 -msgid "-O[N]\t\tLike -o but split vertically" -msgstr "-O[N]\t\tKuten -o, mutta jaa pystysuunnassa" +#, fuzzy +msgid "" +" -c Execute after loading the first file\n" +msgstr "-c \t\tSuorita ensimmäisen tiedoston latauduttua" -#: ../main.c:2230 -msgid "+\t\t\tStart at end of file" -msgstr "+\t\t\tAloita tiedoston lopusta" +#, fuzzy +#~ msgid " -S Source after loading the first file\n" +#~ msgstr "-S \t\tLataa ensimmäisen tiedoston latauduttua" -#: ../main.c:2231 -msgid "+\t\tStart at line " -msgstr "+\t\t\tAloita rivilt " +#, fuzzy +#~ msgid " -s Read Normal mode commands from \n" +#~ msgstr "-s \tLue normaalitilan komentoja -tiedostosta" -#: ../main.c:2232 -msgid "--cmd \tExecute before loading any vimrc file" -msgstr "--cmd \tSuorita ennen vimrc:iden latausta" +#, fuzzy +#~ msgid " -w Append all typed characters to \n" +#~ msgstr "-w \tLisää kirjoitetut komennot -tiedostoon" -#: ../main.c:2233 -msgid "-c \t\tExecute after loading the first file" -msgstr "-c \t\tSuorita ensimmisen tiedoston latauduttua" +#, fuzzy +#~ msgid " -W Write all typed characters to \n" +#~ msgstr "-W \tKirjoita komennot -tiedostoon" -#: ../main.c:2235 -msgid "-S \t\tSource file after loading the first file" -msgstr "-S \t\tLataa ensimmisen tiedoston latauduttua" +#, fuzzy +#~ msgid " --startuptime Write startup timing messages to \n" +#~ msgstr "--startuptime \tKirjoita käynnistysaikaviestit tiedostoon " -#: ../main.c:2236 -msgid "-s \tRead Normal mode commands from file " -msgstr "-s \tLue normaalitilan komentoja -tiedostosta" +#~ msgid "" +#~ " --api-info Dump API metadata serialized to msgpack and exit\n" +#~ msgstr "" -#: ../main.c:2237 -msgid "-w \tAppend all typed commands to file " -msgstr "-w \tLis kirjoitetut komennot -tiedostoon" +#~ msgid " --embed Use stdin/stdout as a msgpack-rpc channel\n" +#~ msgstr "" -#: ../main.c:2238 -msgid "-W \tWrite all typed commands to file " -msgstr "-W \tKirjoita komennot -tiedostoon" +#~ msgid " --headless Don't start a user interface\n" +#~ msgstr "" -#: ../main.c:2240 -msgid "--startuptime \tWrite startup timing messages to " -msgstr "--startuptime \tKirjoita kynnistysaikaviestit tiedostoon " +#, fuzzy +#~ msgid " -v, --version Print version information and exit\n" +#~ msgstr "--version\t\t\tTulosta versiotiedot ja lopeta" -#: ../main.c:2242 -msgid "-i \t\tUse instead of .viminfo" -msgstr "-i \t\tKyt -tiedostoa .viminfon sijaan" +#, fuzzy +#~ msgid " -h, --help Print this help message and exit\n" +#~ msgstr "-h tai --help\tTulosta ohje (tämä viesti) ja lopeta" -#: ../main.c:2243 -msgid "-h or --help\tPrint Help (this message) and exit" -msgstr "-h tai --help\tTulosta ohje (tm viesti) ja lopeta" - -#: ../main.c:2244 -msgid "--version\t\tPrint version information and exit" -msgstr "--version\t\t\tTulosta versiotiedot ja lopeta" - -#: ../mark.c:676 msgid "No marks set" -msgstr "Ei asetettuja merkkej" +msgstr "Ei asetettuja merkkejä" -#: ../mark.c:678 #, c-format msgid "E283: No marks matching \"%s\"" -msgstr "E283: Mikn merkki ei tsm ilmaukseen \"%s\"" +msgstr "E283: Mikään merkki ei täsmää ilmaukseen \"%s\"" #. Highlight title -#: ../mark.c:687 msgid "" "\n" "mark line col file/text" @@ -3615,7 +3403,6 @@ msgstr "" "merkki rivi sarake tiedosto/teksti" #. Highlight title -#: ../mark.c:789 msgid "" "\n" " jump line col file/text" @@ -3624,7 +3411,6 @@ msgstr "" "hyppy rivi sarake tiedosto/teksti" #. Highlight title -#: ../mark.c:831 msgid "" "\n" "change line col text" @@ -3632,138 +3418,85 @@ msgstr "" "\n" "muutos rivi sarake teksti" -#: ../mark.c:1238 -msgid "" -"\n" -"# File marks:\n" -msgstr "" -"\n" -"# Tiedoston merkit:\n" - -#. Write the jumplist with -' -#: ../mark.c:1271 -msgid "" -"\n" -"# Jumplist (newest first):\n" -msgstr "" -"\n" -"# Hyppylista (uusin ensiksi):\n" - -#: ../mark.c:1352 -msgid "" -"\n" -"# History of marks within files (newest to oldest):\n" -msgstr "" -"\n" -"# Tiedostojen merkkien historia (uusimmasta vanhimpaan):\n" - -#: ../mark.c:1431 -msgid "Missing '>'" -msgstr "> puuttuu" - -#: ../memfile.c:426 msgid "E293: block was not locked" msgstr "E293: lohkoa ei ole lukittu" -#: ../memfile.c:799 msgid "E294: Seek error in swap file read" msgstr "E294: Hakuvirhe swap-tiedostoa luettaessa" -#: ../memfile.c:803 msgid "E295: Read error in swap file" msgstr "E295: Lukuvirhe swap-tiedostossa" -#: ../memfile.c:849 msgid "E296: Seek error in swap file write" msgstr "E296: Hakuvirhe swap-tiedostoa kirjoitettaessa" -#: ../memfile.c:865 msgid "E297: Write error in swap file" msgstr "E297: Kirjoitusvirhe swap-tiedostossa" -#: ../memfile.c:1036 msgid "E300: Swap file already exists (symlink attack?)" -msgstr "E300: Swaptiedosto on jo olemassa (symlink-hykkys?)" +msgstr "E300: Swaptiedosto on jo olemassa (symlink-hyökkäys?)" -#: ../memline.c:318 msgid "E298: Didn't get block nr 0?" msgstr "E298: Lohko 0:aa ei saatu?" -#: ../memline.c:361 msgid "E298: Didn't get block nr 1?" -msgstr "E298: Lohko 1:t ei saatu?" +msgstr "E298: Lohko 1:tä ei saatu?" -#: ../memline.c:377 msgid "E298: Didn't get block nr 2?" msgstr "E298: Lohko 2:ta ei saatu?" #. could not (re)open the swap file, what can we do???? -#: ../memline.c:465 msgid "E301: Oops, lost the swap file!!!" -msgstr "E301: Hups, swap-tiedosto hvisi!" +msgstr "E301: Hups, swap-tiedosto hävisi!" -#: ../memline.c:477 msgid "E302: Could not rename swap file" msgstr "E302: Swap-tiedoston uudellennimeys ei onnistu" -#: ../memline.c:554 #, c-format msgid "E303: Unable to open swap file for \"%s\", recovery impossible" msgstr "E303: Swap-tiedostoa %s ei voi avata, palautus ei onnistu" -#: ../memline.c:666 msgid "E304: ml_upd_block0(): Didn't get block 0??" msgstr "E304: ml_upd_block0(): Lohko 0:aa ei saatu?" #. no swap files found -#: ../memline.c:830 #, c-format msgid "E305: No swap file found for %s" msgstr "E305: Ei swap-tiedostoa tiedostolle %s" -#: ../memline.c:839 msgid "Enter number of swap file to use (0 to quit): " msgstr "Anna swap-tiedoston numero tai 0 lopettaaksesi: " -#: ../memline.c:879 #, c-format msgid "E306: Cannot open %s" msgstr "E306: Ei voi avata tiedostoa %s" -#: ../memline.c:897 msgid "Unable to read block 0 from " msgstr "Ei voi lukea lohkoa 0 kohteesta " -#: ../memline.c:900 msgid "" "\n" "Maybe no changes were made or Vim did not update the swap file." msgstr "" "\n" -"Muutoksia ei tehty, tai Vim ei pivittnyt swap-tiedostoa." +"Muutoksia ei tehty, tai Vim ei päivittänyt swap-tiedostoa." -#: ../memline.c:909 msgid " cannot be used with this version of Vim.\n" -msgstr " ei toimi tmn version Vimin kanssa.\n" +msgstr " ei toimi tämän version Vimin kanssa.\n" -#: ../memline.c:911 msgid "Use Vim version 3.0.\n" -msgstr "Kyt Vimin versiota 3.0\n" +msgstr "Käytä Vimin versiota 3.0\n" -#: ../memline.c:916 #, c-format msgid "E307: %s does not look like a Vim swap file" msgstr "E307: %s ei ole Vimin swap-tiedosto" -#: ../memline.c:922 msgid " cannot be used on this computer.\n" -msgstr " ei toimi tll koneella.\n" +msgstr " ei toimi tällä koneella.\n" -#: ../memline.c:924 msgid "The file was created on " msgstr "Tiedosto luotiin " -#: ../memline.c:928 msgid "" ",\n" "or the file has been damaged." @@ -3771,100 +3504,78 @@ msgstr "" ",\n" "tai tiedosto on vahingoittunut." -#: ../memline.c:945 msgid " has been damaged (page size is smaller than minimum value).\n" -msgstr " on vioittunut (sivun koko on vhimmisarvoa pienempi).\n" +msgstr " on vioittunut (sivun koko on vähimmäisarvoa pienempi).\n" -#: ../memline.c:974 #, c-format msgid "Using swap file \"%s\"" -msgstr "Kytetn swap-tiedostoa %s" +msgstr "Käytetään swap-tiedostoa %s" -#: ../memline.c:980 #, c-format msgid "Original file \"%s\"" -msgstr "Alkuperinen tiedosto %s" +msgstr "Alkuperäinen tiedosto %s" -#: ../memline.c:995 msgid "E308: Warning: Original file may have been changed" -msgstr "E308: Varoitus: Alkuperist tiedostoa saattaa olla muutettu" +msgstr "E308: Varoitus: Alkuperäistä tiedostoa saattaa olla muutettu" -#: ../memline.c:1061 #, c-format msgid "E309: Unable to read block 1 from %s" msgstr "E309: Ei voitu lukea lohkoa 1 tiedostosta %s" -#: ../memline.c:1065 msgid "???MANY LINES MISSING" -msgstr "???PALJON RIVEJ PUUTTUU" +msgstr "???PALJON RIVEJÄ PUUTTUU" -#: ../memline.c:1076 msgid "???LINE COUNT WRONG" -msgstr "???RIVIMR PIELESS" +msgstr "???RIVIMÄÄRÄ PIELESSÄ" -#: ../memline.c:1082 msgid "???EMPTY BLOCK" -msgstr "???TYHJ LOHKO" +msgstr "???TYHJÄ LOHKO" -#: ../memline.c:1103 msgid "???LINES MISSING" -msgstr "???RIVEJ PUUTTUU" +msgstr "???RIVEJÄ PUUTTUU" -#: ../memline.c:1128 #, c-format msgid "E310: Block 1 ID wrong (%s not a .swp file?)" -msgstr "E310: Lohon 1 tunniste vr (%s ei ole .swp-tiedosto?)" +msgstr "E310: Lohon 1 tunniste väärä (%s ei ole .swp-tiedosto?)" -#: ../memline.c:1133 msgid "???BLOCK MISSING" msgstr "???LOHKO PUUTTUU" -#: ../memline.c:1147 msgid "??? from here until ???END lines may be messed up" -msgstr "??? tst kohtaan ???LOPPU rivej sekaisin" +msgstr "??? tästä kohtaan ???LOPPU rivejä sekaisin" -#: ../memline.c:1164 msgid "??? from here until ???END lines may have been inserted/deleted" -msgstr "??? tst kohtaan ???LOPPU rivej saattaa olla listty tai poistettu" +msgstr "??? tästä kohtaan ???LOPPU rivejä saattaa olla lisätty tai poistettu" -#: ../memline.c:1181 msgid "???END" msgstr "???LOPPU" -#: ../memline.c:1238 msgid "E311: Recovery Interrupted" msgstr "E311: Palautus keskeytetty" -#: ../memline.c:1243 msgid "" "E312: Errors detected while recovering; look for lines starting with ???" -msgstr "E312: Palautuksessa oli virheit, etsi rivej, jotka alkavat ???" +msgstr "E312: Palautuksessa oli virheitä, etsi rivejä, jotka alkavat ???" -#: ../memline.c:1245 msgid "See \":help E312\" for more information." -msgstr ":help E312 kertoo listietoja" +msgstr ":help E312 kertoo lisätietoja" -#: ../memline.c:1249 msgid "Recovery completed. You should check if everything is OK." -msgstr "Palautus onnistui. Tarkista, ett kaikki on kunnossa." +msgstr "Palautus onnistui. Tarkista, että kaikki on kunnossa." -#: ../memline.c:1251 msgid "" "\n" "(You might want to write out this file under another name\n" msgstr "" "\n" -"(Saattaa kannattaa kirjoittaa tm tiedosto toisella nimell\n" +"(Saattaa kannattaa kirjoittaa tämä tiedosto toisella nimellä\n" -#: ../memline.c:1252 msgid "and run diff with the original file to check for changes)" -msgstr "ja katso diffill muutokset alkuperiseen tiedostoon)" +msgstr "ja katso diffillä muutokset alkuperäiseen tiedostoon)" -#: ../memline.c:1254 msgid "Recovery completed. Buffer contents equals file contents." -msgstr "Palautus onnistui. Puskurin ja tiedoston sisllt tsmvt." +msgstr "Palautus onnistui. Puskurin ja tiedoston sisällöt täsmäävät." -#: ../memline.c:1255 msgid "" "\n" "You may want to delete the .swp file now.\n" @@ -3875,51 +3586,42 @@ msgstr "" "\n" #. use msg() to start the scrolling properly -#: ../memline.c:1327 msgid "Swap files found:" -msgstr "Swap-tiedostoja lytyi:" +msgstr "Swap-tiedostoja löytyi:" -#: ../memline.c:1446 msgid " In current directory:\n" -msgstr " Tss hakemistossa:\n" +msgstr " Tässä hakemistossa:\n" -#: ../memline.c:1448 msgid " Using specified name:\n" -msgstr " Mritellyll nimell:\n" +msgstr " Määritellyllä nimellä:\n" -#: ../memline.c:1450 msgid " In directory " msgstr " Hakemistossa " -#: ../memline.c:1465 msgid " -- none --\n" -msgstr " -- ei mitn --\n" +msgstr " -- ei mitään --\n" -#: ../memline.c:1527 msgid " owned by: " msgstr " omistaja: " -#: ../memline.c:1529 msgid " dated: " msgstr " ajalta: " -#: ../memline.c:1532 ../memline.c:3231 msgid " dated: " msgstr " ajalta:" -#: ../memline.c:1548 msgid " [from Vim version 3.0]" msgstr " [Vimin 3.0-versiosta]" -#: ../memline.c:1550 msgid " [does not look like a Vim swap file]" -msgstr " [ei nyt Vimin swap-tiedostolta]" +msgstr " [ei näytä Vimin swap-tiedostolta]" + +#~ msgid " [garbled strings (not nul terminated)]" +#~ msgstr "" -#: ../memline.c:1552 msgid " file name: " msgstr " tiedostonimi: " -#: ../memline.c:1558 msgid "" "\n" " modified: " @@ -3927,27 +3629,22 @@ msgstr "" "\n" " muokattu: " -#: ../memline.c:1559 msgid "YES" -msgstr "KYLL" +msgstr "KYLLÄ" -#: ../memline.c:1559 msgid "no" msgstr "ei" -#: ../memline.c:1562 msgid "" "\n" " user name: " msgstr "" "\n" -" kyttjnimi: " +" käyttäjänimi: " -#: ../memline.c:1568 msgid " host name: " msgstr " laitenimi: " -#: ../memline.c:1570 msgid "" "\n" " host name: " @@ -3955,7 +3652,6 @@ msgstr "" "\n" " laitenimi: " -#: ../memline.c:1575 msgid "" "\n" " process ID: " @@ -3963,190 +3659,143 @@ msgstr "" "\n" " prosessin tunniste: " -#: ../memline.c:1579 msgid " (still running)" -msgstr " (kynniss)" +msgstr " (käynnissä)" -#: ../memline.c:1586 msgid "" "\n" " [not usable on this computer]" msgstr "" "\n" -" [ei toimi tll koneella]" +" [ei toimi tällä koneella]" -#: ../memline.c:1590 msgid " [cannot be read]" msgstr " [ei voi lukea]" -#: ../memline.c:1593 msgid " [cannot be opened]" msgstr " [ei voi avata]" -#: ../memline.c:1698 msgid "E313: Cannot preserve, there is no swap file" -msgstr "E313: Ei voi silytt, swap-tiedostoa ei ole" +msgstr "E313: Ei voi säilyttää, swap-tiedostoa ei ole" -#: ../memline.c:1747 msgid "File preserved" -msgstr "Tiedosto silytetty" +msgstr "Tiedosto säilytetty" -#: ../memline.c:1749 msgid "E314: Preserve failed" -msgstr "E314: Silyttminen eponnistui" +msgstr "E314: Säilyttäminen epäonnistui" -#: ../memline.c:1819 -#, c-format -msgid "E315: ml_get: invalid lnum: %" -msgstr "E315: ml_get: virheellinen lnum: %" +#, fuzzy, c-format +#~ msgid "E315: ml_get: invalid lnum: %" +#~ msgstr "E315: ml_get: virheellinen lnum: %ld" -#: ../memline.c:1851 -#, c-format -msgid "E316: ml_get: cannot find line %" -msgstr "E316: ml_get: rivi % ei lydy" +#, fuzzy, c-format +#~ msgid "E316: ml_get: cannot find line %" +#~ msgstr "E316: ml_get: riviä %ld ei löydy" -#: ../memline.c:2236 msgid "E317: pointer block id wrong 3" -msgstr "E317: osoitinlohkon tunnus vr 3" +msgstr "E317: osoitinlohkon tunnus väärä 3" -#: ../memline.c:2311 msgid "stack_idx should be 0" -msgstr "stack_idx pit olla 0" +msgstr "stack_idx pitää olla 0" -#: ../memline.c:2369 msgid "E318: Updated too many blocks?" -msgstr "E318: Pivitetty liikaa lohkoja" +msgstr "E318: Päivitetty liikaa lohkoja" -#: ../memline.c:2511 msgid "E317: pointer block id wrong 4" -msgstr "E317: osoitinlohkon tunnus vr 4" +msgstr "E317: osoitinlohkon tunnus väärä 4" -#: ../memline.c:2536 msgid "deleted block 1?" msgstr "poistettu lohko 1?" -#: ../memline.c:2707 -#, c-format -msgid "E320: Cannot find line %" -msgstr "E320: Rivi % ei lydy" +#, fuzzy, c-format +#~ msgid "E320: Cannot find line %" +#~ msgstr "E320: Riviä %ld ei löydy" -#: ../memline.c:2916 msgid "E317: pointer block id wrong" -msgstr "E317: osoitinlohkon tunnus vr" +msgstr "E317: osoitinlohkon tunnus väärä" -#: ../memline.c:2930 msgid "pe_line_count is zero" msgstr "pe_line_count on nolla" -#: ../memline.c:2955 -#, c-format -msgid "E322: line number out of range: % past the end" -msgstr "E322: rivinumero arvoalueen ulkopuoleta: % on loppua suurempi" +#, fuzzy, c-format +#~ msgid "E322: line number out of range: % past the end" +#~ msgstr "E322: rivinumero arvoalueen ulkopuoleta: %ld on loppua suurempi" -#: ../memline.c:2959 -#, c-format -msgid "E323: line count wrong in block %" -msgstr "E323: rivimr vrin lohkossa %" +#, fuzzy, c-format +#~ msgid "E323: line count wrong in block %" +#~ msgstr "E323: rivimäärä väärin lohkossa %ld" -#: ../memline.c:2999 msgid "Stack size increases" msgstr "Pinon koko kasvaa" -#: ../memline.c:3038 msgid "E317: pointer block id wrong 2" -msgstr "E317: osoitinlohon tunnus vr 2" +msgstr "E317: osoitinlohon tunnus väärä 2" -#: ../memline.c:3070 #, c-format msgid "E773: Symlink loop for \"%s\"" msgstr "E773: Symlinkkisilmukka kohteelle %s" -#: ../memline.c:3221 msgid "E325: ATTENTION" msgstr "E325: HUOMAA" -#: ../memline.c:3222 msgid "" "\n" "Found a swap file by the name \"" msgstr "" "\n" -"Swap-tiedosto lytyi: \"" +"Swap-tiedosto löytyi: \"" -#: ../memline.c:3226 msgid "While opening file \"" msgstr "Avattaessa tiedostoa " -#: ../memline.c:3239 msgid " NEWER than swap file!\n" msgstr " joka on UUDEMPI kuin swap-tiedosto!\n" -#: ../memline.c:3244 -#, fuzzy +#. Some of these messages are long to allow translation to +#. * other languages. msgid "" "\n" "(1) Another program may be editing the same file. If this is the case,\n" " be careful not to end up with two different instances of the same\n" -" file when making changes." +" file when making changes. Quit, or continue with caution.\n" msgstr "" "\n" -"(1) Toinen ohjelma saattaa kytt samaa tiedostoa.\n" -" Jos nin on, varo, ettet muokkaa saman tiedoston\n" -" kahta instanssia yht aikaa.\n" +"(1) Toinen ohjelma saattaa käyttää samaa tiedostoa.\n" +" Jos näin on, varo, ettet muokkaa saman tiedoston\n" +" kahta instanssia yhtä aikaa. Lopeta tai jatka varoen.\n" -#: ../memline.c:3245 -#, fuzzy -msgid " Quit, or continue with caution.\n" -msgstr " Lopeta, tai jatka.\n" - -#: ../memline.c:3246 -#, fuzzy msgid "(2) An edit session for this file crashed.\n" -msgstr "" -"\n" -"(2) Ohjelma on kaatunut muokatessa tiedostoa.\n" +msgstr "(2) Tiedostonmuokkausistunto on kaatunut.\n" -#: ../memline.c:3247 msgid " If this is the case, use \":recover\" or \"vim -r " -msgstr " Jos nin on, kyt komentoa :recover tai vim -r " +msgstr " Jos näin on, käytä komentoa :recover tai vim -r " -#: ../memline.c:3249 msgid "" "\"\n" " to recover the changes (see \":help recovery\").\n" msgstr "" "\"\n" -" palauttaaksesi muutokset (listietoja: \":help recovery\").\n" +" palauttaaksesi muutokset (lisätietoja: \":help recovery\").\n" -#: ../memline.c:3250 msgid " If you did this already, delete the swap file \"" -msgstr " Jos teit jo nin, poista swap-tiedosto " +msgstr " Jos teit jo näin, poista swap-tiedosto " -#: ../memline.c:3252 msgid "" "\"\n" " to avoid this message.\n" msgstr "" "\"\n" -" vlttksesi tmn viestin.\n" +" välttääksesi tämän viestin.\n" -#: ../memline.c:3450 ../memline.c:3452 msgid "Swap file \"" msgstr "Swap-tiedosto " -#: ../memline.c:3451 ../memline.c:3455 msgid "\" already exists!" msgstr " on jo olemassa" -#: ../memline.c:3457 msgid "VIM - ATTENTION" msgstr "VIM - HUOMAUTUS" -#: ../memline.c:3459 -msgid "Swap file already exists!" -msgstr "Swap-tiedosto on jo olemassa" - -#: ../memline.c:3464 msgid "" "&Open Read-Only\n" "&Edit anyway\n" @@ -4160,7 +3809,6 @@ msgstr "" "&Lopeta\n" "P&eru" -#: ../memline.c:3467 msgid "" "&Open Read-Only\n" "&Edit anyway\n" @@ -4184,48 +3832,48 @@ msgstr "" #. #. ".s?a" #. ".saa": tried enough, give up -#: ../memline.c:3528 msgid "E326: Too many swap files found" msgstr "E326: Liian monta swap-tiedostoa" -#: ../memory.c:227 -#, c-format -msgid "E342: Out of memory! (allocating % bytes)" -msgstr "E342: Muisti loppui! (varattaessa % tavua)" +#, fuzzy, c-format +msgid "" +"E303: Unable to create directory \"%s\" for swap file, recovery impossible: " +"%s" +msgstr "E303: Swap-tiedostoa %s ei voi avata, palautus ei onnistu" + +#, fuzzy +#~ msgid "Vim: Data too large to fit into virtual memory space\n" +#~ msgstr "arvo on liian suuri mahtumaan C:n int-tyyppiin" + +#, fuzzy, c-format +#~ msgid "E342: Out of memory! (allocating % bytes)" +#~ msgstr "E342: Muisti loppui! (varattaessa %lu tavua)" -#: ../menu.c:62 msgid "E327: Part of menu-item path is not sub-menu" msgstr "E327: Valikkokohtapolun osa ei ole alivalikko" -#: ../menu.c:63 msgid "E328: Menu only exists in another mode" msgstr "E328: Valikko on olemassa vain toisessa tilassa" -#: ../menu.c:64 #, c-format msgid "E329: No menu \"%s\"" msgstr "E329: Ei valikkoa %s" #. Only a mnemonic or accelerator is not valid. -#: ../menu.c:329 msgid "E792: Empty menu name" -msgstr "E792: tyhj valikkonimi" +msgstr "E792: tyhjä valikkonimi" -#: ../menu.c:340 msgid "E330: Menu path must not lead to a sub-menu" msgstr "E330: Valikkopolku ei saa johtaa alivalikkoon" -#: ../menu.c:365 msgid "E331: Must not add menu items directly to menu bar" -msgstr "E331: Valikkokohtia ei saa list suoraan valikkopalkkiin" +msgstr "E331: Valikkokohtia ei saa lisätä suoraan valikkopalkkiin" -#: ../menu.c:370 msgid "E332: Separator cannot be part of a menu path" msgstr "E332: Erotin ei voi olla valikkopolun osa" #. Now we have found the matching menu, and we list the mappings #. Highlight title -#: ../menu.c:762 msgid "" "\n" "--- Menus ---" @@ -4233,87 +3881,64 @@ msgstr "" "\n" "--- Valikot ---" -#: ../menu.c:1313 msgid "E333: Menu path must lead to a menu item" msgstr "E333: Valikkopolun on johdettava valikkokohtaan" -#: ../menu.c:1330 #, c-format msgid "E334: Menu not found: %s" -msgstr "E334: Valikkoa ei lydy: %s" +msgstr "E334: Valikkoa ei löydy: %s" -#: ../menu.c:1396 #, c-format msgid "E335: Menu not defined for %s mode" -msgstr "E335: Valikkoa ei ole mritelty %s-tilassa" +msgstr "E335: Valikkoa ei ole määritelty %s-tilassa" -#: ../menu.c:1426 -msgid "E336: Menu path must lead to a sub-menu" -msgstr "E336: Valikkopolun pit johtaa alivalikkoon" - -#: ../menu.c:1447 -msgid "E337: Menu not found - check menu names" -msgstr "E337: Valikkoa ei lytynyt - tarkista valikkojen nimet" - -#: ../message.c:423 #, c-format msgid "Error detected while processing %s:" msgstr "Virhe suoritettaessa komentoja %s:" -#: ../message.c:445 #, c-format msgid "line %4ld:" msgstr "rivi %4ld:" -#: ../message.c:617 #, c-format msgid "E354: Invalid register name: '%s'" msgstr "E354: Virheellinen rekisterin nimi: %s" -#: ../message.c:986 msgid "Interrupt: " msgstr "Keskeytys: " -#: ../message.c:988 msgid "Press ENTER or type command to continue" -msgstr "Paina enteri tai kirjoita komento aloittaaksesi " +msgstr "Paina enteriä tai kirjoita komento aloittaaksesi " -#: ../message.c:1843 -#, c-format -msgid "%s line %" -msgstr "%s rivi %" +#, fuzzy, c-format +#~ msgid "%s line %" +#~ msgstr "%s rivi %ld" -#: ../message.c:2392 msgid "-- More --" -msgstr "-- Lis --" +msgstr "-- Lisää --" -#: ../message.c:2398 msgid " SPACE/d/j: screen/page/line down, b/u/k: up, q: quit " -msgstr " SPACE/d/j: ruutu/sivu/rivi alas, b/u/k: yls, q: lopeta " +msgstr " SPACE/d/j: ruutu/sivu/rivi alas, b/u/k: ylös, q: lopeta " -#: ../message.c:3021 ../message.c:3031 msgid "Question" msgstr "Kysymys" -#: ../message.c:3023 msgid "" "&Yes\n" "&No" msgstr "" -"&Kyll\n" +"&Kyllä\n" "&Ei" -#: ../message.c:3033 msgid "" "&Yes\n" "&No\n" "&Cancel" msgstr "" -"&Kyll\n" +"&Kyllä\n" "&Ei\n" "&Peru" -#: ../message.c:3045 msgid "" "&Yes\n" "&No\n" @@ -4321,180 +3946,165 @@ msgid "" "&Discard All\n" "&Cancel" msgstr "" -"&Kyll\n" +"&Kyllä\n" "&Ei\n" "&Tallenna kaikki\n" "T&uhoa kaikki\n" "&Peru" -#: ../message.c:3058 -msgid "E766: Insufficient arguments for printf()" -msgstr "E766: printf():lle ei annettu tarpeeksi argumentteja" - -#: ../message.c:3119 -msgid "E807: Expected Float argument for printf()" -msgstr "E807: Odotettiin Float-argumenttia printf():lle" - -#: ../message.c:3873 -msgid "E767: Too many arguments to printf()" -msgstr "E767: printf():lle annettiin liikaa argumentteja" - -#: ../misc1.c:2256 msgid "W10: Warning: Changing a readonly file" msgstr "W10: Varoitus: Muutetaan kirjoitussuojattua tiedostoa" -#: ../misc1.c:2537 msgid "Type number and or click with mouse (empty cancels): " -msgstr "Kirjoita numero ja tai valitse hiirell (tyhj peruu): " +msgstr "Kirjoita numero ja tai valitse hiirellä (tyhjä peruu): " -#: ../misc1.c:2539 msgid "Type number and (empty cancels): " -msgstr "Valitse numero ja (tyhj peruu): " +msgstr "Valitse numero ja (tyhjä peruu): " -#: ../misc1.c:2585 msgid "1 more line" -msgstr "1 rivi lis" +msgstr "1 rivi lisää" -#: ../misc1.c:2588 msgid "1 line less" -msgstr "1 rivi vhemmn" +msgstr "1 rivi vähemmän" -#: ../misc1.c:2593 -#, c-format -msgid "% more lines" -msgstr "% rivi lis" +#, fuzzy, c-format +#~ msgid "% more lines" +#~ msgstr "%ld riviä lisää" -#: ../misc1.c:2596 -#, c-format -msgid "% fewer lines" -msgstr "% rivi vhemmn" +#, fuzzy, c-format +#~ msgid "% fewer lines" +#~ msgstr "%ld riviä vähemmän" -#: ../misc1.c:2599 msgid " (Interrupted)" msgstr " (Keskeytetty)" -#: ../misc1.c:2635 msgid "Beep!" msgstr "Piip!" -#: ../misc2.c:738 #, c-format msgid "Calling shell to execute: \"%s\"" msgstr "Kutsutaan kuorta suorittamaan: %s" -#: ../normal.c:183 +#, c-format +#~ msgid "Invalid channel \"%\"" +#~ msgstr "" + +#~ msgid "Message is not an array" +#~ msgstr "" + +#, fuzzy +#~ msgid "Message is empty" +#~ msgstr "Viesti" + +#~ msgid "Message type must be an integer" +#~ msgstr "" + +#, fuzzy +#~ msgid "Unknown message type" +#~ msgstr "E574: Tuntematon rekisterityyppi %d" + +#~ msgid "Request array size should be 4 (request) or 3 (notification)" +#~ msgstr "" + +#~ msgid "ID must be a positive integer" +#~ msgstr "" + +#~ msgid "Method must be a string" +#~ msgstr "" + +#, fuzzy +#~ msgid "Parameters must be an array" +#~ msgstr "merkin nimen pitää olla yksi merkki" + +#. +#. * nv_*(): functions called to handle Normal and Visual mode commands. +#. * n_*(): functions called to handle Normal mode commands. +#. * v_*(): functions called to handle Visual mode commands. +#. msgid "E349: No identifier under cursor" msgstr "E349: Ei tunnistetta osoittimen alla" -#: ../normal.c:1866 msgid "E774: 'operatorfunc' is empty" -msgstr "E774: operatorfunc on tyhj" +msgstr "E774: operatorfunc on tyhjä" -#: ../normal.c:2637 msgid "Warning: terminal cannot highlight" msgstr "Varoitus: terminaalista puuttuu korostus" -#: ../normal.c:2807 msgid "E348: No string under cursor" msgstr "E348: Ei merkkijonoa kursorin alla" -#: ../normal.c:3937 msgid "E352: Cannot erase folds with current 'foldmethod'" -msgstr "E352: taitoksia ei voi poistaa tll foldmethodilla" +msgstr "E352: taitoksia ei voi poistaa tällä foldmethodilla" -#: ../normal.c:5897 msgid "E664: changelist is empty" -msgstr "E664: muutoslista on tyhj" +msgstr "E664: muutoslista on tyhjä" -#: ../normal.c:5899 msgid "E662: At start of changelist" msgstr "E662: Muutoslistan alussa" -#: ../normal.c:5901 msgid "E663: At end of changelist" msgstr "E663: Muutoslistan lopussa" -#: ../normal.c:7053 -msgid "Type :quit to exit Nvim" -msgstr "Komento :quit lopettaa Vimin" +#, fuzzy +#~ msgid "Type :quit to exit Nvim" +#~ msgstr "Komento :quit lopettaa Vimin" -#: ../ops.c:248 #, c-format msgid "1 line %sed 1 time" -msgstr "1 rivi %s kerran" +msgstr "1 riviä %s kerran" -#: ../ops.c:250 #, c-format msgid "1 line %sed %d times" -msgstr "1 rivi %s %d kertaa" +msgstr "1 riviä %s %d kertaa" -#: ../ops.c:253 -#, c-format -msgid "% lines %sed 1 time" -msgstr "% rivi %s kerran" +#, fuzzy, c-format +#~ msgid "% lines %sed 1 time" +#~ msgstr "%ld riviä %s kerran" -#: ../ops.c:256 -#, c-format -msgid "% lines %sed %d times" -msgstr "% rivi %s %d kertaa" +#, fuzzy, c-format +#~ msgid "% lines %sed %d times" +#~ msgstr "%ld riviä %s %d kertaa" -#: ../ops.c:592 -#, c-format -msgid "% lines to indent... " -msgstr "% rivi sisennettvn..." +#, fuzzy, c-format +#~ msgid "% lines to indent... " +#~ msgstr "%ld riviä sisennettävänä..." -#: ../ops.c:634 msgid "1 line indented " msgstr "1 rivi sisennetty " -#: ../ops.c:636 -#, c-format -msgid "% lines indented " -msgstr "% rivi sisennetty " +#, fuzzy, c-format +#~ msgid "% lines indented " +#~ msgstr "%ld riviä sisennetty " -#: ../ops.c:938 msgid "E748: No previously used register" -msgstr "E748: Ei aiemmin kytettyj rekisterej" +msgstr "E748: Ei aiemmin käytettyjä rekisterejä" -#. must display the prompt -#: ../ops.c:1433 -msgid "cannot yank; delete anyway" -msgstr "Ei voi kopioida; poista joka tapauksessa" - -#: ../ops.c:1929 msgid "1 line changed" msgstr "1 rivi muuttui" -#: ../ops.c:1931 -#, c-format -msgid "% lines changed" -msgstr "% rivi muuttui" +#, fuzzy, c-format +#~ msgid "% lines changed" +#~ msgstr "%ld riviä muuttui" -#: ../ops.c:2521 msgid "block of 1 line yanked" msgstr "1 rivin lohko kopioitu" -#: ../ops.c:2523 msgid "1 line yanked" msgstr "1 rivi kopioitu" -#: ../ops.c:2525 -#, c-format -msgid "block of % lines yanked" -msgstr "lohko % rivilt kopioitu" +#, fuzzy, c-format +#~ msgid "block of % lines yanked" +#~ msgstr "lohko %ld riviltä kopioitu" -#: ../ops.c:2528 -#, c-format -msgid "% lines yanked" -msgstr "% rivi kopioitu" +#, fuzzy, c-format +#~ msgid "% lines yanked" +#~ msgstr "%ld riviä kopioitu" -#: ../ops.c:2710 #, c-format msgid "E353: Nothing in register %s" -msgstr "E353: Rekisteriss %s ei ole mitn" +msgstr "E353: Rekisterissä %s ei ole mitään" #. Highlight title -#: ../ops.c:3185 msgid "" "\n" "--- Registers ---" @@ -4502,207 +4112,142 @@ msgstr "" "\n" "--- Rekisterit ---" -#: ../ops.c:4455 -msgid "Illegal register name" -msgstr "Virheellinen rekisterin nimi" - -#: ../ops.c:4533 msgid "" -"\n" -"# Registers:\n" +"E883: search pattern and expression register may not contain two or more " +"lines" msgstr "" -"\n" -"# Rekisterit:\n" +"E883: hakulauseke- ja -ilmausrekisteri ei voi sisältää kahta tai useampaa " +"riviä" -#: ../ops.c:4575 -#, c-format -msgid "E574: Unknown register type %d" -msgstr "E574: Tuntematon rekisterityyppi %d" +#, fuzzy, c-format +#~ msgid "% Cols; " +#~ msgstr "%ld saraketta, " -#: ../ops.c:5089 -#, c-format -msgid "% Cols; " -msgstr "% saraketta, " - -#: ../ops.c:5097 -#, c-format +#, fuzzy, c-format msgid "" "Selected %s% of % Lines; % of % Words; " "% of % Bytes" -msgstr "" -"Valittu %s%/% rivi, %/% sanaa, %/" -"% tavua" +msgstr "Valittu %s%ld/%ld riviä, %lld/%lld sanaa, %lld/%lld tavua" -#: ../ops.c:5105 -#, c-format +#, fuzzy, c-format msgid "" "Selected %s% of % Lines; % of % Words; " "% of % Chars; % of % Bytes" msgstr "" -"Valittu %s%/% rivi, %/% sanaa, %/" -"% merkki, %/% tavua" +"Valittu %s%ld/%ld riviä, %lld/%lld sanaa, %lld/%lld merkkiä, %lld/%lld tavua" -#: ../ops.c:5123 -#, c-format +#, fuzzy, c-format msgid "" "Col %s of %s; Line % of %; Word % of %; Byte " "% of %" -msgstr "" -"Sarake %s/%s, Rivi %/%, sana %/%, tavu " -"%/%" +msgstr "Sarake %s/%s, Rivi %ld/%ld, sana %lld/%lld, tavu %lld/%lld" -#: ../ops.c:5133 -#, c-format +#, fuzzy, c-format msgid "" "Col %s of %s; Line % of %; Word % of %; Char " "% of %; Byte % of %" msgstr "" -"Sarake %s/%s, rivi %/%, sana %/%, merkki " -"%/%, tavu %/%" +"Sarake %s/%s, rivi %ld/%ld, sana %lld/%lld, merkki %lld/%lld, tavu %lld/%lld" # Unicode Byte Order Mark -#: ../ops.c:5146 -#, c-format -msgid "(+% for BOM)" -msgstr "(+% BOMista)" - -#: ../option.c:1238 -msgid "%<%f%h%m%=Page %N" -msgstr "%<%f%h%m%=Sivu %N" - -#: ../option.c:1574 -msgid "Thanks for flying Vim" -msgstr "Kiitos ett ajoit Vimi" +#, fuzzy, c-format +#~ msgid "(+% for BOM)" +#~ msgstr "(+%ld BOMista)" #. found a mismatch: skip -#: ../option.c:2698 msgid "E518: Unknown option" msgstr "E518: Tuntematon asetus" -#: ../option.c:2709 -msgid "E519: Option not supported" -msgstr "E519: Asetusta ei tueta" - -#: ../option.c:2740 msgid "E520: Not allowed in a modeline" -msgstr "E520: Ei sallitu modeline-rivill" +msgstr "E520: Ei sallitu modeline-rivillä" -#: ../option.c:2815 msgid "E846: Key code not set" -msgstr "" +msgstr "E846: Avainkoodi puuttuu" -#: ../option.c:2924 msgid "E521: Number required after =" -msgstr "E521: =:n jlkeen tarvitaan luku" +msgstr "E521: =:n jälkeen tarvitaan luku" -#: ../option.c:3226 ../option.c:3864 -msgid "E522: Not found in termcap" -msgstr "E522: Puuttuu termcapista" - -#: ../option.c:3335 #, c-format msgid "E539: Illegal character <%s>" msgstr "E539: Virheellinen merkki <%s>" -#: ../option.c:3862 -msgid "E529: Cannot set 'term' to empty string" -msgstr "E529: Termi ei voi asettaa tyhjksi merkkijonoksi" +#, c-format +msgid "For option %s" +msgstr "Asetukselle %s" -#: ../option.c:3885 msgid "E589: 'backupext' and 'patchmode' are equal" msgstr "E589: backupext ja patchmod ovat samat" -#: ../option.c:3964 msgid "E834: Conflicts with value of 'listchars'" msgstr "E834: listcharsin arvoissa on ristiriitoja" -#: ../option.c:3966 msgid "E835: Conflicts with value of 'fillchars'" msgstr "E835: fillcharsin arvossa on ristiriitoja" -#: ../option.c:4163 msgid "E524: Missing colon" msgstr "E524: Kaksoispiste puuttuu" -#: ../option.c:4165 msgid "E525: Zero length string" msgstr "E525: Nollan pituinen merkkijono" -#: ../option.c:4220 #, c-format msgid "E526: Missing number after <%s>" -msgstr "E526: Lukuarvo puuttuu merkkijonon <%s> jlkeen" +msgstr "E526: Lukuarvo puuttuu merkkijonon <%s> jälkeen" -#: ../option.c:4232 msgid "E527: Missing comma" msgstr "E527: Pilkku puuttuu" -#: ../option.c:4239 msgid "E528: Must specify a ' value" -msgstr "E528: '-arvo pit antaa" +msgstr "E528: '-arvo pitää antaa" -#: ../option.c:4271 msgid "E595: contains unprintable or wide character" -msgstr "E595: Sislt tulostumattomia tai leveit merkkej" +msgstr "E595: Sisältää tulostumattomia tai leveitä merkkejä" -#: ../option.c:4469 #, c-format msgid "E535: Illegal character after <%c>" -msgstr "E535: Virheellinen merkki merkin <%c> jlkeen" +msgstr "E535: Virheellinen merkki merkin <%c> jälkeen" -#: ../option.c:4534 msgid "E536: comma required" msgstr "E536: pilkku puuttuu" -#: ../option.c:4543 #, c-format msgid "E537: 'commentstring' must be empty or contain %s" -msgstr "E537: commentstringin pit olla tyhj tai sislt %s" +msgstr "E537: commentstringin pitää olla tyhjä tai sisältää %s" -#: ../option.c:4928 msgid "E540: Unclosed expression sequence" msgstr "E540: Sulkematon lausekesarja" -#: ../option.c:4932 msgid "E541: too many items" msgstr "E541: liikaa kohteita" -#: ../option.c:4934 msgid "E542: unbalanced groups" -msgstr "E542: eptasapainoisia ryhmi" +msgstr "E542: epätasapainoisia ryhmiä" -#: ../option.c:5148 msgid "E590: A preview window already exists" msgstr "E590: Esikatseluikkuna on jo olemassa" -#: ../option.c:5311 msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'" -msgstr "W17: Arabialle pit olla UTF-8:aa, aseta :set encoding=utf-8" +msgstr "W17: Arabialle pitää olla UTF-8:aa, aseta :set encoding=utf-8" -#: ../option.c:5623 #, c-format msgid "E593: Need at least %d lines" -msgstr "E593: Tarvitaan ainakin %d rivi" +msgstr "E593: Tarvitaan ainakin %d riviä" -#: ../option.c:5631 #, c-format msgid "E594: Need at least %d columns" msgstr "E594: Tarvitaan ainakin %d saraketta" -#: ../option.c:6011 #, c-format msgid "E355: Unknown option: %s" msgstr "E355: Tuntematon asetus: %s" #. There's another character after zeros or the string -#. * is empty. In both cases, we are trying to set a -#. * num option using a string. -#: ../option.c:6037 +#. is empty. In both cases, we are trying to set a +#. num option using a string. #, c-format msgid "E521: Number required: &%s = '%s'" msgstr "E521: tarvitaan luku: &%s = '%s'" -#: ../option.c:6149 msgid "" "\n" "--- Terminal codes ---" @@ -4710,7 +4255,6 @@ msgstr "" "\n" "--- Terminaalikoodit ---" -#: ../option.c:6151 msgid "" "\n" "--- Global option values ---" @@ -4718,7 +4262,6 @@ msgstr "" "\n" "--- Globaalit asetukset ---" -#: ../option.c:6153 msgid "" "\n" "--- Local option values ---" @@ -4726,7 +4269,6 @@ msgstr "" "\n" "--- Paikalliset asetukset ---" -#: ../option.c:6155 msgid "" "\n" "--- Options ---" @@ -4734,29 +4276,24 @@ msgstr "" "\n" "--- Asetukset ---" -#: ../option.c:6816 msgid "E356: get_varp ERROR" msgstr "E356: get_varp-virhe" -#: ../option.c:7696 #, c-format msgid "E357: 'langmap': Matching character missing for %s" -msgstr "E357: langmap: Merkkiin %s tsmv merkki puuttuu" +msgstr "E357: langmap: Merkkiin %s täsmäävä merkki puuttuu" -#: ../option.c:7715 #, c-format msgid "E358: 'langmap': Extra characters after semicolon: %s" -msgstr "E358: langmap: ylimrisi merkkej puolipisteen jlkeen: %s" +msgstr "E358: langmap: ylimääräisiä merkkejä puolipisteen jälkeen: %s" -#: ../os/shell.c:194 -msgid "" -"\n" -"Cannot execute shell " -msgstr "" -"\n" -"Kuoren suoritus ei onnistu " +#, c-format +msgid "dlerror = \"%s\"" +msgstr "dlerror = %s" + +msgid "Vim: Error reading input, exiting...\n" +msgstr "Vim: Virhe luettaessa syötettä, poistutaan...\n" -#: ../os/shell.c:439 msgid "" "\n" "shell returned " @@ -4764,8 +4301,18 @@ msgstr "" "\n" "kuoren palautusarvo " -# mik security context? -#: ../os_unix.c:465 ../os_unix.c:471 +#~ msgid "" +#~ "\n" +#~ "shell failed to start: " +#~ msgstr "" + +#. Can happen if system() tries to send input to a shell command that was +#. backgrounded (:call system("cat - &", "foo")). #3529 #5241 +#, fuzzy, c-format +#~ msgid "E5677: Error writing input to shell-command: %s" +#~ msgstr "E677: Väliaikaistiedostoon kirjoittaminen ei onnistunut" + +# mikä security context? msgid "" "\n" "Could not get security context for " @@ -4773,7 +4320,6 @@ msgstr "" "\n" "Ei saatu turvallisuuskontekstia kohteelle " -#: ../os_unix.c:479 msgid "" "\n" "Could not set security context for " @@ -4781,947 +4327,897 @@ msgstr "" "\n" "Ei voitu asettaa turvallisuuskontekstia kohteelle " -#: ../os_unix.c:1558 ../os_unix.c:1647 -#, c-format -msgid "dlerror = \"%s\"" -msgstr "dlerror = %s" - -#: ../path.c:1449 #, c-format msgid "E447: Can't find file \"%s\" in path" -msgstr "E447: Tiedosto %s ei lydy polulta" +msgstr "E447: Tiedosto %s ei löydy polulta" -#: ../quickfix.c:359 #, c-format msgid "E372: Too many %%%c in format string" msgstr "E372: Liikaa %%%c-juttuja muotoilumerkkijonossa" -#: ../quickfix.c:371 #, c-format msgid "E373: Unexpected %%%c in format string" msgstr "E373: Odottamaton %%%c muotoilumerkkijonossa" -#: ../quickfix.c:420 msgid "E374: Missing ] in format string" msgstr "E374: ] puuttuu muotoilemerkkijonosta" -#: ../quickfix.c:431 #, c-format msgid "E375: Unsupported %%%c in format string" msgstr "E375: Tukematon %%%c muotoilumerkkijonossa" -#: ../quickfix.c:448 #, c-format msgid "E376: Invalid %%%c in format string prefix" msgstr "E376: Virheellinen %%%c muotoilumerkkijonon alussa" -#: ../quickfix.c:454 #, c-format msgid "E377: Invalid %%%c in format string" msgstr "E377: Virheellinen %%%c muotoilumerkkijonossa" #. nothing found -#: ../quickfix.c:477 msgid "E378: 'errorformat' contains no pattern" msgstr "E378: errorformatissa ei ole kuvioita" -#: ../quickfix.c:695 msgid "E379: Missing or empty directory name" -msgstr "E379: Puuttuva tai tyhj hakemiston nimi" +msgstr "E379: Puuttuva tai tyhjä hakemiston nimi" -#: ../quickfix.c:1305 msgid "E553: No more items" -msgstr "E553: Ei en kohteita" +msgstr "E553: Ei enää kohteita" + +msgid "E924: Current window was closed" +msgstr "E924: Nykyinen ikkuna on suljettu" + +msgid "E925: Current quickfix was changed" +msgstr "E925: Nykyinen quickfix on muuttunut" + +msgid "E926: Current location list was changed" +msgstr "E926: Nykyinen sijaintiluettelo on muuttunut" -#: ../quickfix.c:1674 #, c-format msgid "(%d of %d)%s%s: " msgstr "(%d/%d)%s%s: " -#: ../quickfix.c:1676 msgid " (line deleted)" msgstr " (rivi poistettu)" -#: ../quickfix.c:1863 +#, c-format +msgid "%serror list %d of %d; %d errors " +msgstr "%svirhelista %d/%d, %d virhettä" + msgid "E380: At bottom of quickfix stack" msgstr "E380: quickfix-pinon pohjalla" -#: ../quickfix.c:1869 msgid "E381: At top of quickfix stack" msgstr "E381: quickfix-pinon huipulla" -#: ../quickfix.c:1880 -#, c-format -msgid "error list %d of %d; %d errors" -msgstr "virhelista %d/%d, %d virhett" +msgid "No entries" +msgstr "Ei kenttiä" -#: ../quickfix.c:2427 msgid "E382: Cannot write, 'buftype' option is set" msgstr "E382: Ei voi kirjoittaa, buftype asetettu" -#: ../quickfix.c:2812 msgid "E683: File name missing or invalid pattern" msgstr "E683: Tiedostonimi puuttuu tai kuvio on viallinen" -#: ../quickfix.c:2911 #, c-format msgid "Cannot open file \"%s\"" msgstr "Tiedostoa %s ei voi avata" -#: ../quickfix.c:3429 msgid "E681: Buffer is not loaded" msgstr "E681: Puskuria ei ole ladattu" -#: ../quickfix.c:3487 msgid "E777: String or List expected" -msgstr "E777: Pit olla merkkijono tai lista" +msgstr "E777: Pitää olla merkkijono tai lista" -#: ../regexp.c:359 #, c-format msgid "E369: invalid item in %s%%[]" msgstr "E369: virheellinen olio kohdassa %s%%[]" -#: ../regexp.c:374 #, c-format msgid "E769: Missing ] after %s[" -msgstr "E769: ] puuttuu merkinnn %s[ jljest" +msgstr "E769: ] puuttuu merkinnän %s[ jäljestä" -#: ../regexp.c:375 #, c-format msgid "E53: Unmatched %s%%(" msgstr "E53: Pariton %s%%(" -#: ../regexp.c:376 #, c-format msgid "E54: Unmatched %s(" msgstr "E54: Pariton %s(" -#: ../regexp.c:377 #, c-format msgid "E55: Unmatched %s)" msgstr "E55: Pariton %s)" -#: ../regexp.c:378 msgid "E66: \\z( not allowed here" -msgstr "E66: \\z( ei ole sallittu tss" +msgstr "E66: \\z( ei ole sallittu tässä" -#: ../regexp.c:379 msgid "E67: \\z1 et al. not allowed here" -msgstr "E67: \\z1 jne. ei ole sallittu tss" +msgstr "E67: \\z1 jne. ei ole sallittu tässä" -#: ../regexp.c:380 #, c-format msgid "E69: Missing ] after %s%%[" -msgstr "E69: ] puuttuu merkinnn %s%%[ jljest" +msgstr "E69: ] puuttuu merkinnän %s%%[ jäljestä" -#: ../regexp.c:381 #, c-format msgid "E70: Empty %s%%[]" -msgstr "E70: Tyhj %s%%[]" +msgstr "E70: Tyhjä %s%%[]" -#: ../regexp.c:1209 ../regexp.c:1224 msgid "E339: Pattern too long" -msgstr "E339: Liian pitk kuvio" +msgstr "E339: Liian pitkä kuvio" -#: ../regexp.c:1371 msgid "E50: Too many \\z(" -msgstr "E50: Liikaa merkkej \\z(" +msgstr "E50: Liikaa merkkejä \\z(" -#: ../regexp.c:1378 #, c-format msgid "E51: Too many %s(" -msgstr "E51: Liikaa merkkej %s(" +msgstr "E51: Liikaa merkkejä %s(" -#: ../regexp.c:1427 msgid "E52: Unmatched \\z(" msgstr "E52: Pariton \\z(" -#: ../regexp.c:1637 #, c-format msgid "E59: invalid character after %s@" -msgstr "E59: virheellinen merkki kohdan %s@ jlkeen" +msgstr "E59: virheellinen merkki kohdan %s@ jälkeen" -#: ../regexp.c:1672 #, c-format msgid "E60: Too many complex %s{...}s" msgstr "E60: Liikaa monimutkaisia ilmauksia %s{...}s" -#: ../regexp.c:1687 #, c-format msgid "E61: Nested %s*" -msgstr "E61: Siskkistetty %s*" +msgstr "E61: Sisäkkäistetty %s*" -#: ../regexp.c:1690 #, c-format msgid "E62: Nested %s%c" -msgstr "E62: Siskkistetty %s%c" +msgstr "E62: Sisäkkäistetty %s%c" -#: ../regexp.c:1800 msgid "E63: invalid use of \\_" -msgstr "E63: vrinkytetty \\_" +msgstr "E63: väärinkäytetty \\_" -#: ../regexp.c:1850 #, c-format msgid "E64: %s%c follows nothing" -msgstr "E64: %s%c jlkeen ei minkn" +msgstr "E64: %s%c jälkeen ei minkään" -#: ../regexp.c:1902 msgid "E65: Illegal back reference" -msgstr "E65: Virheellinen tsmysviittaus" +msgstr "E65: Virheellinen täsmäysviittaus" -#: ../regexp.c:1943 msgid "E68: Invalid character after \\z" -msgstr "E68: Virheellinen merkki ilmauksen \\z jlkeen" +msgstr "E68: Virheellinen merkki ilmauksen \\z jälkeen" -#: ../regexp.c:2049 ../regexp_nfa.c:1296 #, c-format msgid "E678: Invalid character after %s%%[dxouU]" -msgstr "E678: Virheellinen merkki merkinnn %s%%[dxouU] jljess" +msgstr "E678: Virheellinen merkki merkinnän %s%%[dxouU] jäljessä" -#: ../regexp.c:2107 #, c-format msgid "E71: Invalid character after %s%%" -msgstr "E71: Virheellinen merkki merkinnn %s%% jljess" +msgstr "E71: Virheellinen merkki merkinnän %s%% jäljessä" + +#, c-format +msgid "E888: (NFA regexp) cannot repeat %s" +msgstr "E888: (NFA-säänn. ilmaus) ei voi toistaa kohdetta %s" -#: ../regexp.c:3017 #, c-format msgid "E554: Syntax error in %s{...}" msgstr "E554: Syntaksivirhe ilmauksessa %s{...}" -#: ../regexp.c:3805 msgid "External submatches:\n" -msgstr "Ulkoisia alitsmyksi:\n" +msgstr "Ulkoisia alitäsmäyksiä:\n" -#: ../regexp.c:7022 msgid "" "E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be " "used " msgstr "" +"E864: \\%#=-merkkien perään voi tulla vain 0, 1 tai 2. Käytetään " +"automaattista engineä " -#: ../regexp_nfa.c:239 -msgid "E865: (NFA) Regexp end encountered prematurely" -msgstr "" +msgid "Switching to backtracking RE engine for pattern: " +msgstr "Vaihdetaan käyttämään backtrackkaavaa RE-engineä ilmaukselle: " -#: ../regexp_nfa.c:240 -#, c-format -msgid "E866: (NFA regexp) Misplaced %c" -msgstr "" - -#: ../regexp_nfa.c:242 -#, c-format -msgid "E877: (NFA regexp) Invalid character class: %" -msgstr "" - -#: ../regexp_nfa.c:1261 -#, c-format -msgid "E867: (NFA) Unknown operator '\\z%c'" -msgstr "" - -#: ../regexp_nfa.c:1387 -#, c-format -msgid "E867: (NFA) Unknown operator '\\%%%c'" -msgstr "" - -#: ../regexp_nfa.c:1802 -#, c-format -msgid "E869: (NFA) Unknown operator '\\@%c'" -msgstr "" - -#: ../regexp_nfa.c:1831 -msgid "E870: (NFA regexp) Error reading repetition limits" -msgstr "" - -#. Can't have a multi follow a multi. -#: ../regexp_nfa.c:1895 -msgid "E871: (NFA regexp) Can't have a multi follow a multi !" -msgstr "" - -#. Too many `(' -#: ../regexp_nfa.c:2037 -msgid "E872: (NFA regexp) Too many '('" -msgstr "" - -#: ../regexp_nfa.c:2042 -#, fuzzy -msgid "E879: (NFA regexp) Too many \\z(" -msgstr "E50: Liikaa merkkej \\z(" - -#: ../regexp_nfa.c:2066 -msgid "E873: (NFA regexp) proper termination error" -msgstr "" - -#: ../regexp_nfa.c:2599 -msgid "E874: (NFA) Could not pop the stack !" -msgstr "" - -#: ../regexp_nfa.c:3298 -msgid "" -"E875: (NFA regexp) (While converting from postfix to NFA), too many states " -"left on stack" -msgstr "" - -#: ../regexp_nfa.c:3302 -msgid "E876: (NFA regexp) Not enough space to store the whole NFA " -msgstr "" - -#: ../regexp_nfa.c:4571 ../regexp_nfa.c:4869 -msgid "" -"Could not open temporary log file for writing, displaying on stderr ... " -msgstr "" - -#: ../regexp_nfa.c:4840 -#, c-format -msgid "(NFA) COULD NOT OPEN %s !" -msgstr "" - -#: ../regexp_nfa.c:6049 -#, fuzzy -msgid "Could not open temporary log file for writing " -msgstr "E828: Kumoustiedoston avaus kirjoittamista varten ei onnistu: %s" +#~ msgid " TERMINAL" +#~ msgstr "" # tiloja -#: ../screen.c:7435 msgid " VREPLACE" msgstr " VKORVAUS" -#: ../screen.c:7437 msgid " REPLACE" msgstr " KORVAUS" -#: ../screen.c:7440 msgid " REVERSE" -msgstr " KNTEIS" +msgstr " KÄÄNTEIS" -#: ../screen.c:7441 msgid " INSERT" -msgstr " SYTT" +msgstr " SYÖTTÖ" -#: ../screen.c:7443 msgid " (insert)" -msgstr " (sytt)" +msgstr " (syöttö)" -#: ../screen.c:7445 msgid " (replace)" msgstr " (korvaus)" -#: ../screen.c:7447 msgid " (vreplace)" msgstr " (vkorvaus)" -#: ../screen.c:7449 msgid " Hebrew" msgstr " Heprea" -#: ../screen.c:7454 msgid " Arabic" msgstr " Arabia" -#: ../screen.c:7456 -msgid " (lang)" -msgstr " (kieli)" - -#: ../screen.c:7459 msgid " (paste)" msgstr " (liitos)" -#: ../screen.c:7469 msgid " VISUAL" msgstr " VALINTA" -#: ../screen.c:7470 msgid " VISUAL LINE" msgstr " VALINTARIVI" -#: ../screen.c:7471 msgid " VISUAL BLOCK" msgstr " VALINTALOHKO" -#: ../screen.c:7472 msgid " SELECT" msgstr " WALINTA" -#: ../screen.c:7473 msgid " SELECT LINE" msgstr " WALINTARIVI" -#: ../screen.c:7474 msgid " SELECT BLOCK" msgstr " WALINTALOHKO" -#: ../screen.c:7486 ../screen.c:7541 msgid "recording" msgstr "tallennetaan" -#: ../search.c:487 #, c-format msgid "E383: Invalid search string: %s" msgstr "E383: Viallinen hakujono: %s" -#: ../search.c:832 #, c-format msgid "E384: search hit TOP without match for: %s" -msgstr "E384: Haku psi alkuun lytmtt jonoa: %s" +msgstr "E384: Haku pääsi alkuun löytämättä jonoa: %s" -#: ../search.c:835 #, c-format msgid "E385: search hit BOTTOM without match for: %s" -msgstr "E385: Haku psi loppuun lytmtt jonoa: %s" +msgstr "E385: Haku pääsi loppuun löytämättä jonoa: %s" -#: ../search.c:1200 msgid "E386: Expected '?' or '/' after ';'" -msgstr "E386: ;:n jlkeen pit olla ? tai /" +msgstr "E386: ;:n jälkeen pitää olla ? tai /" -#: ../search.c:4085 msgid " (includes previously listed match)" -msgstr " (sislt viimeksi luetellun tsmyksen)" +msgstr " (sisältää viimeksi luetellun täsmäyksen)" #. cursor at status line -#: ../search.c:4104 msgid "--- Included files " -msgstr "--- Sisllytetyt tiedostot " +msgstr "--- Sisällytetyt tiedostot " -#: ../search.c:4106 msgid "not found " -msgstr "ei lytynyt " +msgstr "ei löytynyt " -#: ../search.c:4107 msgid "in path ---\n" msgstr "polusta ---\n" -#: ../search.c:4168 msgid " (Already listed)" msgstr " (Jo lueteltu)" -#: ../search.c:4170 msgid " NOT FOUND" -msgstr " EI LYTYNYT" +msgstr " EI LÖYTYNYT" -#: ../search.c:4211 #, c-format msgid "Scanning included file: %s" -msgstr "Haku sislsi tiedoston: %s" +msgstr "Haku sisälsi tiedoston: %s" -#: ../search.c:4216 #, c-format msgid "Searching included file %s" -msgstr "Haku sislsi tiedoston %s" +msgstr "Haku sisälsi tiedoston %s" -#: ../search.c:4405 msgid "E387: Match is on current line" -msgstr "E387: Tsmys tll rivill" +msgstr "E387: Täsmäys tällä rivillä" -#: ../search.c:4517 msgid "All included files were found" -msgstr "Kaikki sisllytetyt rivit lytyivt" +msgstr "Kaikki sisällytetyt rivit löytyivät" -#: ../search.c:4519 msgid "No included files" -msgstr "Ei sisllytettyj tiedostoja" +msgstr "Ei sisällytettyjä tiedostoja" -#: ../search.c:4527 msgid "E388: Couldn't find definition" -msgstr "E388: Mritelm ei lydy" +msgstr "E388: Määritelmä ei löydy" -#: ../search.c:4529 msgid "E389: Couldn't find pattern" -msgstr "E389: kuvio ei lydy" +msgstr "E389: kuvio ei löydy" -#: ../search.c:4668 -msgid "Substitute " -msgstr "Korvaa " +#~ msgid "too few bytes read" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "System error while skipping in ShaDa file: %s" +#~ msgstr "E782: virhe luettaessa .sug-tiedostoa: %s" -#: ../search.c:4681 #, c-format -msgid "" -"\n" -"# Last %sSearch Pattern:\n" -"~" -msgstr "" -"\n" -"# Edellinen %sHakulauseke:\n" -"~" +#~ msgid "" +#~ "Error while reading ShaDa file: last entry specified that it occupies " +#~ "% bytes, but file ended earlier" +#~ msgstr "" -#: ../spell.c:951 -msgid "E759: Format error in spell file" -msgstr "E759: Muotoiluvirhe oikolukutiedostossa" +#, fuzzy, c-format +#~ msgid "System error while closing ShaDa file: %s" +#~ msgstr "E782: virhe luettaessa .sug-tiedostoa: %s" -#: ../spell.c:952 -msgid "E758: Truncated spell file" -msgstr "E758: Oikolukutiedosto katkaistu" +#, fuzzy, c-format +#~ msgid "System error while writing ShaDa file: %s" +#~ msgstr "E782: virhe luettaessa .sug-tiedostoa: %s" + +#, fuzzy, c-format +#~ msgid "Reading ShaDa file \"%s\"%s%s%s" +#~ msgstr "Luetaan viminfo-tiedostoa \"%s\"%s%s%s" + +msgid " info" +msgstr " info" + +msgid " marks" +msgstr " merkit" + +msgid " oldfiles" +msgstr " vanhaatiedostoa" + +msgid " FAILED" +msgstr " EPÄONNISTUI" -#: ../spell.c:953 #, c-format -msgid "Trailing text in %s line %d: %s" -msgstr "Teksti rivin perss tiedostossa %s rivill %d: %s" +#~ msgid "System error while opening ShaDa file %s for reading: %s" +#~ msgstr "" + +#~ msgid "additional elements of ShaDa " +#~ msgstr "" + +#~ msgid "additional data of ShaDa " +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "Failed to write variable %s" +#~ msgstr "ei voitu vaihtaa puskuriin %d" -#: ../spell.c:954 #, c-format -msgid "Affix name too long in %s line %d: %s" -msgstr "Affiksin nimi on liian pitk tiedostossa %s rivill %d: %s" +#~ msgid "" +#~ "Failed to parse ShaDa file due to a msgpack parser error at position " +#~ "%" +#~ msgstr "" -#: ../spell.c:955 -msgid "E761: Format error in affix file FOL, LOW or UPP" -msgstr "E761: Affiksitiedoston FOL-, LOW- tai UPP-muotovirhe " +#, c-format +#~ msgid "" +#~ "Failed to parse ShaDa file: incomplete msgpack string at position %" +#~ msgstr "" -#: ../spell.c:957 -msgid "E762: Character in FOL, LOW or UPP is out of range" -msgstr "E762: Merkki FOL:ss, LOW:ss tai UPP:ss ei kuulu arvoalueeseen" +#, c-format +#~ msgid "" +#~ "Failed to parse ShaDa file: extra bytes in msgpack string at position " +#~ "%" +#~ msgstr "" -#: ../spell.c:958 -msgid "Compressing word tree..." -msgstr "Tiivistetn sanapuuta..." +#, c-format +#~ msgid "" +#~ "System error while opening ShaDa file %s for reading to merge before writing " +#~ "it: %s" +#~ msgstr "" + +#. Tried names from .tmp.a to .tmp.z, all failed. Something must be +#. wrong then. +#, c-format +#~ msgid "E138: All %s.tmp.X files exist, cannot write ShaDa file!" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "System error while opening temporary ShaDa file %s for writing: %s" +#~ msgstr "Väliaikaislokitiedoston avaus kirjoittamista varten ei onnistu" + +#, c-format +#~ msgid "Failed to create directory %s for writing ShaDa file: %s" +#~ msgstr "" + +#, c-format +#~ msgid "System error while opening ShaDa file %s for writing: %s" +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "Writing ShaDa file \"%s\"" +#~ msgstr "Kirjoitetaan viminfo-tiedostoa %s" + +#, fuzzy, c-format +#~ msgid "Failed setting uid and gid for file %s: %s" +#~ msgstr "Ladattu kumoustiedoto %s" + +#, fuzzy, c-format +#~ msgid "E137: ShaDa file is not writable: %s" +#~ msgstr "E137: Viminfo-tiedostoon ei voitu kirjoittaa: %s" + +#, fuzzy, c-format +#~ msgid "Can't rename ShaDa file from %s to %s!" +#~ msgstr "E886: Viminfo-tiedostoa ei voit uudelleennimetä nimelle %s" + +#, fuzzy, c-format +#~ msgid "Did not rename %s because %s does not looks like a ShaDa file" +#~ msgstr " [ei näytä Vimin swap-tiedostolta]" + +#, c-format +#~ msgid "Did not rename %s to %s because there were errors during writing it" +#~ msgstr "" + +#, c-format +#~ msgid "Do not forget to remove %s or rename it manually to %s." +#~ msgstr "" + +#, fuzzy, c-format +#~ msgid "System error while reading ShaDa file: %s" +#~ msgstr "E782: virhe luettaessa .sug-tiedostoa: %s" + +#, fuzzy, c-format +#~ msgid "System error while reading integer from ShaDa file: %s" +#~ msgstr "E782: virhe luettaessa .sug-tiedostoa: %s" + +#, c-format +#~ msgid "" +#~ "Error while reading ShaDa file: expected positive integer at position " +#~ "%, but got nothing" +#~ msgstr "" + +#, c-format +#~ msgid "" +#~ "Error while reading ShaDa file: expected positive integer at position " +#~ "%" +#~ msgstr "" + +#. kSDItemUnknown cannot possibly pass that far because it is -1 and that +#. will fail in msgpack_read_uint64. But kSDItemMissing may and it will +#. otherwise be skipped because (1 << 0) will never appear in flags. +#, c-format +#~ msgid "" +#~ "Error while reading ShaDa file: there is an item at position % that " +#~ "must not be there: Missing items are for internal uses only" +#~ msgstr "" + +#, c-format +#~ msgid "" +#~ "Error while reading ShaDa file: buffer list at position % contains " +#~ "entry that is not a dictionary" +#~ msgstr "" + +#, c-format +#~ msgid "" +#~ "Error while reading ShaDa file: buffer list at position % contains " +#~ "entry with invalid line number" +#~ msgstr "" + +#, c-format +#~ msgid "" +#~ "Error while reading ShaDa file: buffer list at position % contains " +#~ "entry with invalid column number" +#~ msgstr "" + +#, c-format +#~ msgid "" +#~ "Error while reading ShaDa file: buffer list at position % contains " +#~ "entry that does not have a file name" +#~ msgstr "" + +#. values for ts_isdiff +#. no different byte (yet) +#. different byte found +#. inserting character +#. values for ts_flags +#. already checked that prefix is OK +#. tried split at this point +#. did a delete, "ts_delidx" has index +#. special values ts_prefixdepth +#. not using prefixes +#. walking through the prefix tree +#. highest value that's not special +#. mode values for find_word +#. find word case-folded +#. find keep-case word +#. find word after prefix +#. find case-folded compound word +#. find keep-case compound word +#, fuzzy +#~ msgid "E759: Format error in spell file" +#~ msgstr "E297: Kirjoitusvirhe swap-tiedostossa" -#: ../spell.c:1951 msgid "E756: Spell checking is not enabled" -msgstr "E756: Oikaisuluku ei ole pll" +msgstr "E756: Oikaisuluku ei ole päällä" -#: ../spell.c:2249 #, c-format msgid "Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\"" -msgstr "Varoitus: Ei lydetty sanalistaa %s.%s.spl tai %s.ascii.spl" +msgstr "Varoitus: Ei löydetty sanalistaa %s.%s.spl tai %s.ascii.spl" -#: ../spell.c:2473 -#, c-format -msgid "Reading spell file \"%s\"" -msgstr "Luetaan oikaisulukutiedosta %s" - -#: ../spell.c:2496 -msgid "E757: This does not look like a spell file" -msgstr "E757: Ei vaikuta oikaisulukutiedostolta" - -#: ../spell.c:2501 -msgid "E771: Old spell file, needs to be updated" -msgstr "E771: Vanha oikaisulukutiedosto vaatii pivittmist" - -#: ../spell.c:2504 -msgid "E772: Spell file is for newer version of Vim" -msgstr "E772: Oikaisulukutiedosto on uudemmalle Vimille" - -#: ../spell.c:2602 -msgid "E770: Unsupported section in spell file" -msgstr "E770: Tukematon osio oikaisulukutiedostossa" - -#: ../spell.c:3762 +#. This is probably an error. Give a warning and +#. accept the words anyway. #, c-format msgid "Warning: region %s not supported" msgstr "Varoitus: osaa %s ei tueta" -#: ../spell.c:4550 +msgid "Sorry, no suggestions" +msgstr "ei ehdotuksia" + +#, fuzzy, c-format +#~ msgid "Sorry, only % suggestions" +#~ msgstr "vain %ld ehdotusta" + +#. for when 'cmdheight' > 1 +#. avoid more prompt +#, c-format +msgid "Change \"%.*s\" to:" +msgstr "Muuta %.*s:" + +#, c-format +msgid " < \"%.*s\"" +msgstr " < %.*s" + +msgid "E752: No previous spell replacement" +msgstr "E752: Ei edellistä oikaisulukukorjausta" + +#, c-format +msgid "E753: Not found: %s" +msgstr "E753: Ei löytynyt: %s" + +msgid "E758: Truncated spell file" +msgstr "E758: Oikolukutiedosto katkaistu" + +#, c-format +msgid "Trailing text in %s line %d: %s" +msgstr "Tekstiä rivin perässä tiedostossa %s rivillä %d: %s" + +#, c-format +msgid "Affix name too long in %s line %d: %s" +msgstr "Affiksin nimi on liian pitkä tiedostossa %s rivillä %d: %s" + +msgid "E761: Format error in affix file FOL, LOW or UPP" +msgstr "E761: Affiksitiedoston FOL-, LOW- tai UPP-muotovirhe " + +msgid "E762: Character in FOL, LOW or UPP is out of range" +msgstr "E762: Merkki FOL:ssä, LOW:ssä tai UPP:ssä ei kuulu arvoalueeseen" + +msgid "Compressing word tree..." +msgstr "Tiivistetään sanapuuta..." + +#, c-format +msgid "Reading spell file \"%s\"" +msgstr "Luetaan oikaisulukutiedosta %s" + +msgid "E757: This does not look like a spell file" +msgstr "E757: Ei vaikuta oikaisulukutiedostolta" + +#, fuzzy, c-format +#~ msgid "E5042: Failed to read spell file %s: %s" +#~ msgstr "E482: Tiedostoa %s ei voi luoda" + +msgid "E771: Old spell file, needs to be updated" +msgstr "E771: Vanha oikaisulukutiedosto vaatii päivittämistä" + +msgid "E772: Spell file is for newer version of Vim" +msgstr "E772: Oikaisulukutiedosto on uudemmalle Vimille" + +msgid "E770: Unsupported section in spell file" +msgstr "E770: Tukematon osio oikaisulukutiedostossa" + +#, c-format +msgid "E778: This does not look like a .sug file: %s" +msgstr "E778: Ei vaikuta .sug-tiedostolta: %s" + +#, c-format +msgid "E779: Old .sug file, needs to be updated: %s" +msgstr "E779: Vanha .sug-tiedosto pitää päivittää: %s" + +#, c-format +msgid "E780: .sug file is for newer version of Vim: %s" +msgstr "E780: .sug-tiedosto on uudemmalle Vimille: %s" + +#, c-format +msgid "E781: .sug file doesn't match .spl file: %s" +msgstr "E781: .sug-tiedosto ei täsmää .spl-tiedostoon: %s" + +#, c-format +msgid "E782: error while reading .sug file: %s" +msgstr "E782: virhe luettaessa .sug-tiedostoa: %s" + #, c-format msgid "Reading affix file %s ..." msgstr "Luetaan affiksitiedostoa %s..." -#: ../spell.c:4589 ../spell.c:5635 ../spell.c:6140 #, c-format msgid "Conversion failure for word in %s line %d: %s" -msgstr "Muunnosvirhe sanalle %s rivill %d: %s" +msgstr "Muunnosvirhe sanalle %s rivillä %d: %s" -#: ../spell.c:4630 ../spell.c:6170 #, c-format msgid "Conversion in %s not supported: from %s to %s" msgstr "Muunnosta kohteessa %s ei tueta: kohteesta %s kohteeseen %s" -#: ../spell.c:4642 #, c-format msgid "Invalid value for FLAG in %s line %d: %s" -msgstr "Tuntematon FLAG kohteessa %s rivill %d: %s" +msgstr "Tuntematon FLAG kohteessa %s rivillä %d: %s" -#: ../spell.c:4655 #, c-format msgid "FLAG after using flags in %s line %d: %s" -msgstr "FLAG kohteessa %s lippujen jlkeen rivill %d: %s" +msgstr "FLAG kohteessa %s lippujen jälkeen rivillä %d: %s" -#: ../spell.c:4723 #, c-format msgid "" "Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line " "%d" msgstr "" -"COMPOUNDFORBIDFLAG PFX:n jlkeen voi antaa vri tuloksia kohteessa %s " -"rivill %d" +"COMPOUNDFORBIDFLAG PFX:n jälkeen voi antaa vääriä tuloksia kohteessa %s " +"rivillä %d" -#: ../spell.c:4731 #, c-format msgid "" "Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line " "%d" msgstr "" -"COMPOUNDPERMITFLAG PFX:n jlkeen voi antaa vri tuloksia kohteessa %s " -"rivill %d" +"COMPOUNDPERMITFLAG PFX:n jälkeen voi antaa vääriä tuloksia kohteessa %s " +"rivillä %d" -#: ../spell.c:4747 #, c-format msgid "Wrong COMPOUNDRULES value in %s line %d: %s" -msgstr "Vr COMPOUNDRULES-arvo kohteessa %s rivill %d: %s" +msgstr "Väärä COMPOUNDRULES-arvo kohteessa %s rivillä %d: %s" -#: ../spell.c:4771 #, c-format msgid "Wrong COMPOUNDWORDMAX value in %s line %d: %s" -msgstr "Vr COMPOUNDWORDMAX-arvo kohteessa %s rivill %d: %s" +msgstr "Väärä COMPOUNDWORDMAX-arvo kohteessa %s rivillä %d: %s" -#: ../spell.c:4777 #, c-format msgid "Wrong COMPOUNDMIN value in %s line %d: %s" -msgstr "Vr COMPOUNDMIN-arvo kohteessa %s rivill %d: %s" +msgstr "Väärä COMPOUNDMIN-arvo kohteessa %s rivillä %d: %s" -#: ../spell.c:4783 #, c-format msgid "Wrong COMPOUNDSYLMAX value in %s line %d: %s" -msgstr "Vr COMPOUNDSYLMAX-arvo kohteessa %s rivill %d: %s" +msgstr "Väärä COMPOUNDSYLMAX-arvo kohteessa %s rivillä %d: %s" -#: ../spell.c:4795 #, c-format msgid "Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s" -msgstr "Vr CHECKCOMPOUNDPATTERN-arvo kohteessa %s rivill %d: %s" +msgstr "Väärä CHECKCOMPOUNDPATTERN-arvo kohteessa %s rivillä %d: %s" -#: ../spell.c:4847 #, c-format msgid "Different combining flag in continued affix block in %s line %d: %s" msgstr "" -"Eri yhdistelmlippu jatketussa affiksilohkossa kohteessa %s rivill %d: %s" +"Eri yhdistelmälippu jatketussa affiksilohkossa kohteessa %s rivillä %d: %s" -#: ../spell.c:4850 #, c-format msgid "Duplicate affix in %s line %d: %s" -msgstr "Kaksoiskappale affiksista kohteessa %s rivill %d: %s" +msgstr "Kaksoiskappale affiksista kohteessa %s rivillä %d: %s" -#: ../spell.c:4871 -#, c-format +#, fuzzy, c-format msgid "" -"Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST in %s " +"Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGESTin %s " "line %d: %s" msgstr "" -"Affiksia kytetty mys BAD-, RARE-, KEEPCASE-, NEEDAFFIX-, NEEDCOMPOUND- tai " -"NOSUGGEST-arvossa kohteessa %s rivill %d: %s" +"Affiksia käytetty myös BAD-, RARE-, KEEPCASE-, NEEDAFFIX-, NEEDCOMPOUND- tai " +"NOSUGGEST-arvossa kohteessa %s rivillä %d: %s" -#: ../spell.c:4893 #, c-format msgid "Expected Y or N in %s line %d: %s" -msgstr "Odotettiin Y:t tai N: kohteessa %s rivill %d: %s" +msgstr "Odotettiin Y:tä tai N:ää kohteessa %s rivillä %d: %s" -#: ../spell.c:4968 #, c-format msgid "Broken condition in %s line %d: %s" -msgstr "Viallinen ehto kohteessa %s rivill %d: %s" +msgstr "Viallinen ehto kohteessa %s rivillä %d: %s" -#: ../spell.c:5091 #, c-format msgid "Expected REP(SAL) count in %s line %d" -msgstr "Odotettiin REP(SAL)-arvoa kohteessa %s rivill %d" +msgstr "Odotettiin REP(SAL)-arvoa kohteessa %s rivillä %d" -#: ../spell.c:5120 #, c-format msgid "Expected MAP count in %s line %d" -msgstr "Odotettiin MAP-arvoa kohteessa %s rivill %d" +msgstr "Odotettiin MAP-arvoa kohteessa %s rivillä %d" -#: ../spell.c:5132 #, c-format msgid "Duplicate character in MAP in %s line %d" -msgstr "Kaksoiskappale merkist MAP:ss kohteessa %s rivill %d" +msgstr "Kaksoiskappale merkistä MAP:ssä kohteessa %s rivillä %d" -#: ../spell.c:5176 #, c-format msgid "Unrecognized or duplicate item in %s line %d: %s" -msgstr "Tunnistamaton tai kaksoiskappale arvosta kohteessa %s rivill %d: %s" +msgstr "Tunnistamaton tai kaksoiskappale arvosta kohteessa %s rivillä %d: %s" -#: ../spell.c:5197 #, c-format msgid "Missing FOL/LOW/UPP line in %s" msgstr "Puuttuva FOL, LOW tai UPP rivi kohteessa %s" -#: ../spell.c:5220 msgid "COMPOUNDSYLMAX used without SYLLABLE" msgstr "COMPOUNDSYLMAX ilman SYLLABLEa" -#: ../spell.c:5236 msgid "Too many postponed prefixes" -msgstr "Liikaa jlkikteistettyj prefiksej" +msgstr "Liikaa jälkikäteistettyjä prefiksejä" -#: ../spell.c:5238 msgid "Too many compound flags" msgstr "Liikaa yhdyssanalippuja" -#: ../spell.c:5240 msgid "Too many postponed prefixes and/or compound flags" -msgstr "Liikaa jlkikteistettyj prefiksej tai yhdyssanalippuja" +msgstr "Liikaa jälkikäteistettyjä prefiksejä tai yhdyssanalippuja" -#: ../spell.c:5250 #, c-format msgid "Missing SOFO%s line in %s" msgstr "Puuttuva SOFO%s-rivi kohteessa %s" -#: ../spell.c:5253 #, c-format msgid "Both SAL and SOFO lines in %s" msgstr "SAL- ja SOFO-rivit kohteessa %s" -#: ../spell.c:5331 #, c-format msgid "Flag is not a number in %s line %d: %s" -msgstr "Lippu ei ole lukuarvo kohteessa %s rivill %d: %s" +msgstr "Lippu ei ole lukuarvo kohteessa %s rivillä %d: %s" -#: ../spell.c:5334 #, c-format msgid "Illegal flag in %s line %d: %s" -msgstr "Tuntematon lippu kohteessa %s rivill %d: %s" +msgstr "Tuntematon lippu kohteessa %s rivillä %d: %s" -#: ../spell.c:5493 ../spell.c:5501 #, c-format msgid "%s value differs from what is used in another .aff file" msgstr "%s-arvo eroaa toisessa .aff-tiedostossa olevasta" -#: ../spell.c:5602 #, c-format msgid "Reading dictionary file %s ..." msgstr "Luetaan sanakirjatiedostoa %s" -#: ../spell.c:5611 #, c-format msgid "E760: No word count in %s" msgstr "E760: Ei sanalaskuria kohteessa %s" -#: ../spell.c:5669 #, c-format msgid "line %6d, word %6d - %s" msgstr "rivi %6d, sana %6d - %s" -#: ../spell.c:5691 #, c-format msgid "Duplicate word in %s line %d: %s" -msgstr "Toistettu sana kohteessa %s rivill %d: %s" +msgstr "Toistettu sana kohteessa %s rivillä %d: %s" -#: ../spell.c:5694 #, c-format msgid "First duplicate word in %s line %d: %s" -msgstr "Ensimminen kappale kohteessa %s rivill %d: %s" +msgstr "Ensimmäinen kappale kohteessa %s rivillä %d: %s" -#: ../spell.c:5746 #, c-format msgid "%d duplicate word(s) in %s" msgstr "toistettuja sanoja %d kohteessa %s" -#: ../spell.c:5748 #, c-format msgid "Ignored %d word(s) with non-ASCII characters in %s" msgstr "Ei-ASCII-merkkien takia ohitettuja sanoja %d kohteessa %s" -#: ../spell.c:6115 #, c-format msgid "Reading word file %s ..." msgstr "Luetaan sanatiedostoa %s..." -#: ../spell.c:6155 #, c-format msgid "Duplicate /encoding= line ignored in %s line %d: %s" -msgstr "Toistettu /encoding= ohitettu kohteessa %s rivill %d: %s" +msgstr "Toistettu /encoding= ohitettu kohteessa %s rivillä %d: %s" -#: ../spell.c:6159 #, c-format msgid "/encoding= line after word ignored in %s line %d: %s" -msgstr "/encoding= sanojen jlkeen ohitettu kohteessa %s rivill %d: %s" +msgstr "/encoding= sanojen jälkeen ohitettu kohteessa %s rivillä %d: %s" -#: ../spell.c:6180 #, c-format msgid "Duplicate /regions= line ignored in %s line %d: %s" -msgstr "Toistettu /regions= ohitettu kohteessa %s rivill %d: %s" +msgstr "Toistettu /regions= ohitettu kohteessa %s rivillä %d: %s" -#: ../spell.c:6185 #, c-format msgid "Too many regions in %s line %d: %s" -msgstr "Liikaa regionseja kohteessa %s rivill %d: %s" +msgstr "Liikaa regionseja kohteessa %s rivillä %d: %s" -#: ../spell.c:6198 #, c-format msgid "/ line ignored in %s line %d: %s" -msgstr "/ ohitettu kohteessa %s rivill %d: %s" +msgstr "/ ohitettu kohteessa %s rivillä %d: %s" -#: ../spell.c:6224 #, c-format msgid "Invalid region nr in %s line %d: %s" -msgstr "Virheellinen region-luku kohteessa %s rivill %d: %s" +msgstr "Virheellinen region-luku kohteessa %s rivillä %d: %s" -#: ../spell.c:6230 #, c-format msgid "Unrecognized flags in %s line %d: %s" -msgstr "Tunnistamaton lippu kohteessa %s rivill %d: %s" +msgstr "Tunnistamaton lippu kohteessa %s rivillä %d: %s" -#: ../spell.c:6257 #, c-format msgid "Ignored %d words with non-ASCII characters" msgstr "Ei-ASCIIn takia ohitettuja sanoja %d" -#: ../spell.c:6656 #, c-format msgid "Compressed %d of %d nodes; %d (%d%%) remaining" -msgstr "Tiivistetty %d/%d noodia. %d (%d %%) jljell" +msgstr "Tiivistetty %d/%d noodia. %d (%d %%) jäljellä" -#: ../spell.c:7340 msgid "Reading back spell file..." msgstr "Luetaan taas oikaisulukutiedostoa..." #. Go through the trie of good words, soundfold each word and add it to #. the soundfold trie. -#: ../spell.c:7357 msgid "Performing soundfolding..." -msgstr "ntmyksen mukaan yhdistelln..." +msgstr "Ääntämyksen mukaan yhdistellään..." -#: ../spell.c:7368 -#, c-format -msgid "Number of words after soundfolding: %" -msgstr "Sanoja ntmysyhdistelyn jlkeen: %" +#, fuzzy, c-format +#~ msgid "Number of words after soundfolding: %" +#~ msgstr "Sanoja ääntämysyhdistelyn jälkeen: %ld" -#: ../spell.c:7476 #, c-format msgid "Total number of words: %d" -msgstr "Sanoja yhteens: %d" +msgstr "Sanoja yhteensä: %d" -#: ../spell.c:7655 #, c-format msgid "Writing suggestion file %s ..." msgstr "Kirjoitetaan ehdotustiedostoa %s..." -#: ../spell.c:7707 ../spell.c:7927 #, c-format msgid "Estimated runtime memory use: %d bytes" -msgstr "Arvioitu kyttmuisti: %d tavua" +msgstr "Arvioitu käyttömuisti: %d tavua" -#: ../spell.c:7820 msgid "E751: Output file name must not have region name" -msgstr "E751: Tulostetiedostonimess ei saa olla alueen nime" +msgstr "E751: Tulostetiedostonimessä ei saa olla alueen nimeä" -#: ../spell.c:7822 msgid "E754: Only up to 8 regions supported" -msgstr "E754: Enintn 8 aluetta tuetaan" +msgstr "E754: Enintään 8 aluetta tuetaan" -#: ../spell.c:7846 #, c-format msgid "E755: Invalid region in %s" msgstr "E755: Virheellinen alue kohteelle %s" -#: ../spell.c:7907 msgid "Warning: both compounding and NOBREAK specified" -msgstr "Varoitus: sek yhdyssanamuodostus ett NOBREAK kytss" +msgstr "Varoitus: sekä yhdyssanamuodostus että NOBREAK käytössä" -#: ../spell.c:7920 #, c-format msgid "Writing spell file %s ..." msgstr "Kirjoitetaan oikaisulukutiedostoa %s..." -#: ../spell.c:7925 msgid "Done!" msgstr "Valmista." -#: ../spell.c:8034 -#, c-format -msgid "E765: 'spellfile' does not have % entries" -msgstr "E765: spellfile ei sisll % kohtaa" - -#: ../spell.c:8074 #, fuzzy, c-format +#~ msgid "E765: 'spellfile' does not have % entries" +#~ msgstr "E765: spellfile ei sisällä %ld kohtaa" + +#, c-format msgid "Word '%.*s' removed from %s" -msgstr "Sana poistettu kohteesta %s" +msgstr "Sana %.*s poistettu kohteesta %s" -#: ../spell.c:8117 -#, fuzzy, c-format +#, c-format msgid "Word '%.*s' added to %s" -msgstr "Sana listty kohteeseen %s" +msgstr "Sana %.*s lisätty kohteeseen %s" -#: ../spell.c:8381 msgid "E763: Word characters differ between spell files" -msgstr "E763: Sanan merkit muuttuvat oikaisulukutiedostojen vlill" - -#: ../spell.c:8684 -msgid "Sorry, no suggestions" -msgstr "Sori, ei ehdotuksia" - -#: ../spell.c:8687 -#, c-format -msgid "Sorry, only % suggestions" -msgstr "Sori, vain % ehdotusta" - -#. for when 'cmdheight' > 1 -#. avoid more prompt -#: ../spell.c:8704 -#, c-format -msgid "Change \"%.*s\" to:" -msgstr "Muuta %.*s:" - -#: ../spell.c:8737 -#, c-format -msgid " < \"%.*s\"" -msgstr " < %.*s" - -#: ../spell.c:8882 -msgid "E752: No previous spell replacement" -msgstr "E752: Ei edellist oikaisulukukorjausta" - -#: ../spell.c:8925 -#, c-format -msgid "E753: Not found: %s" -msgstr "E753: Ei lytynyt: %s" - -#: ../spell.c:9276 -#, c-format -msgid "E778: This does not look like a .sug file: %s" -msgstr "E778: Ei vaikuta .sug-tiedostolta: %s" - -#: ../spell.c:9282 -#, c-format -msgid "E779: Old .sug file, needs to be updated: %s" -msgstr "E779: Vanha .sug-tiedosto pit pivitt: %s" - -#: ../spell.c:9286 -#, c-format -msgid "E780: .sug file is for newer version of Vim: %s" -msgstr "E780: .sug-tiedosto on uudemmalle Vimille: %s" - -#: ../spell.c:9295 -#, c-format -msgid "E781: .sug file doesn't match .spl file: %s" -msgstr "E781: .sug-tiedosto ei tsm .spl-tiedostoon: %s" - -#: ../spell.c:9305 -#, c-format -msgid "E782: error while reading .sug file: %s" -msgstr "E782: virhe luettaessa .sug-tiedostoa: %s" +msgstr "E763: Sanan merkit muuttuvat oikaisulukutiedostojen välillä" #. This should have been checked when generating the .spl #. file. -#: ../spell.c:11575 msgid "E783: duplicate char in MAP entry" -msgstr "E783: kaksoiskappale merkist MAP-kohdassa" +msgstr "E783: kaksoiskappale merkistä MAP-kohdassa" + +msgid "E766: Insufficient arguments for printf()" +msgstr "E766: printf():lle ei annettu tarpeeksi argumentteja" + +msgid "E807: Expected Float argument for printf()" +msgstr "E807: Odotettiin Float-argumenttia printf():lle" + +msgid "E767: Too many arguments to printf()" +msgstr "E767: printf():lle annettiin liikaa argumentteja" -#: ../syntax.c:266 msgid "No Syntax items defined for this buffer" -msgstr "Ei syntaksikohteita tlle puskurille" +msgstr "Ei syntaksikohteita tälle puskurille" -#: ../syntax.c:3083 ../syntax.c:3104 ../syntax.c:3127 #, c-format msgid "E390: Illegal argument: %s" msgstr "E390: Virheellinen argumentti: %s" -#: ../syntax.c:3299 +msgid "syntax iskeyword " +msgstr "syntax iskeyword " + #, c-format msgid "E391: No such syntax cluster: %s" msgstr "E391: Syntaksiklusteri puuttuu: %s" -#: ../syntax.c:3433 msgid "syncing on C-style comments" msgstr "synkkaa C-tyylin kommentteihin" -#: ../syntax.c:3439 msgid "no syncing" msgstr "ei synkkausta" -#: ../syntax.c:3441 msgid "syncing starts " msgstr "synkkaus aloitettu " -#: ../syntax.c:3443 ../syntax.c:3506 msgid " lines before top line" -msgstr " rivi ennen alkua" +msgstr " riviä ennen alkua" -#: ../syntax.c:3448 msgid "" "\n" "--- Syntax sync items ---" @@ -5729,7 +5225,6 @@ msgstr "" "\n" "--- Syntax sync -kohteet ---" -#: ../syntax.c:3452 msgid "" "\n" "syncing on items" @@ -5737,7 +5232,6 @@ msgstr "" "\n" "synkataan kohteisiin" -#: ../syntax.c:3457 msgid "" "\n" "--- Syntax items ---" @@ -5745,2079 +5239,886 @@ msgstr "" "\n" "--- Syntax-kohteet ---" -#: ../syntax.c:3475 #, c-format msgid "E392: No such syntax cluster: %s" msgstr "E392: syntaksiklusteria ei ole: %s" -#: ../syntax.c:3497 msgid "minimal " -msgstr "vhintn " +msgstr "vähintään " -#: ../syntax.c:3503 msgid "maximal " -msgstr "enitntn " +msgstr "enitntään " -#: ../syntax.c:3513 msgid "; match " -msgstr "; tsm " +msgstr "; täsmää " -#: ../syntax.c:3515 msgid " line breaks" msgstr " rivinvaihdot" -#: ../syntax.c:4076 msgid "E395: contains argument not accepted here" -msgstr "E395: contains ei sovi thn" +msgstr "E395: contains ei sovi tähän" -#: ../syntax.c:4096 -#, fuzzy msgid "E844: invalid cchar value" -msgstr "E474: Virheellinen argumentti" +msgstr "E844: Virheellinen cchar-arvo" -#: ../syntax.c:4107 msgid "E393: group[t]here not accepted here" -msgstr "E393: group[t]here ei sovi thn" +msgstr "E393: group[t]here ei sovi tähän" -#: ../syntax.c:4126 #, c-format msgid "E394: Didn't find region item for %s" -msgstr "E394: Aluetta nimelle %s ei lydy" +msgstr "E394: Aluetta nimelle %s ei löydy" -#: ../syntax.c:4188 msgid "E397: Filename required" msgstr "E397: Tiedostonimi puuttuu" -#: ../syntax.c:4221 -#, fuzzy msgid "E847: Too many syntax includes" -msgstr "E77: Liikaa tiedostonimi" +msgstr "E847: Liikaa syntax includeja" -#: ../syntax.c:4303 #, c-format msgid "E789: Missing ']': %s" msgstr "E789: ] puuttuu: %s" -#: ../syntax.c:4531 +#, c-format +msgid "E890: trailing char after ']': %s]%s" +msgstr "E890: Ylimääräisiä merkkejä merkin ] perässä: %s]%s" + #, c-format msgid "E398: Missing '=': %s" msgstr "E398: = puuttuu: %s" -#: ../syntax.c:4666 #, c-format msgid "E399: Not enough arguments: syntax region %s" msgstr "E399: Argumentteja puuttuu: syntaksialue %s" -#: ../syntax.c:4870 -#, fuzzy msgid "E848: Too many syntax clusters" -msgstr "E391: Syntaksiklusteri puuttuu: %s" +msgstr "E848: Liikaa syntaksiklustereita" -#: ../syntax.c:4954 msgid "E400: No cluster specified" -msgstr "E400: klusteri mrittelemtt" +msgstr "E400: klusteri määrittelemättä" #. end delimiter not found -#: ../syntax.c:4986 #, c-format msgid "E401: Pattern delimiter not found: %s" msgstr "E401: Kuvoin erotin puuttuu: %s" -#: ../syntax.c:5049 #, c-format msgid "E402: Garbage after pattern: %s" -msgstr "E402: Roskia kuvion jljess: %s" +msgstr "E402: Roskia kuvion jäljessä: %s" -#: ../syntax.c:5120 msgid "E403: syntax sync: line continuations pattern specified twice" -msgstr "E403: syntax sync: rivinjatkamiskuvio mritelty kahdesti" +msgstr "E403: syntax sync: rivinjatkamiskuvio määritelty kahdesti" -#: ../syntax.c:5169 #, c-format msgid "E404: Illegal arguments: %s" msgstr "E404: Virheelliset argumentit: %s" -#: ../syntax.c:5217 #, c-format msgid "E405: Missing equal sign: %s" msgstr "E405: = puuttuu: %s" -#: ../syntax.c:5222 #, c-format msgid "E406: Empty argument: %s" -msgstr "E406: Tyhj argumentti: %s" +msgstr "E406: Tyhjä argumentti: %s" -#: ../syntax.c:5240 #, c-format msgid "E407: %s not allowed here" -msgstr "E407: %s ei sovi thn" +msgstr "E407: %s ei sovi tähän" -#: ../syntax.c:5246 #, c-format msgid "E408: %s must be first in contains list" msgstr "E408: %s kuuluu contains-listan alkuun" -#: ../syntax.c:5304 #, c-format msgid "E409: Unknown group name: %s" -msgstr "E409: Tuntematon ryhmn nimi: %s" +msgstr "E409: Tuntematon ryhmän nimi: %s" -#: ../syntax.c:5512 #, c-format msgid "E410: Invalid :syntax subcommand: %s" msgstr "E410: Virheelluinen :syntax-osakomento: %s" -#: ../syntax.c:5854 msgid "" " TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN" msgstr "" +" KAIKKI MÄÄRÄ TÄSMÄYS HITAIN KEKSIARVO NIMI ILMAUS" -#: ../syntax.c:6146 msgid "E679: recursive loop loading syncolor.vim" -msgstr "E679: rekursiivinen silmukka syncolor.vimiss" +msgstr "E679: rekursiivinen silmukka syncolor.vimissä" -#: ../syntax.c:6256 #, c-format msgid "E411: highlight group not found: %s" -msgstr "E411: korostusryhm ei lytynyt: %s" +msgstr "E411: korostusryhmää ei löytynyt: %s" -#: ../syntax.c:6278 #, c-format msgid "E412: Not enough arguments: \":highlight link %s\"" msgstr "E412: Argumentteja puuttuu: :highlight link %s" -#: ../syntax.c:6284 #, c-format msgid "E413: Too many arguments: \":highlight link %s\"" msgstr "E413: Liikaa argumentteja: :highlight link %s" -#: ../syntax.c:6302 msgid "E414: group has settings, highlight link ignored" -msgstr "E414: ryhmll on asetuksia, highlight link -komento ohitetaan" +msgstr "E414: ryhmällä on asetuksia, highlight link -komento ohitetaan" -#: ../syntax.c:6367 #, c-format msgid "E415: unexpected equal sign: %s" msgstr "E415: odotuksenvastainen =-merkki: %s" -#: ../syntax.c:6395 #, c-format msgid "E416: missing equal sign: %s" msgstr "E416: puuttuva =-merkki: %s" -#: ../syntax.c:6418 #, c-format msgid "E417: missing argument: %s" msgstr "E417: puuttuva argumentti: %s" -#: ../syntax.c:6446 #, c-format msgid "E418: Illegal value: %s" msgstr "E418: Viallinen arvo: %s" -#: ../syntax.c:6496 msgid "E419: FG color unknown" -msgstr "E419: edustavri tuntematon" +msgstr "E419: edustaväri tuntematon" -#: ../syntax.c:6504 msgid "E420: BG color unknown" -msgstr "E420: taustavri tuntematon" +msgstr "E420: taustaväri tuntematon" -#: ../syntax.c:6564 #, c-format msgid "E421: Color name or number not recognized: %s" -msgstr "E421: Vrin nimi tai numero tuntematon: %s" +msgstr "E421: Värin nimi tai numero tuntematon: %s" -#: ../syntax.c:6714 -#, c-format -msgid "E422: terminal code too long: %s" -msgstr "E422: terminaalikoodi liian pitk: %s" - -#: ../syntax.c:6753 #, c-format msgid "E423: Illegal argument: %s" msgstr "E423: Virheellinen argumentti: %s" -#: ../syntax.c:6925 msgid "E424: Too many different highlighting attributes in use" msgstr "E424: Liikaa eri korostusattribuutteja" -#: ../syntax.c:7427 msgid "E669: Unprintable character in group name" -msgstr "E669: Tulostuskelvoton merkki ryhmn nimess" +msgstr "E669: Tulostuskelvoton merkki ryhmän nimessä" -#: ../syntax.c:7434 msgid "W18: Invalid character in group name" -msgstr "W18: Virheellinen merkki ryhmn nimess" +msgstr "W18: Virheellinen merkki ryhmän nimessä" -#: ../syntax.c:7448 msgid "E849: Too many highlight and syntax groups" -msgstr "" +msgstr "E849: Liikaa korostuksia ja syntaksiryhmiä" -#: ../tag.c:104 msgid "E555: at bottom of tag stack" -msgstr "E555: tgipinon pohja" +msgstr "E555: tägipinon pohja" -#: ../tag.c:105 msgid "E556: at top of tag stack" -msgstr "E556: tgipinon huippu" +msgstr "E556: tägipinon huippu" -#: ../tag.c:380 msgid "E425: Cannot go before first matching tag" -msgstr "E425: Ei voida menn ensimmist tsmv tgi alummaksi" +msgstr "E425: Ei voida mennä ensimmäistä täsmäävää tägiä alummaksi" -#: ../tag.c:504 #, c-format msgid "E426: tag not found: %s" -msgstr "E426: tgi puuttuu: %s" +msgstr "E426: tägi puuttuu: %s" -#: ../tag.c:528 msgid " # pri kind tag" -msgstr " # arvo tyyppi tgi" +msgstr " # arvo tyyppi tägi" -#: ../tag.c:531 msgid "file\n" msgstr "tiedosto\n" -#: ../tag.c:829 msgid "E427: There is only one matching tag" -msgstr "E427: Vain yksi tgi tsm" +msgstr "E427: Vain yksi tägi täsmää" -#: ../tag.c:831 msgid "E428: Cannot go beyond last matching tag" -msgstr "E428: Ei voida edet viimeisen tsmvn tgin ohi" +msgstr "E428: Ei voida edetä viimeisen täsmäävän tägin ohi" -#: ../tag.c:850 #, c-format msgid "File \"%s\" does not exist" msgstr "Tiedostoa %s ei ole" #. Give an indication of the number of matching tags -#: ../tag.c:859 #, c-format msgid "tag %d of %d%s" -msgstr "tgi %d/%d%s" +msgstr "tägi %d/%d%s" -#: ../tag.c:862 msgid " or more" msgstr " tai useammasta" -#: ../tag.c:864 msgid " Using tag with different case!" -msgstr " Tgiss eri kirjaintaso" +msgstr " Tägissä eri kirjaintaso" -#: ../tag.c:909 #, c-format msgid "E429: File \"%s\" does not exist" msgstr "E429: Tiedostoa %s ei ole" #. Highlight title -#: ../tag.c:960 msgid "" "\n" " # TO tag FROM line in file/text" msgstr "" "\n" -" # TILL tagg FRN LINJE i fil/text" +" # TILL tagg FRÅN LINJE i fil/text" -#: ../tag.c:1303 #, c-format msgid "Searching tags file %s" -msgstr "Etsitn tgitiedostoa %s" +msgstr "Etsitään tägitiedostoa %s" -#: ../tag.c:1545 msgid "Ignoring long line in tags file" -msgstr "Ohitetaan pitk rivi tgitiedostossa" +msgstr "Ohitetaan pitkä rivi tägitiedostossa" -#: ../tag.c:1915 #, c-format msgid "E431: Format error in tags file \"%s\"" -msgstr "E431: Muotovirh tgitiedostossa %s" +msgstr "E431: Muotovirh tägitiedostossa %s" -#: ../tag.c:1917 -#, c-format -msgid "Before byte %" -msgstr "Ennen tavua %" +#, fuzzy, c-format +#~ msgid "Before byte %" +#~ msgstr "Ennen tavua %ld" -#: ../tag.c:1929 #, c-format msgid "E432: Tags file not sorted: %s" -msgstr "E432: Tgitiedosto ei ole jrjestetty: %s" +msgstr "E432: Tägitiedosto ei ole järjestetty: %s" #. never opened any tags file -#: ../tag.c:1960 msgid "E433: No tags file" -msgstr "E433: Ei tgitiedostoja" +msgstr "E433: Ei tägitiedostoja" -#: ../tag.c:2536 msgid "E434: Can't find tag pattern" -msgstr "E434: Tgikuviota ei lydy" +msgstr "E434: Tägikuviota ei löydy" -#: ../tag.c:2544 msgid "E435: Couldn't find tag, just guessing!" -msgstr "E435: Tgi ei lydy, arvataan." +msgstr "E435: Tägiä ei löydy, arvataan." -#: ../tag.c:2797 #, c-format msgid "Duplicate field name: %s" -msgstr "Kaksoiskappale kentn nimest: %s" - -#: ../term.c:1442 -msgid "' not known. Available builtin terminals are:" -msgstr " ei tunnettu. Tuetut terminaalit:" - -#: ../term.c:1463 -msgid "defaulting to '" -msgstr "oletusarvona " - -#: ../term.c:1731 -msgid "E557: Cannot open termcap file" -msgstr "E557: Ei voi avata termcap-tiedostoa" - -#: ../term.c:1735 -msgid "E558: Terminal entry not found in terminfo" -msgstr "E558: Terminaalia ei lytynyt terminfosta" - -#: ../term.c:1737 -msgid "E559: Terminal entry not found in termcap" -msgstr "E559: Terminaalia ei lytynyt termcapista" - -#: ../term.c:1878 -#, c-format -msgid "E436: No \"%s\" entry in termcap" -msgstr "E436: %s ei lytynyt termcapista" - -#: ../term.c:2249 -msgid "E437: terminal capability \"cm\" required" -msgstr "E437: terminaalilla pit olla cm kyvyissn" - -#. Highlight title -#: ../term.c:4376 -msgid "" -"\n" -"--- Terminal keys ---" -msgstr "" -"\n" -"--- Terminaalinppimet ---" - -#: ../ui.c:481 -msgid "Vim: Error reading input, exiting...\n" -msgstr "Vim: Virhe luettaessa sytett, poistutaan...\n" +msgstr "Kaksoiskappale kentän nimestä: %s" #. This happens when the FileChangedRO autocommand changes the #. * file in a way it becomes shorter. -#: ../undo.c:379 -#, fuzzy msgid "E881: Line count changed unexpectedly" -msgstr "E834: Rivimr vaihtui odottamatta" +msgstr "E881: Rivimäärä vaihtui odottamatta" -#: ../undo.c:627 #, c-format msgid "E828: Cannot open undo file for writing: %s" msgstr "E828: Kumoustiedoston avaus kirjoittamista varten ei onnistu: %s" -#: ../undo.c:717 +#, fuzzy, c-format +#~ msgid "E5003: Unable to create directory \"%s\" for undo file: %s" +#~ msgstr "E346: Hakemisto %s ei ole enää cdpathissa" + #, c-format msgid "E825: Corrupted undo file (%s): %s" msgstr "E825: Pilaanntunut kumoustiedosto (%s): %s" -#: ../undo.c:1039 msgid "Cannot write undo file in any directory in 'undodir'" -msgstr "Ei voitu lukea kumoustiedostoa mistn undodir-muuttujan hakemistosta" +msgstr "Ei voitu lukea kumoustiedostoa mistään undodir-muuttujan hakemistosta" -#: ../undo.c:1074 #, c-format msgid "Will not overwrite with undo file, cannot read: %s" msgstr "Ei ylikirjoitetat kumoustiedostolla, koska ei voida lukea: %s" -#: ../undo.c:1092 #, c-format msgid "Will not overwrite, this is not an undo file: %s" -msgstr "Ei ylikirjoiteta, koska tm ei ole kumoustiedosto: %s" +msgstr "Ei ylikirjoiteta, koska tämä ei ole kumoustiedosto: %s" -#: ../undo.c:1108 msgid "Skipping undo file write, nothing to undo" msgstr "Ohitetaan kumoustiedoston kirjoitus, koska ei ole peruutettavia" -#: ../undo.c:1121 #, c-format msgid "Writing undo file: %s" msgstr "Kirjoitetaan kumoustiedostoa: %s" -#: ../undo.c:1213 #, c-format msgid "E829: write error in undo file: %s" msgstr "E829: Kirjoitusvirhe kumoustiedostossa: %s" -#: ../undo.c:1280 #, c-format msgid "Not reading undo file, owner differs: %s" msgstr "Ei lueta kumoustiedosto jonka omistaja on eri: %s" -#: ../undo.c:1292 #, c-format msgid "Reading undo file: %s" msgstr "Luetaan kumoustiedostoa: %s" -#: ../undo.c:1299 #, c-format msgid "E822: Cannot open undo file for reading: %s" msgstr "E822: Kumoustiedostoa ei voi avata lukemista varten: %s" -#: ../undo.c:1308 #, c-format msgid "E823: Not an undo file: %s" msgstr "E823: Ei ole kumoustiedosto: %s" -#: ../undo.c:1313 #, c-format msgid "E824: Incompatible undo file: %s" -msgstr "E824: Epyhteensopiva kumoustiedosto: %s" +msgstr "E824: Epäyhteensopiva kumoustiedosto: %s" -#: ../undo.c:1328 msgid "File contents changed, cannot use undo info" msgstr "" -"Tiedoston sislt on muuttunut, joen kumoustiedot ovat kyttkelvottomia" +"Tiedoston sisältö on muuttunut, joen kumoustiedot ovat käyttökelvottomia" -#: ../undo.c:1497 #, c-format msgid "Finished reading undo file %s" msgstr "Ladattu kumoustiedoto %s" -#: ../undo.c:1586 ../undo.c:1812 msgid "Already at oldest change" msgstr "Vanhimmassa muutoksessa" -#: ../undo.c:1597 ../undo.c:1814 msgid "Already at newest change" msgstr "Nuorimmassa muutoksessa" -#: ../undo.c:1806 -#, c-format -msgid "E830: Undo number % not found" -msgstr "E830: Kumouslukua % ei lydy" +#, fuzzy, c-format +#~ msgid "E830: Undo number % not found" +#~ msgstr "E830: Kumouslukua %ld ei löydy" -#: ../undo.c:1979 msgid "E438: u_undo: line numbers wrong" -msgstr "E438: u_undo: vrt rivinumerot" +msgstr "E438: u_undo: väärät rivinumerot" -#: ../undo.c:2183 msgid "more line" -msgstr "rivi lis" +msgstr "rivi lisää" -#: ../undo.c:2185 msgid "more lines" -msgstr "rivi lis" +msgstr "riviä lisää" -#: ../undo.c:2187 msgid "line less" -msgstr "rivi vhemmn" +msgstr "rivi vähemmän" -#: ../undo.c:2189 msgid "fewer lines" -msgstr "rivi vhemmn" +msgstr "riviä vähemmän" -#: ../undo.c:2193 msgid "change" msgstr "muutos" -#: ../undo.c:2195 msgid "changes" msgstr "muutosta" -# eka %s ylpuolelta, toka %s alapuolelta, kolmas %s aika -#: ../undo.c:2225 -#, c-format -msgid "% %s; %s #% %s" -msgstr "% %s, %s #% %s" +# eka %s yläpuolelta, toka %s alapuolelta, kolmas %s aika +#, fuzzy, c-format +#~ msgid "% %s; %s #% %s" +#~ msgstr "%ld %s, %s #%ld %s" + +msgid "after" +msgstr "jälkeen muutoksen" -#: ../undo.c:2228 msgid "before" msgstr "ennen muutosta" -#: ../undo.c:2228 -msgid "after" -msgstr "jlkeen muutoksen" - -#: ../undo.c:2325 msgid "Nothing to undo" msgstr "Ei kumottavaa" -#: ../undo.c:2330 -#, fuzzy msgid "number changes when saved" -msgstr "muutoksia aika tallennettu" +msgstr "numero muutoksia aika tallennettu" -#: ../undo.c:2360 -#, c-format -msgid "% seconds ago" -msgstr "% sekuntia sitten" +#, fuzzy, c-format +#~ msgid "% seconds ago" +#~ msgstr "%ld sekuntia sitten" -#: ../undo.c:2372 msgid "E790: undojoin is not allowed after undo" -msgstr "E790: undojoin ei toimi undon jlkeen" +msgstr "E790: undojoin ei toimi undon jälkeen" -#: ../undo.c:2466 msgid "E439: undo list corrupt" msgstr "E439: kumouslista rikki" -#: ../undo.c:2495 msgid "E440: undo line missing" msgstr "E440: kumousrivi puuttuu" -#: ../version.c:600 -msgid "" -"\n" -"Included patches: " -msgstr "" -"\n" -"Ptsit: " - -#: ../version.c:627 msgid "" "\n" "Extra patches: " msgstr "" "\n" -"Muita ptsej: " +"Muita pätsejä: " -#: ../version.c:639 ../version.c:864 -msgid "Modified by " -msgstr "Muokannut " - -#: ../version.c:646 msgid "" "\n" "Compiled " msgstr "" "\n" -"Kntnyt " +"Kääntänyt " -#: ../version.c:649 msgid "by " msgstr ": " -#: ../version.c:660 +#, fuzzy msgid "" "\n" -"Huge version " -msgstr "" "\n" -"Huge-versio " - -#: ../version.c:661 -msgid "without GUI." -msgstr "ilman GUIta." - -#: ../version.c:662 -msgid " Features included (+) or not (-):\n" +"Optional features included (+) or not (-): " msgstr " Ominaisuudet mukana (+) ja poissa (-):\n" -#: ../version.c:667 msgid " system vimrc file: \"" -msgstr " jrjestelmn vimrc: \"" +msgstr " järjestelmän vimrc: \"" -#: ../version.c:672 -msgid " user vimrc file: \"" -msgstr " kyttjn vimrc: \"" - -#: ../version.c:677 -msgid " 2nd user vimrc file: \"" -msgstr " 2. kyttjn vimrc: \"" - -#: ../version.c:682 -msgid " 3rd user vimrc file: \"" -msgstr " 3. kyttjn vimrc: \"" - -#: ../version.c:687 -msgid " user exrc file: \"" -msgstr " kyttjn exrc: \"" - -#: ../version.c:692 -msgid " 2nd user exrc file: \"" -msgstr " 2. kyttjn exrc: \"" - -#: ../version.c:699 msgid " fall-back for $VIM: \"" msgstr " $VIMin fallback: \"" -#: ../version.c:705 msgid " f-b for $VIMRUNTIME: \"" msgstr " $VIMRUNTIMEn f-b: \"" -#: ../version.c:709 -msgid "Compilation: " -msgstr "Knns: " - -#: ../version.c:712 -msgid "Linking: " -msgstr "Linkitys: " - -#: ../version.c:717 -msgid " DEBUG BUILD" -msgstr " DEBUG-versio" - -#: ../version.c:767 -msgid "VIM - Vi IMproved" -msgstr "VIM - Vi IMproved" - -#: ../version.c:769 -msgid "version " -msgstr "versio " - -#: ../version.c:770 msgid "by Bram Moolenaar et al." -msgstr "tekijt Bram Moolenaar et al." +msgstr "tekijät Bram Moolenaar et al." -#: ../version.c:774 -msgid "Vim is open source and freely distributable" -msgstr "Vim on avointa lhdekoodia ja vapaasti jaossa" +#, fuzzy +#~ msgid "Nvim is open source and freely distributable" +#~ msgstr "Vim on avointa lähdekoodia ja vapaasti jaossa" -#: ../version.c:776 -msgid "Help poor children in Uganda!" -msgstr "Auta Ugandan kyhi lapsia" +#~ msgid "https://neovim.io/community" +#~ msgstr "" -#: ../version.c:777 -msgid "type :help iccf for information " -msgstr "kirjoita :help iccf listietoa varten " +#, fuzzy +#~ msgid "type :help nvim if you are new! " +#~ msgstr "kirjoita :help iccf lisätietoa varten " + +#, fuzzy +#~ msgid "type :CheckHealth to optimize Nvim" +#~ msgstr "kirjoita :help iccf lisätietoa varten " -#: ../version.c:779 msgid "type :q to exit " msgstr "kirjoita :q lopettaaksesi " -#: ../version.c:780 -msgid "type :help or for on-line help" -msgstr "kirjoita :help tai ohjetta varten " +#, fuzzy +#~ msgid "type :help for help " +#~ msgstr "kirjoita :q lopettaaksesi " -#: ../version.c:781 -msgid "type :help version7 for version info" -msgstr "kirjoita :help version7 versiotietoja varten " +msgid "Help poor children in Uganda!" +msgstr "Auta Ugandan köyhiä lapsia" -#: ../version.c:784 -msgid "Running in Vi compatible mode" -msgstr "Suoritetaan Vi-yhteensopivuustilaa" +msgid "type :help iccf for information " +msgstr "kirjoita :help iccf lisätietoa varten " -#: ../version.c:785 -msgid "type :set nocp for Vim defaults" -msgstr "kirjoita :set nocp Vimin oletuksiin " - -#: ../version.c:786 -msgid "type :help cp-default for info on this" -msgstr "kirjoita :help cp-default ohjetta oletuksista varten" - -#: ../version.c:827 msgid "Sponsor Vim development!" -msgstr "Tue Vimin kehityst" +msgstr "Tue Vimin kehitystä" -#: ../version.c:828 msgid "Become a registered Vim user!" -msgstr "Rekisteridy Vim-kyttjksi." +msgstr "Rekisteröidy Vim-käyttäjäksi." -#: ../version.c:831 msgid "type :help sponsor for information " -msgstr "kirjoita :help sponsor listietoja varten" +msgstr "kirjoita :help sponsor lisätietoja varten" -#: ../version.c:832 msgid "type :help register for information " -msgstr "kirjoita :help register listietoja varten" +msgstr "kirjoita :help register lisätietoja varten" -#: ../version.c:834 msgid "menu Help->Sponsor/Register for information " -msgstr "valikko Ohje->Sponsoroi/Rekisteri listietoja varten" +msgstr "valikko Ohje->Sponsoroi/Rekisteröi lisätietoja varten" -#: ../window.c:119 msgid "Already only one window" -msgstr "En yksi ikkuna jljell" +msgstr "Enää yksi ikkuna jäljellä" -#: ../window.c:224 msgid "E441: There is no preview window" msgstr "E441: Ei esikatseluikkunaa" -#: ../window.c:559 msgid "E442: Can't split topleft and botright at the same time" -msgstr "E442: Ei voi jakaa vasenta ylnurkkaa ja oikeaa alanurkkaa yhtaikaa" +msgstr "E442: Ei voi jakaa vasenta ylänurkkaa ja oikeaa alanurkkaa yhtäaikaa" -#: ../window.c:1228 msgid "E443: Cannot rotate when another window is split" -msgstr "E443: Ei voi kiert kun toinen ikkuna on jaettu" +msgstr "E443: Ei voi kiertää kun toinen ikkuna on jaettu" -#: ../window.c:1803 msgid "E444: Cannot close last window" -msgstr "E444: Ei voi sulkea viimeist ikkunaa" +msgstr "E444: Ei voi sulkea viimeistä ikkunaa" -#: ../window.c:1810 msgid "E813: Cannot close autocmd window" msgstr "E813: Ei voi sulkea autocmd-ikkunaa" -#: ../window.c:1814 msgid "E814: Cannot close window, only autocmd window would remain" -msgstr "E814: Ei voi sulkea viimeist ikkunaa, joka ei ole autocmd-ikkuna" +msgstr "E814: Ei voi sulkea viimeistä ikkunaa, joka ei ole autocmd-ikkuna" -#: ../window.c:2717 msgid "E445: Other window contains changes" -msgstr "E445: Toinen ikkuna sislt muutoksia" +msgstr "E445: Toinen ikkuna sisältää muutoksia" -#: ../window.c:4805 msgid "E446: No file name under cursor" -msgstr "E446: Ei tiedostonime kursorin alla" +msgstr "E446: Ei tiedostonimeä kursorin alla" -#~ msgid "E831: bf_key_init() called with empty password" -#~ msgstr "E831: bf_key_init() tyhjll salasanalla" - -#~ msgid "E820: sizeof(uint32_t) != 4" -#~ msgstr "E820: sizeof(uint32_t) != 4" - -#~ msgid "E817: Blowfish big/little endian use wrong" -#~ msgstr "E817: Blowfishin tavujrjestys vr" - -#~ msgid "E818: sha256 test failed" -#~ msgstr "E818: sha256-testi eponnistui failed" - -#~ msgid "E819: Blowfish test failed" -#~ msgstr "E819: Blowfish-testi eponnistui" - -#~ msgid "Patch file" -#~ msgstr "Patch-tiedosto" +msgid "List or number required" +msgstr "Lista tai luku tarvitaan" #~ msgid "" -#~ "&OK\n" -#~ "&Cancel" +#~ "Failed to set path: sys.path is not a list\n" +#~ "You should now append vim.VIM_SPECIAL_PATH to sys.path" #~ msgstr "" -#~ "&OK\n" -#~ "&Peru" - -#~ msgid "E240: No connection to Vim server" -#~ msgstr "E240: Ei yhteytt vim-palvelimeen" - -#~ msgid "E241: Unable to send to %s" -#~ msgstr "E241: Kohteeseen %s lhettminen ei onnistunut" - -#~ msgid "E277: Unable to read a server reply" -#~ msgstr "E277: Palvelimen vastauksen lukeminen ei onnistunut" - -#~ msgid "E258: Unable to send to client" -#~ msgstr "E258: Asiakkaalle lhetys ei onnistunut" - -#~ msgid "Save As" -#~ msgstr "Tallenna nimell" - -#~ msgid "Source Vim script" -#~ msgstr "Lataa vim-skripti" - -#~ msgid "Edit File" -#~ msgstr "Muokkaa tiedostoa" - -#~ msgid " (NOT FOUND)" -#~ msgstr " (EI LYTYNYT)" - -#~ msgid "unknown" -#~ msgstr "tuntematon" - -#~ msgid "Edit File in new window" -#~ msgstr "Muokkaa uudessa ikkunassa" - -#~ msgid "Append File" -#~ msgstr "Lis tiedostoon" - -#~ msgid "Window position: X %d, Y %d" -#~ msgstr "Ikkunan sijainti: X %d, Y %d" - -#~ msgid "Save Redirection" -#~ msgstr "Tallenna uudelleenosoitus" - -#~ msgid "Save View" -#~ msgstr "Tallenna nkym" - -#~ msgid "Save Session" -#~ msgstr "Tallenna sessio" - -#~ msgid "Save Setup" -#~ msgstr "Tallenna asetukset" - -#~ msgid "E809: #< is not available without the +eval feature" -#~ msgstr "E809: #< ei ole kytss jollei +eval ole pll" - -#~ msgid "E196: No digraphs in this version" -#~ msgstr "E196: Digraafeja ei ole tss versiossa" - -#~ msgid "is a device (disabled with 'opendevice' option)" -#~ msgstr "on laite (ei kytss opendevice-asetuksen takia)" - -#~ msgid "Reading from stdin..." -#~ msgstr "Luetaan vakiosytteest" - -#~ msgid "[crypted]" -#~ msgstr "[salattu]" - -#~ msgid "E821: File is encrypted with unknown method" -#~ msgstr "E821: Tiedoston salaus on tuntematon" - -#~ msgid "NetBeans disallows writes of unmodified buffers" -#~ msgstr "NetBeans ei salli kirjoittaa muokkaamattomiin puskureihin" - -#~ msgid "Partial writes disallowed for NetBeans buffers" -#~ msgstr "Osittaiset kirjoitukset kielletty NetBeans-puskureissa" - -#~ msgid "writing to device disabled with 'opendevice' option" -#~ msgstr "laitteeseen kirjoittaminen pois kytst opendevice-asetuksella" - -# tietkseni resurssiforkki on applen tiedostojrjestelmn tunnistejuttujuttu -#~ msgid "E460: The resource fork would be lost (add ! to override)" -#~ msgstr "E460: resurssiosa hviisi (lis komentoon ! ohittaaksesi)" - -#~ msgid " " -#~ msgstr " " - -#~ msgid "E616: vim_SelFile: can't get font %s" -#~ msgstr "E616: vim_SelFile: ei saada fonttia %s" - -#~ msgid "E614: vim_SelFile: can't return to current directory" -#~ msgstr "E614: vim_SelFile: nykyiseen hakemistoon ei voi palata" - -#~ msgid "Pathname:" -#~ msgstr "Polku:" - -#~ msgid "E615: vim_SelFile: can't get current directory" -#~ msgstr "E615: vim_SelFile: nykyist hakemistoa ei saada selville" - -#~ msgid "OK" -#~ msgstr "OK" - -#~ msgid "Cancel" -#~ msgstr "Peru" - -#~ msgid "Vim dialog" -#~ msgstr "Vim-ikkuna" - -#~ msgid "Scrollbar Widget: Could not get geometry of thumb pixmap." -#~ msgstr "Vierityspalkki: Pixmapin geometria ei selvi" - -#~ msgid "E232: Cannot create BalloonEval with both message and callback" -#~ msgstr "E232: Ei voi luoda BalloonEvalia viestille ja callbackille" - -#~ msgid "E229: Cannot start the GUI" -#~ msgstr "E229: GUIn kynnistys ei onnistu" - -#~ msgid "E230: Cannot read from \"%s\"" -#~ msgstr "E230: Ei voi lukea kohteesta %s" - -#~ msgid "E665: Cannot start GUI, no valid font found" -#~ msgstr "E665: Ei voi avata GUIta, sopivaa fonttia ei lydy" - -#~ msgid "E231: 'guifontwide' invalid" -#~ msgstr "E231: guifontwide virheellinen" - -#~ msgid "E599: Value of 'imactivatekey' is invalid" -#~ msgstr "E599: imactivatekeyn arvo on virheellinen" - -#~ msgid "E254: Cannot allocate color %s" -#~ msgstr "E254: Vri %s ei voi mritell" - -#~ msgid "No match at cursor, finding next" -#~ msgstr "Ei tsmyst kursorin alla, etsitn seuraava" - -#~ msgid "Input _Methods" -#~ msgstr "Syte_menetelmt" - -#~ msgid "VIM - Search and Replace..." -#~ msgstr "VIM - Etsi ja korvaa..." - -#~ msgid "VIM - Search..." -#~ msgstr "VIM - Etsi..." - -#~ msgid "Find what:" -#~ msgstr "Etsi:" - -#~ msgid "Replace with:" -#~ msgstr "Korvaa:" - -#~ msgid "Match whole word only" -#~ msgstr "Korvaa kokonaisia sanoja" - -#~ msgid "Match case" -#~ msgstr "Kirjaintaso" - -#~ msgid "Direction" -#~ msgstr "Suunta" - -#~ msgid "Up" -#~ msgstr "Yls" - -#~ msgid "Down" -#~ msgstr "Alas" - -#~ msgid "Find Next" -#~ msgstr "Etsi seuraava" - -#~ msgid "Replace" -#~ msgstr "Korvaa" - -#~ msgid "Replace All" -#~ msgstr "Korvaa kaikki" - -#~ msgid "Vim: Received \"die\" request from session manager\n" -#~ msgstr "Vim: sessiomanageri lhetti die-pyynnn\n" - -#~ msgid "Close" -#~ msgstr "Sulje" - -#~ msgid "New tab" -#~ msgstr "Uusi vlilehti" - -#~ msgid "Open Tab..." -#~ msgstr "Avaa vlilehti..." - -#~ msgid "Vim: Main window unexpectedly destroyed\n" -#~ msgstr "Vim: Pikkuna tuhoutui odottamatta\n" - -#~ msgid "&Filter" -#~ msgstr "&Suodata" - -#~ msgid "&Cancel" -#~ msgstr "&Peru" - -#~ msgid "Directories" -#~ msgstr "Hakemistot" - -#~ msgid "Filter" -#~ msgstr "Suodatus" - -#~ msgid "&Help" -#~ msgstr "O&hje" - -#~ msgid "Files" -#~ msgstr "Tiedostot" - -#~ msgid "&OK" -#~ msgstr "&Ok" - -#~ msgid "Selection" -#~ msgstr "Valinta" - -#~ msgid "Find &Next" -#~ msgstr "Hae &seuraava" - -#~ msgid "&Replace" -#~ msgstr "Ko&rvaa" - -#~ msgid "Replace &All" -#~ msgstr "Korvaa k&aikki" - -#~ msgid "&Undo" -#~ msgstr "&Kumoa" - -#~ msgid "E671: Cannot find window title \"%s\"" -#~ msgstr "E671: Ikkunan otsikkoa ei lydy %s" - -# OLE on object linking and embedding p windowska -#~ msgid "E243: Argument not supported: \"-%s\"; Use the OLE version." -#~ msgstr "E243: Argumenttia ei tueta: -%s, kyt OLE-versiota" - -# MDI eli windowsin moni-ikkunasovellus -#~ msgid "E672: Unable to open window inside MDI application" -#~ msgstr "E672: Ikkunaa ei voitu avata MDI-sovellukseen" - -#~ msgid "Close tab" -#~ msgstr "Sulje vlilehti" - -#~ msgid "Open tab..." -#~ msgstr "Avaa vlilehti..." - -#~ msgid "Find string (use '\\\\' to find a '\\')" -#~ msgstr "Etsi merkkijonoa (\\\\:ll lyt \\:t)" - -#~ msgid "Find & Replace (use '\\\\' to find a '\\')" -#~ msgstr "Etsi ja korvaa (\\\\:ll lyt \\:t)" - -#~ msgid "Not Used" -#~ msgstr "Ei kytss" - -#~ msgid "Directory\t*.nothing\n" -#~ msgstr "Hakemisto\t*.nothing\n" +#~ "Ei onnistuttu asettaman polkua: sys.path ei ole list\n" +#~ "Lisää vim.VIM_SPECIAL_PATH muuttujaan sys.path" #~ msgid "" -#~ "Vim E458: Cannot allocate colormap entry, some colors may be incorrect" +#~ "Failed to set path hook: sys.path_hooks is not a list\n" +#~ "You should now do the following:\n" +#~ "- append vim.path_hook to sys.path_hooks\n" +#~ "- append vim.VIM_SPECIAL_PATH to sys.path\n" #~ msgstr "" -#~ "Vim E458: Ei voi varata vrikartan alkiota, vrit voivat menn vrin" +#~ "Ei voitu asettaa polkukoukkua: sys.path_hooks ei ole lista\n" +#~ "Koeta seuraavaa:\n" +#~ "- lisää vim.path_hook muuttujaan sys.path_hooks\n" +#~ "- lisää vim.VIM_SPECIAL_PATH muuttujaan sys.path\n" -#~ msgid "E250: Fonts for the following charsets are missing in fontset %s:" -#~ msgstr "E250: Seuraavien merkistjoukkojen fontit puuttuvat fontsetist %s:" +#~ msgid "internal error: invalid value type" +#~ msgstr "sisäinen virhe: huono arvotyyppi" -#~ msgid "E252: Fontset name: %s" -#~ msgstr "E252: Fontsetin nimi: %s" +#~ msgid "internal error: NULL reference passed" +#~ msgstr "sisäinen virhe: NULL-viite annettu" -#~ msgid "Font '%s' is not fixed-width" -#~ msgstr "Fontti %s ei ole tasavlinen" +#~ msgid "unable to convert %s to vim structure" +#~ msgstr "ei voi konvertoida oliota %s vim-tietorakenteeksi" -#~ msgid "E253: Fontset name: %s\n" -#~ msgstr "E253: Fontsetin nimi: %s\n" +#~ msgid "unable to convert %s to vim dictionary" +#~ msgstr "ei voitu konvertoida oliota %s vim-sanakirjaksi" -#~ msgid "Font0: %s\n" -#~ msgstr "Fontti0: %s\n" +#~ msgid "E859: Failed to convert returned python object to vim value" +#~ msgstr "E859: Ei voitu konvertoida python-oliota vim-arvoksi" -#~ msgid "Font1: %s\n" -#~ msgstr "Fontti1: %s\n" +#~ msgid "E858: Eval did not return a valid python object" +#~ msgstr "E858: Eval ei palauttanut python-oliota" -#~ msgid "Font% width is not twice that of font0\n" -#~ msgstr "Fontti%:n leveys ei ole kaksi kertaa fontti0:n\n" +#~ msgid "failed to run the code" +#~ msgstr "ei voitu suorittaa koodia" -#~ msgid "Font0 width: %\n" -#~ msgstr "Fontti0:n leveys: %\n" +#~ msgid "did not switch to the specified tab page" +#~ msgstr "ei voitu vaihtaa annetulle välilehtisivulle" + +#~ msgid "expected vim.TabPage object, but got %s" +#~ msgstr "odotettiin vim.TabPage-oliota, saatiin %s" + +#~ msgid "did not switch to the specified window" +#~ msgstr "ei vaihdettu annettuun ikkunaan" + +#~ msgid "failed to find window in the current tab page" +#~ msgstr "ei voitu löytää ikkunaa nykyiselle välilehtisivulle" + +#~ msgid "expected vim.Window object, but got %s" +#~ msgstr "odotettiin vim.Window-oliota, saatiin %s" + +#~ msgid "expected vim.Buffer object, but got %s" +#~ msgstr "odotettiin vim.Buffer-oliota, ei %s" + +#~ msgid "attempt to refer to deleted buffer" +#~ msgstr "yritettiin viitata poistettuun puskuriin" + +#~ msgid "no such window" +#~ msgstr "ikkunaa ei ole" + +#~ msgid "readonly attribute: buffer" +#~ msgstr "kirjoitussuojausattribuutti: puskuri" + +#~ msgid "attempt to refer to deleted window" +#~ msgstr "yritettiin viitata poistettuun ikkunaan" + +#~ msgid "no such tab page" +#~ msgstr "välilehteä ei ole" + +#~ msgid "attempt to refer to deleted tab page" +#~ msgstr "yritettiin viitata poistettuun välilehteen" + +#~ msgid "internal error: unknown option type" +#~ msgstr "sisäinen virhe: tuntematon asetustyyppi" + +#~ msgid "unable to get option value" +#~ msgstr "ei voitu hakea asetuksen arvoa" + +#~ msgid "failed to run function %s" +#~ msgstr "ei voitu suorittaa funktiota %s" + +#~ msgid "function %s does not exist" +#~ msgstr "funktiota %s ei ole" + +#~ msgid "unnamed function %s does not exist" +#~ msgstr "nimetöntä funktiota %s ei ole" + +#~ msgid "cannot modify fixed list" +#~ msgstr "ei voida muokata kiinitettyä listaa" + +#~ msgid "cannot delete vim.List attributes" +#~ msgstr "ei voi poistaa vim.List-attribuutteja" + +#~ msgid "failed to add item to list" +#~ msgstr "ei voitu lisätä kohtaa listaan" + +#~ msgid "attempt to assign sequence of size %d to extended slice of size %d" +#~ msgstr "" +#~ "yritettiin asettaa sekvenssiä jonka koko on %d sliceen jonka koko on %d" + +#~ msgid "internal error: failed to add item to list" +#~ msgstr "sisäinen virhe: ei voitu lisätä kohtaa listaan" + +#~ msgid "internal error: not enough list items" +#~ msgstr "sisäinen virhe: ei tarpeeksi listan kohtia" + +#~ msgid "internal error: no vim list item %d" +#~ msgstr "sisäinen virhe: ei vim-listan indeksiä %d" + +#~ msgid "attempt to assign sequence of size greater than %d to extended slice" +#~ msgstr "" +#~ "yritettiin sijoittaa sekvenssiä jonka koko on enemmän kuin %d sliceen" + +#~ msgid "slice step cannot be zero" +#~ msgstr "slicen askel ei voi olla nolla" + +#~ msgid "internal error: failed to get vim list item %d" +#~ msgstr "sisäinen virhe: ei pystytty hakea vimin listan indeksiä %d" + +#~ msgid "list index out of range" +#~ msgstr "listaindeksi arvoalueen ulkopuolelta" + +#~ msgid "list constructor does not accept keyword arguments" +#~ msgstr "listakonstruktori ei tue avainsanaparametrejä" + +#~ msgid "expected sequence element of size 2, but got sequence of size %d" +#~ msgstr "sekvenssin elementin koon pitäisi olla 2, ei %d" + +#~ msgid "hashtab changed during iteration" +#~ msgstr "hashtab muuttui kesken iteraation" + +#~ msgid "cannot set attribute %s" +#~ msgstr "ei voi asettaa attribuuttia %s" + +#~ msgid "cannot delete vim.Dictionary attributes" +#~ msgstr "ei voi poistaa vim.Dictionary-attribuutteja" + +#~ msgid "internal error: imp.find_module returned tuple with NULL" +#~ msgstr "" +#~ "sisäinen virhe: imp.find_module palautti tuplen joka sisältää nullin" #~ msgid "" -#~ "Font1 width: %\n" -#~ "\n" +#~ "expected 3-tuple as imp.find_module() result, but got tuple of size %d" #~ msgstr "" -#~ "Fontti1:n leveys: %\n" -#~ "\n" +#~ "odotettiin 3-tuple tuloksnea imp.find_module()-kutsulle, mutta tuplen " +#~ "koko onkin %d" -#~ msgid "Invalid font specification" -#~ msgstr "Virheellinen fonttimritys" +#~ msgid "expected 3-tuple as imp.find_module() result, but got %s" +#~ msgstr "odotettiin 3-tuplea tuloksena imp.find_module()-kutsulle, ei %s" -#~ msgid "&Dismiss" -#~ msgstr "&Ohita" +#~ msgid "E264: Python: Error initialising I/O objects" +#~ msgstr "E264: Python: Virhe IO-olioiden alustuksessa" -#~ msgid "no specific match" -#~ msgstr "ei tarkkaa tsmyst" - -#~ msgid "Vim - Font Selector" -#~ msgstr "Vim - fonttivalitsin" - -#~ msgid "Name:" -#~ msgstr "Nimi:" - -#~ msgid "Show size in Points" -#~ msgstr "Nyt koko pistein" - -#~ msgid "Encoding:" -#~ msgstr "Koodaus:" - -#~ msgid "Font:" -#~ msgstr "Fontti:" - -#~ msgid "Style:" -#~ msgstr "Tyyli:" - -#~ msgid "Size:" -#~ msgstr "Koko:" - -#~ msgid "E256: Hangul automata ERROR" -#~ msgstr "E256: Hangu-automaattivirhe" - -#~ msgid "E563: stat error" -#~ msgstr "E563: stat-virhe" - -#~ msgid "E625: cannot open cscope database: %s" -#~ msgstr "E625: ei voi avata cscope-tietokantaa: %s" - -#~ msgid "E626: cannot get cscope database information" -#~ msgstr "E626: ei voi hakea cscope-tietokannan tietoja" - -#~ msgid "Lua library cannot be loaded." -#~ msgstr "Luan kirjastoa ei voitu ladata." - -#~ msgid "cannot save undo information" -#~ msgstr "ei voitu tallentaa kumoustietoja" - -#~ msgid "" -#~ "E815: Sorry, this command is disabled, the MzScheme libraries could not " -#~ "be loaded." -#~ msgstr "E815: Sori, komento ei toimi, MzScheme-kirjastoa ei voitu ladata." - -#~ msgid "invalid expression" -#~ msgstr "virheellinen ilmaus" - -#~ msgid "expressions disabled at compile time" -#~ msgstr "ilmaukset poistettu kytst knnsaikana" - -#~ msgid "hidden option" -#~ msgstr "piilotettu asetus" - -#~ msgid "unknown option" -#~ msgstr "tuntematon asetus" - -#~ msgid "window index is out of range" -#~ msgstr "ikkunan indeksi alueen ulkopuolella" - -#~ msgid "couldn't open buffer" -#~ msgstr "ei voitu avata puskuria" - -#~ msgid "cannot delete line" -#~ msgstr "ei voitu poistaa rivi" - -#~ msgid "cannot replace line" -#~ msgstr "ei voitu korvata rivi" - -#~ msgid "cannot insert line" -#~ msgstr "ei voitu list rivi" - -#~ msgid "string cannot contain newlines" -#~ msgstr "merkkijono ei saa sislt rivinvaihtoja" - -#~ msgid "Vim error: ~a" -#~ msgstr "Vim-virhe: ~a" - -#~ msgid "Vim error" -#~ msgstr "Vim-virhe" - -#~ msgid "buffer is invalid" -#~ msgstr "puskuri on virheellinen" - -#~ msgid "window is invalid" -#~ msgstr "ikkuna on virheellinen" - -#~ msgid "linenr out of range" -#~ msgstr "rivinumero arvoalueen ulkopuolelta" - -#~ msgid "not allowed in the Vim sandbox" -#~ msgstr "ei sallittu Vimin hiekkalaatikossa" - -#~ msgid "E836: This Vim cannot execute :python after using :py3" -#~ msgstr "" -#~ "E836: Python: Ei voi kytt komentoja :py ja :py3 samassa istunnossa" - -#~ msgid "E837: This Vim cannot execute :py3 after using :python" -#~ msgstr "" -#~ "E837: Python: Ei voi kytt komentoja :py ja :py3 samassa istunnossa" - -#~ msgid "" -#~ "E263: Sorry, this command is disabled, the Python library could not be " -#~ "loaded." -#~ msgstr "" -#~ "E263: Sori, komento ei toimi, Python-kirjaston lataaminen ei onnistunut." +#~ msgid "invalid attribute: %s" +#~ msgstr "virheellinen attribuutti: %s" #~ msgid "can't delete OutputObject attributes" #~ msgstr "ei voi poistaa OutputObject-attribuutteja" -#~ msgid "softspace must be an integer" -#~ msgstr "softspacen pit olla kokonaisluku" +#~ msgid "number must be greater or equal to zero" +#~ msgstr "luvun on oltava yhtä suuri tai suurempi kuin nolla" -#~ msgid "invalid attribute" -#~ msgstr "virheellinen attribuutti" +#~ msgid "value is too small to fit into C int type" +#~ msgstr "arvo on liian pieni mahtumaan C:n int-tyyppiin" -#~ msgid "" -#~ msgstr "" - -#~ msgid "E659: Cannot invoke Python recursively" -#~ msgstr "E659: Pythonia ei voi kutsua rekursiivisesti" - -#~ msgid "E265: $_ must be an instance of String" -#~ msgstr "E265: muuttujan $_ pit olla Stringin instanssi" - -#~ msgid "" -#~ "E266: Sorry, this command is disabled, the Ruby library could not be " -#~ "loaded." -#~ msgstr "E266: Sori, komento ei toimi, Ruby-kirjastoa ei voitu ladata." - -#~ msgid "E267: unexpected return" -#~ msgstr "E267: odotuksenvastainen return" - -#~ msgid "E268: unexpected next" -#~ msgstr "E268: Odotuksenvastainen next" - -#~ msgid "E269: unexpected break" -#~ msgstr "E269: Odotuksenvastainen break" - -#~ msgid "E270: unexpected redo" -#~ msgstr "E270: odotuksenvastainen redo" - -#~ msgid "E271: retry outside of rescue clause" -#~ msgstr "E271: retry rescuen ulkopuolella" - -#~ msgid "E272: unhandled exception" -#~ msgstr "E272: ksittelemtn poikkeus" - -#~ msgid "E273: unknown longjmp status %d" -#~ msgstr "E273: tuntematon longjmp-tila %d" - -#~ msgid "Toggle implementation/definition" -#~ msgstr "Vaihda toteutuksen ja mritelmn vlill" - -#~ msgid "Show base class of" -#~ msgstr "Nyt kantaluokka kohteelle" - -#~ msgid "Show overridden member function" -#~ msgstr "Nyt korvattu jsenfunktio" - -#~ msgid "Retrieve from file" -#~ msgstr "Jljit tiedostosta" - -#~ msgid "Retrieve from project" -#~ msgstr "Jljit projektista" - -#~ msgid "Retrieve from all projects" -#~ msgstr "Jljit kaikista projekteista" - -#~ msgid "Retrieve" -#~ msgstr "Jljit" - -#~ msgid "Show source of" -#~ msgstr "Nyt lhdekoodi kohteelle" - -#~ msgid "Find symbol" -#~ msgstr "Etsi symboli" - -#~ msgid "Browse class" -#~ msgstr "Selaa luokkaa" - -#~ msgid "Show class in hierarchy" -#~ msgstr "Nyt luokka hierarkiassa" - -#~ msgid "Show class in restricted hierarchy" -#~ msgstr "Nyt luokka rajoitetussa hierarkiassa" - -#~ msgid "Xref refers to" -#~ msgstr "Xref viittaa kohteeseen" - -#~ msgid "Xref referred by" -#~ msgstr "Xref viitattu kohteesta" - -#~ msgid "Xref has a" -#~ msgstr "Xref sislt kohteen" - -#~ msgid "Xref used by" -#~ msgstr "Xrefi kytt" - -#~ msgid "Show docu of" -#~ msgstr "Nyt dokumentti kohteelle" - -#~ msgid "Generate docu for" -#~ msgstr "Luo dokumentti kohteelle" - -#~ msgid "" -#~ "Cannot connect to SNiFF+. Check environment (sniffemacs must be found in " -#~ "$PATH).\n" +#~ msgid "expected int() or something supporting coercing to int(), but got %s" #~ msgstr "" -#~ "Ei voida yhdist SNiFF+:aan. Tarkista ympristmuuttujat (sniffemacsin " -#~ "lyty polkumuuttujasta $PATH).\n" - -#~ msgid "E274: Sniff: Error during read. Disconnected" -#~ msgstr "E274: Sniff: Virhe luettaessa, yhteys katkaistu" - -#~ msgid "SNiFF+ is currently " -#~ msgstr "SNiFF+ " - -#~ msgid "not " -#~ msgstr "ei ole " - -#~ msgid "connected" -#~ msgstr "yhdistetty" - -#~ msgid "E275: Unknown SNiFF+ request: %s" -#~ msgstr "E275: Tuntematon SNiFF+-pyynt: %s" - -#~ msgid "E276: Error connecting to SNiFF+" -#~ msgstr "E276: Virhe yhdistettess SNiFF+:aan" - -#~ msgid "E278: SNiFF+ not connected" -#~ msgstr "E278: SNiFF+ ei ole yhdistetty" - -#~ msgid "E279: Not a SNiFF+ buffer" -#~ msgstr "E279: Ei ole SNiFF+-puskuri" - -#~ msgid "Sniff: Error during write. Disconnected" -#~ msgstr "Sniff: Virhe kirjoituksessa, yhteys katkaistu" - -#~ msgid "invalid buffer number" -#~ msgstr "virheellinen puskurinumero" - -#~ msgid "not implemented yet" -#~ msgstr "ei toteutettu" - -#~ msgid "cannot set line(s)" -#~ msgstr "ei voi asettaa rivej" - -#~ msgid "invalid mark name" -#~ msgstr "virheellinen merkin nimi" - -#~ msgid "mark not set" -#~ msgstr "merkko ei ole asetettu" - -#~ msgid "row %d column %d" -#~ msgstr "rivi %d sarake %d" - -#~ msgid "cannot insert/append line" -#~ msgstr "rivin lisys ei onnistu" - -#~ msgid "line number out of range" -#~ msgstr "rivinumero arvoalueen ulkopuolella" - -#~ msgid "unknown flag: " -#~ msgstr "tuntematon asetus: " - -#~ msgid "unknown vimOption" -#~ msgstr "tuntematon vimOption" - -#~ msgid "keyboard interrupt" -#~ msgstr "nppimistkeskeytys" - -#~ msgid "vim error" -#~ msgstr "vim-virhe" - -#~ msgid "cannot create buffer/window command: object is being deleted" -#~ msgstr "ei voi luoda puskuri- tai ikkunakomentoa, olio on poistumassa" +#~ "odotettiin tyyppiä int() tai jotain joka muuntuu tyyppiin int(), ei %s" #~ msgid "" -#~ "cannot register callback command: buffer/window is already being deleted" -#~ msgstr "callbackia ei voi rekisterid: puskuri tai ikkuna on poistettu" - -#~ msgid "" -#~ "E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-" -#~ "dev@vim.org" +#~ "expected int(), long() or something supporting coercing to long(), but " +#~ "got %s" #~ msgstr "" -#~ "E280: kriittinen TCL-virhe: reflist hajalla? Ilmoita asiasta " -#~ "postituslistalle vim-dev@vim.org" +#~ "odotettiin instanssia tyypeistä int(), long() tai mitä tahansa joka " +#~ "muuntuisi tyyppiin long(), ei %s" -#~ msgid "cannot register callback command: buffer/window reference not found" -#~ msgstr "" -#~ "callbackia ei voi rekisterid: puskurin tai ikkunan viitett ei lydy" +#~ msgid "expected bytes() or str() instance, but got %s" +#~ msgstr "odotettiin instanssia tyypeistä bytes() tai str(), ei %s" + +#~ msgid "expected str() or unicode() instance, but got %s" +#~ msgstr "odottettiin insanssia tyypeistä str() tai unicode(), ei %s" + +#~ msgid "index must be int or slice, not %s" +#~ msgstr "indeksin pitää olla int tai slice, ei %s" + +#~ msgid "failed to add key '%s' to dictionary" +#~ msgstr "avaimen %s lisääminen sanakirjaan ei onnistu" + +#~ msgid "list is locked" +#~ msgstr "luettelo on lukittu" + +#~ msgid "Need encryption key for \"%s\"" +#~ msgstr "Tarvitaan salausavain kohteelle %s " + +#~ msgid "E744: NetBeans does not allow changes in read-only files" +#~ msgstr "E744: NetBeans ei tue muutoksia kirjoitussuojattuihin tiedostoihin" + +#~ msgid "E463: Region is guarded, cannot modify" +#~ msgstr "E463: Alue on suojattu, muuttaminen ei onnistu" + +#~ msgid "E449: Invalid expression received" +#~ msgstr "E449: Virheellinen ilmaus saatu" + +#~ msgid "E233: cannot open display" +#~ msgstr "E233: näyttöä ei voi avata" + +#~ msgid "E247: no registered server named \"%s\"" +#~ msgstr "E247: palvelinta %s ei ole rekisteröitynä" + +#~ msgid "E800: Arabic cannot be used: Not enabled at compile time\n" +#~ msgstr "E800: Arabiaa ei voi käyttää, koska sitä ei käännetty mukaan\n" + +#~ msgid "E27: Farsi cannot be used: Not enabled at compile time\n" +#~ msgstr "E27: Farsia ei voi käyttää, koska sitä ei käännetty mukaan\n" + +#~ msgid "E26: Hebrew cannot be used: Not enabled at compile time\n" +#~ msgstr "E26: Hepreaa ei voi käyttää, koska sitä ei käännetty mukaan\n" + +#~ msgid "E25: GUI cannot be used: Not enabled at compile time" +#~ msgstr "E25: GUIta ei voi käyttää, koska sitä ei käännetty mukaan" + +#~ msgid "E448: Could not load library function %s" +#~ msgstr "E448: Ei voitu ladta kirjastofunktiota %s" + +#~ msgid "E236: Font \"%s\" is not fixed-width" +#~ msgstr "E236: Fontti %s ei ole tasavälinen" + +#~ msgid "E234: Unknown fontset: %s" +#~ msgstr "E234: Tuntematon fontset: %s" + +#~ msgid "gvimext.dll error" +#~ msgstr "gvimext.dll-virhe" + +#~ msgid "Error creating process: Check if gvim is in your path!" +#~ msgstr "Virhe prosessin käynnistämisessä, varmista että gvim on polulla" + +#~ msgid "Edits the selected file(s) with Vim" +#~ msgstr "Muokkaa valittuja tiedostoja Vimillä" + +#~ msgid "Edit with existing Vim - " +#~ msgstr "Muokkaa olemassaolevalla Vimillä - " + +#~ msgid "Edit with &Vim" +#~ msgstr "Muokkaa &Vimillä" + +#~ msgid "Diff with Vim" +#~ msgstr "Diffi Vimillä" + +#~ msgid "Edit with single &Vim" +#~ msgstr "Muokkaa yhdellä &Vimillä" + +#~ msgid "Edit with &multiple Vims" +#~ msgstr "&Muokkaa usealla Vimillä" + +#~ msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" +#~ msgstr "E299: Perl-suoritus kielletty hiekkalaatikossa ilman Safe-moduulia" #~ msgid "" -#~ "E571: Sorry, this command is disabled: the Tcl library could not be " -#~ "loaded." -#~ msgstr "E571: Sori, komento ei toimi, Tcl-kirjastoa ei voitu ladata." +#~ "Sorry, this command is disabled: the Perl library could not be loaded." +#~ msgstr "komento ei toimi, Perl kirjastoa ei voinut ladata." -#~ msgid "" -#~ "E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim." -#~ "org" -#~ msgstr "" -#~ "E281: TCL-virhe: lopetuskoodi ei ole kokonaisluku? Ilmoita asiasta " -#~ "postituslistalle vim-dev@vim.org" +#~ msgid "E370: Could not load library %s" +#~ msgstr "E370: Kirjaston %s lataaminen ei onnistu" -#~ msgid "E572: exit code %d" -#~ msgstr "E572: palautusarvo %d" +#~ msgid "type :help windows95 for info on this" +#~ msgstr "kirjoita :help windows95 lisätietoja varten" -#~ msgid "cannot get line" -#~ msgstr "ei voida hakea rivi" +#~ msgid "WARNING: Windows 95/98/ME detected" +#~ msgstr "VAROITUS: Window 95/98/ME havaittu" -#~ msgid "Unable to register a command server name" -#~ msgstr "Komentopalvelimen nimen rekisterinti ei onnistu" +#~ msgid " for Vim defaults " +#~ msgstr " Vim-oletuksia varten" -#~ msgid "E248: Failed to send command to the destination program" -#~ msgstr "E248: Komennon lhetys kohdeohjelmalle ei onnistu" +#~ msgid "menu Edit->Global Settings->Toggle Vi Compatible" +#~ msgstr "valikko Muokkaa->Yleiset asetukset->Vaihda Vi-yhteensopivuutta" -#~ msgid "E573: Invalid server id used: %s" -#~ msgstr "E573: Virheellinen palvelimen tunniste: %s" +#~ msgid "menu Edit->Global Settings->Toggle Insert Mode " +#~ msgstr "valikko Muokkaa->Yleiset asetukset->Vaihda syötetilaa" -#~ msgid "E251: VIM instance registry property is badly formed. Deleted!" -#~ msgstr "E251: VIMin instanssin rekisteriarvo on virheellinen, poistettiin." +#~ msgid "Running modeless, typed text is inserted" +#~ msgstr "Suoritetaan tilattomana, kirjoitettu teksti syötetään" -#~ msgid "netbeans is not supported with this GUI\n" -#~ msgstr "netbeans ei toimi tss kyttliittymss\n" +#~ msgid "menu Help->Orphans for information " +#~ msgstr "valikko Ohje->Orvot lisätietoja varten " -#~ msgid "This Vim was not compiled with the diff feature." -#~ msgstr "Thn Vimiin ei ole knnetty diff-toimintoja mukaan." +#~ msgid "type :help cp-default for info on this" +#~ msgstr "kirjoita :help cp-default ohjetta oletuksista varten" -#~ msgid "'-nb' cannot be used: not enabled at compile time\n" -#~ msgstr "-nb:t ei voi kytt, koska sit ei knnetty mukaan\n" +#~ msgid "type :set nocp for Vim defaults" +#~ msgstr "kirjoita :set nocp Vimin oletuksiin " -#~ msgid "Vim: Error: Failure to start gvim from NetBeans\n" -#~ msgstr "Vim: Virhe: Gvimin kynnistys NetBeansist ei onnistu\n" +#~ msgid "Running in Vi compatible mode" +#~ msgstr "Suoritetaan Vi-yhteensopivuustilaa" + +#~ msgid "type :help version8 for version info" +#~ msgstr "kirjoita :help version8 versiotietoja varten " + +#~ msgid "type :help or for on-line help" +#~ msgstr "kirjoita :help tai ohjetta varten " + +#~ msgid "version " +#~ msgstr "versio " + +#~ msgid "VIM - Vi IMproved" +#~ msgstr "VIM - Vi IMproved" + +#~ msgid " DEBUG BUILD" +#~ msgstr " DEBUG-versio" + +#~ msgid "Linking: " +#~ msgstr "Linkitys: " + +#~ msgid "Compiler: " +#~ msgstr "Käännin: " + +#~ msgid "Compilation: " +#~ msgstr "Käännös: " + +#~ msgid " system menu file: \"" +#~ msgstr " järjestelmävalikko: \"" + +#~ msgid " defaults file: \"" +#~ msgstr " defaults-tiedosto: \"" + +#~ msgid "3rd user gvimrc file: \"" +#~ msgstr "3. käyttäjän gvimrc: \"" + +#~ msgid "2nd user gvimrc file: \"" +#~ msgstr "2. käyttäjän gvimrc: \"" + +#~ msgid " user gvimrc file: \"" +#~ msgstr " käyttäjän gvimrc: \"" + +#~ msgid " system gvimrc file: \"" +#~ msgstr " järjestelmän gvimrc: \"" + +#~ msgid " 2nd user exrc file: \"" +#~ msgstr " 2. käyttäjän exrc: \"" + +#~ msgid " user exrc file: \"" +#~ msgstr " käyttäjän exrc: \"" + +#~ msgid " 3rd user vimrc file: \"" +#~ msgstr " 3. käyttäjän vimrc: \"" + +#~ msgid " 2nd user vimrc file: \"" +#~ msgstr " 2. käyttäjän vimrc: \"" + +#~ msgid " user vimrc file: \"" +#~ msgstr " käyttäjän vimrc: \"" + +#~ msgid "with (classic) GUI." +#~ msgstr "perinteisellä GUIlla." + +#~ msgid "with Cocoa GUI." +#~ msgstr "Cocoa-GUIlla." + +#~ msgid "with Carbon GUI." +#~ msgstr "Carbon-GUIlla." + +#~ msgid "with GUI." +#~ msgstr "GUIlla." + +#~ msgid "with Photon GUI." +#~ msgstr "Photon-GUIlla." + +#~ msgid "with X11-Athena GUI." +#~ msgstr "X11-Athena-GUIlla." + +#~ msgid "with X11-neXtaw GUI." +#~ msgstr "X11-neXtaw-GUIlla." + +#~ msgid "with X11-Motif GUI." +#~ msgstr "X11-Motif-GUIlla." + +#~ msgid "with GTK2 GUI." +#~ msgstr "GTK2-GUIlla." + +#~ msgid "with GTK2-GNOME GUI." +#~ msgstr "GTK2-Gnome-GUIlla." + +#~ msgid "with GTK3 GUI." +#~ msgstr "GTK3-GUIlla." + +#~ msgid "without GUI." +#~ msgstr "ilman GUIta." #~ msgid "" #~ "\n" -#~ "Where case is ignored prepend / to make flag upper case" +#~ "Tiny version " #~ msgstr "" #~ "\n" -#~ "Jos aakkoslaji on ohitettu, lis alkuun / tehdksesi asetuksesta " -#~ "suuraakkosia" - -#~ msgid "-register\t\tRegister this gvim for OLE" -#~ msgstr "-register\t\trekisteri gvim OLEa varten" - -#~ msgid "-unregister\t\tUnregister gvim for OLE" -#~ msgstr "-unregister\t\tPoista gvim OLE-rekisterist" - -#~ msgid "-g\t\t\tRun using GUI (like \"gvim\")" -#~ msgstr "-g\t\t\tAvaa GUI (kuten gvimill)" - -#~ msgid "-f or --nofork\tForeground: Don't fork when starting GUI" -#~ msgstr "-f tai --nofork\tEdustalle: l haarauta GUIn kynnistyksess" - -#~ msgid "-f\t\t\tDon't use newcli to open window" -#~ msgstr "-f\t\t\tl kyt newcli:t ikkunan avaamiseen" - -#~ msgid "-dev \t\tUse for I/O" -#~ msgstr "-dev \t\tKyt IO:hon" - -#~ msgid "-U \t\tUse instead of any .gvimrc" -#~ msgstr "-U \t\tKyt -tiedostoa .gvimrc:iden sijasta" - -#~ msgid "-x\t\t\tEdit encrypted files" -#~ msgstr "-x\t\t\tMuokkaa salattua tiedostoa" - -#~ msgid "-display \tConnect vim to this particular X-server" -#~ msgstr "-display \tYhdist vim tiettyyn X-palvelimeen" - -#~ msgid "-X\t\t\tDo not connect to X server" -#~ msgstr "-X\t\t\tl yhdist X-palvelimeen" - -#~ msgid "--remote \tEdit in a Vim server if possible" -#~ msgstr "" -#~ "--remote \tMuokkaa Vim-palvelimessa, jos " -#~ "mahdollista" - -#~ msgid "--remote-silent Same, don't complain if there is no server" -#~ msgstr "" -#~ "--remote-silent \tSama, mutta l ilmoita puuttuvasta " -#~ "palvelimesta" - -#~ msgid "" -#~ "--remote-wait As --remote but wait for files to have been edited" -#~ msgstr "" -#~ "--remote-wait kuten --remote, mutta odota tiedostojen " -#~ "muokkaamista" - -#~ msgid "" -#~ "--remote-wait-silent Same, don't complain if there is no server" -#~ msgstr "" -#~ "--remote-wait-silent sama, mutta l ilmoita puuttuvasta " -#~ "palvelimesta" - -#~ msgid "" -#~ "--remote-tab[-wait][-silent] As --remote but use tab page per " -#~ "file" -#~ msgstr "" -#~ "--remote-tab[-wait][-silent] kuten --remote, mutta avaa " -#~ "vlilehti joka tiedostolle" - -#~ msgid "--remote-send \tSend to a Vim server and exit" -#~ msgstr "" -#~ "--remote-send \tLhet painalluksina Vimille ja " -#~ "lopeta" - -#~ msgid "" -#~ "--remote-expr \tEvaluate in a Vim server and print result" -#~ msgstr "" -#~ "--remote-expr \tKsittele Vim-palvelimella ja tulosta " -#~ "tulos" - -#~ msgid "--serverlist\t\tList available Vim server names and exit" -#~ msgstr "--serverlist\t\tLuettele Vim-palvelinten nimet ja lopeta" - -#~ msgid "--servername \tSend to/become the Vim server " -#~ msgstr "--servername \tLhet Vim-palvelimelle tai luo se" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (Motif version):\n" -#~ msgstr "" -#~ "\n" -#~ "Gvimin (Motif-version) tuntemat argumentit:\n" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (neXtaw version):\n" -#~ msgstr "" -#~ "\n" -#~ "Gvimin (neXtaw-version) tuntemat argumentit:\n" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (Athena version):\n" -#~ msgstr "" -#~ "\n" -#~ "Gvimin (Athena-version) tuntemat argumentit:\n" - -#~ msgid "-display \tRun vim on " -#~ msgstr "-display \tSuorita vim " - -#~ msgid "-iconic\t\tStart vim iconified" -#~ msgstr "-iconic\t\tKynnist pienennettyn" - -#~ msgid "-background \tUse for the background (also: -bg)" -#~ msgstr "-background \tKyt taustavrin (mys: -bg)" - -#~ msgid "-foreground \tUse for normal text (also: -fg)" -#~ msgstr "-foreground \tKyt tekstin vrin (mys: -fg)" - -#~ msgid "-font \t\tUse for normal text (also: -fn)" -#~ msgstr "-font \t\tKyt tekstiss (mys: -fn)" - -#~ msgid "-boldfont \tUse for bold text" -#~ msgstr "-boldfont \tKyt lihavoidussa tekstiss" - -#~ msgid "-italicfont \tUse for italic text" -#~ msgstr "-italicfont \tKyt kursivoidussa tekstiss" - -#~ msgid "-geometry \tUse for initial geometry (also: -geom)" -#~ msgstr "" -#~ "-geometry \tKyt mittoja ikkunan asetteluun (mys: -geom)" - -#~ msgid "-borderwidth \tUse a border width of (also: -bw)" -#~ msgstr "-borderwidt \tKyt reunuksissa (mys: -bw) " - -#~ msgid "" -#~ "-scrollbarwidth Use a scrollbar width of (also: -sw)" -#~ msgstr "" -#~ "-scrollbarwidth Kyt vierityspalkissa (mys: -sw)" - -#~ msgid "-menuheight \tUse a menu bar height of (also: -mh)" -#~ msgstr "-menuheight \tKyt valikossa (mys: -mh)" - -#~ msgid "-reverse\t\tUse reverse video (also: -rv)" -#~ msgstr "-reverse\t\tKyt knteisvrej (mys: -rv) " - -#~ msgid "+reverse\t\tDon't use reverse video (also: +rv)" -#~ msgstr "+reverse\t\tl kyt knteisvrej (mys: +rv)" - -#~ msgid "-xrm \tSet the specified resource" -#~ msgstr "-xrm \tAseta resurssi" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (RISC OS version):\n" -#~ msgstr "" -#~ "\n" -#~ "Gvimin (RISC OS -version) tuntemat argumentit:\n" - -#~ msgid "--columns \tInitial width of window in columns" -#~ msgstr "--columns \tIkkunan alkuleveys sarakkeina" - -#~ msgid "--rows \tInitial height of window in rows" -#~ msgstr "--rows \tIkkunan alkukorkeus rivein" - -#~ msgid "" -#~ "\n" -#~ "Arguments recognised by gvim (GTK+ version):\n" -#~ msgstr "" -#~ "\n" -#~ "Gvimin (GTK+-version) tuntemat argumentit:\n" - -#~ msgid "-display \tRun vim on (also: --display)" -#~ msgstr "-display \tSuorita vim nytll (mys: --display)" - -# X-ikkunointijrjestelmss saman sovelluksen saman luokan ikkunat -# tunnistetaan rooliresursseista -#~ msgid "--role \tSet a unique role to identify the main window" -#~ msgstr "" -#~ "--role \tAseta pikkunalle ainutlaatuinen rooli tunnisteeksi" - -#~ msgid "--socketid \tOpen Vim inside another GTK widget" -#~ msgstr "--socketid \tAvaa Vim annettuun GTK-olioon " - -#~ msgid "-P \tOpen Vim inside parent application" -#~ msgstr "-P \tAvaa Vim isntohjelman sisn" - -#~ msgid "--windowid \tOpen Vim inside another win32 widget" -#~ msgstr "--windowid \tAvaa Vim annettuun win32-olioon " - -#~ msgid "No display" -#~ msgstr "Ei nytt" - -#~ msgid ": Send failed.\n" -#~ msgstr ": Lhetys eponnistui.\n" - -#~ msgid ": Send failed. Trying to execute locally\n" -#~ msgstr ": Lhetys eponnistui. Yritetn suorittaa paikallisena\n" - -#~ msgid "%d of %d edited" -#~ msgstr "%d/%d muokattu" - -#~ msgid "No display: Send expression failed.\n" -#~ msgstr "Ei nytt: Ilmauksen lhetys eponnistui.\n" - -#~ msgid ": Send expression failed.\n" -#~ msgstr ": Ilmauksen lhetys eponnistui.\n" - -#~ msgid "E543: Not a valid codepage" -#~ msgstr "E543: Koodisivu ei ole kyp" - -#~ msgid "E285: Failed to create input context" -#~ msgstr "E285: Sytekontekstin luonti ei onnistu" - -#~ msgid "E286: Failed to open input method" -#~ msgstr "E286: Sytemetodin avaus ei onnistu" - -#~ msgid "E287: Warning: Could not set destroy callback to IM" -#~ msgstr "" -#~ "E287: Varoitus: Ei voitu asettaa destroy-kutsua sytemetodipalvelimelle" - -#~ msgid "E288: input method doesn't support any style" -#~ msgstr "E288: sytemetodi ei tue tyylej" - -#~ msgid "E289: input method doesn't support my preedit type" -#~ msgstr "E289: sytemetodi ei tue tt preedit-tyyppi" - -#~ msgid "" -#~ "E833: %s is encrypted and this version of Vim does not support encryption" -#~ msgstr "E833: %s on salattu eik tm Vim tue salausta" - -#~ msgid "Swap file is encrypted: \"%s\"" -#~ msgstr "Swap-tiedosto on salattu: %s" - -#~ msgid "" -#~ "\n" -#~ "If you entered a new crypt key but did not write the text file," -#~ msgstr "" -#~ "\n" -#~ "Jos kytit uutta salausavainta muttet kirjoittanut tekstitiedostoa," - -#~ msgid "" -#~ "\n" -#~ "enter the new crypt key." -#~ msgstr "" -#~ "\n" -#~ "anna uusi salausavain." - -#~ msgid "" -#~ "\n" -#~ "If you wrote the text file after changing the crypt key press enter" -#~ msgstr "" -#~ "\n" -#~ "Jos kirjoitit tekstitiedoston salausavaimen vaihdon jlkeen paina enteri" - -#~ msgid "" -#~ "\n" -#~ "to use the same key for text file and swap file" -#~ msgstr "" -#~ "\n" -#~ "kyttksesi samaa avainta teksti- ja swppitiedostoille" - -#~ msgid "Using crypt key from swap file for the text file.\n" -#~ msgstr "Kytetn swpin salausavainta tekstitiedostolle\n" - -#~ msgid "" -#~ "\n" -#~ " [not usable with this version of Vim]" -#~ msgstr "" -#~ "\n" -#~ " [ei toimi tmn Vim-version kanssa]" - -#~ msgid "Tear off this menu" -#~ msgstr "Repise valikko irti" - -#~ msgid "Select Directory dialog" -#~ msgstr "Hakemiston valintaikkuna" - -#~ msgid "Save File dialog" -#~ msgstr "Tallennusikkuna" - -#~ msgid "Open File dialog" -#~ msgstr "Avausikkuna" - -#~ msgid "E338: Sorry, no file browser in console mode" -#~ msgstr "E338: Sori, tiedostonselain puuttuu konsolitilasta" - -#~ msgid "Vim: preserving files...\n" -#~ msgstr "Vim: sstetn tiedostoja...\n" - -#~ msgid "Vim: Finished.\n" -#~ msgstr "Vim: Valmis.\n" - -#~ msgid "ERROR: " -#~ msgstr "VIRHE: " - -#~ msgid "" -#~ "\n" -#~ "[bytes] total alloc-freed %-%, in use %, peak use " -#~ "%\n" -#~ msgstr "" -#~ "\n" -#~ "[tavua] yht. alloc-free %-%, kytss %, " -#~ "kytthuippu %\n" - -#~ msgid "" -#~ "[calls] total re/malloc()'s %, total free()'s %\n" -#~ "\n" -#~ msgstr "" -#~ "[kutsut] yht. re/malloc() %, yht. free() %\n" -#~ "\n" - -#~ msgid "E340: Line is becoming too long" -#~ msgstr "E340: Rivist tulee liian pitk" - -#~ msgid "E341: Internal error: lalloc(%, )" -#~ msgstr "E341: Sisinen virhe: lalloc(%, )" - -#~ msgid "E547: Illegal mouseshape" -#~ msgstr "E547: Virheellinen hiiren muoto" - -#~ msgid "Enter encryption key: " -#~ msgstr "Anna salausavain: " - -#~ msgid "Enter same key again: " -#~ msgstr "Anna sama avain uudestaan: " - -#~ msgid "Keys don't match!" -#~ msgstr "Avaimet eivt tsm!" - -#~ msgid "Cannot connect to Netbeans #2" -#~ msgstr "Ei voi yhdist Netbeans #2:een" - -#~ msgid "Cannot connect to Netbeans" -#~ msgstr "Ei voi yhdist Netbeansiin" - -#~ msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\"" -#~ msgstr "E668: Vr avaustila NetBeans-yhteyden infotiedostolle: %s" - -#~ msgid "read from Netbeans socket" -#~ msgstr "luettu Netbeans-soketista" - -#~ msgid "E658: NetBeans connection lost for buffer %" -#~ msgstr "E658: NetBeans-yhteys katkesi puskurille %" - -#~ msgid "E511: netbeans already connected" -#~ msgstr "E511: netbeans on yhdistetty jo" - -#~ msgid "E505: " -#~ msgstr "E505: " - -#~ msgid "E775: Eval feature not available" -#~ msgstr "E775: Eval ei ole kytettviss" - -#~ msgid "freeing % lines" -#~ msgstr "vapautetaan % rivi" - -#~ msgid "E530: Cannot change term in GUI" -#~ msgstr "E530: Ei voi vaihtaa termi GUIssa" - -#~ msgid "E531: Use \":gui\" to start the GUI" -#~ msgstr "E531: Kyt komentoa :gui GUIn kynnistmiseen" - -#~ msgid "E617: Cannot be changed in the GTK+ 2 GUI" -#~ msgstr "E617: Ei voi muuttaa GTK+2-GUIssa" - -#~ msgid "E596: Invalid font(s)" -#~ msgstr "E596: Viallisia fontteja" - -#~ msgid "E597: can't select fontset" -#~ msgstr "E597: Fontsetin valinta ei onnistu" - -#~ msgid "E598: Invalid fontset" -#~ msgstr "E598: Viallinen fontset" - -#~ msgid "E533: can't select wide font" -#~ msgstr "E533: Leven fontin valinta ei onnistu" - -#~ msgid "E534: Invalid wide font" -#~ msgstr "E534: Viallinen leve fontti" - -#~ msgid "E538: No mouse support" -#~ msgstr "E538: Hiirt ei tueta" - -#~ msgid "cannot open " -#~ msgstr "ei voi avata " - -#~ msgid "VIM: Can't open window!\n" -#~ msgstr "VIM: Ei voi avata ikkunaa\n" - -#~ msgid "Need Amigados version 2.04 or later\n" -#~ msgstr "Amigados 2.04 tai uudempi tarvitaan\n" - -#~ msgid "Need %s version %\n" -#~ msgstr "Tarvitaan %s versio %\n" - -#~ msgid "Cannot open NIL:\n" -#~ msgstr "Ei voi avata NILi:\n" - -#~ msgid "Cannot create " -#~ msgstr "Ei voi luoda " - -#~ msgid "Vim exiting with %d\n" -#~ msgstr "Vim sulkeutuu koodilla %d\n" - -#~ msgid "cannot change console mode ?!\n" -#~ msgstr "ei voi vaihtaa konsolitilaa?\n" - -#~ msgid "mch_get_shellsize: not a console??\n" -#~ msgstr "mch_get_shellsize: ei ole konsoli?\n" - -#~ msgid "E360: Cannot execute shell with -f option" -#~ msgstr "E360: Kuorta ei voi avata asetuksella -f" - -#~ msgid "Cannot execute " -#~ msgstr "Ei voi suorittaa " - -#~ msgid "shell " -#~ msgstr "kuori " - -#~ msgid " returned\n" -#~ msgstr " palautti\n" - -#~ msgid "ANCHOR_BUF_SIZE too small." -#~ msgstr "ANCHOR_BUF_SIZE liian pieni." - -#~ msgid "I/O ERROR" -#~ msgstr "IO-virhe" - -#~ msgid "Message" -#~ msgstr "Viesti" - -#~ msgid "'columns' is not 80, cannot execute external commands" -#~ msgstr "columns ei ole 80, ei voi suorittaa ulkoista komentoa" - -#~ msgid "E237: Printer selection failed" -#~ msgstr "E237: Tulostimen valinta eponnistui" - -#~ msgid "to %s on %s" -#~ msgstr "tulostimelle %s kohteessa %s" - -#~ msgid "E613: Unknown printer font: %s" -#~ msgstr "E613: Tuntematon tulostimen fontti: %s" - -#~ msgid "E238: Print error: %s" -#~ msgstr "E238: Tulostinvirhe: %s" - -#~ msgid "Printing '%s'" -#~ msgstr "Tulostetaan %s" - -#~ msgid "E244: Illegal charset name \"%s\" in font name \"%s\"" -#~ msgstr "E244: Virheellinen merkistn nimi %s fontin nimess %s" - -#~ msgid "E245: Illegal char '%c' in font name \"%s\"" -#~ msgstr "E245: Virheellinen merkki %c fontin nimess %s" - -#~ msgid "Vim: Double signal, exiting\n" -#~ msgstr "Vim: Kaksoissignaali, lopetetaan\n" - -#~ msgid "Vim: Caught deadly signal %s\n" -#~ msgstr "Vim: Tappava signaali %s\n" - -#~ msgid "Vim: Caught deadly signal\n" -#~ msgstr "Vim: Tappava signaali\n" - -#~ msgid "Opening the X display took % msec" -#~ msgstr "X-nytn avaus vei % millisekuntia" - -#~ msgid "" -#~ "\n" -#~ "Vim: Got X error\n" -#~ msgstr "" -#~ "\n" -#~ "Vim: X-virhe\n" - -#~ msgid "Testing the X display failed" -#~ msgstr "X-nytn testaus eponnistui" - -#~ msgid "Opening the X display timed out" -#~ msgstr "X-nytn avaus aikakatkaistiin" - -#~ msgid "" -#~ "\n" -#~ "Cannot execute shell sh\n" -#~ msgstr "" -#~ "\n" -#~ "Kuoren sh suoritus ei onnistu\n" - -#~ msgid "" -#~ "\n" -#~ "Cannot create pipes\n" -#~ msgstr "" -#~ "\n" -#~ "Putkia ei voi tehd\n" - -#~ msgid "" -#~ "\n" -#~ "Cannot fork\n" -#~ msgstr "" -#~ "\n" -#~ "Ei voi haarauttaa\n" - -#~ msgid "" -#~ "\n" -#~ "Command terminated\n" -#~ msgstr "" -#~ "\n" -#~ "Komento loppui\n" - -#~ msgid "XSMP lost ICE connection" -#~ msgstr "XSMP kadotti ICE-yhteyden" - -#~ msgid "Opening the X display failed" -#~ msgstr "X-nytn avaus eponnistui" - -#~ msgid "XSMP handling save-yourself request" -#~ msgstr "XSMP ksittelee save-yourself-pyynt" - -#~ msgid "XSMP opening connection" -#~ msgstr "XSMP avaa yhteytt" - -#~ msgid "XSMP ICE connection watch failed" -#~ msgstr "XSMP:n ICE-yhteyden tarkkailu eponnistui" - -#~ msgid "XSMP SmcOpenConnection failed: %s" -#~ msgstr "XSMP SmcOpenConnection eponnistui: %s" - -#~ msgid "At line" -#~ msgstr "Rivill" - -#~ msgid "Could not load vim32.dll!" -#~ msgstr "Vim32.dll: ei voitu ladata" - -#~ msgid "VIM Error" -#~ msgstr "VIM-virhe" - -#~ msgid "Could not fix up function pointers to the DLL!" -#~ msgstr "Ei voitu korjata funktio-osoittimia DLL:ss" - -#~ msgid "shell returned %d" -#~ msgstr "kuori palautti arvon %d" - -#~ msgid "Vim: Caught %s event\n" -#~ msgstr "Vim: Napattiin %s\n" - -#~ msgid "close" -#~ msgstr "sulkeminen" - -#~ msgid "logoff" -#~ msgstr "uloskirjautuminen" - -#~ msgid "shutdown" -#~ msgstr "sammutus" - -#~ msgid "E371: Command not found" -#~ msgstr "E371: Komentoa ei lydy" - -#~ msgid "" -#~ "VIMRUN.EXE not found in your $PATH.\n" -#~ "External commands will not pause after completion.\n" -#~ "See :help win32-vimrun for more information." -#~ msgstr "" -#~ "VIMRUN.EXE ei lydy muuttujasta $PATH.\n" -#~ "Ulkoiset komennot eivt pyshdy suorituksen lopussa.\n" -#~ "Listietoja komennolla :help win32-vimrun" - -#~ msgid "Vim Warning" -#~ msgstr "Vim-varoitus" - -#~ msgid "Error file" -#~ msgstr "Virhetiedosto" - -#~ msgid "Conversion in %s not supported" -#~ msgstr "Muutosta kohteessa %s ei tueta" - -#~ msgid "E430: Tag file path truncated for %s\n" -#~ msgstr "E430: Tgitiedoston polku katkaistu kohdassa %s\n" - -#~ msgid "new shell started\n" -#~ msgstr "uusi kuori avattu\n" - -#~ msgid "Used CUT_BUFFER0 instead of empty selection" -#~ msgstr "Kytettiin CUT_BUFFER0:aa tyhjn valinnan sijaan" - -#~ msgid "No undo possible; continue anyway" -#~ msgstr "Ei voi kumota, jatketaan silti" - -#~ msgid "E832: Non-encrypted file has encrypted undo file: %s" -#~ msgstr "E832: Salaamattomalla tiedostolla on salattu kumoustiedosto: %s" - -#~ msgid "E826: Undo file decryption failed: %s" -#~ msgstr "E826: Kumoustiedoston purku eponnistui: %s" - -#~ msgid "E827: Undo file is encrypted: %s" -#~ msgstr "E827: Kumoustiedosto on salattu: %s" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 16/32-bit GUI version" -#~ msgstr "" -#~ "\n" -#~ "MS-Windows 16- t. 32-bittinen GUI-versio" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 64-bit GUI version" -#~ msgstr "" -#~ "\n" -#~ "MS-Windows 64-bittinen GUI-versio" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 32-bit GUI version" -#~ msgstr "" -#~ "\n" -#~ "MS-Windows 32-bittinen GUI-version" - -#~ msgid " in Win32s mode" -#~ msgstr " Win32s-tilassa" - -#~ msgid " with OLE support" -#~ msgstr " OLE-tuella" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 64-bit console version" -#~ msgstr "" -#~ "\n" -#~ "MS-Windows 32-bittinen konsoliversio" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 32-bit console version" -#~ msgstr "" -#~ "\n" -#~ "MS-Windows 32-bittinen konsoliversio" - -#~ msgid "" -#~ "\n" -#~ "MS-Windows 16-bit version" -#~ msgstr "" -#~ "\n" -#~ "MS-Windows 16-bittinen versio" - -#~ msgid "" -#~ "\n" -#~ "32-bit MS-DOS version" -#~ msgstr "" -#~ "\n" -#~ "32-bittinen MS-DOS-versio" - -#~ msgid "" -#~ "\n" -#~ "16-bit MS-DOS version" -#~ msgstr "" -#~ "\n" -#~ "16-bittinen MS-DOS-versio" - -#~ msgid "" -#~ "\n" -#~ "MacOS X (unix) version" -#~ msgstr "" -#~ "\n" -#~ "MacOS X-version (unix)" - -#~ msgid "" -#~ "\n" -#~ "MacOS X version" -#~ msgstr "" -#~ "\n" -#~ "MacOS X-version" - -#~ msgid "" -#~ "\n" -#~ "MacOS version" -#~ msgstr "" -#~ "\n" -#~ "MacOS-version" - -#~ msgid "" -#~ "\n" -#~ "RISC OS version" -#~ msgstr "" -#~ "\n" -#~ "RISC OS-version" - -#~ msgid "" -#~ "\n" -#~ "OpenVMS version" -#~ msgstr "" -#~ "\n" -#~ "OpenVMS-version" - -#~ msgid "" -#~ "\n" -#~ "Big version " -#~ msgstr "" -#~ "\n" -#~ "Big-version " - -#~ msgid "" -#~ "\n" -#~ "Normal version " -#~ msgstr "" -#~ "\n" -#~ "Normal-versio " +#~ "Tiny-versio " #~ msgid "" #~ "\n" @@ -7828,231 +6129,1609 @@ msgstr "E446: Ei tiedostonime #~ msgid "" #~ "\n" -#~ "Tiny version " +#~ "Normal version " #~ msgstr "" #~ "\n" -#~ "Tiny-versio " - -#~ msgid "with GTK2-GNOME GUI." -#~ msgstr "GTK2-Gnome-GUIlla." - -#~ msgid "with GTK2 GUI." -#~ msgstr "GTK2-GUIlla." - -#~ msgid "with X11-Motif GUI." -#~ msgstr "X11-Motif-GUIlla." - -#~ msgid "with X11-neXtaw GUI." -#~ msgstr "X11-neXtaw-GUIlla." - -#~ msgid "with X11-Athena GUI." -#~ msgstr "X11-Athena-GUIlla." - -#~ msgid "with Photon GUI." -#~ msgstr "Photon-GUIlla." - -#~ msgid "with GUI." -#~ msgstr "GUIlla." - -#~ msgid "with Carbon GUI." -#~ msgstr "Carbon-GUIlla." - -#~ msgid "with Cocoa GUI." -#~ msgstr "Cocoa-GUIlla." - -#~ msgid "with (classic) GUI." -#~ msgstr "perinteisell GUIlla." - -#~ msgid " system gvimrc file: \"" -#~ msgstr " jrjestelmn gvimrc: \"" - -#~ msgid " user gvimrc file: \"" -#~ msgstr " kyttjn gvimrc: \"" - -#~ msgid "2nd user gvimrc file: \"" -#~ msgstr "2. kyttjn gvimrc: \"" - -#~ msgid "3rd user gvimrc file: \"" -#~ msgstr "3. kyttjn gvimrc: \"" - -#~ msgid " system menu file: \"" -#~ msgstr " jrjestelmvalikko: \"" - -#~ msgid "Compiler: " -#~ msgstr "Knnin: " - -#~ msgid "menu Help->Orphans for information " -#~ msgstr "valikko Ohje->Orvot listietoja varten " - -#~ msgid "Running modeless, typed text is inserted" -#~ msgstr "Suoritetaan tilattomana, kirjoitettu teksti sytetn" - -#~ msgid "menu Edit->Global Settings->Toggle Insert Mode " -#~ msgstr "valikko Muokkaa->Yleiset asetukset->Vaihda sytetilaa" - -#~ msgid " for two modes " -#~ msgstr " kahta tilaa varten " - -#~ msgid "menu Edit->Global Settings->Toggle Vi Compatible" -#~ msgstr "valikko Muokkaa->Yleiset asetukset->Vaihda Vi-yhteensopivuutta" - -#~ msgid " for Vim defaults " -#~ msgstr " Vim-oletuksia varten" - -#~ msgid "WARNING: Windows 95/98/ME detected" -#~ msgstr "VAROITUS: Window 95/98/ME havaittu" - -#~ msgid "type :help windows95 for info on this" -#~ msgstr "kirjoita :help windows95 listietoja varten" - -#~ msgid "E370: Could not load library %s" -#~ msgstr "E370: Kirjaston %s lataaminen ei onnistu" +#~ "Normal-versio " #~ msgid "" -#~ "Sorry, this command is disabled: the Perl library could not be loaded." -#~ msgstr "Sori, komento ei toimi, Perl kirjastoa ei voinut ladata." +#~ "\n" +#~ "Big version " +#~ msgstr "" +#~ "\n" +#~ "Big-version " -#~ msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" -#~ msgstr "E299: Perl-suoritus kielletty hiekkalaatikossa ilman Safe-moduulia" +#~ msgid "" +#~ "\n" +#~ "Huge version " +#~ msgstr "" +#~ "\n" +#~ "Huge-versio " -#~ msgid "Edit with &multiple Vims" -#~ msgstr "&Muokkaa usealla Vimill" +#~ msgid "Modified by " +#~ msgstr "Muokannut " -#~ msgid "Edit with single &Vim" -#~ msgstr "Muokkaa yhdell &Vimill" +#~ msgid "" +#~ "\n" +#~ "Included patches: " +#~ msgstr "" +#~ "\n" +#~ "Pätsit: " -#~ msgid "Diff with Vim" -#~ msgstr "Diffi Vimill" +#~ msgid "" +#~ "\n" +#~ "OpenVMS version" +#~ msgstr "" +#~ "\n" +#~ "OpenVMS-version" -#~ msgid "Edit with &Vim" -#~ msgstr "Muokkaa &Vimill" +#~ msgid "" +#~ "\n" +#~ "MacOS version" +#~ msgstr "" +#~ "\n" +#~ "MacOS-version" -#~ msgid "Edit with existing Vim - " -#~ msgstr "Muokkaa olemassaolevalla Vimill - " +#~ msgid "" +#~ "\n" +#~ "MacOS X version" +#~ msgstr "" +#~ "\n" +#~ "MacOS X-version" -#~ msgid "Edits the selected file(s) with Vim" -#~ msgstr "Muokkaa valittuja tiedostoja Vimill" +#~ msgid "" +#~ "\n" +#~ "MacOS X (unix) version" +#~ msgstr "" +#~ "\n" +#~ "MacOS X-version (unix)" -#~ msgid "Error creating process: Check if gvim is in your path!" -#~ msgstr "Virhe prosessin kynnistmisess, varmista ett gvim on polulla" +#~ msgid "" +#~ "\n" +#~ "MS-Windows 32-bit console version" +#~ msgstr "" +#~ "\n" +#~ "MS-Windows 32-bittinen konsoliversio" -#~ msgid "gvimext.dll error" -#~ msgstr "gvimext.dll-virhe" +#~ msgid "" +#~ "\n" +#~ "MS-Windows 64-bit console version" +#~ msgstr "" +#~ "\n" +#~ "MS-Windows 32-bittinen konsoliversio" -#~ msgid "Path length too long!" -#~ msgstr "Liian pitk polku" +#~ msgid " with OLE support" +#~ msgstr " OLE-tuella" -#~ msgid "E234: Unknown fontset: %s" -#~ msgstr "E234: Tuntematon fontset: %s" +#~ msgid " in Win32s mode" +#~ msgstr " Win32s-tilassa" -#~ msgid "E235: Unknown font: %s" -#~ msgstr "E235: Tuntematon fontti: %s" +#~ msgid "" +#~ "\n" +#~ "MS-Windows 32-bit GUI version" +#~ msgstr "" +#~ "\n" +#~ "MS-Windows 32-bittinen GUI-version" -#~ msgid "E236: Font \"%s\" is not fixed-width" -#~ msgstr "E236: Fontti %s ei ole tasavlinen" +#~ msgid "" +#~ "\n" +#~ "MS-Windows 64-bit GUI version" +#~ msgstr "" +#~ "\n" +#~ "MS-Windows 64-bittinen GUI-versio" -#~ msgid "E448: Could not load library function %s" -#~ msgstr "E448: Ei voitu ladta kirjastofunktiota %s" +#~ msgid "" +#~ "\n" +#~ "MS-Windows 16/32-bit GUI version" +#~ msgstr "" +#~ "\n" +#~ "MS-Windows 16- t. 32-bittinen GUI-versio" -#~ msgid "E26: Hebrew cannot be used: Not enabled at compile time\n" -#~ msgstr "E26: Hepreaa ei voi kytt, koska sit ei knnetty mukaan\n" +#~ msgid "E827: Undo file is encrypted: %s" +#~ msgstr "E827: Kumoustiedosto on salattu: %s" -#~ msgid "E27: Farsi cannot be used: Not enabled at compile time\n" -#~ msgstr "E27: Farsia ei voi kytt, koska sit ei knnetty mukaan\n" +#~ msgid "E826: Undo file decryption failed: %s" +#~ msgstr "E826: Kumoustiedoston purku epäonnistui: %s" -#~ msgid "E800: Arabic cannot be used: Not enabled at compile time\n" -#~ msgstr "E800: Arabiaa ei voi kytt, koska sit ei knnetty mukaan\n" +#~ msgid "E832: Non-encrypted file has encrypted undo file: %s" +#~ msgstr "E832: Salaamattomalla tiedostolla on salattu kumoustiedosto: %s" -#~ msgid "E247: no registered server named \"%s\"" -#~ msgstr "E247: palvelinta %s ei ole rekisterityn" +#~ msgid "No undo possible; continue anyway" +#~ msgstr "Ei voi kumota, jatketaan silti" -#~ msgid "E233: cannot open display" -#~ msgstr "E233: nytt ei voi avata" +#~ msgid "Used CUT_BUFFER0 instead of empty selection" +#~ msgstr "Käytettiin CUT_BUFFER0:aa tyhjän valinnan sijaan" -#~ msgid "E449: Invalid expression received" -#~ msgstr "E449: Virheellinen ilmaus saatu" +#~ msgid "new shell started\n" +#~ msgstr "uusi kuori avattu\n" -#~ msgid "E463: Region is guarded, cannot modify" -#~ msgstr "E463: Alue on suojattu, muuttaminen ei onnistu" +#~ msgid "Cannot open $VIMRUNTIME/rgb.txt" +#~ msgstr "Ei voida avata tiedostoa $VIMRUNTIME/rgb.txt" -#~ msgid "E744: NetBeans does not allow changes in read-only files" -#~ msgstr "E744: NetBeans ei tue muutoksia kirjoitussuojattuihin tiedostoihin" +#~ msgid "" +#~ "\n" +#~ "--- Terminal keys ---" +#~ msgstr "" +#~ "\n" +#~ "--- Terminaalinäppäimet ---" -#~ msgid "Need encryption key for \"%s\"" -#~ msgstr "Tarvitaan salausavain kohteelle %s " +#~ msgid "E437: terminal capability \"cm\" required" +#~ msgstr "E437: terminaalilla pitää olla cm kyvyissään" -#~ msgid "writelines() requires list of strings" -#~ msgstr "writelines()-komennolle pit antaa merkkijonolista" +#~ msgid "E436: No \"%s\" entry in termcap" +#~ msgstr "E436: %s ei löytynyt termcapista" -#~ msgid "E264: Python: Error initialising I/O objects" -#~ msgstr "E264: Python: Virhe IO-olioiden alustuksessa" +#~ msgid "E559: Terminal entry not found in termcap" +#~ msgstr "E559: Terminaalia ei löytynyt termcapista" -#~ msgid "no such buffer" -#~ msgstr "puskuria ei ole" +#~ msgid "E558: Terminal entry not found in terminfo" +#~ msgstr "E558: Terminaalia ei löytynyt terminfosta" -#~ msgid "attempt to refer to deleted window" -#~ msgstr "yritettiin viitata poistettuun ikkunaan" +#~ msgid "E557: Cannot open termcap file" +#~ msgstr "E557: Ei voi avata termcap-tiedostoa" -#~ msgid "readonly attribute" -#~ msgstr "kirjoitussuojattu attribuutti" +#~ msgid "defaulting to '" +#~ msgstr "oletusarvona " -#~ msgid "cursor position outside buffer" -#~ msgstr "kursorin sijainti puskurin ulkopuolella" +#~ msgid "' not known. Available builtin terminals are:" +#~ msgstr " ei tunnettu. Tuetut terminaalit:" -#~ msgid "" -#~ msgstr "" +#~ msgid "E430: Tag file path truncated for %s\n" +#~ msgstr "E430: Tägitiedoston polku katkaistu kohdassa %s\n" -#~ msgid "" -#~ msgstr "" +#~ msgid "E422: terminal code too long: %s" +#~ msgstr "E422: terminaalikoodi liian pitkä: %s" -#~ msgid "" -#~ msgstr "" +#~ msgid "E845: Insufficient memory, word list will be incomplete" +#~ msgstr "E845: Muisti ei riitä, sanalista jää keskeneräiseksi" -#~ msgid "no such window" -#~ msgstr "ikkunaa ei ole" +#~ msgid "Conversion in %s not supported" +#~ msgstr "Muutosta kohteessa %s ei tueta" -#~ msgid "attempt to refer to deleted buffer" -#~ msgstr "yritettiin viitata poistettuun puskuriin" +#~ msgid "Warning: Cannot find word list \"%s_%s.spl\" or \"%s_ascii.spl\"" +#~ msgstr "Varoitus: Ei löydetty sanalistaa %s_%s.spl tai %s_ascii.spl" -# New Line eli uusi rivinvaihtomerkki (ei CR, LF tai CR LF) -#~ msgid "[NL found]" -#~ msgstr "[NL puuttuu]" +#~ msgid "" +#~ "\n" +#~ "# Last %sSearch Pattern:\n" +#~ "~" +#~ msgstr "" +#~ "\n" +#~ "# Edellinen %sHakulauseke:\n" +#~ "~" -#~ msgid "Vim dialog..." -#~ msgstr "Vim-ikkuna..." +#~ msgid "Substitute " +#~ msgstr "Korvaa " -#~ msgid "Font Selection" -#~ msgstr "Fontin valinta" +#~ msgid "(NFA) COULD NOT OPEN %s !" +#~ msgstr "(NFA) EI VOI AVATA KOHDETTA %s" -#~ msgid "E569: maximum number of cscope connections reached" -#~ msgstr "E569: enimmismr cscope-yhteyksi otettu" +#~ msgid "" +#~ "Could not open temporary log file for writing, displaying on stderr ... " +#~ msgstr "" +#~ "Ei voitu avata väliaikaislokitiedosta kirjoittamista varten, joten " +#~ "virheet näytetään vakiovirhevirrassa. " -#~ msgid "-name \t\tUse resource as if vim was " -#~ msgstr "-name \t\tKyt resurssia vim " +#~ msgid "E878: (NFA) Could not allocate memory for branch traversal!" +#~ msgstr "E878: (NFA) Ei voitu allokoida muistia polkujen läpikäyntiin" -#~ msgid "\t\t\t (Unimplemented)\n" -#~ msgstr "\t\t\t (toteuttamatta)\n" +#~ msgid "E876: (NFA regexp) Not enough space to store the whole NFA " +#~ msgstr "E876: (NFA regexp) Tila ei riitä NFA:n tallentamiseen" -#~ msgid "E290: over-the-spot style requires fontset" -#~ msgstr "E290: over-the-spot-tyyliss pit olla fontset" +#~ msgid "" +#~ "E875: (NFA regexp) (While converting from postfix to NFA), too many " +#~ "states left on stack" +#~ msgstr "" +#~ "E875: (NFA regexp) (Muunnettaessa postfixistä NFA:ksi), liikaa tiloja " +#~ "jäljellä pinossa" -#~ msgid "E291: Your GTK+ is older than 1.2.3. Status area disabled" -#~ msgstr "E291: GTK+-versio vanhempi kuin 1.2.3: Tila-alue poistettu kytst" +#~ msgid "E874: (NFA) Could not pop the stack !" +#~ msgstr "E874: (NFA) Ei voida poistaa pinosta" -#~ msgid "E292: Input Method Server is not running" -#~ msgstr "E292: Sytemetodipalvelin ei ole kynniss" +#~ msgid "E873: (NFA regexp) proper termination error" +#~ msgstr "E873: (NFA regexp) oikea lopetusvirhe" -#~ msgid "E396: containedin argument not accepted here" -#~ msgstr "E396: containedin ei sovi thn" +#~ msgid "E879: (NFA regexp) Too many \\z(" +#~ msgstr "E879: (NFA regexp) Liikaa merkkejä \\z(" -#~ msgid "with GTK-GNOME GUI." -#~ msgstr "GTK-Gnome-GUIlla." +#~ msgid "E872: (NFA regexp) Too many '('" +#~ msgstr "E872: (NFA regexp) Liian monta suljetta '('" -#~ msgid "with GTK GUI." -#~ msgstr "GTK-GUIlla." +#~ msgid "E871: (NFA regexp) Can't have a multi follow a multi !" +#~ msgstr "E871: (NFA regexp) Multi ei voi seurata multia" -#~ msgid "-V[N]\t\tVerbose level" -#~ msgstr "-V[N]\t\tMonisanaisuustaso" +#~ msgid "E870: (NFA regexp) Error reading repetition limits" +#~ msgstr "E870: (NFA regexp) Virhe luettaessa toiston määriä" -#~ msgid "...(truncated)" -#~ msgstr "...(katkaistu)" +#~ msgid "E869: (NFA) Unknown operator '\\@%c'" +#~ msgstr "E869: (NFA) Tuntematon operaattori '\\@%c'" + +#~ msgid "E868: Error building NFA with equivalence class!" +#~ msgstr "E868: Virhe NFA:n ekvivalenssiluokkia tekemisessä" + +#~ msgid "E867: (NFA) Unknown operator '\\%%%c'" +#~ msgstr "E867: (NFA) Tuntematon operaattori '\\%%%c'" + +#~ msgid "E867: (NFA) Unknown operator '\\z%c'" +#~ msgstr "E867: (NFA) Tuntematon operaattori '\\z%c'" + +#~ msgid "E877: (NFA regexp) Invalid character class: %ld" +#~ msgstr "E877: (NFA regexp) Virheellinen merkkiluokka: %ld" + +#~ msgid "E866: (NFA regexp) Misplaced %c" +#~ msgstr "E866: (NFA-regexp) %c väärässä paikassa" + +#~ msgid "E865: (NFA) Regexp end encountered prematurely" +#~ msgstr "E865: (NFA) Säännöllisen ilmauksen ennenaikainen loppu" + +#~ msgid "Error file" +#~ msgstr "Virhetiedosto" + +#~ msgid "shell returned %d" +#~ msgstr "kuori palautti arvon %d" + +#~ msgid "Vim Warning" +#~ msgstr "Vim-varoitus" + +#~ msgid "" +#~ "VIMRUN.EXE not found in your $PATH.\n" +#~ "External commands will not pause after completion.\n" +#~ "See :help win32-vimrun for more information." +#~ msgstr "" +#~ "VIMRUN.EXEä ei löydy muuttujasta $PATH.\n" +#~ "Ulkoiset komennot eivät pysähdy suorituksen lopussa.\n" +#~ "Lisätietoja komennolla :help win32-vimrun" + +#~ msgid "E371: Command not found" +#~ msgstr "E371: Komentoa ei löydy" + +#~ msgid "shutdown" +#~ msgstr "sammutus" + +#~ msgid "logoff" +#~ msgstr "uloskirjautuminen" + +#~ msgid "close" +#~ msgstr "sulkeminen" + +#~ msgid "Vim: Caught %s event\n" +#~ msgstr "Vim: Napattiin %s\n" + +#~ msgid "Could not fix up function pointers to the DLL!" +#~ msgstr "Ei voitu korjata funktio-osoittimia DLL:ssä" + +#~ msgid "VIM Error" +#~ msgstr "VIM-virhe" + +#~ msgid "Could not load vim32.dll!" +#~ msgstr "Vim32.dll:ää ei voitu ladata" + +#~ msgid "At line" +#~ msgstr "Rivillä" + +#~ msgid "XSMP SmcOpenConnection failed: %s" +#~ msgstr "XSMP SmcOpenConnection epäonnistui: %s" + +#~ msgid "XSMP ICE connection watch failed" +#~ msgstr "XSMP:n ICE-yhteyden tarkkailu epäonnistui" + +#~ msgid "XSMP opening connection" +#~ msgstr "XSMP avaa yhteyttä" + +#~ msgid "XSMP handling save-yourself request" +#~ msgstr "XSMP käsittelee save-yourself-pyyntöä" + +#~ msgid "Opening the X display failed" +#~ msgstr "X-näytön avaus epäonnistui" + +#~ msgid "XSMP lost ICE connection" +#~ msgstr "XSMP kadotti ICE-yhteyden" + +#~ msgid "" +#~ "\n" +#~ "Command terminated\n" +#~ msgstr "" +#~ "\n" +#~ "Komento loppui\n" + +#~ msgid "" +#~ "\n" +#~ "Cannot execute shell " +#~ msgstr "" +#~ "\n" +#~ "Kuoren suoritus ei onnistu " + +#~ msgid "" +#~ "\n" +#~ "Cannot fork\n" +#~ msgstr "" +#~ "\n" +#~ "Ei voi haarauttaa\n" + +#~ msgid "" +#~ "\n" +#~ "Cannot create pipes\n" +#~ msgstr "" +#~ "\n" +#~ "Putkia ei voi tehdä\n" + +#~ msgid "" +#~ "\n" +#~ "Cannot execute shell sh\n" +#~ msgstr "" +#~ "\n" +#~ "Kuoren sh suoritus ei onnistu\n" + +# mikä security context? +#~ msgid "Could not get security context %s for %s. Removing it!" +#~ msgstr "Ei saatu turvallisuuskontekstia %s kohteelle %s ja se poistetaan" + +#~ msgid "Could not set security context %s for %s" +#~ msgstr "Ei voitu asettaa turvallisuuskontekstia %s kohteelle %s" + +#~ msgid "Opening the X display timed out" +#~ msgstr "X-näytön avaus aikakatkaistiin" + +#~ msgid "Testing the X display failed" +#~ msgstr "X-näytön testaus epäonnistui" + +#~ msgid "" +#~ "\n" +#~ "Vim: Got X error\n" +#~ msgstr "" +#~ "\n" +#~ "Vim: X-virhe\n" + +#~ msgid "Opening the X display took %ld msec" +#~ msgstr "X-näytön avaus vei %ld millisekuntia" + +#~ msgid "E245: Illegal char '%c' in font name \"%s\"" +#~ msgstr "E245: Virheellinen merkki %c fontin nimessä %s" + +#~ msgid "E244: Illegal quality name \"%s\" in font name \"%s\"" +#~ msgstr "E244: Virheellinen laatunimi %s fontin nimessä %s" + +#~ msgid "E244: Illegal charset name \"%s\" in font name \"%s\"" +#~ msgstr "E244: Virheellinen merkistön nimi %s fontin nimessä %s" + +#~ msgid "Printing '%s'" +#~ msgstr "Tulostetaan %s" + +#~ msgid "E238: Print error: %s" +#~ msgstr "E238: Tulostinvirhe: %s" + +#~ msgid "E613: Unknown printer font: %s" +#~ msgstr "E613: Tuntematon tulostimen fontti: %s" + +#~ msgid "to %s on %s" +#~ msgstr "tulostimelle %s kohteessa %s" + +#~ msgid "E237: Printer selection failed" +#~ msgstr "E237: Tulostimen valinta epäonnistui" + +#~ msgid "'columns' is not 80, cannot execute external commands" +#~ msgstr "columns ei ole 80, ei voi suorittaa ulkoista komentoa" + +#~ msgid "I/O ERROR" +#~ msgstr "IO-virhe" + +#~ msgid "ANCHOR_BUF_SIZE too small." +#~ msgstr "ANCHOR_BUF_SIZE liian pieni." + +#~ msgid " returned\n" +#~ msgstr " palautti\n" + +#~ msgid "shell " +#~ msgstr "kuori " + +#~ msgid "Cannot execute " +#~ msgstr "Ei voi suorittaa " + +#~ msgid "E360: Cannot execute shell with -f option" +#~ msgstr "E360: Kuorta ei voi avata asetuksella -f" + +#~ msgid "mch_get_shellsize: not a console??\n" +#~ msgstr "mch_get_shellsize: ei ole konsoli?\n" + +#~ msgid "cannot change console mode ?!\n" +#~ msgstr "ei voi vaihtaa konsolitilaa?\n" + +#~ msgid "Vim exiting with %d\n" +#~ msgstr "Vim sulkeutuu koodilla %d\n" + +#~ msgid "Cannot create " +#~ msgstr "Ei voi luoda " + +#~ msgid "Cannot open NIL:\n" +#~ msgstr "Ei voi avata NILiä:\n" + +#~ msgid "Need %s version %ld\n" +#~ msgstr "Tarvitaan %s versio %ld\n" + +#~ msgid "Need Amigados version 2.04 or later\n" +#~ msgstr "Amigados 2.04 tai uudempi tarvitaan\n" + +#~ msgid "VIM: Can't open window!\n" +#~ msgstr "VIM: Ei voi avata ikkunaa\n" + +#~ msgid "cannot open " +#~ msgstr "ei voi avata " + +#~ msgid "E538: No mouse support" +#~ msgstr "E538: Hiirtä ei tueta" + +#~ msgid "E533: can't select wide font" +#~ msgstr "E533: Leveän fontin valinta ei onnistu" + +#~ msgid "E598: Invalid fontset" +#~ msgstr "E598: Viallinen fontset" + +#~ msgid "E597: can't select fontset" +#~ msgstr "E597: Fontsetin valinta ei onnistu" + +#~ msgid "E596: Invalid font(s)" +#~ msgstr "E596: Viallisia fontteja" + +#~ msgid "E617: Cannot be changed in the GTK+ 2 GUI" +#~ msgstr "E617: Ei voi muuttaa GTK+2-GUIssa" + +#~ msgid "E531: Use \":gui\" to start the GUI" +#~ msgstr "E531: Käytä komentoa :gui GUIn käynnistämiseen" + +#~ msgid "E530: Cannot change term in GUI" +#~ msgstr "E530: Ei voi vaihtaa termiä GUIssa" + +#~ msgid "E522: Not found in termcap" +#~ msgstr "E522: Puuttuu termcapista" + +#~ msgid "Thanks for flying Vim" +#~ msgstr "Kiitos että ajoit Vimiä" + +#~ msgid "%<%f%h%m%=Page %N" +#~ msgstr "%<%f%h%m%=Sivu %N" + +#~ msgid "" +#~ "\n" +#~ "# Registers:\n" +#~ msgstr "" +#~ "\n" +#~ "# Rekisterit:\n" + +#~ msgid "Illegal register name" +#~ msgstr "Virheellinen rekisterin nimi" + +#~ msgid "freeing %ld lines" +#~ msgstr "vapautetaan %ld riviä" + +#~ msgid "cannot yank; delete anyway" +#~ msgstr "Ei voi kopioida; poista joka tapauksessa" + +#~ msgid "E775: Eval feature not available" +#~ msgstr "E775: Eval ei ole käytettävissä" + +#~ msgid "E505: %s is read-only (add ! to override)" +#~ msgstr "E505: %s on kirjoitussuojattu (lisää komentoon ! ohittaaksesi)" + +#~ msgid "E511: netbeans already connected" +#~ msgstr "E511: netbeans on yhdistetty jo" + +#~ msgid "E838: netbeans is not supported with this GUI" +#~ msgstr "E838: netbeans ei toimi tässä käyttöliittymässä" + +#~ msgid "E658: NetBeans connection lost for buffer %ld" +#~ msgstr "E658: NetBeans-yhteys katkesi puskurille %ld" + +#~ msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\"" +#~ msgstr "E668: Väärä avaustila NetBeans-yhteyden infotiedostolle: %s" + +#~ msgid "E547: Illegal mouseshape" +#~ msgstr "E547: Virheellinen hiiren muoto" + +#~ msgid "E341: Internal error: lalloc(%ld, )" +#~ msgstr "E341: Sisäinen virhe: lalloc(%ld, )" + +#~ msgid "E340: Line is becoming too long" +#~ msgstr "E340: Rivistä tulee liian pitkä" + +#~ msgid "" +#~ "[calls] total re/malloc()'s %lu, total free()'s %lu\n" +#~ "\n" +#~ msgstr "" +#~ "[kutsut] yht. re/malloc() %lu, yht. free() %lu\n" +#~ "\n" + +#~ msgid "" +#~ "\n" +#~ "[bytes] total alloc-freed %lu-%lu, in use %lu, peak use %lu\n" +#~ msgstr "" +#~ "\n" +#~ "[tavua] yht. alloc-free %lu-%lu, käytössä %lu, käyttöhuippu %lu\n" + +#~ msgid "ERROR: " +#~ msgstr "VIRHE: " + +#~ msgid "E338: Sorry, no file browser in console mode" +#~ msgstr "E338: tiedostonselain puuttuu konsolitilasta" + +#~ msgid "Open File dialog" +#~ msgstr "Avausikkuna" + +#~ msgid "Save File dialog" +#~ msgstr "Tallennusikkuna" + +#~ msgid "Select Directory dialog" +#~ msgstr "Hakemiston valintaikkuna" + +#~ msgid "Messages maintainer: Bram Moolenaar " +#~ msgstr "Käännöksen ylläpitäjä: Flammie Pirinen " + +#~ msgid "E337: Menu not found - check menu names" +#~ msgstr "E337: Valikkoa ei löytynyt - tarkista valikkojen nimet" + +#~ msgid "E336: Menu path must lead to a sub-menu" +#~ msgstr "E336: Valikkopolun pitää johtaa alivalikkoon" + +#~ msgid "Tear off this menu" +#~ msgstr "Repäise valikko irti" + +#~ msgid "Swap file already exists!" +#~ msgstr "Swap-tiedosto on jo olemassa" + +#~ msgid "" +#~ "\n" +#~ " [not usable with this version of Vim]" +#~ msgstr "" +#~ "\n" +#~ " [ei toimi tämän Vim-version kanssa]" + +#~ msgid "Using crypt key from swap file for the text file.\n" +#~ msgstr "Käytetään swäpin salausavainta tekstitiedostolle\n" + +#~ msgid "" +#~ "\n" +#~ "to use the same key for text file and swap file" +#~ msgstr "" +#~ "\n" +#~ "käyttääksesi samaa avainta teksti- ja swäppitiedostoille" + +#~ msgid "" +#~ "\n" +#~ "If you wrote the text file after changing the crypt key press enter" +#~ msgstr "" +#~ "\n" +#~ "Jos kirjoitit tekstitiedoston salausavaimen vaihdon jälkeen paina enteriä" + +#~ msgid "" +#~ "\n" +#~ "enter the new crypt key." +#~ msgstr "" +#~ "\n" +#~ "anna uusi salausavain." + +#~ msgid "" +#~ "\n" +#~ "If you entered a new crypt key but did not write the text file," +#~ msgstr "" +#~ "\n" +#~ "Jos käytit uutta salausavainta muttet kirjoittanut tekstitiedostoa," + +#~ msgid "Swap file is encrypted: \"%s\"" +#~ msgstr "Swap-tiedosto on salattu: %s" + +#~ msgid "" +#~ "E833: %s is encrypted and this version of Vim does not support encryption" +#~ msgstr "E833: %s on salattu eikä tämä Vim tue salausta" + +#~ msgid "E843: Error while updating swap file crypt" +#~ msgstr "E843: Virhe päivitettäessä swapin kryptausta" + +#~ msgid "E289: input method doesn't support my preedit type" +#~ msgstr "E289: syötemetodi ei tue tätä preedit-tyyppiä" + +#~ msgid "E288: input method doesn't support any style" +#~ msgstr "E288: syötemetodi ei tue tyylejä" + +#~ msgid "E287: Warning: Could not set destroy callback to IM" +#~ msgstr "" +#~ "E287: Varoitus: Ei voitu asettaa destroy-kutsua syötemetodipalvelimelle" + +#~ msgid "E286: Failed to open input method" +#~ msgstr "E286: Syötemetodin avaus ei onnistu" + +#~ msgid "E285: Failed to create input context" +#~ msgstr "E285: Syötekontekstin luonti ei onnistu" + +#~ msgid "E284: Cannot set IC values" +#~ msgstr "E284: Ei voi asettaa IC-arvoja" + +#~ msgid "E543: Not a valid codepage" +#~ msgstr "E543: Koodisivu ei ole käypä" + +#~ msgid "Missing '>'" +#~ msgstr "> puuttuu" + +#~ msgid "" +#~ "\n" +#~ "# History of marks within files (newest to oldest):\n" +#~ msgstr "" +#~ "\n" +#~ "# Tiedostojen merkkien historia (uusimmasta vanhimpaan):\n" + +#~ msgid "" +#~ "\n" +#~ "# Jumplist (newest first):\n" +#~ msgstr "" +#~ "\n" +#~ "# Hyppylista (uusin ensiksi):\n" + +#~ msgid "" +#~ "\n" +#~ "# File marks:\n" +#~ msgstr "" +#~ "\n" +#~ "# Tiedoston merkit:\n" + +#~ msgid ": Send expression failed.\n" +#~ msgstr ": Ilmauksen lähetys epäonnistui.\n" + +#~ msgid "No display: Send expression failed.\n" +#~ msgstr "Ei näyttöä: Ilmauksen lähetys epäonnistui.\n" + +#~ msgid "%d of %d edited" +#~ msgstr "%d/%d muokattu" + +#~ msgid ": Send failed. Trying to execute locally\n" +#~ msgstr ": Lähetys epäonnistui. Yritetään suorittaa paikallisena\n" + +#~ msgid ": Send failed.\n" +#~ msgstr ": Lähetys epäonnistui.\n" + +#~ msgid "No display" +#~ msgstr "Ei näyttöä" + +#~ msgid "--windowid \tOpen Vim inside another win32 widget" +#~ msgstr "--windowid \tAvaa Vim annettuun win32-olioon " + +#~ msgid "-P \tOpen Vim inside parent application" +#~ msgstr "-P \tAvaa Vim isäntäohjelman sisään" + +#~ msgid "--echo-wid\t\tMake gvim echo the Window ID on stdout" +#~ msgstr "--echo-wid\t\tTulosta gvimin Window ID vakiotulosteeseen" + +#~ msgid "--socketid \tOpen Vim inside another GTK widget" +#~ msgstr "--socketid \tAvaa Vim annettuun GTK-olioon " + +# X-ikkunointijärjestelmässä saman sovelluksen saman luokan ikkunat +# tunnistetaan rooliresursseista +#~ msgid "--role \tSet a unique role to identify the main window" +#~ msgstr "" +#~ "--role \tAseta pääikkunalle ainutlaatuinen rooli tunnisteeksi" + +#~ msgid "-display \tRun vim on (also: --display)" +#~ msgstr "-display \tSuorita vim näytöllä (myös: --display)" + +#~ msgid "" +#~ "\n" +#~ "Arguments recognised by gvim (GTK+ version):\n" +#~ msgstr "" +#~ "\n" +#~ "Gvimin (GTK+-version) tuntemat argumentit:\n" + +#~ msgid "-xrm \tSet the specified resource" +#~ msgstr "-xrm \tAseta resurssi" + +#~ msgid "+reverse\t\tDon't use reverse video (also: +rv)" +#~ msgstr "+reverse\t\tÄlä käytä käänteisvärejä (myös: +rv)" + +#~ msgid "-reverse\t\tUse reverse video (also: -rv)" +#~ msgstr "-reverse\t\tKäytä käänteisvärejä (myös: -rv) " + +#~ msgid "-menuheight \tUse a menu bar height of (also: -mh)" +#~ msgstr "-menuheight \tKäytä valikossa (myös: -mh)" + +#~ msgid "" +#~ "-scrollbarwidth Use a scrollbar width of (also: -sw)" +#~ msgstr "" +#~ "-scrollbarwidth Käytä vierityspalkissa (myös: -sw)" + +#~ msgid "-borderwidth \tUse a border width of (also: -bw)" +#~ msgstr "-borderwidt \tKäytä reunuksissa (myös: -bw) " + +#~ msgid "-geometry \tUse for initial geometry (also: -geom)" +#~ msgstr "" +#~ "-geometry \tKäytä mittoja ikkunan asetteluun (myös: -geom)" + +#~ msgid "-italicfont \tUse for italic text" +#~ msgstr "-italicfont \tKäytä kursivoidussa tekstissä" + +#~ msgid "-boldfont \tUse for bold text" +#~ msgstr "-boldfont \tKäytä lihavoidussa tekstissä" + +#~ msgid "-font \t\tUse for normal text (also: -fn)" +#~ msgstr "-font \t\tKäytä tekstissä (myös: -fn)" + +#~ msgid "-foreground \tUse for normal text (also: -fg)" +#~ msgstr "-foreground \tKäytä tekstin värinä (myös: -fg)" + +#~ msgid "-background \tUse for the background (also: -bg)" +#~ msgstr "-background \tKäytä taustavärinä (myös: -bg)" + +#~ msgid "-iconic\t\tStart vim iconified" +#~ msgstr "-iconic\t\tKäynnistä pienennettynä" + +#~ msgid "-display \tRun vim on " +#~ msgstr "-display \tSuorita vim " + +#~ msgid "" +#~ "\n" +#~ "Arguments recognised by gvim (Athena version):\n" +#~ msgstr "" +#~ "\n" +#~ "Gvimin (Athena-version) tuntemat argumentit:\n" + +#~ msgid "" +#~ "\n" +#~ "Arguments recognised by gvim (neXtaw version):\n" +#~ msgstr "" +#~ "\n" +#~ "Gvimin (neXtaw-version) tuntemat argumentit:\n" + +#~ msgid "" +#~ "\n" +#~ "Arguments recognised by gvim (Motif version):\n" +#~ msgstr "" +#~ "\n" +#~ "Gvimin (Motif-version) tuntemat argumentit:\n" + +#~ msgid "-i \t\tUse instead of .viminfo" +#~ msgstr "-i \t\tKäytä -tiedostoa .viminfon sijaan" + +#~ msgid "--servername \tSend to/become the Vim server " +#~ msgstr "--servername \tLähetä Vim-palvelimelle tai luo se" + +#~ msgid "--serverlist\t\tList available Vim server names and exit" +#~ msgstr "--serverlist\t\tLuettele Vim-palvelinten nimet ja lopeta" + +#~ msgid "" +#~ "--remote-expr \tEvaluate in a Vim server and print result" +#~ msgstr "" +#~ "--remote-expr \tKäsittele Vim-palvelimella ja tulosta " +#~ "tulos" + +#~ msgid "--remote-send \tSend to a Vim server and exit" +#~ msgstr "" +#~ "--remote-send \tLähetä painalluksina Vimille ja " +#~ "lopeta" + +#~ msgid "" +#~ "--remote-tab[-wait][-silent] As --remote but use tab page per " +#~ "file" +#~ msgstr "" +#~ "--remote-tab[-wait][-silent] kuten --remote, mutta avaa " +#~ "välilehti joka tiedostolle" + +#~ msgid "" +#~ "--remote-wait-silent Same, don't complain if there is no server" +#~ msgstr "" +#~ "--remote-wait-silent sama, mutta älä ilmoita puuttuvasta " +#~ "palvelimesta" + +#~ msgid "" +#~ "--remote-wait As --remote but wait for files to have been edited" +#~ msgstr "" +#~ "--remote-wait kuten --remote, mutta odota tiedostojen " +#~ "muokkaamista" + +#~ msgid "--remote-silent Same, don't complain if there is no server" +#~ msgstr "" +#~ "--remote-silent \tSama, mutta älä ilmoita puuttuvasta " +#~ "palvelimesta" + +#~ msgid "--remote \tEdit in a Vim server if possible" +#~ msgstr "" +#~ "--remote \tMuokkaa Vim-palvelimessa, jos " +#~ "mahdollista" + +#~ msgid "-X\t\t\tDo not connect to X server" +#~ msgstr "-X\t\t\tÄlä yhdistä X-palvelimeen" + +#~ msgid "-display \tConnect vim to this particular X-server" +#~ msgstr "-display \tYhdistä vim tiettyyn X-palvelimeen" + +#~ msgid "-x\t\t\tEdit encrypted files" +#~ msgstr "-x\t\t\tMuokkaa salattua tiedostoa" + +#~ msgid "+\t\t\tStart at end of file" +#~ msgstr "+\t\t\tAloita tiedoston lopusta" + +#~ msgid "-U \t\tUse instead of any .gvimrc" +#~ msgstr "-U \t\tKäytä -tiedostoa .gvimrc:iden sijasta" + +#~ msgid "--not-a-term\t\tSkip warning for input/output not being a terminal" +#~ msgstr "--not-a-term\t\tOhita varoitus siitä että i/o ei ole terminaali" + +#~ msgid "-T \tSet terminal type to " +#~ msgstr "-T \tAseta terminaalin tyypiksi " + +#~ msgid "-F\t\t\tStart in Farsi mode" +#~ msgstr "-F\t\t\tkäynnistä farsi-tilassa" + +#~ msgid "-H\t\t\tStart in Hebrew mode" +#~ msgstr "-H\t\t\tkäynnistä heprea-tilassa" + +#~ msgid "-A\t\t\tstart in Arabic mode" +#~ msgstr "-A\t\t\tkäynnistä arabia-tilassa" + +#~ msgid "-dev \t\tUse for I/O" +#~ msgstr "-dev \t\tKäytä IO:hon" + +#~ msgid "-f\t\t\tDon't use newcli to open window" +#~ msgstr "-f\t\t\tÄlä käytä newcli:tä ikkunan avaamiseen" + +#~ msgid "-L\t\t\tSame as -r" +#~ msgstr "-L\t\t\tkuten -r" + +#~ msgid "-D\t\t\tDebugging mode" +#~ msgstr "-D\t\t\tVianetsintätila" + +#~ msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'" +#~ msgstr "-N\t\t\tEi Vi-yhteensopivuutta: nocompatible" + +#~ msgid "-C\t\t\tCompatible with Vi: 'compatible'" +#~ msgstr "-C\t\t\tVi-yhteensopivuustila: compatible" + +#~ msgid "-l\t\t\tLisp mode" +#~ msgstr "-l\t\t\tLisp-tila" + +#~ msgid "-b\t\t\tBinary mode" +#~ msgstr "-b\t\t\tBinääritila" + +#~ msgid "-Z\t\t\tRestricted mode (like \"rvim\")" +#~ msgstr "-Z\t\t\tRajoitettu tila (kuten rvimillä)" + +#~ msgid "-R\t\t\tReadonly mode (like \"view\")" +#~ msgstr "-R\t\t\tKirjoitussuojattu tila (kuten view'lla)" + +#~ msgid "-y\t\t\tEasy mode (like \"evim\", modeless)" +#~ msgstr "-y\t\t\tHelppokäyttötila (kuten evimissä, ilman tiloja)" + +#~ msgid "-d\t\t\tDiff mode (like \"vimdiff\")" +#~ msgstr "-d\t\t\tDiff-tila (kuten vimdiffillä)" + +#~ msgid "-E\t\t\tImproved Ex mode" +#~ msgstr "-E\t\t\tParanneltu Ex-tila" + +#~ msgid "-e\t\t\tEx mode (like \"ex\")" +#~ msgstr "-e\t\t\tEx-tila (kute exillä)" + +#~ msgid "-v\t\t\tVi mode (like \"vi\")" +#~ msgstr "-v\t\t\tVi-tila (kuten villä)" + +#~ msgid "-f or --nofork\tForeground: Don't fork when starting GUI" +#~ msgstr "-f tai --nofork\tEdustalle: Älä haarauta GUIn käynnistyksessä" + +#~ msgid "-g\t\t\tRun using GUI (like \"gvim\")" +#~ msgstr "-g\t\t\tAvaa GUI (kuten gvimillä)" + +#~ msgid "-unregister\t\tUnregister gvim for OLE" +#~ msgstr "-unregister\t\tPoista gvim OLE-rekisteristä" + +#~ msgid "-register\t\tRegister this gvim for OLE" +#~ msgstr "-register\t\trekisteröi gvim OLEa varten" + +#~ msgid "" +#~ "\n" +#~ "Where case is ignored prepend / to make flag upper case" +#~ msgstr "" +#~ "\n" +#~ "Jos aakkoslaji on ohitettu, lisää alkuun / tehdäksesi asetuksesta " +#~ "suuraakkosia" + +#~ msgid "" +#~ "\n" +#~ " or:" +#~ msgstr "" +#~ "\n" +#~ " tai:" + +#~ msgid " vim [arguments] " +#~ msgstr " vim [argumentit] " + +#~ msgid "Vim: Error: This version of Vim does not run in a Cygwin terminal\n" +#~ msgstr "Vim: Virhe: Tämä versio Vimistä ei toimi Cygwinin terminaalissa\n" + +#~ msgid "Vim: Error: Failure to start gvim from NetBeans\n" +#~ msgstr "Vim: Virhe: Gvimin käynnistys NetBeansistä ei onnistu\n" + +#~ msgid "This Vim was not compiled with the diff feature." +#~ msgstr "Tähän Vimiin ei ole käännetty diff-toimintoja mukaan." + +#~ msgid "'-nb' cannot be used: not enabled at compile time\n" +#~ msgstr "-nb:tä ei voi käyttää, koska sitä ei käännetty mukaan\n" + +#~ msgid "netbeans is not supported with this GUI\n" +#~ msgstr "netbeans ei toimi tässä käyttöliittymässä\n" + +#~ msgid "%d files to edit\n" +#~ msgstr "%d tiedostoa muokattavana\n" + +#~ msgid "E251: VIM instance registry property is badly formed. Deleted!" +#~ msgstr "E251: VIMin instanssin rekisteriarvo on virheellinen, poistettiin." + +#~ msgid "E573: Invalid server id used: %s" +#~ msgstr "E573: Virheellinen palvelimen tunniste: %s" + +#~ msgid "E248: Failed to send command to the destination program" +#~ msgstr "E248: Komennon lähetys kohdeohjelmalle ei onnistu" + +#~ msgid "Unable to register a command server name" +#~ msgstr "Komentopalvelimen nimen rekisteröinti ei onnistu" + +#~ msgid "cannot get line" +#~ msgstr "ei voida hakea riviä" + +#~ msgid "E572: exit code %d" +#~ msgstr "E572: palautusarvo %d" + +#~ msgid "" +#~ "E571: Sorry, this command is disabled: the Tcl library could not be " +#~ "loaded." +#~ msgstr "E571: komento ei toimi, Tcl-kirjastoa ei voitu ladata." + +#~ msgid "cannot register callback command: buffer/window reference not found" +#~ msgstr "" +#~ "callbackia ei voi rekisteröidä: puskurin tai ikkunan viitettä ei löydy" + +#~ msgid "" +#~ "E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-" +#~ "dev@vim.org" +#~ msgstr "" +#~ "E280: kriittinen TCL-virhe: reflist hajalla? Ilmoita asiasta " +#~ "postituslistalle vim-dev@vim.org" + +#~ msgid "" +#~ "cannot register callback command: buffer/window is already being deleted" +#~ msgstr "callbackia ei voi rekisteröidä: puskuri tai ikkuna on poistettu" + +#~ msgid "cannot create buffer/window command: object is being deleted" +#~ msgstr "ei voi luoda puskuri- tai ikkunakomentoa, olio on poistumassa" + +#~ msgid "vim error" +#~ msgstr "vim-virhe" + +#~ msgid "unknown vimOption" +#~ msgstr "tuntematon vimOption" + +#~ msgid "unknown flag: " +#~ msgstr "tuntematon asetus: " + +#~ msgid "cannot insert/append line" +#~ msgstr "rivin lisäys ei onnistu" + +#~ msgid "row %d column %d" +#~ msgstr "rivi %d sarake %d" + +#~ msgid "mark not set" +#~ msgstr "merkko ei ole asetettu" + +#~ msgid "cannot set line(s)" +#~ msgstr "ei voi asettaa rivejä" + +#~ msgid "not implemented yet" +#~ msgstr "ei toteutettu" + +#~ msgid "E273: unknown longjmp status %d" +#~ msgstr "E273: tuntematon longjmp-tila %d" + +#~ msgid "E272: unhandled exception" +#~ msgstr "E272: käsittelemätön poikkeus" + +#~ msgid "E271: retry outside of rescue clause" +#~ msgstr "E271: retry rescuen ulkopuolella" + +#~ msgid "E269: unexpected break" +#~ msgstr "E269: Odotuksenvastainen break" + +#~ msgid "E268: unexpected next" +#~ msgstr "E268: Odotuksenvastainen next" + +#~ msgid "E267: unexpected return" +#~ msgstr "E267: odotuksenvastainen return" + +#~ msgid "" +#~ "E266: Sorry, this command is disabled, the Ruby library could not be " +#~ "loaded." +#~ msgstr "E266: komento ei toimi, Ruby-kirjastoa ei voitu ladata." + +#~ msgid "E265: $_ must be an instance of String" +#~ msgstr "E265: muuttujan $_ pitää olla Stringin instanssi" + +#~ msgid "E837: This Vim cannot execute :py3 after using :python" +#~ msgstr "" +#~ "E837: Python: Ei voi käyttää komentoja :py ja :py3 samassa istunnossa" + +#~ msgid "E659: Cannot invoke Python recursively" +#~ msgstr "E659: Pythonia ei voi kutsua rekursiivisesti" + +#~ msgid "" +#~ "E887: Sorry, this command is disabled, the Python's site module could not " +#~ "be loaded." +#~ msgstr "" +#~ "E887: Komento ei toimi, Pythonin site-moduulien lataaminen ei onnistunut." + +#~ msgid "" +#~ "E263: Sorry, this command is disabled, the Python library could not be " +#~ "loaded." +#~ msgstr "E263: komento ei toimi, Python-kirjaston lataaminen ei onnistunut." + +#~ msgid "E836: This Vim cannot execute :python after using :py3" +#~ msgstr "" +#~ "E836: Python: Ei voi käyttää komentoja :py ja :py3 samassa istunnossa" + +#~ msgid "not allowed in the Vim sandbox" +#~ msgstr "ei sallittu Vimin hiekkalaatikossa" + +#~ msgid "linenr out of range" +#~ msgstr "rivinumero arvoalueen ulkopuolelta" + +#~ msgid "window is invalid" +#~ msgstr "ikkuna on virheellinen" + +#~ msgid "buffer is invalid" +#~ msgstr "puskuri on virheellinen" + +#~ msgid "Vim error" +#~ msgstr "Vim-virhe" + +#~ msgid "Vim error: ~a" +#~ msgstr "Vim-virhe: ~a" + +#~ msgid "couldn't open buffer" +#~ msgstr "ei voitu avata puskuria" + +#~ msgid "unknown option" +#~ msgstr "tuntematon asetus" + +#~ msgid "hidden option" +#~ msgstr "piilotettu asetus" + +#~ msgid "expressions disabled at compile time" +#~ msgstr "ilmaukset poistettu käytöstä käännösaikana" + +#~ msgid "invalid expression" +#~ msgstr "virheellinen ilmaus" + +#~ msgid "" +#~ "E895: Sorry, this command is disabled, the MzScheme's racket/base module " +#~ "could not be loaded." +#~ msgstr "" +#~ "E895: Komento ei toimi, MzScheme-moduulia racket/base ei voitu ladata." + +#~ msgid "" +#~ "E815: Sorry, this command is disabled, the MzScheme libraries could not " +#~ "be loaded." +#~ msgstr "E815: komento ei toimi, MzScheme-kirjastoa ei voitu ladata." + +#~ msgid "Lua library cannot be loaded." +#~ msgstr "Luan kirjastoa ei voitu ladata." + +#~ msgid "E626: cannot get cscope database information" +#~ msgstr "E626: ei voi hakea cscope-tietokannan tietoja" + +#~ msgid "E625: cannot open cscope database: %s" +#~ msgstr "E625: ei voi avata cscope-tietokantaa: %s" + +#~ msgid "E563: stat error" +#~ msgstr "E563: stat-virhe" + +#~ msgid "E256: Hangul automata ERROR" +#~ msgstr "E256: Hangu-automaattivirhe" + +#~ msgid "Size:" +#~ msgstr "Koko:" + +#~ msgid "Style:" +#~ msgstr "Tyyli:" + +#~ msgid "Font:" +#~ msgstr "Fontti:" + +#~ msgid "Encoding:" +#~ msgstr "Koodaus:" + +#~ msgid "Show size in Points" +#~ msgstr "Näytä koko pisteinä" + +#~ msgid "Name:" +#~ msgstr "Nimi:" + +#~ msgid "Vim - Font Selector" +#~ msgstr "Vim - fonttivalitsin" + +#~ msgid "no specific match" +#~ msgstr "ei tarkkaa täsmäystä" + +#~ msgid "&Dismiss" +#~ msgstr "&Ohita" + +#~ msgid "Invalid font specification" +#~ msgstr "Virheellinen fonttimääritys" + +#~ msgid "Font1 width: %ld" +#~ msgstr "Fontti1:n leveys: %ld" + +#~ msgid "Font0 width: %ld" +#~ msgstr "Fontti0:n leveys: %ld" + +#~ msgid "Font%ld width is not twice that of font0" +#~ msgstr "Fontti%ld:n leveys ei ole kaksi kertaa fontti0:n" + +#~ msgid "Font1: %s" +#~ msgstr "Fontti1: %s" + +#~ msgid "Font0: %s" +#~ msgstr "Fontti0: %s" + +#~ msgid "E253: Fontset name: %s" +#~ msgstr "E253: Fontsetin nimi: %s" + +#~ msgid "Font '%s' is not fixed-width" +#~ msgstr "Fontti %s ei ole tasavälinen" + +#~ msgid "E252: Fontset name: %s" +#~ msgstr "E252: Fontsetin nimi: %s" + +#~ msgid "E250: Fonts for the following charsets are missing in fontset %s:" +#~ msgstr "E250: Seuraavien merkistöjoukkojen fontit puuttuvat fontsetistä %s:" + +#~ msgid "" +#~ "Vim E458: Cannot allocate colormap entry, some colors may be incorrect" +#~ msgstr "" +#~ "Vim E458: Ei voi varata värikartan alkiota, värit voivat mennä väärin" + +# MDI eli windowsin moni-ikkunasovellus +#~ msgid "E672: Unable to open window inside MDI application" +#~ msgstr "E672: Ikkunaa ei voitu avata MDI-sovellukseen" + +# OLE on object linking and embedding på windowska +#~ msgid "E243: Argument not supported: \"-%s\"; Use the OLE version." +#~ msgstr "E243: Argumenttia ei tueta: -%s, käytä OLE-versiota" + +#~ msgid "Directory\t*.nothing\n" +#~ msgstr "Hakemisto\t*.nothing\n" + +#~ msgid "Not Used" +#~ msgstr "Ei käytössä" + +#~ msgid "Find & Replace (use '\\\\' to find a '\\')" +#~ msgstr "Etsi ja korvaa (\\\\:llä löytää \\:t)" + +#~ msgid "Find string (use '\\\\' to find a '\\')" +#~ msgstr "Etsi merkkijonoa (\\\\:llä löytää \\:t)" + +#~ msgid "Open tab..." +#~ msgstr "Avaa välilehti..." + +#~ msgid "&Undo" +#~ msgstr "&Kumoa" + +#~ msgid "Replace &All" +#~ msgstr "Korvaa k&aikki" + +#~ msgid "&Replace" +#~ msgstr "Ko&rvaa" + +#~ msgid "Find &Next" +#~ msgstr "Hae &seuraava" + +#~ msgid "Selection" +#~ msgstr "Valinta" + +#~ msgid "&OK" +#~ msgstr "&Ok" + +#~ msgid "Files" +#~ msgstr "Tiedostot" + +#~ msgid "&Help" +#~ msgstr "O&hje" + +#~ msgid "Filter" +#~ msgstr "Suodatus" + +#~ msgid "Directories" +#~ msgstr "Hakemistot" + +#~ msgid "&Cancel" +#~ msgstr "&Peru" + +#~ msgid "&Filter" +#~ msgstr "&Suodata" + +#~ msgid "Vim: Main window unexpectedly destroyed\n" +#~ msgstr "Vim: Pääikkuna tuhoutui odottamatta\n" + +#~ msgid "Open Tab..." +#~ msgstr "Avaa välilehti..." + +#~ msgid "New tab" +#~ msgstr "Uusi välilehti" + +#~ msgid "Close tab" +#~ msgstr "Sulje välilehti" + +#~ msgid "Vim: Received \"die\" request from session manager\n" +#~ msgstr "Vim: sessiomanageri lähetti die-pyynnön\n" + +#~ msgid "_Close" +#~ msgstr "_Sulje" + +#~ msgid "Replace All" +#~ msgstr "Korvaa kaikki" + +#~ msgid "Replace" +#~ msgstr "Korvaa" + +#~ msgid "Find Next" +#~ msgstr "Etsi seuraava" + +#~ msgid "Down" +#~ msgstr "Alas" + +#~ msgid "Up" +#~ msgstr "Ylös" + +#~ msgid "Direction" +#~ msgstr "Suunta" + +#~ msgid "Match case" +#~ msgstr "Kirjaintaso" + +#~ msgid "Match whole word only" +#~ msgstr "Korvaa kokonaisia sanoja" + +#~ msgid "Replace with:" +#~ msgstr "Korvaa:" + +#~ msgid "Find what:" +#~ msgstr "Etsi:" + +#~ msgid "VIM - Search..." +#~ msgstr "VIM - Etsi..." + +#~ msgid "VIM - Search and Replace..." +#~ msgstr "VIM - Etsi ja korvaa..." + +#~ msgid "Input _Methods" +#~ msgstr "Syöte_menetelmät" + +#~ msgid "No" +#~ msgstr "Ei" + +#~ msgid "Yes" +#~ msgstr "Kyllä" + +#~ msgid "_OK" +#~ msgstr "_OK" + +#~ msgid "_Open" +#~ msgstr "_Avaa" + +#~ msgid "_Save" +#~ msgstr "_Tallenna" + +#~ msgid "_Cancel" +#~ msgstr "_Peru" + +#~ msgid "E232: Cannot create BalloonEval with both message and callback" +#~ msgstr "E232: Ei voi luoda BalloonEvalia viestille ja callbackille" + +#~ msgid "Vim dialog" +#~ msgstr "Vim-ikkuna" + +#~ msgid "Scrollbar Widget: Could not get geometry of thumb pixmap." +#~ msgstr "Vierityspalkki: Pixmapin geometria ei selviä" + +#~ msgid "Cancel" +#~ msgstr "Peru" + +#~ msgid "OK" +#~ msgstr "OK" + +#~ msgid "E615: vim_SelFile: can't get current directory" +#~ msgstr "E615: vim_SelFile: nykyistä hakemistoa ei saada selville" + +#~ msgid "Pathname:" +#~ msgstr "Polku:" + +#~ msgid "E614: vim_SelFile: can't return to current directory" +#~ msgstr "E614: vim_SelFile: nykyiseen hakemistoon ei voi palata" + +#~ msgid "E616: vim_SelFile: can't get font %s" +#~ msgstr "E616: vim_SelFile: ei saada fonttia %s" + +#~ msgid " " +#~ msgstr " " + +#~ msgid "No match at cursor, finding next" +#~ msgstr "Ei täsmäystä kursorin alla, etsitään seuraava" + +#~ msgid "E599: Value of 'imactivatekey' is invalid" +#~ msgstr "E599: imactivatekeyn arvo on virheellinen" + +#~ msgid "E231: 'guifontwide' invalid" +#~ msgstr "E231: guifontwide virheellinen" + +#~ msgid "E665: Cannot start GUI, no valid font found" +#~ msgstr "E665: Ei voi avata GUIta, sopivaa fonttia ei löydy" + +#~ msgid "E230: Cannot read from \"%s\"" +#~ msgstr "E230: Ei voi lukea kohteesta %s" + +#~ msgid "E229: Cannot start the GUI" +#~ msgstr "E229: GUIn käynnistys ei onnistu" + +#~ msgid "E851: Failed to create a new process for the GUI" +#~ msgstr "E851: Ei voitu luoda uutta prosessia käyttöliittymälle" + +# tietääkseni resurssiforkki on applen tiedostojärjestelmän tunnistejuttujuttu +#~ msgid "E460: The resource fork would be lost (add ! to override)" +#~ msgstr "E460: resurssiosa häviäisi (lisää komentoon ! ohittaaksesi)" + +#~ msgid "writing to device disabled with 'opendevice' option" +#~ msgstr "laitteeseen kirjoittaminen pois käytöstä opendevice-asetuksella" + +#~ msgid "Partial writes disallowed for NetBeans buffers" +#~ msgstr "Osittaiset kirjoitukset kielletty NetBeans-puskureissa" + +#~ msgid "NetBeans disallows writes of unmodified buffers" +#~ msgstr "NetBeans ei salli kirjoittaa muokkaamattomiin puskureihin" + +#~ msgid "Reading from stdin..." +#~ msgstr "Luetaan vakiosyötteestä" + +#~ msgid "Vim: Reading from stdin...\n" +#~ msgstr "Vim: Luetaan vakiosyötteestä...\n" + +#~ msgid "is a device (disabled with 'opendevice' option)" +#~ msgstr "on laite (ei käytössä opendevice-asetuksen takia)" + +#~ msgid "Debug Line" +#~ msgstr "Vianetsintärivi" + +#~ msgid "Input Line" +#~ msgstr "Syöterivi" + +#~ msgid "Expression" +#~ msgstr "Ilmaus" + +#~ msgid "Search String" +#~ msgstr "Hakujono" + +#~ msgid "Command Line" +#~ msgstr "Komentorivi" + +#~ msgid "" +#~ "\n" +#~ "# %s History (newest to oldest):\n" +#~ msgstr "" +#~ "\n" +#~ "# %s Historia (uusimmasta alkaen):\n" + +#~ msgid "E196: No digraphs in this version" +#~ msgstr "E196: Digraafeja ei ole tässä versiossa" + +#~ msgid "E195: Cannot open viminfo file for reading" +#~ msgstr "E195: Viminfoa ei voi avata lukemista varten" + +#~ msgid "E809: #< is not available without the +eval feature" +#~ msgstr "E809: #< ei ole käytössä jollei +eval ole päällä" + +#~ msgid "Save Setup" +#~ msgstr "Tallenna asetukset" + +#~ msgid "Save Session" +#~ msgstr "Tallenna sessio" + +#~ msgid "Save View" +#~ msgstr "Tallenna näkymä" + +#~ msgid "Save Redirection" +#~ msgstr "Tallenna uudelleenosoitus" + +#~ msgid "E930: Cannot use :redir inside execute()" +#~ msgstr "E930: Komentoa :redir ei voi käyttää funktion execute() sisällä" + +#~ msgid "E466: :winpos requires two number arguments" +#~ msgstr "E466: :winpos vaatii kaksi lukuargumenttia" + +#~ msgid "E188: Obtaining window position not implemented for this platform" +#~ msgstr "E188: Ikkunan sijainnin selvitys ei toimi tällä alustalla" + +#~ msgid "Window position: X %d, Y %d" +#~ msgstr "Ikkunan sijainti: X %d, Y %d" + +#~ msgid "" +#~ "E747: Cannot change directory, buffer is modified (add ! to override)" +#~ msgstr "" +#~ "E747: Hakemistoa ei voida muuttaa, puskuria on muokattu (lisää " +#~ "komentoon ! ohittaaksesi" + +#~ msgid "Append File" +#~ msgstr "Lisää tiedostoon" + +#~ msgid "Edit File in new window" +#~ msgstr "Muokkaa uudessa ikkunassa" + +#~ msgid "unknown" +#~ msgstr "tuntematon" + +#~ msgid "E172: Only one file name allowed" +#~ msgstr "E172: Vain yksi tiedostonimi sallitaan" + +#~ msgid "Source Vim script" +#~ msgstr "Lataa vim-skripti" + +#~ msgid " (NOT FOUND)" +#~ msgstr " (EI LÖYTYNYT)" + +#~ msgid "" +#~ "\n" +#~ "# Last Substitute String:\n" +#~ "$" +#~ msgstr "" +#~ "\n" +#~ "# Viimeisin korvausmerkkijono:\n" +#~ "$" + +#~ msgid "Edit File" +#~ msgstr "Muokkaa tiedostoa" + +#~ msgid "Save As" +#~ msgstr "Tallenna nimellä" + +#~ msgid "" +#~ "\n" +#~ "# Bar lines, copied verbatim:\n" +#~ msgstr "" +#~ "\n" +#~ "# Bar-rivit, kopiotu sellaisenaan:\n" + +#~ msgid "Illegal starting char" +#~ msgstr "Virheellinen aloitusmerkki" + +#~ msgid "# Value of 'encoding' when this file was written\n" +#~ msgstr "# encoding-muuttujan arvo tiedostoa kirjoitettaessa\n" + +#~ msgid "" +#~ "# You may edit it if you're careful!\n" +#~ "\n" +#~ msgstr "" +#~ "# Muokkaa varovasti!\n" +#~ "\n" + +#~ msgid "# This viminfo file was generated by Vim %s.\n" +#~ msgstr "# Vimin %s generoima viminfo-tiedosto.\n" + +#~ msgid "E138: Can't write viminfo file %s!" +#~ msgstr "E138: Viminfo-tiedoston kirjoittaminen ei onnistu %s" + +#~ msgid "E929: Too many viminfo temp files, like %s!" +#~ msgstr "E929: liikaa viminfo-väliaikaistiedostoja, kuten %s." + +#~ msgid "E136: viminfo: Too many errors, skipping rest of file" +#~ msgstr "E136: viminfo: liikaa virheitä, ohitetaan lopputiedosto" + +#~ msgid "%sviminfo: %s in line: " +#~ msgstr "%sviminfo: %s rivillä: " + +#~ msgid "E258: Unable to send to client" +#~ msgstr "E258: Asiakkaalle lähetys ei onnistunut" + +#~ msgid "E277: Unable to read a server reply" +#~ msgstr "E277: Palvelimen vastauksen lukeminen ei onnistunut" + +#~ msgid "E240: No connection to Vim server" +#~ msgstr "E240: Ei yhteyttä vim-palvelimeen" + +#~ msgid "" +#~ "&OK\n" +#~ "&Cancel" +#~ msgstr "" +#~ "&OK\n" +#~ "&Peru" + +#~ msgid "" +#~ "\n" +#~ "# global variables:\n" +#~ msgstr "" +#~ "\n" +#~ "# globaalit muuttujat:\n" + +#~ msgid "E729: using Funcref as a String" +#~ msgstr "E729: Funcref ei käy merkkijonosta" + +#~ msgid "E914: Using a Channel as a Float" +#~ msgstr "E914: Käytettiin Channelia Floattina" + +#~ msgid "E911: Using a Job as a Float" +#~ msgstr "E911: Job ei käy Floatista" + +#~ msgid "E913: Using a Channel as a Number" +#~ msgstr "E913: Channel ei käy Numberista" + +#~ msgid "E910: Using a Job as a Number" +#~ msgstr "E910: Job ei käy Numberista" + +#~ msgid "E703: Using a Funcref as a Number" +#~ msgstr "E703: Funcref ei käy Numberista" + +#~ msgid "E724: variable nested too deep for displaying" +#~ msgstr "E724: muuttuja on upotettu liian syvälle näytettäväksi" + +#~ msgid "Patch file" +#~ msgstr "Patch-tiedosto" + +#~ msgid "[crypted]" +#~ msgstr "[salattu]" + +#~ msgid "Keys don't match!" +#~ msgstr "Avaimet eivät täsmää!" + +#~ msgid "Enter same key again: " +#~ msgstr "Anna sama avain uudestaan: " + +#~ msgid "Enter encryption key: " +#~ msgstr "Anna salausavain: " + +#~ msgid "Warning: Using a weak encryption method; see :help 'cm'" +#~ msgstr "Varoitus: Käytetään heikkoa salausmenetelmää, ks. :help 'cm'" + +#~ msgid "E821: File is encrypted with unknown method" +#~ msgstr "E821: Tiedoston salaus on tuntematon" + +#~ msgid "E918: buffer must be loaded: %s" +#~ msgstr "E918: puskuria ei voi ladata: %s" + +#~ msgid "E915: in_io buffer requires in_buf or in_name to be set" +#~ msgstr "E915: in_io-puskurilla pitää olla in_buf tai in_name asetettu" + +#~ msgid "E920: _io file requires _name to be set" +#~ msgstr "E920: _io-tiedostolla pitää olla _name asetettu" + +#~ msgid "E906: not an open channel" +#~ msgstr "E906: ei ole avoin kanava" + +#~ msgid "" +#~ "E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel" +#~ msgstr "" +#~ "E912: ei voida käyttää funktioita ch_evalexpr(), ch_sendexpr() raa'an tai " +#~ "nl-kanavan kanssa" + +#~ msgid "E917: Cannot use a callback with %s()" +#~ msgstr "E917: Ei voitu käyttää callbackia %s()" + +#~ msgid "" +#~ "\n" +#~ "# Buffer list:\n" +#~ msgstr "" +#~ "\n" +#~ "# Puskuriluettelo:\n" + +#~ msgid "E931: Buffer cannot be registered" +#~ msgstr "E931: Puskuria ei voi rekisteröidä" + +#~ msgid "E819: Blowfish test failed" +#~ msgstr "E819: Blowfish-testi epäonnistui" + +#~ msgid "E818: sha256 test failed" +#~ msgstr "E818: sha256-testi epäonnistui failed" + +#~ msgid "E817: Blowfish big/little endian use wrong" +#~ msgstr "E817: Blowfishin tavujärjestys väärä" + +#~ msgid "E820: sizeof(uint32_t) != 4" +#~ msgstr "E820: sizeof(uint32_t) != 4" + +#~ msgid "E831: bf_key_init() called with empty password" +#~ msgstr "E831: bf_key_init() tyhjällä salasanalla" From b25fa94eb5234e3c5ae1f7b3c0888aac644ae923 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 19 Apr 2017 21:26:01 +0200 Subject: [PATCH 124/257] scripts/vim-patch.sh: word-boundaries in preprocess regex --- scripts/vim-patch.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index c8ae36cc3b..3ade90a65b 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -137,18 +137,18 @@ preprocess_patch() { # Remove channel.txt, netbeans.txt, os_*.txt, todo.txt, version*.txt, tags local na_doc='channel\.txt\|netbeans\.txt\|os_\w\+\.txt\|todo\.txt\|version\d\.txt\|tags' - 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/\%('${na_doc}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file" + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/\<\%('${na_doc}'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file" # Remove "Last change ..." changes in doc files. 2>/dev/null $nvim --cmd 'set dir=/tmp' +'%s/^@@.*\n.*For Vim version.*Last change.*\n.*For Vim version.*Last change.*//' +w +q "$file" # Remove some testdir/Make_*.mak files local na_src_testdir='Make_amiga.mak\|Make_dos.mak\|Make_ming.mak\|Make_vms.mms' - 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/\%('${na_src_testdir}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file" + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/\<\%('${na_src_testdir}'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file" # Remove some *.po files. #5622 local na_po='sjiscorr.c\|ja.sjis.po\|ko.po\|pl.cp1250.po\|pl.po\|ru.cp1251.po\|uk.cp1251.po\|zh_CN.cp936.po\|zh_CN.po\|zh_TW.po' - 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/po/\%('${na_po}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file" + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/po/\<\%('${na_po}'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file" # Rename src/ paths to src/nvim/ LC_ALL=C sed -e 's/\( [ab]\/src\)/\1\/nvim/g' \ From c5d7eaf66468d5f71049a602e820c19d8ad8c772 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 15 Apr 2017 13:21:38 -0400 Subject: [PATCH 125/257] vim-patch:7.4.2152 Problem: No proper translation of messages with a count. Solution: Use ngettext(). (Sergey Alyoshin) https://github.com/vim/vim/commit/ee695f787ade7fd88fc5f5497553d95c0c3645b5 --- src/nvim/eval.c | 7 +++---- src/nvim/fold.c | 18 ++++++++++-------- src/nvim/screen.c | 2 +- src/nvim/version.c | 2 +- src/nvim/vim.h | 2 ++ 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index dcbd7ab152..60c4e725b7 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8663,7 +8663,6 @@ static void f_foldtext(typval_T *argvars, typval_T *rettv, FunPtr fptr) char_u *r; int len; char *txt; - long count; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; @@ -8691,8 +8690,8 @@ static void f_foldtext(typval_T *argvars, typval_T *rettv, FunPtr fptr) s = skipwhite(s + 1); } } - count = (long)(foldend - foldstart + 1); - txt = _("+-%s%3ld lines: "); + unsigned long count = (unsigned long)(foldend - foldstart + 1); + txt = ngettext("+-%s%3ld line: ", "+-%s%3ld lines: ", count); r = xmalloc(STRLEN(txt) + STRLEN(dashes) // for %s + 20 // for %3ld @@ -8712,7 +8711,7 @@ static void f_foldtext(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_foldtextresult(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *text; - char_u buf[51]; + char_u buf[FOLD_TEXT_LEN]; foldinfo_T foldinfo; int fold_count; diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 34db4d2171..ff3f46cb78 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -1689,12 +1689,10 @@ static void foldDelMarker(linenr_T lnum, char_u *marker, size_t markerlen) } } -/* get_foldtext() {{{2 */ -/* - * Return the text for a closed fold at line "lnum", with last line "lnume". - * When 'foldtext' isn't set puts the result in "buf[51]". Otherwise the - * result is in allocated memory. - */ +// get_foldtext() {{{2 +/// Return the text for a closed fold at line "lnum", with last line "lnume". +/// When 'foldtext' isn't set puts the result in "buf[FOLD_TEXT_LEN]". +/// Otherwise the result is in allocated memory. char_u *get_foldtext(win_T *wp, linenr_T lnum, linenr_T lnume, foldinfo_T *foldinfo, char_u *buf) FUNC_ATTR_NONNULL_ARG(1) @@ -1781,8 +1779,12 @@ char_u *get_foldtext(win_T *wp, linenr_T lnum, linenr_T lnume, } } if (text == NULL) { - sprintf((char *)buf, _("+--%3ld lines folded "), - (long)(lnume - lnum + 1)); + unsigned long count = (unsigned long)(lnume - lnum + 1); + + vim_snprintf((char *)buf, FOLD_TEXT_LEN, + ngettext("+--%3ld line folded", + "+--%3ld lines folded ", count), + count); text = buf; } return text; diff --git a/src/nvim/screen.c b/src/nvim/screen.c index a8993be4e5..f34dbf5d64 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1684,7 +1684,7 @@ static int compute_foldcolumn(win_T *wp, int col) */ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T lnum, int row) { - char_u buf[51]; + char_u buf[FOLD_TEXT_LEN]; pos_T *top, *bot; linenr_T lnume = lnum + fold_count - 1; int len; diff --git a/src/nvim/version.c b/src/nvim/version.c index 9a5d7ce169..cd904da573 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -289,7 +289,7 @@ static const int included_patches[] = { // 2155 NA // 2154 NA // 2153 NA - // 2152, + 2152, 2151, // 2150 NA 2149, diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 172e62b039..f29ccdd296 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -204,6 +204,8 @@ enum { #define DIALOG_MSG_SIZE 1000 /* buffer size for dialog_msg() */ +enum { FOLD_TEXT_LEN = 51 }; //!< buffer size for get_foldtext() + /* * Maximum length of key sequence to be mapped. * Must be able to hold an Amiga resize report. From cb02137dfac7357650a2e9cc32acb66326e59058 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 15 Apr 2017 13:54:40 -0400 Subject: [PATCH 127/257] vim-patch:7.4.2209 Problem: Cannot map . (Stephen Riehm) Solution: Solve the memory access problem in another way. (Dominique Pelle) Allow for using in a string. https://github.com/vim/vim/commit/35a4cfa200917dd171b1fff3cd5b6cee9add673d --- src/nvim/eval.c | 2 +- src/nvim/keymap.c | 40 ++++++++++++++++++------------- src/nvim/option.c | 2 +- src/nvim/os/input.c | 3 ++- src/nvim/testdir/test_mapping.vim | 8 +++++++ src/nvim/version.c | 2 +- 6 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 60c4e725b7..9f56d8db0c 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -4764,7 +4764,7 @@ static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate) // Special key, e.g.: "\" case '<': - extra = trans_special((const char_u **) &p, STRLEN(p), name, true); + extra = trans_special((const char_u **)&p, STRLEN(p), name, true, true); if (extra != 0) { name += extra; break; diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c index 72b0d0aa40..9838b63a6b 100644 --- a/src/nvim/keymap.c +++ b/src/nvim/keymap.c @@ -490,17 +490,19 @@ char_u *get_special_key_name(int c, int modifiers) /// @param[out] dst Location where translation result will be kept. Must have /// at least six bytes. /// @param[in] keycode Prefer key code, e.g. K_DEL in place of DEL. +/// @param[in] in_string Inside a double quoted string /// /// @return Number of characters added to dst, zero for no match. unsigned int trans_special(const char_u **srcp, const size_t src_len, - char_u *const dst, const bool keycode) + char_u *const dst, const bool keycode, + const bool in_string) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT { int modifiers = 0; int key; unsigned int dlen = 0; - key = find_special_key(srcp, src_len, &modifiers, keycode, false); + key = find_special_key(srcp, src_len, &modifiers, keycode, false, in_string); if (key == 0) { return 0; } @@ -536,10 +538,12 @@ unsigned int trans_special(const char_u **srcp, const size_t src_len, /// @param[out] modp Location where information about modifiers is saved. /// @param[in] keycode Prefer key code, e.g. K_DEL in place of DEL. /// @param[in] keep_x_key Don’t translate xHome to Home key. +/// @param[in] in_string In string, double quote is escaped /// /// @return Key and modifiers or 0 if there is no match. int find_special_key(const char_u **srcp, const size_t src_len, int *const modp, - const bool keycode, const bool keep_x_key) + const bool keycode, const bool keep_x_key, + const bool in_string) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { const char_u *last_dash; @@ -573,10 +577,14 @@ int find_special_key(const char_u **srcp, const size_t src_len, int *const modp, } else { l = 1; } - if (end - bp > l && bp[l] != '"' && bp[l + 1] == '>') { - // Anything accepted, like , except , because the " - // ends the string. + // Anything accepted, like . + // or are not special in strings as " is + // the string delimiter. With a backslash it works: + if (end - bp > l && !(in_string && bp[1] == '"') && bp[2] == '>') { bp += l; + } else if (end - bp > 2 && in_string && bp[1] == '\\' + && bp[2] == '"' && bp[3] == '>') { + bp += 2; } } } @@ -612,18 +620,17 @@ int find_special_key(const char_u **srcp, const size_t src_len, int *const modp, vim_str2nr(last_dash + 6, NULL, NULL, STR2NR_ALL, NULL, &n, 0); key = (int)n; } else { - /* - * Modifier with single letter, or special key name. - */ - if (has_mbyte) { - l = mb_ptr2len(last_dash + 1); - } else { - l = 1; + int off = 1; + + // Modifier with single letter, or special key name. + if (in_string && last_dash[1] == '\\' && last_dash[2] == '"') { + off = 2; } + l = mb_ptr2len(last_dash + 1); if (modifiers != 0 && last_dash[l + 1] == '>') { - key = PTR2CHAR(last_dash + 1); + key = PTR2CHAR(last_dash + off); } else { - key = get_special_key_code(last_dash + 1); + key = get_special_key_code(last_dash + off); if (!keep_x_key) { key = handle_x_keys(key); } @@ -828,7 +835,8 @@ char_u *replace_termcodes(const char_u *from, const size_t from_len, } } - slen = trans_special(&src, (size_t) (end - src) + 1, result + dlen, true); + slen = trans_special(&src, (size_t)(end - src) + 1, result + dlen, true, + true); if (slen) { dlen += slen; continue; diff --git a/src/nvim/option.c b/src/nvim/option.c index 0070a0056d..8748406ba4 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4818,7 +4818,7 @@ int find_key_option_len(const char_u *arg, size_t len) } else { arg--; // put arg at the '<' modifiers = 0; - key = find_special_key(&arg, len + 1, &modifiers, true, true); + key = find_special_key(&arg, len + 1, &modifiers, true, true, false); if (modifiers) { // can't handle modifiers here key = 0; } diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 5f0f2ec677..1fa1f52806 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -182,7 +182,8 @@ size_t input_enqueue(String keys) while (rbuffer_space(input_buffer) >= 6 && ptr < end) { uint8_t buf[6] = { 0 }; unsigned int new_size - = trans_special((const uint8_t **)&ptr, (size_t)(end - ptr), buf, true); + = trans_special((const uint8_t **)&ptr, (size_t)(end - ptr), buf, true, + true); if (new_size) { new_size = handle_mouse_event(&ptr, buf, new_size); diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 6b313ff54f..7f93ddd56e 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -150,3 +150,11 @@ func Test_break_undo() call assert_equal('new line here', getline(line('$') - 1)) set nomodified endfunc + +func Test_map_meta_quotes() + imap foo + call feedkeys("Go-\-\", "xt") + call assert_equal("-foo-", getline('$')) + set nomodified + iunmap +endfunc diff --git a/src/nvim/version.c b/src/nvim/version.c index cd904da573..f7a78a15f9 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -232,7 +232,7 @@ static const int included_patches[] = { 2212, // 2211 NA // 2210 NA - // 2209, + 2209, 2208, // 2207 NA // 2206 NA From a6f50c1120f4427d1b4f531ac564d83b770fd62f Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 19 Apr 2017 23:22:27 -0400 Subject: [PATCH 128/257] version.c: Mark 7.4.{2165,2173,2179} applied --- src/nvim/version.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nvim/version.c b/src/nvim/version.c index f7a78a15f9..4edfe88e18 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -262,13 +262,13 @@ static const int included_patches[] = { // 2182 NA // 2181 NA 2180, - // 2179, + 2179, 2178, 2177, // 2176 NA 2175, 2174, - // 2173, + 2173, 2172, // 2171 NA 2170, @@ -276,7 +276,7 @@ static const int included_patches[] = { // 2168 NA // 2167 NA // 2166 NA - // 2165, + 2165, 2164, 2163, 2162, From 17052946c744abd53d8f3349f453964ffa818bea Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 20 Apr 2017 12:32:14 +0200 Subject: [PATCH 129/257] 'scrollback': Allow :setlocal -1 on normal buffers Avoids a spurious :loadview error. --- src/nvim/option.c | 2 +- test/functional/terminal/scrollback_spec.lua | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/nvim/option.c b/src/nvim/option.c index 8748406ba4..ae038389b4 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4223,7 +4223,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value, } else if (pp == &curbuf->b_p_scbk || pp == &p_scbk) { // 'scrollback' if (*pp < -1 || *pp > SB_MAX - || (opt_flags == OPT_LOCAL && !curbuf->terminal)) { + || (*pp != -1 && opt_flags == OPT_LOCAL && !curbuf->terminal)) { errmsg = e_invarg; *pp = old_value; } else if (curbuf->terminal) { diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua index 32f25d4086..05f81295c2 100644 --- a/test/functional/terminal/scrollback_spec.lua +++ b/test/functional/terminal/scrollback_spec.lua @@ -451,6 +451,13 @@ describe("'scrollback' option", function() it(':setlocal in a normal buffer is an error', function() command('new') + + -- :setlocal to -1 is NOT an error. + feed_command('setlocal scrollback=-1') + eq(nil, string.match(eval("v:errmsg"), "E%d*:")) + feed('') + + -- :setlocal to anything except -1 is an error. feed_command('setlocal scrollback=42') feed('') eq('E474:', string.match(eval("v:errmsg"), "E%d*:")) From d55fd9588f621719e3e8c66f69290a00e1fadc1b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 20 Apr 2017 13:01:11 +0200 Subject: [PATCH 130/257] doc: Recommend `:silent!` for :loadview. ex_loadview() was changed in 9b1c9393709a to check the file open result. If user doesn't care about failure to open, using :silent! instead of :silent is a reasonable, conventional approach. Closes #3196 --- runtime/doc/starting.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 2d1dd22222..14e8c5d76f 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -922,7 +922,7 @@ You might want to clean up your 'viewdir' directory now and then. To automatically save and restore views for *.c files: > au BufWinLeave *.c mkview - au BufWinEnter *.c silent loadview + au BufWinEnter *.c silent! loadview ============================================================================== 8. The ShaDa file *shada* *shada-file* From 19646a2985e54dfc561a90a70054522afc052a45 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 12 Apr 2017 07:37:19 -0700 Subject: [PATCH 131/257] health.vim: 'guicursor' advice #6506 Also: - Mark provider sections as "(optional)". - Fix help-link substitution to support single-quoted tags. --- runtime/autoload/health.vim | 2 +- runtime/autoload/health/nvim.vim | 20 ++++++++++++++++---- runtime/autoload/health/provider.vim | 6 +++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index 05c024f585..8f45adcff1 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -88,7 +88,7 @@ endfunction " Changes ':h clipboard' to ':help |clipboard|'. function! s:help_to_link(s) abort - return substitute(a:s, '\v:h%[elp] ([^|][^''"\r\n]+)', ':help |\1|', 'g') + return substitute(a:s, '\v:h%[elp] ([^|][^"\r\n]+)', ':help |\1|', 'g') endfunction " Format a message for a specific report item diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim index ca62de84d8..4c6aa0eb04 100644 --- a/runtime/autoload/health/nvim.vim +++ b/runtime/autoload/health/nvim.vim @@ -1,16 +1,28 @@ -let s:suggest_faq = 'See https://github.com/neovim/neovim/wiki/FAQ' +let s:suggest_faq = 'https://github.com/neovim/neovim/wiki/FAQ' function! s:check_config() abort + let ok = v:true call health#report_start('Configuration') - if !get(g:, 'loaded_sensible', 0) - call health#report_ok('no issues found') - else + + if get(g:, 'loaded_sensible', 0) + let ok = v:false let sensible_pi = globpath(&runtimepath, '**/sensible.vim', 1, 1) call health#report_info("found sensible.vim plugin:\n".join(sensible_pi, "\n")) call health#report_error("sensible.vim plugin is not needed; Nvim has the same defaults built-in." \ ." Also, sensible.vim sets 'ttimeoutlen' to a sub-optimal value.", \ ["Remove sensible.vim plugin, or wrap it in a `if !has('nvim')` check."]) endif + + if exists('$NVIM_TUI_ENABLE_CURSOR_SHAPE') + let ok = v:false + call health#report_warn("$NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+", + \ [ "Use the 'guicursor' option to configure cursor shape. :help 'guicursor'", + \ 'https://github.com/neovim/neovim/wiki/Following-HEAD#20170402' ]) + endif + + if ok + call health#report_ok('no issues found') + endif endfunction " Load the remote plugin manifest file and check for unregistered plugins diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 9db209849b..2506c8216b 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -111,7 +111,7 @@ endfunction " Check for clipboard tools. function! s:check_clipboard() abort - call health#report_start('Clipboard') + call health#report_start('Clipboard (optional)') let clipboard_tool = provider#clipboard#Executable() if empty(clipboard_tool) @@ -224,7 +224,7 @@ function! s:check_bin(bin) abort endfunction function! s:check_python(version) abort - call health#report_start('Python ' . a:version . ' provider') + call health#report_start('Python ' . a:version . ' provider (optional)') let pyname = 'python'.(a:version == 2 ? '' : '3') let pyenv = resolve(exepath('pyenv')) @@ -419,7 +419,7 @@ function! s:check_python(version) abort endfunction function! s:check_ruby() abort - call health#report_start('Ruby provider') + call health#report_start('Ruby provider (optional)') let loaded_var = 'g:loaded_ruby_provider' if exists(loaded_var) && !exists('*provider#ruby#Call') From 9cdbbd49825561d642705990a2704b2241cf0584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Mon, 17 Apr 2017 11:32:14 +0200 Subject: [PATCH 132/257] ui: support more cursor shape modes throttle unneccessary cursor shape events --- src/nvim/api/ui.c | 23 +++++++--------- src/nvim/cursor_shape.c | 35 +++++++++++++++++++++++- src/nvim/cursor_shape.h | 3 ++- src/nvim/ex_getln.c | 16 +++++++++++ src/nvim/mouse.c | 1 + src/nvim/tui/tui.c | 60 +++++++++++------------------------------ src/nvim/ui.c | 31 ++++++++------------- src/nvim/ui.h | 2 +- src/nvim/ui_bridge.c | 4 +-- 9 files changed, 93 insertions(+), 82 deletions(-) diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index de60339e5f..0053050717 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -266,19 +266,14 @@ static void remote_ui_mouse_off(UI *ui) push_call(ui, "mouse_off", args); } -static void remote_ui_mode_change(UI *ui, int mode) +static void remote_ui_mode_change(UI *ui, int mode_idx) { Array args = ARRAY_DICT_INIT; - if (mode == INSERT) { - ADD(args, STRING_OBJ(cstr_to_string("insert"))); - } else if (mode == REPLACE) { - ADD(args, STRING_OBJ(cstr_to_string("replace"))); - } else if (mode == CMDLINE) { - ADD(args, STRING_OBJ(cstr_to_string("cmdline"))); - } else { - assert(mode == NORMAL); - ADD(args, STRING_OBJ(cstr_to_string("normal"))); - } + + char *full_name = shape_table[mode_idx].full_name; + ADD(args, STRING_OBJ(cstr_to_string(full_name))); + + ADD(args, INTEGER_OBJ(mode_idx)); push_call(ui, "mode_change", args); } @@ -393,8 +388,10 @@ static void remote_ui_update_sp(UI *ui, int sp) static void remote_ui_flush(UI *ui) { UIData *data = ui->data; - channel_send_event(data->channel_id, "redraw", data->buffer); - data->buffer = (Array)ARRAY_DICT_INIT; + if (data->buffer.size > 0) { + channel_send_event(data->channel_id, "redraw", data->buffer); + data->buffer = (Array)ARRAY_DICT_INIT; + } } static void remote_ui_suspend(UI *ui) diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 34ee53bf75..57dc241c54 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -11,7 +11,7 @@ #include "nvim/ui.h" /// Handling of cursor and mouse pointer shapes in various modes. -static cursorentry_T shape_table[SHAPE_IDX_COUNT] = +cursorentry_T shape_table[SHAPE_IDX_COUNT] = { // Values are set by 'guicursor' and 'mouseshape'. // Adjust the SHAPE_IDX_ defines when changing this! @@ -63,6 +63,7 @@ Dictionary cursor_shape_dict(void) PUT(dic, "id_lm", INTEGER_OBJ(cur->id_lm)); } PUT(dic, "short_name", STRING_OBJ(cstr_to_string(cur->name))); + PUT(dic, "mode_idx", INTEGER_OBJ(i)); PUT(all, cur->full_name, DICTIONARY_OBJ(dic)); } @@ -260,3 +261,35 @@ int cursor_mode_str2int(const char *mode) return -1; } + +/// Return the index into shape_table[] for the current mode. +int cursor_get_mode_idx(void) +{ + if (State == SHOWMATCH) { + return SHAPE_IDX_SM; + } else if (State & VREPLACE_FLAG) { + return SHAPE_IDX_R; + } else if (State & REPLACE_FLAG) { + return SHAPE_IDX_R; + } else if (State & INSERT) { + return SHAPE_IDX_I; + } else if (State & CMDLINE) { + if (cmdline_at_end()) { + return SHAPE_IDX_C; + } else if (cmdline_overstrike()) { + return SHAPE_IDX_CR; + } else { + return SHAPE_IDX_CI; + } + } else if (finish_op) { + return SHAPE_IDX_O; + } else if (VIsual_active) { + if (*p_sel == 'e') { + return SHAPE_IDX_VE; + } else { + return SHAPE_IDX_V; + } + } else { + return SHAPE_IDX_N; + } +} diff --git a/src/nvim/cursor_shape.h b/src/nvim/cursor_shape.h index 7cf65cba3c..2c466603f0 100644 --- a/src/nvim/cursor_shape.h +++ b/src/nvim/cursor_shape.h @@ -25,7 +25,7 @@ SHAPE_IDX_MORE = 14, ///< Hit-return or More SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line SHAPE_IDX_SM = 16, ///< showing matching paren SHAPE_IDX_COUNT = 17 -} MouseMode; +} ModeShape; typedef enum { SHAPE_BLOCK = 0, ///< block cursor @@ -53,6 +53,7 @@ typedef struct cursor_entry { char used_for; ///< SHAPE_MOUSE and/or SHAPE_CURSOR } cursorentry_T; +extern cursorentry_T shape_table[SHAPE_IDX_COUNT]; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "cursor_shape.h.generated.h" diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 0b6036ace9..5d228e7492 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -351,6 +351,7 @@ static int command_line_check(VimState *state) quit_more = false; // reset after CTRL-D which had a more-prompt cursorcmd(); // set the cursor on the right spot + ui_cursor_shape(); return 1; } @@ -2092,6 +2093,18 @@ redraw: return (char_u *)line_ga.ga_data; } +bool cmdline_overstrike(void) +{ + return ccline.overstrike; +} + + +/// Return true if the cursor is at the end of the cmdline. +bool cmdline_at_end(void) +{ + return (ccline.cmdpos >= ccline.cmdlen); +} + /* * Allocate a new command line buffer. * Assigns the new buffer to ccline.cmdbuff and ccline.cmdbufflen. @@ -2262,6 +2275,7 @@ void putcmdline(int c, int shift) draw_cmdline(ccline.cmdpos, ccline.cmdlen - ccline.cmdpos); msg_no_more = FALSE; cursorcmd(); + ui_cursor_shape(); } /* @@ -2281,6 +2295,7 @@ void unputcmdline(void) draw_cmdline(ccline.cmdpos, 1); msg_no_more = FALSE; cursorcmd(); + ui_cursor_shape(); } /* @@ -2598,6 +2613,7 @@ void redrawcmdline(void) compute_cmdrow(); redrawcmd(); cursorcmd(); + ui_cursor_shape(); } static void redrawcmdprompt(void) diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 2ebe199f47..0029f364da 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -456,6 +456,7 @@ void setmouse(void) { int checkfor; + ui_cursor_shape(); /* be quick when mouse is off */ if (*p_mouse == NUL) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index f34f5f1bc4..3498e8f4e7 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -73,7 +73,7 @@ typedef struct { bool busy; cursorentry_T cursor_shapes[SHAPE_IDX_COUNT]; HlAttrs print_attrs; - int showing_mode; + ModeShape showing_mode; struct { int enable_mouse, disable_mouse; int enable_bracketed_paste, disable_bracketed_paste; @@ -131,7 +131,7 @@ static void terminfo_start(UI *ui) data->can_use_terminal_scroll = true; data->bufpos = 0; data->bufsize = sizeof(data->buf) - CNORM_COMMAND_MAX_SIZE; - data->showing_mode = 0; + data->showing_mode = SHAPE_IDX_N; data->unibi_ext.enable_mouse = -1; data->unibi_ext.disable_mouse = -1; data->unibi_ext.set_cursor_color = -1; @@ -173,7 +173,7 @@ static void terminfo_stop(UI *ui) { TUIData *data = ui->data; // Destroy output stuff - tui_mode_change(ui, NORMAL); + tui_mode_change(ui, SHAPE_IDX_N); tui_mouse_off(ui); unibi_out(ui, unibi_exit_attribute_mode); // cursor should be set to normal before exiting alternate screen @@ -451,7 +451,7 @@ CursorShape tui_cursor_decode_shape(const char *shape_str) return shape; } -static cursorentry_T decode_cursor_entry(Dictionary args) +static cursorentry_T decode_cursor_entry(Dictionary args, int *mode_idx) { cursorentry_T r; @@ -467,6 +467,8 @@ static cursorentry_T decode_cursor_entry(Dictionary args) r.blinkoff = (int)value.data.integer; } else if (strequal(key, "hl_id")) { r.id = (int)value.data.integer; + } else if (strequal(key, "mode_idx")) { + *mode_idx = (int)value.data.integer; } } return r; @@ -484,15 +486,15 @@ static void tui_cursor_style_set(UI *ui, bool enabled, Dictionary args) // Keys: as defined by `shape_table`. for (size_t i = 0; i < args.size; i++) { char *mode_name = args.items[i].key.data; - const int mode_id = cursor_mode_str2int(mode_name); - assert(mode_id >= 0); - cursorentry_T r = decode_cursor_entry(args.items[i].value.data.dictionary); + int mode_idx; + cursorentry_T r = decode_cursor_entry(args.items[i].value.data.dictionary, + &mode_idx); + assert(mode_idx >= 0); r.full_name = mode_name; - data->cursor_shapes[mode_id] = r; + data->cursor_shapes[mode_idx] = r; } - MouseMode cursor_mode = tui_mode2cursor(data->showing_mode); - tui_set_cursor(ui, cursor_mode); + tui_set_mode(ui, data->showing_mode); } static void tui_update_menu(UI *ui) @@ -529,7 +531,7 @@ static void tui_mouse_off(UI *ui) } /// @param mode one of SHAPE_XXX -static void tui_set_cursor(UI *ui, MouseMode mode) +static void tui_set_mode(UI *ui, ModeShape mode) { if (!cursor_style_enabled) { return; @@ -584,42 +586,12 @@ static void tui_set_cursor(UI *ui, MouseMode mode) } } -/// Returns cursor mode from edit mode -static MouseMode tui_mode2cursor(int mode) -{ - switch (mode) { - case INSERT: return SHAPE_IDX_I; - case CMDLINE: return SHAPE_IDX_C; - case REPLACE: return SHAPE_IDX_R; - case NORMAL: - default: return SHAPE_IDX_N; - } -} - /// @param mode editor mode -static void tui_mode_change(UI *ui, int mode) +static void tui_mode_change(UI *ui, int mode_idx) { TUIData *data = ui->data; - - if (mode == INSERT) { - if (data->showing_mode != INSERT) { - tui_set_cursor(ui, SHAPE_IDX_I); - } - } else if (mode == CMDLINE) { - if (data->showing_mode != CMDLINE) { - tui_set_cursor(ui, SHAPE_IDX_C); - } - } else if (mode == REPLACE) { - if (data->showing_mode != REPLACE) { - tui_set_cursor(ui, SHAPE_IDX_R); - } - } else { - assert(mode == NORMAL); - if (data->showing_mode != NORMAL) { - tui_set_cursor(ui, SHAPE_IDX_N); - } - } - data->showing_mode = mode; + tui_set_mode(ui, (ModeShape)mode_idx); + data->showing_mode = (ModeShape)mode_idx; } static void tui_set_scroll_region(UI *ui, int top, int bot, int left, diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 28f71b7ef2..8c5e579301 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -53,6 +53,7 @@ static int current_attr_code = 0; static bool pending_cursor_update = false; static int busy = 0; static int height, width; +static int old_mode_idx = -1; // UI_CALL invokes a function on all registered UI instances. The functions can // have 0-5 arguments (configurable by SELECT_NTH). @@ -150,12 +151,6 @@ void ui_event(char *name, Array args) } } -// May update the shape of the cursor. -void ui_cursor_shape(void) -{ - ui_mode_change(); -} - void ui_refresh(void) { if (!ui_active()) { @@ -181,6 +176,8 @@ void ui_refresh(void) screen_resize(width, height); pum_set_external(pum_external); ui_cursor_style_set(); + old_mode_idx = -1; + ui_cursor_shape(); } static void ui_refresh_event(void **argv) @@ -541,25 +538,19 @@ static void flush_cursor_update(void) } } -// Notify that the current mode has changed. Can be used to change cursor -// shape, for example. -static void ui_mode_change(void) +/// Check if current mode has changed. +/// May update the shape of the cursor. +void ui_cursor_shape(void) { - int mode; if (!full_screen) { return; } - // Get a simple UI mode out of State. - if ((State & REPLACE) == REPLACE) { - mode = REPLACE; - } else if (State & INSERT) { - mode = INSERT; - } else if (State & CMDLINE) { - mode = CMDLINE; - } else { - mode = NORMAL; + int mode_idx = cursor_get_mode_idx(); + + if (old_mode_idx != mode_idx) { + old_mode_idx = mode_idx; + UI_CALL(mode_change, mode_idx); } - UI_CALL(mode_change, mode); conceal_check_cursur_line(); } diff --git a/src/nvim/ui.h b/src/nvim/ui.h index 8ffc5a45a6..d63ceb106c 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -28,7 +28,7 @@ struct ui_t { void (*busy_stop)(UI *ui); void (*mouse_on)(UI *ui); void (*mouse_off)(UI *ui); - void (*mode_change)(UI *ui, int mode); + void (*mode_change)(UI *ui, int mode_idx); void (*set_scroll_region)(UI *ui, int top, int bot, int left, int right); void (*scroll)(UI *ui, int count); void (*highlight_set)(UI *ui, HlAttrs attrs); diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c index 9f780663ac..59942fb2cb 100644 --- a/src/nvim/ui_bridge.c +++ b/src/nvim/ui_bridge.c @@ -249,9 +249,9 @@ static void ui_bridge_mouse_off_event(void **argv) ui->mouse_off(ui); } -static void ui_bridge_mode_change(UI *b, int mode) +static void ui_bridge_mode_change(UI *b, int mode_idx) { - UI_CALL(b, mode_change, 2, b, INT2PTR(mode)); + UI_CALL(b, mode_change, 2, b, INT2PTR(mode_idx)); } static void ui_bridge_mode_change_event(void **argv) { From 2c5751b9b2b22b8519aeda82088fe4525f2bd713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Mon, 17 Apr 2017 13:32:22 +0200 Subject: [PATCH 133/257] ui: add tests for new cursor shape modes --- test/functional/terminal/ex_terminal_spec.lua | 2 +- test/functional/ui/cursor_spec.lua | 17 ++ test/functional/ui/mode_spec.lua | 227 ++++++++++++++++++ test/functional/ui/screen.lua | 5 +- test/functional/ui/screen_basic_spec.lua | 113 --------- 5 files changed, 247 insertions(+), 117 deletions(-) create mode 100644 test/functional/ui/mode_spec.lua diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index 154374cda9..1ed63adcfb 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -26,7 +26,7 @@ describe(':terminal', function() feed_command([[terminal while true; do echo X; done]]) helpers.feed([[]]) wait() - helpers.sleep(10) -- Let some terminal activity happen. + screen.sleep(10) -- Let some terminal activity happen. feed_command("messages") screen:expect([[ msg1 | diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua index 02e9422781..e4c1b17ef3 100644 --- a/test/functional/ui/cursor_spec.lua +++ b/test/functional/ui/cursor_spec.lua @@ -20,9 +20,11 @@ describe('ui/cursor', function() it("'guicursor' is published as a UI event", function() local expected_cursor_style = { cmdline_hover = { + mode_idx = 9, mouse_shape = 0, short_name = 'e' }, cmdline_insert = { + mode_idx = 5, blinkoff = 250, blinkon = 400, blinkwait = 700, @@ -33,6 +35,7 @@ describe('ui/cursor', function() mouse_shape = 0, short_name = 'ci' }, cmdline_normal = { + mode_idx = 4, blinkoff = 250, blinkon = 400, blinkwait = 700, @@ -43,6 +46,7 @@ describe('ui/cursor', function() mouse_shape = 0, short_name = 'c' }, cmdline_replace = { + mode_idx = 6, blinkoff = 250, blinkon = 400, blinkwait = 700, @@ -53,6 +57,7 @@ describe('ui/cursor', function() mouse_shape = 0, short_name = 'cr' }, insert = { + mode_idx = 2, blinkoff = 250, blinkon = 400, blinkwait = 700, @@ -63,12 +68,15 @@ describe('ui/cursor', function() mouse_shape = 0, short_name = 'i' }, more = { + mode_idx = 14, mouse_shape = 0, short_name = 'm' }, more_lastline = { + mode_idx = 15, mouse_shape = 0, short_name = 'ml' }, normal = { + mode_idx = 0, blinkoff = 250, blinkon = 400, blinkwait = 700, @@ -79,6 +87,7 @@ describe('ui/cursor', function() mouse_shape = 0, short_name = 'n' }, operator = { + mode_idx = 7, blinkoff = 250, blinkon = 400, blinkwait = 700, @@ -89,6 +98,7 @@ describe('ui/cursor', function() mouse_shape = 0, short_name = 'o' }, replace = { + mode_idx = 3, blinkoff = 250, blinkon = 400, blinkwait = 700, @@ -99,6 +109,7 @@ describe('ui/cursor', function() mouse_shape = 0, short_name = 'r' }, showmatch = { + mode_idx = 16, blinkoff = 150, blinkon = 175, blinkwait = 175, @@ -108,12 +119,15 @@ describe('ui/cursor', function() id_lm = 46, short_name = 'sm' }, statusline_drag = { + mode_idx = 11, mouse_shape = 0, short_name = 'sd' }, statusline_hover = { + mode_idx = 10, mouse_shape = 0, short_name = 's' }, visual = { + mode_idx = 1, blinkoff = 250, blinkon = 400, blinkwait = 700, @@ -124,6 +138,7 @@ describe('ui/cursor', function() mouse_shape = 0, short_name = 'v' }, visual_select = { + mode_idx = 8, blinkoff = 250, blinkon = 400, blinkwait = 700, @@ -134,9 +149,11 @@ describe('ui/cursor', function() mouse_shape = 0, short_name = 've' }, vsep_drag = { + mode_idx = 13, mouse_shape = 0, short_name = 'vd' }, vsep_hover = { + mode_idx = 12, mouse_shape = 0, short_name = 'vs' } } diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua new file mode 100644 index 0000000000..f0cedfeeb5 --- /dev/null +++ b/test/functional/ui/mode_spec.lua @@ -0,0 +1,227 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') + +local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert +local command, eval = helpers.command, helpers.eval +local eq = helpers.eq + +describe('ui mode_change event', function() + local screen + + before_each(function() + clear() + screen = Screen.new(25, 4) + screen:attach({rgb= true}) + screen:set_default_attr_ids( { + [0] = {bold=true, foreground=255}, + [1] = {bold=true, reverse=true}, + [2] = {bold=true}, + [3] = {reverse=true}, + }) + end) + + it('works in normal mode', function() + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + | + ]],nil,nil,function () + eq("normal", screen.mode) + end) + + feed('d') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + | + ]],nil,nil,function () + eq("operator", screen.mode) + end) + + feed('') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + | + ]],nil,nil,function () + eq("normal", screen.mode) + end) + end) + + it('works in insert mode', function() + feed('i') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + {2:-- INSERT --} | + ]],nil,nil,function () + eq("insert", screen.mode) + end) + + feed('word') + screen:expect([[ + wor^d | + {0:~ }| + {0:~ }| + | + ]], nil, nil, function () + eq("normal", screen.mode) + end) + + command("set showmatch") + eq(eval('&matchtime'), 5) -- tenths of seconds + feed('a(stuff') + screen:expect([[ + word(stuff^ | + {0:~ }| + {0:~ }| + {2:-- INSERT --} | + ]], nil, nil, function () + eq("insert", screen.mode) + end) + + feed(')') + screen:expect([[ + word^(stuff) | + {0:~ }| + {0:~ }| + {2:-- INSERT --} | + ]], nil, nil, function () + eq("showmatch", screen.mode) + end) + + screen:sleep(400) + screen:expect([[ + word(stuff)^ | + {0:~ }| + {0:~ }| + {2:-- INSERT --} | + ]], nil, nil, function () + eq("insert", screen.mode) + end) + end) + + it('works in replace mode', function() + feed('R') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + {2:-- REPLACE --} | + ]], nil, nil, function () + eq("replace", screen.mode) + end) + + feed('word') + screen:expect([[ + wor^d | + {0:~ }| + {0:~ }| + | + ]], nil, nil, function () + eq("normal", screen.mode) + end) + end) + + it('works in cmdline mode', function() + feed(':') + screen:expect([[ + | + {0:~ }| + {0:~ }| + :^ | + ]],nil,nil,function () + eq("cmdline_normal", screen.mode) + end) + + feed('x') + screen:expect([[ + | + {0:~ }| + {0:~ }| + :^x | + ]],nil,nil,function () + eq("cmdline_insert", screen.mode) + end) + + feed('') + screen:expect([[ + | + {0:~ }| + {0:~ }| + :^x | + ]],nil,nil,function () + eq("cmdline_replace", screen.mode) + end) + + + feed('') + screen:expect([[ + | + {0:~ }| + {0:~ }| + :x^ | + ]],nil,nil,function () + eq("cmdline_normal", screen.mode) + end) + + feed('') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + | + ]],nil,nil,function () + eq("normal", screen.mode) + end) + end) + + it('works in visal mode', function() + insert("text") + feed('v') + screen:expect([[ + tex^t | + {0:~ }| + {0:~ }| + {2:-- VISUAL --} | + ]],nil,nil,function () + eq("visual", screen.mode) + end) + + feed('') + screen:expect([[ + tex^t | + {0:~ }| + {0:~ }| + | + ]],nil,nil,function () + eq("normal", screen.mode) + end) + + command('set selection=exclusive') + feed('v') + screen:expect([[ + tex^t | + {0:~ }| + {0:~ }| + {2:-- VISUAL --} | + ]],nil,nil,function () + eq("visual_select", screen.mode) + end) + + feed('') + screen:expect([[ + tex^t | + {0:~ }| + {0:~ }| + | + ]],nil,nil,function () + eq("normal", screen.mode) + end) + end) +end) + diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index afbcd222c7..ceb82db98f 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -384,9 +384,8 @@ function Screen:_handle_mouse_off() self._mouse_enabled = false end -function Screen:_handle_mode_change(mode) - assert(mode == 'insert' or mode == 'replace' - or mode == 'normal' or mode == 'cmdline') +function Screen:_handle_mode_change(mode, idx) + assert(idx == self._cursor_style[mode].mode_idx) self.mode = mode end diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 8182190b5f..d9cb3d7b6f 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -566,119 +566,6 @@ describe('Screen', function() end) end) - describe('mode change', function() - before_each(function() - screen:try_resize(25, 5) - end) - - it('works in normal mode', function() - screen:expect([[ - ^ | - {0:~ }| - {0:~ }| - {0:~ }| - | - ]],nil,nil,function () - eq("normal", screen.mode) - end) - end) - - it('works in insert mode', function() - feed('i') - screen:expect([[ - ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {2:-- INSERT --} | - ]],nil,nil,function () - eq("insert", screen.mode) - end) - - feed('word') - screen:expect([[ - wor^d | - {0:~ }| - {0:~ }| - {0:~ }| - | - ]], nil, nil, function () - eq("normal", screen.mode) - end) - end) - - it('works in replace mode', function() - feed('R') - screen:expect([[ - ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {2:-- REPLACE --} | - ]], nil, nil, function () - eq("replace", screen.mode) - end) - - feed('word') - screen:expect([[ - wor^d | - {0:~ }| - {0:~ }| - {0:~ }| - | - ]], nil, nil, function () - eq("normal", screen.mode) - end) - end) - - it('works in cmdline mode', function() - feed(':') - screen:expect([[ - | - {0:~ }| - {0:~ }| - {0:~ }| - :^ | - ]],nil,nil,function () - eq("cmdline", screen.mode) - end) - - feed('/') - screen:expect([[ - | - {0:~ }| - {0:~ }| - {0:~ }| - /^ | - ]],nil,nil,function () - eq("cmdline", screen.mode) - end) - - - feed('?') - screen:expect([[ - | - {0:~ }| - {0:~ }| - {0:~ }| - ?^ | - ]],nil,nil,function () - eq("cmdline", screen.mode) - end) - - feed('') - screen:expect([[ - ^ | - {0:~ }| - {0:~ }| - {0:~ }| - | - ]],nil,nil,function () - eq("normal", screen.mode) - end) - end) - end) - it('nvim_ui_attach() handles very large width/height #2180', function() screen:detach() screen = Screen.new(999, 999) From 7ea5c78687168c07bfc4582c84145e86a5252f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Tue, 18 Apr 2017 13:42:04 +0200 Subject: [PATCH 134/257] ui: use an array for mode styles --- src/nvim/api/ui.c | 10 +- src/nvim/cursor_shape.c | 14 +- src/nvim/tui/tui.c | 25 ++-- src/nvim/ui.c | 10 +- src/nvim/ui.ch | 0 src/nvim/ui.h | 2 +- src/nvim/ui_bridge.c | 20 +-- test/functional/ui/cursor_spec.lua | 224 +++++++++++++++-------------- test/functional/ui/screen.lua | 8 +- 9 files changed, 156 insertions(+), 157 deletions(-) create mode 100644 src/nvim/ui.ch diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 0053050717..3e7e2718bb 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -70,7 +70,7 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, ui->clear = remote_ui_clear; ui->eol_clear = remote_ui_eol_clear; ui->cursor_goto = remote_ui_cursor_goto; - ui->cursor_style_set = remote_ui_cursor_style_set; + ui->mode_info_set = remote_ui_mode_info_set; ui->update_menu = remote_ui_update_menu; ui->busy_start = remote_ui_busy_start; ui->busy_stop = remote_ui_busy_stop; @@ -295,12 +295,12 @@ static void remote_ui_scroll(UI *ui, int count) push_call(ui, "scroll", args); } -static void remote_ui_cursor_style_set(UI *ui, bool enabled, Dictionary data) +static void remote_ui_mode_info_set(UI *ui, bool guicursor_enabled, Array data) { Array args = ARRAY_DICT_INIT; - ADD(args, BOOLEAN_OBJ(enabled)); - ADD(args, copy_object(DICTIONARY_OBJ(data))); - push_call(ui, "cursor_style_set", args); + ADD(args, BOOLEAN_OBJ(guicursor_enabled)); + ADD(args, copy_object(ARRAY_OBJ(data))); + push_call(ui, "mode_info_set", args); } static void remote_ui_highlight_set(UI *ui, HlAttrs attrs) diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index 57dc241c54..3099a5189b 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -34,11 +34,11 @@ cursorentry_T shape_table[SHAPE_IDX_COUNT] = { "showmatch", 0, 0, 0, 100L, 100L, 100L, 0, 0, "sm", SHAPE_CURSOR }, }; -/// Converts cursor_shapes into a Dictionary of dictionaries -/// @return dictionary of the form {"normal" : { "cursor_shape": ... }, ...} -Dictionary cursor_shape_dict(void) +/// Converts cursor_shapes into an Array of Dictionaries +/// @return Array of the form {[ "cursor_shape": ... ], ...} +Array mode_style_array(void) { - Dictionary all = ARRAY_DICT_INIT; + Array all = ARRAY_DICT_INIT; for (int i = 0; i < SHAPE_IDX_COUNT; i++) { Dictionary dic = ARRAY_DICT_INIT; @@ -62,10 +62,10 @@ Dictionary cursor_shape_dict(void) PUT(dic, "hl_id", INTEGER_OBJ(cur->id)); PUT(dic, "id_lm", INTEGER_OBJ(cur->id_lm)); } + PUT(dic, "name", STRING_OBJ(cstr_to_string(cur->full_name))); PUT(dic, "short_name", STRING_OBJ(cstr_to_string(cur->name))); - PUT(dic, "mode_idx", INTEGER_OBJ(i)); - PUT(all, cur->full_name, DICTIONARY_OBJ(dic)); + ADD(all, DICTIONARY_OBJ(dic)); } return all; @@ -241,7 +241,7 @@ char_u *parse_shape_opt(int what) shape_table[SHAPE_IDX_VE].id_lm = shape_table[SHAPE_IDX_V].id_lm; } } - ui_cursor_style_set(); + ui_mode_info_set(); return NULL; } diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 3498e8f4e7..172160fddb 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -101,7 +101,7 @@ UI *tui_start(void) ui->clear = tui_clear; ui->eol_clear = tui_eol_clear; ui->cursor_goto = tui_cursor_goto; - ui->cursor_style_set = tui_cursor_style_set; + ui->mode_info_set = tui_mode_info_set; ui->update_menu = tui_update_menu; ui->busy_start = tui_busy_start; ui->busy_stop = tui_busy_stop; @@ -451,7 +451,7 @@ CursorShape tui_cursor_decode_shape(const char *shape_str) return shape; } -static cursorentry_T decode_cursor_entry(Dictionary args, int *mode_idx) +static cursorentry_T decode_cursor_entry(Dictionary args) { cursorentry_T r; @@ -467,31 +467,26 @@ static cursorentry_T decode_cursor_entry(Dictionary args, int *mode_idx) r.blinkoff = (int)value.data.integer; } else if (strequal(key, "hl_id")) { r.id = (int)value.data.integer; - } else if (strequal(key, "mode_idx")) { - *mode_idx = (int)value.data.integer; } } return r; } -static void tui_cursor_style_set(UI *ui, bool enabled, Dictionary args) +static void tui_mode_info_set(UI *ui, bool guicursor_enabled, Array args) { - cursor_style_enabled = enabled; - if (!enabled) { + cursor_style_enabled = guicursor_enabled; + if (!guicursor_enabled) { return; // Do not send cursor style control codes. } TUIData *data = ui->data; assert(args.size); - // Keys: as defined by `shape_table`. + + // cursor style entries as defined by `shape_table`. for (size_t i = 0; i < args.size; i++) { - char *mode_name = args.items[i].key.data; - int mode_idx; - cursorentry_T r = decode_cursor_entry(args.items[i].value.data.dictionary, - &mode_idx); - assert(mode_idx >= 0); - r.full_name = mode_name; - data->cursor_shapes[mode_idx] = r; + assert(args.items[i].type == kObjectTypeDictionary); + cursorentry_T r = decode_cursor_entry(args.items[i].data.dictionary); + data->cursor_shapes[i] = r; } tui_set_mode(ui, data->showing_mode); diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 8c5e579301..5fb57dd257 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -175,7 +175,7 @@ void ui_refresh(void) row = col = 0; screen_resize(width, height); pum_set_external(pum_external); - ui_cursor_style_set(); + ui_mode_info_set(); old_mode_idx = -1; ui_cursor_shape(); } @@ -375,12 +375,12 @@ void ui_cursor_goto(int new_row, int new_col) pending_cursor_update = true; } -void ui_cursor_style_set(void) +void ui_mode_info_set(void) { - Dictionary style = cursor_shape_dict(); + Array style = mode_style_array(); bool enabled = (*p_guicursor != NUL); - UI_CALL(cursor_style_set, enabled, style); - api_free_dictionary(style); + UI_CALL(mode_info_set, enabled, style); + api_free_array(style); } void ui_update_menu(void) diff --git a/src/nvim/ui.ch b/src/nvim/ui.ch new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/nvim/ui.h b/src/nvim/ui.h index d63ceb106c..f5cbf748ee 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -22,7 +22,7 @@ struct ui_t { void (*clear)(UI *ui); void (*eol_clear)(UI *ui); void (*cursor_goto)(UI *ui, int row, int col); - void (*cursor_style_set)(UI *ui, bool enabled, Dictionary cursor_styles); + void (*mode_info_set)(UI *ui, bool enabled, Array cursor_styles); void (*update_menu)(UI *ui); void (*busy_start)(UI *ui); void (*busy_stop)(UI *ui); diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c index 59942fb2cb..e899cbf397 100644 --- a/src/nvim/ui_bridge.c +++ b/src/nvim/ui_bridge.c @@ -60,7 +60,7 @@ UI *ui_bridge_attach(UI *ui, ui_main_fn ui_main, event_scheduler scheduler) rv->bridge.clear = ui_bridge_clear; rv->bridge.eol_clear = ui_bridge_eol_clear; rv->bridge.cursor_goto = ui_bridge_cursor_goto; - rv->bridge.cursor_style_set = ui_bridge_cursor_style_set; + rv->bridge.mode_info_set = ui_bridge_mode_info_set; rv->bridge.update_menu = ui_bridge_update_menu; rv->bridge.busy_start = ui_bridge_busy_start; rv->bridge.busy_stop = ui_bridge_busy_stop; @@ -180,23 +180,23 @@ static void ui_bridge_cursor_goto_event(void **argv) ui->cursor_goto(ui, PTR2INT(argv[1]), PTR2INT(argv[2])); } -static void ui_bridge_cursor_style_set(UI *b, bool enabled, Dictionary styles) +static void ui_bridge_mode_info_set(UI *b, bool enabled, Array modes) { bool *enabledp = xmalloc(sizeof(*enabledp)); - Object *stylesp = xmalloc(sizeof(*stylesp)); + Object *modesp = xmalloc(sizeof(*modesp)); *enabledp = enabled; - *stylesp = copy_object(DICTIONARY_OBJ(styles)); - UI_CALL(b, cursor_style_set, 3, b, enabledp, stylesp); + *modesp = copy_object(ARRAY_OBJ(modes)); + UI_CALL(b, mode_info_set, 3, b, enabledp, modesp); } -static void ui_bridge_cursor_style_set_event(void **argv) +static void ui_bridge_mode_info_set_event(void **argv) { UI *ui = UI(argv[0]); bool *enabled = argv[1]; - Object *styles = argv[2]; - ui->cursor_style_set(ui, *enabled, styles->data.dictionary); + Object *modes = argv[2]; + ui->mode_info_set(ui, *enabled, modes->data.array); xfree(enabled); - api_free_object(*styles); - xfree(styles); + api_free_object(*modes); + xfree(modes); } static void ui_bridge_update_menu(UI *b) diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua index e4c1b17ef3..abe0e0b1fd 100644 --- a/test/functional/ui/cursor_spec.lua +++ b/test/functional/ui/cursor_spec.lua @@ -18,155 +18,155 @@ describe('ui/cursor', function() end) it("'guicursor' is published as a UI event", function() - local expected_cursor_style = { - cmdline_hover = { - mode_idx = 9, - mouse_shape = 0, - short_name = 'e' }, - cmdline_insert = { - mode_idx = 5, - blinkoff = 250, - blinkon = 400, - blinkwait = 700, - cell_percentage = 25, - cursor_shape = 'vertical', - hl_id = 46, - id_lm = 47, - mouse_shape = 0, - short_name = 'ci' }, - cmdline_normal = { - mode_idx = 4, + local expected_mode_info = { + [1] = { blinkoff = 250, blinkon = 400, blinkwait = 700, cell_percentage = 0, cursor_shape = 'block', + name = 'normal', hl_id = 46, id_lm = 47, mouse_shape = 0, - short_name = 'c' }, - cmdline_replace = { - mode_idx = 6, + short_name = 'n' }, + [2] = { + blinkoff = 250, + blinkon = 400, + blinkwait = 700, + cell_percentage = 0, + cursor_shape = 'block', + name = 'visual', + hl_id = 46, + id_lm = 47, + mouse_shape = 0, + short_name = 'v' }, + [3] = { + blinkoff = 250, + blinkon = 400, + blinkwait = 700, + cell_percentage = 25, + cursor_shape = 'vertical', + name = 'insert', + hl_id = 46, + id_lm = 47, + mouse_shape = 0, + short_name = 'i' }, + [4] = { blinkoff = 250, blinkon = 400, blinkwait = 700, cell_percentage = 20, cursor_shape = 'horizontal', + name = 'replace', hl_id = 46, id_lm = 47, mouse_shape = 0, - short_name = 'cr' }, - insert = { - mode_idx = 2, - blinkoff = 250, - blinkon = 400, - blinkwait = 700, - cell_percentage = 25, - cursor_shape = 'vertical', - hl_id = 46, - id_lm = 47, - mouse_shape = 0, - short_name = 'i' }, - more = { - mode_idx = 14, - mouse_shape = 0, - short_name = 'm' }, - more_lastline = { - mode_idx = 15, - mouse_shape = 0, - short_name = 'ml' }, - normal = { - mode_idx = 0, + short_name = 'r' }, + [5] = { blinkoff = 250, blinkon = 400, blinkwait = 700, cell_percentage = 0, cursor_shape = 'block', + name = 'cmdline_normal', hl_id = 46, id_lm = 47, mouse_shape = 0, - short_name = 'n' }, - operator = { - mode_idx = 7, + short_name = 'c' }, + [6] = { + blinkoff = 250, + blinkon = 400, + blinkwait = 700, + cell_percentage = 25, + cursor_shape = 'vertical', + name = 'cmdline_insert', + hl_id = 46, + id_lm = 47, + mouse_shape = 0, + short_name = 'ci' }, + [7] = { + blinkoff = 250, + blinkon = 400, + blinkwait = 700, + cell_percentage = 20, + cursor_shape = 'horizontal', + name = 'cmdline_replace', + hl_id = 46, + id_lm = 47, + mouse_shape = 0, + short_name = 'cr' }, + [8] = { blinkoff = 250, blinkon = 400, blinkwait = 700, cell_percentage = 50, cursor_shape = 'horizontal', + name = 'operator', hl_id = 46, id_lm = 46, mouse_shape = 0, short_name = 'o' }, - replace = { - mode_idx = 3, - blinkoff = 250, - blinkon = 400, - blinkwait = 700, - cell_percentage = 20, - cursor_shape = 'horizontal', - hl_id = 46, - id_lm = 47, - mouse_shape = 0, - short_name = 'r' }, - showmatch = { - mode_idx = 16, - blinkoff = 150, - blinkon = 175, - blinkwait = 175, - cell_percentage = 0, - cursor_shape = 'block', - hl_id = 46, - id_lm = 46, - short_name = 'sm' }, - statusline_drag = { - mode_idx = 11, - mouse_shape = 0, - short_name = 'sd' }, - statusline_hover = { - mode_idx = 10, - mouse_shape = 0, - short_name = 's' }, - visual = { - mode_idx = 1, - blinkoff = 250, - blinkon = 400, - blinkwait = 700, - cell_percentage = 0, - cursor_shape = 'block', - hl_id = 46, - id_lm = 47, - mouse_shape = 0, - short_name = 'v' }, - visual_select = { - mode_idx = 8, + [9] = { blinkoff = 250, blinkon = 400, blinkwait = 700, cell_percentage = 35, cursor_shape = 'vertical', + name = 'visual_select', hl_id = 46, id_lm = 46, mouse_shape = 0, short_name = 've' }, - vsep_drag = { - mode_idx = 13, + [10] = { + name = 'cmdline_hover', + mouse_shape = 0, + short_name = 'e' }, + [11] = { + name = 'statusline_hover', + mouse_shape = 0, + short_name = 's' }, + [12] = { + name = 'statusline_drag', + mouse_shape = 0, + short_name = 'sd' }, + [13] = { + name = 'vsep_hover', + mouse_shape = 0, + short_name = 'vs' }, + [14] = { + name = 'vsep_drag', mouse_shape = 0, short_name = 'vd' }, - vsep_hover = { - mode_idx = 12, + [15] = { + name = 'more', mouse_shape = 0, - short_name = 'vs' } - } + short_name = 'm' }, + [16] = { + name = 'more_lastline', + mouse_shape = 0, + short_name = 'ml' }, + [17] = { + blinkoff = 150, + blinkon = 175, + blinkwait = 175, + cell_percentage = 0, + cursor_shape = 'block', + name = 'showmatch', + hl_id = 46, + id_lm = 46, + short_name = 'sm' }, + } screen:expect(function() -- Default 'guicursor' published on startup. - eq(expected_cursor_style, screen._cursor_style) + eq(expected_mode_info, screen._mode_info) eq(true, screen._cursor_style_enabled) eq('normal', screen.mode) end) -- Event is published ONLY if the cursor style changed. - screen._cursor_style = nil + screen._mode_info = nil command("echo 'test'") screen:expect([[ ^ | @@ -175,20 +175,24 @@ describe('ui/cursor', function() ~ | test | ]], nil, nil, function() - eq(nil, screen._cursor_style) + eq(nil, screen._mode_info) end) -- Change the cursor style. meths.set_option('guicursor', 'n-v-c:ver35-blinkwait171-blinkoff172-blinkon173,ve:hor35,o:ver50,i-ci:block,r-cr:hor90,sm:ver42') screen:expect(function() - eq('vertical', screen._cursor_style.normal.cursor_shape) - eq('horizontal', screen._cursor_style.visual_select.cursor_shape) - eq('vertical', screen._cursor_style.operator.cursor_shape) - eq('block', screen._cursor_style.insert.cursor_shape) - eq('vertical', screen._cursor_style.showmatch.cursor_shape) - eq(171, screen._cursor_style.normal.blinkwait) - eq(172, screen._cursor_style.normal.blinkoff) - eq(173, screen._cursor_style.normal.blinkon) + local named = {} + for _, m in ipairs(screen._mode_info) do + named[m.name] = m + end + eq('vertical', named.normal.cursor_shape) + eq('horizontal', named.visual_select.cursor_shape) + eq('vertical', named.operator.cursor_shape) + eq('block', named.insert.cursor_shape) + eq('vertical', named.showmatch.cursor_shape) + eq(171, named.normal.blinkwait) + eq(172, named.normal.blinkoff) + eq(173, named.normal.blinkon) end) end) @@ -197,11 +201,11 @@ describe('ui/cursor', function() screen:expect(function() -- Empty 'guicursor' sets enabled=false. eq(false, screen._cursor_style_enabled) - for _, m in ipairs({ 'cmdline_insert', 'cmdline_normal', 'cmdline_replace', 'insert', - 'showmatch', 'normal', 'replace', 'visual', - 'visual_select', }) do - eq('block', screen._cursor_style[m].cursor_shape) - eq(0, screen._cursor_style[m].blinkon) + for _, m in ipairs(screen._mode_info) do + if m['cursor_shape'] ~= nil then + eq('block', m.cursor_shape) + eq(0, m.blinkon) + end end end) end) diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index ceb82db98f..bcf2a2e3d6 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -348,9 +348,9 @@ function Screen:_handle_resize(width, height) } end -function Screen:_handle_cursor_style_set(enabled, style) - self._cursor_style_enabled = enabled - self._cursor_style = style +function Screen:_handle_mode_info_set(cursor_style_enabled, mode_info) + self._cursor_style_enabled = cursor_style_enabled + self._mode_info = mode_info end function Screen:_handle_clear() @@ -385,7 +385,7 @@ function Screen:_handle_mouse_off() end function Screen:_handle_mode_change(mode, idx) - assert(idx == self._cursor_style[mode].mode_idx) + assert(mode == self._mode_info[idx+1].name) self.mode = mode end From 9cc97896813fa4f40a4e37b6f72284cdb10c4195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Mon, 17 Apr 2017 16:29:15 +0200 Subject: [PATCH 135/257] ui: document new mode index and add note about forward-compatibility --- runtime/doc/msgpack_rpc.txt | 41 +++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 3f3c41f566..d05e88d483 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -270,10 +270,14 @@ a dictionary with these (optional) keys: Defaults to false. Nvim will then send msgpack-rpc notifications, with the method name "redraw" -and a single argument, an array of screen updates (described below). -These should be processed in order. Preferably the user should only be able to -see the screen state after all updates are processed (not any intermediate -state after processing only a part of the array). +and a single argument, an array of screen updates (described below). These +should be processed in order. Preferably the user should only be able to see +the screen state after all updates in the same "redraw" event are processed +(not any intermediate state after processing only a part of the array). + +Future versions of Nvim may add new update kinds and may append new parameters +to existing update kinds. Clients must be prepared to ignore such extensions +to be forward-compatible. |api-contract| Screen updates are arrays. The first element a string describing the kind of update. @@ -387,10 +391,31 @@ of update. ["update_menu"] The menu mappings changed. -["mode_change", mode] - The mode changed. Currently sent when "insert", "replace", "cmdline" and - "normal" modes are entered. A client could for instance change the cursor - shape. +["mode_info_set", cursor_style_enabled, mode_info] +`mode_info` is an array containing information about various modes, as later +will be indicated with the `mode_change` update. Currently this primarily +concerns cursor styles to be set in the different modes. The keys are + + `cursor_shape`: One of "block", "horizontal" or "vertical" + `cell_percentage`:Percentage of the cell taken by the cursor. + `blinkwait`, `blinkon`, `blinkoff`: see |cursor-blinking|. + `hl_id`: Highlight group for the cursor. + `hl_lm`: Highlight group for the cursor when langmap is active. + `short_name`: Short name for the mode, as used in 'guicursor' + option. + `name`: Full name for the mode. + `mouse_shape`: (To be implemented.) + +Not all keys need to be present for all modes. `cursor_style_enabled` is a +boolean indicating if the ui should change the cursor style. + +["mode_change", mode, mode_idx] +The mode changed. The first parameter `mode` is a string representing the +current mode. `mode_idx` is an index into the array received in the +`mode_info_set` event. UIs should change the cursor style according to the +properties specified in the corresponding item. The set of modes reported will +change in new versions of Nvim, for instance more submodes and temporary +states might be represented as separate modes. ["popupmenu_show", items, selected, row, col] When `popupmenu_external` is set to true, nvim will not draw the From 48f0542ad6f923443ab4bba858aae2d9558f8d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Linse?= Date: Fri, 21 Apr 2017 10:59:06 +0200 Subject: [PATCH 136/257] tests: detect invalid helpers.sleep --- test/functional/ex_cmds/ctrl_c_spec.lua | 2 +- test/functional/helpers.lua | 11 ++++++++++- test/functional/terminal/ex_terminal_spec.lua | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/test/functional/ex_cmds/ctrl_c_spec.lua b/test/functional/ex_cmds/ctrl_c_spec.lua index 993bfa0dba..091a008814 100644 --- a/test/functional/ex_cmds/ctrl_c_spec.lua +++ b/test/functional/ex_cmds/ctrl_c_spec.lua @@ -41,7 +41,7 @@ describe("CTRL-C (mapped)", function() local function test_ctrl_c(ms) feed(":global/^/p") - helpers.sleep(ms) + screen:sleep(ms) feed("") screen:expect([[Interrupt]], nil, nil, nil, true) end diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 5882758b5a..84e81c5af4 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -392,7 +392,16 @@ end -- sleeps the test runner (_not_ the nvim instance) local function sleep(ms) - run(nil, nil, nil, ms) + local function notification_cb(method, args) + local _ = args + if method == "redraw" then + error("helpers.sleep() called while screen is attached. ".. + "Use screen:sleep(...) instead") + end + return true + end + + run(nil, notification_cb, nil, ms) end local function curbuf_contents() diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua index 1ed63adcfb..be0fd9f8ff 100644 --- a/test/functional/terminal/ex_terminal_spec.lua +++ b/test/functional/terminal/ex_terminal_spec.lua @@ -26,7 +26,7 @@ describe(':terminal', function() feed_command([[terminal while true; do echo X; done]]) helpers.feed([[]]) wait() - screen.sleep(10) -- Let some terminal activity happen. + screen:sleep(10) -- Let some terminal activity happen. feed_command("messages") screen:expect([[ msg1 | From a396874da0efaeb7def5e26afab9ae1c980510a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Othon=20Brigan=C3=B3?= Date: Fri, 21 Apr 2017 10:21:02 -0300 Subject: [PATCH 137/257] refactor/single-include: getchar.h (#6560) --- src/nvim/CMakeLists.txt | 1 - src/nvim/getchar.h | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index a91657f1bd..e4b3b4de13 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -429,7 +429,6 @@ function(get_test_target prefix sfile relative_path_var target_var) endfunction() set(NO_SINGLE_CHECK_HEADERS - getchar.h if_cscope_defs.h misc2.h msgpack_rpc/server.h diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h index bdf65909b6..28584e0534 100644 --- a/src/nvim/getchar.h +++ b/src/nvim/getchar.h @@ -1,6 +1,10 @@ #ifndef NVIM_GETCHAR_H #define NVIM_GETCHAR_H +#include "nvim/types.h" +#include "nvim/buffer_defs.h" +#include "nvim/ex_cmds_defs.h" + /* Values for "noremap" argument of ins_typebuf(). Also used for * map->m_noremap and menu->noremap[]. */ #define REMAP_YES 0 /* allow remapping */ @@ -12,6 +16,7 @@ #define KEYLEN_PART_MAP -2 /* keylen value for incomplete mapping */ #define KEYLEN_REMOVED 9999 /* keylen value for removed sequence */ + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "getchar.h.generated.h" #endif From f50e03f2e35cf4bee8cedb2c95bf9619f3b57bc2 Mon Sep 17 00:00:00 2001 From: sander2 Date: Fri, 21 Apr 2017 15:45:51 +0200 Subject: [PATCH 138/257] ex_cmds.c: Fix bug in ex_z (#6557) vim-patch:8.0.0571 --- src/nvim/ex_cmds.c | 12 +++++++++--- test/functional/ex_cmds/print_commands_spec.lua | 12 ++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 test/functional/ex_cmds/print_commands_spec.lua diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 117ef6a507..7726e0fc6d 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2877,8 +2877,11 @@ void ex_z(exarg_T *eap) if (end > curbuf->b_ml.ml_line_count) end = curbuf->b_ml.ml_line_count; - if (curs > curbuf->b_ml.ml_line_count) + if (curs > curbuf->b_ml.ml_line_count) { curs = curbuf->b_ml.ml_line_count; + } else if (curs < 1) { + curs = 1; + } for (i = start; i <= end; i++) { if (minus && i == lnum) { @@ -2898,8 +2901,11 @@ void ex_z(exarg_T *eap) } } - curwin->w_cursor.lnum = curs; - ex_no_reprint = TRUE; + if (curwin->w_cursor.lnum != curs) { + curwin->w_cursor.lnum = curs; + curwin->w_cursor.col = 0; + } + ex_no_reprint = true; } /* diff --git a/test/functional/ex_cmds/print_commands_spec.lua b/test/functional/ex_cmds/print_commands_spec.lua new file mode 100644 index 0000000000..98c0f74635 --- /dev/null +++ b/test/functional/ex_cmds/print_commands_spec.lua @@ -0,0 +1,12 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear, eq, command, funcs = + helpers.clear, helpers.eq, helpers.command, helpers.funcs + +describe(':z^', function() + before_each(clear) + + it('correctly sets the cursor after :z^', function() + command('z^') + eq(1, funcs.line('.')) + end) +end) From 654c50b227b7616300763da75ad4a79151883694 Mon Sep 17 00:00:00 2001 From: relnod Date: Sat, 22 Apr 2017 15:43:35 +0200 Subject: [PATCH 139/257] refactor/single-include: window.h, version.h (#6570) --- src/nvim/CMakeLists.txt | 2 -- src/nvim/version.h | 2 ++ src/nvim/window.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index e4b3b4de13..04fe56952f 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -456,8 +456,6 @@ set(NO_SINGLE_CHECK_HEADERS ui_bridge.h undo.h undo_defs.h - version.h - window.h ) foreach(hfile ${NVIM_HEADERS}) get_test_target(test-includes "${hfile}" relative_path texe) diff --git a/src/nvim/version.h b/src/nvim/version.h index 1de809e539..a0babfb156 100644 --- a/src/nvim/version.h +++ b/src/nvim/version.h @@ -1,6 +1,8 @@ #ifndef NVIM_VERSION_H #define NVIM_VERSION_H +#include "nvim/ex_cmds_defs.h" + // defined in version.c extern char* Version; extern char* longVersion; diff --git a/src/nvim/window.h b/src/nvim/window.h index 2ac4c00c28..82b3fe5e88 100644 --- a/src/nvim/window.h +++ b/src/nvim/window.h @@ -3,6 +3,8 @@ #include +#include "nvim/buffer_defs.h" + /* Values for file_name_in_line() */ #define FNAME_MESS 1 /* give error message */ #define FNAME_EXP 2 /* expand to path */ From e41c044b530d2cc3f548fcef07862640eb249c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Othon=20Brigan=C3=B3?= Date: Sat, 22 Apr 2017 10:44:58 -0300 Subject: [PATCH 140/257] refactor/single-include (#6563) --- src/nvim/CMakeLists.txt | 3 --- src/nvim/screen.h | 4 ++++ src/nvim/search.h | 6 ++++++ src/nvim/syntax.h | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 04fe56952f..597864845e 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -440,13 +440,10 @@ set(NO_SINGLE_CHECK_HEADERS quickfix.h regexp.h regexp_defs.h - screen.h - search.h sha256.h sign_defs.h spell.h spellfile.h - syntax.h syntax_defs.h tag.h terminal.h diff --git a/src/nvim/screen.h b/src/nvim/screen.h index 81a8b9ed4c..17515d4253 100644 --- a/src/nvim/screen.h +++ b/src/nvim/screen.h @@ -3,6 +3,10 @@ #include +#include "nvim/types.h" +#include "nvim/buffer_defs.h" +#include "nvim/pos.h" + /* * flags for update_screen() * The higher the value, the higher the priority diff --git a/src/nvim/search.h b/src/nvim/search.h index d4e40cb287..cb50742990 100644 --- a/src/nvim/search.h +++ b/src/nvim/search.h @@ -4,6 +4,12 @@ #include #include +#include "nvim/types.h" +#include "nvim/buffer_defs.h" +#include "nvim/eval/typval.h" +#include "nvim/normal.h" +#include "nvim/os/time.h" + /* Values for the find_pattern_in_path() function args 'type' and 'action': */ #define FIND_ANY 1 #define FIND_DEFINE 2 diff --git a/src/nvim/syntax.h b/src/nvim/syntax.h index 574e3372e2..bb733ead30 100644 --- a/src/nvim/syntax.h +++ b/src/nvim/syntax.h @@ -4,7 +4,7 @@ #include #include "nvim/buffer_defs.h" - +#include "nvim/ex_cmds_defs.h" /// Terminal highlighting attribute bits. /// Attributes above HL_ALL are used for syntax highlighting. From 1e83add288b4f9183d39387356fc7e8f294d5d4b Mon Sep 17 00:00:00 2001 From: relnod Date: Sat, 22 Apr 2017 16:55:28 +0200 Subject: [PATCH 141/257] refactor/single-include: ui.h, ui_bridge.h, ugrid.h (#6571) --- src/nvim/CMakeLists.txt | 3 --- src/nvim/ui.h | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 597864845e..db5e62fd67 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -448,9 +448,6 @@ set(NO_SINGLE_CHECK_HEADERS tag.h terminal.h tui/tui.h - ugrid.h - ui.h - ui_bridge.h undo.h undo_defs.h ) diff --git a/src/nvim/ui.h b/src/nvim/ui.h index f5cbf748ee..fcf52ac9e1 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -6,6 +6,7 @@ #include #include "api/private/defs.h" +#include "nvim/buffer_defs.h" typedef struct { bool bold, underline, undercurl, italic, reverse; From c703d0529b3c4f6485d6ce6f37033d4658356b05 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 22 Apr 2017 18:19:37 +0200 Subject: [PATCH 142/257] 'guicursor': iTerm: Set cursor color. iTerm uses proprietary escape codes to set cursor color. https://www.iterm2.com/documentation-escape-codes.html --- src/nvim/tui/tui.c | 53 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 6ea6376202..ae7551098d 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -43,6 +43,15 @@ #define OUTBUF_SIZE 0xffff #define TOO_MANY_EVENTS 1000000 +#define STARTS_WITH(str, prefix) (!memcmp(str, prefix, sizeof(prefix) - 1)) + +typedef enum TermType { + kTermUnknown, + kTermGnome, + kTermiTerm, + kTermKonsole, + kTermRxvt, +} TermType; typedef struct { int top, bot, left, right; @@ -77,6 +86,7 @@ typedef struct { cursorentry_T cursor_shapes[SHAPE_IDX_COUNT]; HlAttrs print_attrs; ModeShape showing_mode; + TermType term; struct { int enable_mouse, disable_mouse; int enable_bracketed_paste, disable_bracketed_paste; @@ -528,7 +538,6 @@ static void tui_mouse_off(UI *ui) } } -/// @param mode one of SHAPE_XXX static void tui_set_mode(UI *ui, ModeShape mode) { if (!cursor_style_enabled) { @@ -537,14 +546,14 @@ static void tui_set_mode(UI *ui, ModeShape mode) TUIData *data = ui->data; cursorentry_T c = data->cursor_shapes[mode]; int shape = c.shape; - bool inside_tmux = os_getenv("TMUX") != NULL; + bool is_tmux = os_getenv("TMUX") != NULL; unibi_var_t vars[26 + 26] = { { 0 } }; -# define TMUX_WRAP(seq) (inside_tmux ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) +# define TMUX_WRAP(seq) (is_tmux ? "\x1bPtmux;\x1b" seq "\x1b\\" : seq) // Support changing cursor shape on some popular terminals. const char *vte_version = os_getenv("VTE_VERSION"); - if (os_getenv("KONSOLE_PROFILE_NAME") || os_getenv("KONSOLE_DBUS_SESSION")) { + if (data->term == kTermKonsole) { // Konsole uses a proprietary escape code to set the cursor shape // and does not support DECSCUSR. switch (shape) { @@ -921,6 +930,24 @@ static void unibi_set_if_empty(unibi_term *ut, enum unibi_string str, } } +static TermType detect_term(const char *term, const char *colorterm) +{ + if (STARTS_WITH(term, "rxvt")) { + return kTermRxvt; + } + if (os_getenv("KONSOLE_PROFILE_NAME") || os_getenv("KONSOLE_DBUS_SESSION")) { + return kTermKonsole; + } + const char *termprg = os_getenv("TERM_PROGRAM"); + if (termprg && strstr(termprg, "iTerm.app")) { + return kTermiTerm; + } + if (colorterm && strstr(colorterm, "gnome-terminal")) { + return kTermGnome; + } + return kTermUnknown; +} + static void fix_terminfo(TUIData *data) { unibi_term *ut = data->ut; @@ -930,10 +957,9 @@ static void fix_terminfo(TUIData *data) if (!term) { goto end; } + data->term = detect_term(term, colorterm); -#define STARTS_WITH(str, prefix) (!memcmp(str, prefix, sizeof(prefix) - 1)) - - if (STARTS_WITH(term, "rxvt")) { + if (data->term == kTermRxvt) { unibi_set_if_empty(ut, unibi_exit_attribute_mode, "\x1b[m\x1b(B"); unibi_set_if_empty(ut, unibi_flash_screen, "\x1b[?5h$<20/>\x1b[?5l"); unibi_set_if_empty(ut, unibi_enter_italics_mode, "\x1b[3m"); @@ -945,7 +971,7 @@ static void fix_terminfo(TUIData *data) unibi_set_if_empty(ut, unibi_from_status_line, "\x1b\\"); } - if (STARTS_WITH(term, "xterm") || STARTS_WITH(term, "rxvt")) { + if (STARTS_WITH(term, "xterm") || data->term == kTermRxvt) { const char *normal = unibi_get_str(ut, unibi_cursor_normal); if (!normal) { unibi_set_str(ut, unibi_cursor_normal, "\x1b[?25h"); @@ -982,7 +1008,7 @@ static void fix_terminfo(TUIData *data) if ((colorterm && strstr(colorterm, "256")) || strstr(term, "256") || strstr(term, "xterm")) { - // Assume TERM~=xterm or COLORTERM~=256 supports 256 colors. + // Assume TERM=~xterm or COLORTERM=~256 supports 256 colors. unibi_set_num(ut, unibi_max_colors, 256); unibi_set_str(ut, unibi_set_a_foreground, XTERM_SETAF); unibi_set_str(ut, unibi_set_a_background, XTERM_SETAB); @@ -990,8 +1016,13 @@ static void fix_terminfo(TUIData *data) end: // Fill some empty slots with common terminal strings - data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str( - ut, NULL, "\033]12;#%p1%06x\007"); + if (data->term == kTermiTerm) { + data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str( + ut, NULL, "\033]Pl%p1%06x\033\\"); + } else { + data->unibi_ext.set_cursor_color = (int)unibi_add_ext_str( + ut, NULL, "\033]12;#%p1%06x\007"); + } data->unibi_ext.enable_mouse = (int)unibi_add_ext_str(ut, NULL, "\x1b[?1002h\x1b[?1006h"); data->unibi_ext.disable_mouse = (int)unibi_add_ext_str(ut, NULL, From 719095d7d33a05679f47f5adc1309b5432529385 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 22 Apr 2017 18:53:01 +0200 Subject: [PATCH 143/257] os_term_is_nice: Return true for rxvt and iTerm. --- src/nvim/os/env.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 72bd0bf788..8f7a6e72b5 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -915,9 +915,20 @@ bool os_term_is_nice(void) return true; #else const char *vte_version = os_getenv("VTE_VERSION"); - return (vte_version && atoi(vte_version) >= 3900) - || NULL != os_getenv("KONSOLE_PROFILE_NAME") - || NULL != os_getenv("KONSOLE_DBUS_SESSION"); + if ((vte_version && atoi(vte_version) >= 3900) + || os_getenv("KONSOLE_PROFILE_NAME") + || os_getenv("KONSOLE_DBUS_SESSION")) { + return true; + } + const char *termprg = os_getenv("TERM_PROGRAM"); + if (termprg && striequal(termprg, "iTerm.app")) { + return true; + } + const char *term = os_getenv("TERM"); + if (term && strncmp(term, "rxvt", 4) == 0) { + return true; + } + return false; #endif } From 1fe8945748620713402cab77a46501ec5311778b Mon Sep 17 00:00:00 2001 From: Patrick Jackson Date: Sat, 22 Apr 2017 17:32:56 -0700 Subject: [PATCH 144/257] refactor: Remove unused MAP_IMPL. (#6573) --- src/nvim/map.c | 1 - src/nvim/map.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/nvim/map.c b/src/nvim/map.c index 54a9e559af..366b286d14 100644 --- a/src/nvim/map.c +++ b/src/nvim/map.c @@ -142,7 +142,6 @@ static inline bool String_eq(String a, String b) MAP_IMPL(int, int, DEFAULT_INITIALIZER) -MAP_IMPL(cstr_t, uint64_t, DEFAULT_INITIALIZER) MAP_IMPL(cstr_t, ptr_t, DEFAULT_INITIALIZER) MAP_IMPL(ptr_t, ptr_t, DEFAULT_INITIALIZER) MAP_IMPL(uint64_t, ptr_t, DEFAULT_INITIALIZER) diff --git a/src/nvim/map.h b/src/nvim/map.h index ba3e84cb31..a4fccf47f9 100644 --- a/src/nvim/map.h +++ b/src/nvim/map.h @@ -25,7 +25,6 @@ void map_##T##_##U##_clear(Map(T, U) *map); MAP_DECLS(int, int) -MAP_DECLS(cstr_t, uint64_t) MAP_DECLS(cstr_t, ptr_t) MAP_DECLS(ptr_t, ptr_t) MAP_DECLS(uint64_t, ptr_t) From 45240538742d6276ab25abe0d8b02550e1c68179 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 21 Apr 2017 14:58:52 +0200 Subject: [PATCH 145/257] test: api: Do not truncate errors <1 MB. --- test/functional/api/vim_spec.lua | 9 ++++++++- test/functional/ui/screen.lua | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 8f9f155110..60f30dcfe6 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -412,7 +412,7 @@ describe('api', function() eq(5, meths.get_var('avar')) end) - it('throws error on malformated arguments', function() + it('throws error on malformed arguments', function() local req = { {'nvim_set_var', {'avar', 1}}, {'nvim_set_var'}, @@ -452,6 +452,13 @@ describe('api', function() ok(err:match('Invalid option name') ~= nil) end) + it('does not truncate error message <1 MB #5984', function() + local very_long_name = 'A'..('x'):rep(10000)..'Z' + local status, err = pcall(nvim, 'get_option', very_long_name) + eq(false, status) + eq(very_long_name, err:match('Ax+Z?')) + end) + it("doesn't leak memory on incorrect argument types", function() local status, err = pcall(nvim, 'set_current_dir',{'not', 'a', 'dir'}) eq(false, status) diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index bcf2a2e3d6..7d9cd6c026 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -312,12 +312,13 @@ function Screen:_redraw(updates) -- print(require('inspect')(update)) local method = update[1] for i = 2, #update do - local handler = self['_handle_'..method] + local handler_name = '_handle_'..method + local handler = self[handler_name] if handler ~= nil then handler(self, unpack(update[i])) else assert(self._on_event, - "Add Screen:_handle_XXX method or call Screen:set_on_event_handler") + "Add Screen:"..handler_name.." or call Screen:set_on_event_handler") self._on_event(method, update[i]) end end From 5c9860a0a2bf27d409c986673f0a74542561c4c3 Mon Sep 17 00:00:00 2001 From: Sander Bosma Date: Wed, 1 Mar 2017 10:43:47 +0100 Subject: [PATCH 146/257] api: Do not truncate errors <1 MB. #6237 Closes #5984 --- scripts/gendispatch.lua | 6 +- src/nvim/api/buffer.c | 44 +++++---- src/nvim/api/private/defs.h | 4 +- src/nvim/api/private/helpers.c | 113 +++++++++++++--------- src/nvim/api/private/helpers.h | 10 -- src/nvim/api/tabpage.c | 4 +- src/nvim/api/ui.c | 18 ++-- src/nvim/api/vim.c | 44 +++++---- src/nvim/api/window.c | 16 +-- src/nvim/eval.c | 5 +- src/nvim/msgpack_rpc/channel.c | 73 +++++++------- src/nvim/msgpack_rpc/helpers.c | 22 ++--- src/nvim/terminal.c | 10 +- src/nvim/tui/input.c | 2 +- test/functional/provider/python3_spec.lua | 10 ++ 15 files changed, 209 insertions(+), 172 deletions(-) diff --git a/scripts/gendispatch.lua b/scripts/gendispatch.lua index 45a4f4a4de..683962aa60 100644 --- a/scripts/gendispatch.lua +++ b/scripts/gendispatch.lua @@ -225,8 +225,7 @@ for i = 1, #functions do end output:write('\n') output:write('\n if (args.size != '..#fn.parameters..') {') - output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') - output:write('\n error->set = true;') + output:write('\n _api_set_error(error, error->type, "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') output:write('\n goto cleanup;') output:write('\n }\n') @@ -251,8 +250,7 @@ for i = 1, #functions do output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;') end output:write('\n } else {') - output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong type for argument '..j..', expecting '..param[1]..'");') - output:write('\n error->set = true;') + output:write('\n _api_set_error(error, error->type, "Wrong type for argument '..j..', expecting '..param[1]..'");') output:write('\n goto cleanup;') output:write('\n }\n') else diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 1b3592679b..2f306ebfc8 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -171,7 +171,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, end = normalize_index(buf, end, &oob); if (strict_indexing && oob) { - api_set_error(err, Validation, _("Index out of bounds")); + _api_set_error(err, kErrorTypeValidation, _("Index out of bounds")); return rv; } @@ -187,7 +187,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i; if (lnum > LONG_MAX) { - api_set_error(err, Validation, _("Line index is too high")); + _api_set_error(err, kErrorTypeValidation, _("Line index is too high")); goto end; } @@ -283,14 +283,14 @@ void nvim_buf_set_lines(uint64_t channel_id, end = normalize_index(buf, end, &oob); if (strict_indexing && oob) { - api_set_error(err, Validation, _("Index out of bounds")); + _api_set_error(err, kErrorTypeValidation, _("Index out of bounds")); return; } if (start > end) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("Argument \"start\" is higher than \"end\"")); return; } @@ -304,8 +304,8 @@ void nvim_buf_set_lines(uint64_t channel_id, for (size_t i = 0; i < new_len; i++) { if (replacement.items[i].type != kObjectTypeString) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("All items in the replacement array must be strings")); goto end; } @@ -317,7 +317,7 @@ void nvim_buf_set_lines(uint64_t channel_id, lines[i] = xmallocz(l.size); for (size_t j = 0; j < l.size; j++) { if (l.data[j] == '\n' && channel_id != INTERNAL_CALL) { - api_set_error(err, Exception, _("string cannot contain newlines")); + _api_set_error(err, kErrorTypeException, _("string cannot contain newlines")); new_len = i + 1; goto end; } @@ -330,7 +330,7 @@ void nvim_buf_set_lines(uint64_t channel_id, switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf); if (u_save((linenr_T)(start - 1), (linenr_T)end) == FAIL) { - api_set_error(err, Exception, _("Failed to save undo information")); + _api_set_error(err, kErrorTypeException, _("Failed to save undo information")); goto end; } @@ -340,7 +340,7 @@ void nvim_buf_set_lines(uint64_t channel_id, size_t to_delete = (new_len < old_len) ? (size_t)(old_len - new_len) : 0; for (size_t i = 0; i < to_delete; i++) { if (ml_delete((linenr_T)start, false) == FAIL) { - api_set_error(err, Exception, _("Failed to delete line")); + _api_set_error(err, kErrorTypeException, _("Failed to delete line")); goto end; } } @@ -357,12 +357,12 @@ void nvim_buf_set_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i; if (lnum > LONG_MAX) { - api_set_error(err, Validation, _("Index value is too high")); + _api_set_error(err, kErrorTypeValidation, _("Index value is too high")); goto end; } if (ml_replace((linenr_T)lnum, (char_u *)lines[i], false) == FAIL) { - api_set_error(err, Exception, _("Failed to replace line")); + _api_set_error(err, kErrorTypeException, _("Failed to replace line")); goto end; } // Mark lines that haven't been passed to the buffer as they need @@ -375,12 +375,12 @@ void nvim_buf_set_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i - 1; if (lnum > LONG_MAX) { - api_set_error(err, Validation, _("Index value is too high")); + _api_set_error(err, kErrorTypeValidation, _("Index value is too high")); goto end; } if (ml_append((linenr_T)lnum, (char_u *)lines[i], 0, false) == FAIL) { - api_set_error(err, Exception, _("Failed to insert line")); + _api_set_error(err, kErrorTypeException, _("Failed to insert line")); goto end; } @@ -627,7 +627,7 @@ void nvim_buf_set_name(Buffer buffer, String name, Error *err) } if (ren_ret == FAIL) { - api_set_error(err, Exception, _("Failed to rename buffer")); + _api_set_error(err, kErrorTypeException, _("Failed to rename buffer")); } } @@ -639,7 +639,9 @@ Boolean nvim_buf_is_valid(Buffer buffer) FUNC_API_SINCE(1) { Error stub = ERROR_INIT; - return find_buffer_by_handle(buffer, &stub) != NULL; + Boolean ret = find_buffer_by_handle(buffer, &stub) != NULL; + xfree(stub.msg); + return ret; } /// Inserts a sequence of lines to a buffer at a certain index @@ -678,7 +680,7 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) } if (name.size != 1) { - api_set_error(err, Validation, _("Mark name must be a single character")); + _api_set_error(err, kErrorTypeValidation, _("Mark name must be a single character")); return rv; } @@ -696,7 +698,7 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) } if (posp == NULL) { - api_set_error(err, Validation, _("Invalid mark name")); + _api_set_error(err, kErrorTypeValidation, _("Invalid mark name")); return rv; } @@ -751,11 +753,11 @@ Integer nvim_buf_add_highlight(Buffer buffer, } if (line < 0 || line >= MAXLNUM) { - api_set_error(err, Validation, _("Line number outside range")); + _api_set_error(err, kErrorTypeValidation, _("Line number outside range")); return 0; } if (col_start < 0 || col_start > MAXCOL) { - api_set_error(err, Validation, _("Column value outside range")); + _api_set_error(err, kErrorTypeValidation, _("Column value outside range")); return 0; } if (col_end < 0 || col_end > MAXCOL) { @@ -792,7 +794,7 @@ void nvim_buf_clear_highlight(Buffer buffer, } if (line_start < 0 || line_start >= MAXLNUM) { - api_set_error(err, Validation, _("Line number outside range")); + _api_set_error(err, kErrorTypeValidation, _("Line number outside range")); return; } if (line_end < 0 || line_end > MAXLNUM) { diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h index 223aab09dc..a07422bd12 100644 --- a/src/nvim/api/private/defs.h +++ b/src/nvim/api/private/defs.h @@ -8,7 +8,7 @@ #define ARRAY_DICT_INIT {.size = 0, .capacity = 0, .items = NULL} #define STRING_INIT {.data = NULL, .size = 0} #define OBJECT_INIT { .type = kObjectTypeNil } -#define ERROR_INIT { .set = false } +#define ERROR_INIT { .set = false, .msg = NULL } #define REMOTE_TYPE(type) typedef handle_T type #ifdef INCLUDE_GENERATED_DECLARATIONS @@ -38,7 +38,7 @@ typedef enum { typedef struct { ErrorType type; - char msg[1024]; + char *msg; bool set; } Error; diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 5877b848fc..e6632525e1 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -61,7 +61,7 @@ bool try_end(Error *err) discard_current_exception(); } - api_set_error(err, Exception, _("Keyboard interrupt")); + _api_set_error(err, kErrorTypeException, _("Keyboard interrupt")); got_int = false; } else if (msg_list != NULL && *msg_list != NULL) { int should_free; @@ -69,15 +69,14 @@ bool try_end(Error *err) ET_ERROR, NULL, &should_free); - xstrlcpy(err->msg, msg, sizeof(err->msg)); - err->set = true; + _api_set_error(err, err->type, "%s", msg); free_global_msglist(); if (should_free) { xfree(msg); } } else if (did_throw) { - api_set_error(err, Exception, "%s", current_exception->value); + _api_set_error(err, kErrorTypeException, "%s", current_exception->value); discard_current_exception(); } @@ -94,7 +93,7 @@ Object dict_get_value(dict_T *dict, String key, Error *err) dictitem_T *const di = tv_dict_find(dict, key.data, (ptrdiff_t)key.size); if (di == NULL) { - api_set_error(err, Validation, _("Key not found")); + _api_set_error(err, kErrorTypeValidation, _("Key not found")); return (Object) OBJECT_INIT; } @@ -118,17 +117,17 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, Object rv = OBJECT_INIT; if (dict->dv_lock) { - api_set_error(err, Exception, _("Dictionary is locked")); + _api_set_error(err, kErrorTypeException, _("Dictionary is locked")); return rv; } if (key.size == 0) { - api_set_error(err, Validation, _("Empty variable names aren't allowed")); + _api_set_error(err, kErrorTypeValidation, _("Empty variable names aren't allowed")); return rv; } if (key.size > INT_MAX) { - api_set_error(err, Validation, _("Key length is too high")); + _api_set_error(err, kErrorTypeValidation, _("Key length is too high")); return rv; } @@ -136,13 +135,13 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, if (di != NULL) { if (di->di_flags & DI_FLAGS_RO) { - api_set_error(err, Exception, _("Key is read-only: %s"), key.data); + _api_set_error(err, kErrorTypeException, _("Key is read-only: %s"), key.data); return rv; } else if (di->di_flags & DI_FLAGS_FIX) { - api_set_error(err, Exception, _("Key is fixed: %s"), key.data); + _api_set_error(err, kErrorTypeException, _("Key is fixed: %s"), key.data); return rv; } else if (di->di_flags & DI_FLAGS_LOCK) { - api_set_error(err, Exception, _("Key is locked: %s"), key.data); + _api_set_error(err, kErrorTypeException, _("Key is locked: %s"), key.data); return rv; } } @@ -151,7 +150,7 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, // Delete the key if (di == NULL) { // Doesn't exist, fail - api_set_error(err, Validation, _("Key \"%s\" doesn't exist"), key.data); + _api_set_error(err, kErrorTypeValidation, _("Key \"%s\" doesn't exist"), key.data); } else { // Return the old value if (retval) { @@ -203,7 +202,7 @@ Object get_option_from(void *from, int type, String name, Error *err) Object rv = OBJECT_INIT; if (name.size == 0) { - api_set_error(err, Validation, _("Empty option name")); + _api_set_error(err, kErrorTypeValidation, _("Empty option name")); return rv; } @@ -214,8 +213,8 @@ Object get_option_from(void *from, int type, String name, Error *err) type, from); if (!flags) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("Invalid option name \"%s\""), name.data); return rv; @@ -233,14 +232,14 @@ Object get_option_from(void *from, int type, String name, Error *err) rv.data.string.data = stringval; rv.data.string.size = strlen(stringval); } else { - api_set_error(err, - Exception, + _api_set_error(err, + kErrorTypeException, _("Unable to get value for option \"%s\""), name.data); } } else { - api_set_error(err, - Exception, + _api_set_error(err, + kErrorTypeException, _("Unknown type for option \"%s\""), name.data); } @@ -258,15 +257,15 @@ Object get_option_from(void *from, int type, String name, Error *err) void set_option_to(void *to, int type, String name, Object value, Error *err) { if (name.size == 0) { - api_set_error(err, Validation, _("Empty option name")); + _api_set_error(err, kErrorTypeValidation, _("Empty option name")); return; } int flags = get_option_value_strict(name.data, NULL, NULL, type, to); if (flags == 0) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("Invalid option name \"%s\""), name.data); return; @@ -274,14 +273,14 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (value.type == kObjectTypeNil) { if (type == SREQ_GLOBAL) { - api_set_error(err, - Exception, + _api_set_error(err, + kErrorTypeException, _("Unable to unset option \"%s\""), name.data); return; } else if (!(flags & SOPT_GLOBAL)) { - api_set_error(err, - Exception, + _api_set_error(err, + kErrorTypeException, _("Cannot unset option \"%s\" " "because it doesn't have a global value"), name.data); @@ -296,8 +295,8 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (flags & SOPT_BOOL) { if (value.type != kObjectTypeBoolean) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("Option \"%s\" requires a boolean value"), name.data); return; @@ -307,16 +306,16 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) set_option_value_for(name.data, val, NULL, opt_flags, type, to, err); } else if (flags & SOPT_NUM) { if (value.type != kObjectTypeInteger) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("Option \"%s\" requires an integer value"), name.data); return; } if (value.data.integer > INT_MAX || value.data.integer < INT_MIN) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("Value for option \"%s\" is outside range"), name.data); return; @@ -326,8 +325,8 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) set_option_value_for(name.data, val, NULL, opt_flags, type, to, err); } else { if (value.type != kObjectTypeString) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("Option \"%s\" requires a string value"), name.data); return; @@ -561,13 +560,13 @@ buf_T *find_buffer_by_handle(Buffer buffer, Error *err) buf_T *rv = handle_get_buffer(buffer); if (!rv) { - api_set_error(err, Validation, _("Invalid buffer id")); + _api_set_error(err, kErrorTypeValidation, _("Invalid buffer id")); } return rv; } -win_T * find_window_by_handle(Window window, Error *err) +win_T *find_window_by_handle(Window window, Error *err) { if (window == 0) { return curwin; @@ -576,13 +575,13 @@ win_T * find_window_by_handle(Window window, Error *err) win_T *rv = handle_get_window(window); if (!rv) { - api_set_error(err, Validation, _("Invalid window id")); + _api_set_error(err, kErrorTypeValidation, _("Invalid window id")); } return rv; } -tabpage_T * find_tab_by_handle(Tabpage tabpage, Error *err) +tabpage_T *find_tab_by_handle(Tabpage tabpage, Error *err) { if (tabpage == 0) { return curtab; @@ -591,7 +590,7 @@ tabpage_T * find_tab_by_handle(Tabpage tabpage, Error *err) tabpage_T *rv = handle_get_tabpage(tabpage); if (!rv) { - api_set_error(err, Validation, _("Invalid tabpage id")); + _api_set_error(err, kErrorTypeValidation, _("Invalid tabpage id")); } return rv; @@ -659,7 +658,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) case kObjectTypeInteger: if (obj.data.integer > VARNUMBER_MAX || obj.data.integer < VARNUMBER_MIN) { - api_set_error(err, Validation, _("Integer value outside range")); + _api_set_error(err, kErrorTypeValidation, _("Integer value outside range")); return false; } @@ -713,7 +712,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) String key = item.key; if (key.size == 0) { - api_set_error(err, Validation, + _api_set_error(err, kErrorTypeValidation, _("Empty dictionary keys aren't allowed")); // cleanup tv_dict_free(dict); @@ -801,6 +800,12 @@ void api_free_dictionary(Dictionary value) xfree(value.items); } +void api_free_error(Error *value) +{ + xfree(value->msg); + value->msg = NULL; +} + Dictionary api_metadata(void) { static Dictionary metadata = ARRAY_DICT_INIT; @@ -926,8 +931,8 @@ static void set_option_value_for(char *key, if (try_end(err)) { return; } - api_set_error(err, - Exception, + _api_set_error(err, + kErrorTypeException, _("Problem while switching windows")); return; } @@ -965,6 +970,26 @@ static void set_option_value_err(char *key, return; } - api_set_error(err, Exception, "%s", errmsg); + _api_set_error(err, kErrorTypeException, "%s", errmsg); } } + +void _api_set_error(Error *err, ErrorType errType, const char *format, ...) + FUNC_ATTR_NONNULL_ALL +{ + va_list args1; + va_list args2; + va_start(args1, format); + va_copy(args2, args1); + int len = vsnprintf(NULL, 0, format, args1); + va_end(args1); + assert(len >= 0); + // Limit error message to 1 MB. + size_t bufsize = MIN((size_t)len + 1, 1024 * 1024); + err->msg = xmalloc(bufsize); + vsnprintf(err->msg, bufsize, format, args2); + va_end(args2); + + err->set = true; + err->type = errType; +} diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index 20b4015fb5..681945ac9c 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -8,16 +8,6 @@ #include "nvim/memory.h" #include "nvim/lib/kvec.h" -// -V:api_set_error:618 -#define api_set_error(err, errtype, ...) \ - do { \ - snprintf((err)->msg, \ - sizeof((err)->msg), \ - __VA_ARGS__); \ - (err)->set = true; \ - (err)->type = kErrorType##errtype; \ - } while (0) - #define OBJECT_OBJ(o) o #define BOOLEAN_OBJ(b) ((Object) { \ diff --git a/src/nvim/api/tabpage.c b/src/nvim/api/tabpage.c index 29592408fc..e6d5f7edad 100644 --- a/src/nvim/api/tabpage.c +++ b/src/nvim/api/tabpage.c @@ -193,6 +193,8 @@ Boolean nvim_tabpage_is_valid(Tabpage tabpage) FUNC_API_SINCE(1) { Error stub = ERROR_INIT; - return find_tab_by_handle(tabpage, &stub) != NULL; + Boolean ret = find_tab_by_handle(tabpage, &stub) != NULL; + xfree(stub.msg); + return ret; } diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 2a33d2ad72..534274db0f 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -55,12 +55,12 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, Exception, _("UI already attached for channel")); + _api_set_error(err, kErrorTypeException, _("UI already attached for channel")); return; } if (width <= 0 || height <= 0) { - api_set_error(err, Validation, + _api_set_error(err, kErrorTypeValidation, _("Expected width > 0 and height > 0")); return; } @@ -126,7 +126,7 @@ void nvim_ui_detach(uint64_t channel_id, Error *err) FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, Exception, _("UI is not attached for channel")); + _api_set_error(err, kErrorTypeException, _("UI is not attached for channel")); return; } remote_ui_disconnect(channel_id); @@ -138,12 +138,12 @@ void nvim_ui_try_resize(uint64_t channel_id, Integer width, FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, Exception, _("UI is not attached for channel")); + _api_set_error(err, kErrorTypeException, _("UI is not attached for channel")); return; } if (width <= 0 || height <= 0) { - api_set_error(err, Validation, + _api_set_error(err, kErrorTypeValidation, _("Expected width > 0 and height > 0")); return; } @@ -159,7 +159,7 @@ void nvim_ui_set_option(uint64_t channel_id, String name, FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(error, Exception, _("UI is not attached for channel")); + _api_set_error(error, kErrorTypeException, _("UI is not attached for channel")); return; } UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); @@ -173,19 +173,19 @@ void nvim_ui_set_option(uint64_t channel_id, String name, static void ui_set_option(UI *ui, String name, Object value, Error *error) { if (strcmp(name.data, "rgb") == 0) { if (value.type != kObjectTypeBoolean) { - api_set_error(error, Validation, _("rgb must be a Boolean")); + _api_set_error(error, kErrorTypeValidation, _("rgb must be a Boolean")); return; } ui->rgb = value.data.boolean; } else if (strcmp(name.data, "popupmenu_external") == 0) { if (value.type != kObjectTypeBoolean) { - api_set_error(error, Validation, + _api_set_error(error, kErrorTypeValidation, _("popupmenu_external must be a Boolean")); return; } ui->pum_external = value.data.boolean; } else { - api_set_error(error, Validation, _("No such ui option")); + _api_set_error(error, kErrorTypeValidation, _("No such ui option")); } } diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index e5ef4a35c1..bd4a196367 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -188,7 +188,7 @@ Object nvim_eval(String expr, Error *err) typval_T rettv; if (eval0((char_u *)expr.data, &rettv, NULL, true) == FAIL) { - api_set_error(err, Exception, "Failed to evaluate expression"); + _api_set_error(err, kErrorTypeException, "Failed to evaluate expression"); } if (!try_end(err)) { @@ -214,7 +214,7 @@ Object nvim_call_function(String fname, Array args, Error *err) { Object rv = OBJECT_INIT; if (args.size > MAX_FUNC_ARGS) { - api_set_error(err, Validation, + _api_set_error(err, kErrorTypeValidation, _("Function called with too many arguments.")); return rv; } @@ -237,7 +237,7 @@ Object nvim_call_function(String fname, Array args, Error *err) curwin->w_cursor.lnum, curwin->w_cursor.lnum, &dummy, true, NULL, NULL); if (r == FAIL) { - api_set_error(err, Exception, _("Error calling function.")); + _api_set_error(err, kErrorTypeException, _("Error calling function.")); } if (!try_end(err)) { rv = vim_to_object(&rettv); @@ -262,7 +262,7 @@ Integer nvim_strwidth(String str, Error *err) FUNC_API_SINCE(1) { if (str.size > INT_MAX) { - api_set_error(err, Validation, _("String length is too high")); + _api_set_error(err, kErrorTypeValidation, _("String length is too high")); return 0; } @@ -318,7 +318,7 @@ void nvim_set_current_dir(String dir, Error *err) FUNC_API_SINCE(1) { if (dir.size >= MAXPATHL) { - api_set_error(err, Validation, _("Directory string is too long")); + _api_set_error(err, kErrorTypeValidation, _("Directory string is too long")); return; } @@ -330,7 +330,7 @@ void nvim_set_current_dir(String dir, Error *err) if (vim_chdir((char_u *)string, kCdScopeGlobal)) { if (!try_end(err)) { - api_set_error(err, Exception, _("Failed to change directory")); + _api_set_error(err, kErrorTypeException, _("Failed to change directory")); } return; } @@ -538,8 +538,8 @@ void nvim_set_current_buf(Buffer buffer, Error *err) try_start(); int result = do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, buf->b_fnum, 0); if (!try_end(err) && result == FAIL) { - api_set_error(err, - Exception, + _api_set_error(err, + kErrorTypeException, _("Failed to switch to buffer %d"), buffer); } @@ -591,8 +591,8 @@ void nvim_set_current_win(Window window, Error *err) try_start(); goto_tabpage_win(win_find_tabpage(win), win); if (!try_end(err) && win != curwin) { - api_set_error(err, - Exception, + _api_set_error(err, + kErrorTypeException, _("Failed to switch to window %d"), window); } @@ -645,8 +645,8 @@ void nvim_set_current_tabpage(Tabpage tabpage, Error *err) try_start(); goto_tabpage_tp(tp, true, true); if (!try_end(err) && tp != curtab) { - api_set_error(err, - Exception, + _api_set_error(err, + kErrorTypeException, _("Failed to switch to tabpage %d"), tabpage); } @@ -744,30 +744,30 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) size_t i; // also used for freeing the variables for (i = 0; i < calls.size; i++) { if (calls.items[i].type != kObjectTypeArray) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("All items in calls array must be arrays")); goto validation_error; } Array call = calls.items[i].data.array; if (call.size != 2) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("All items in calls array must be arrays of size 2")); goto validation_error; } if (call.items[0].type != kObjectTypeString) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("name must be String")); goto validation_error; } String name = call.items[0].data.string; if (call.items[1].type != kObjectTypeArray) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("args must be Array")); goto validation_error; } @@ -794,10 +794,12 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) } else { ADD(rv, NIL); } - return rv; + goto theend; validation_error: api_free_array(results); +theend: + api_free_error(&nested_error); return rv; } diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index e1bb70ee0d..254ab1c09f 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -64,8 +64,8 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) if (pos.size != 2 || pos.items[0].type != kObjectTypeInteger || pos.items[1].type != kObjectTypeInteger) { - api_set_error(err, - Validation, + _api_set_error(err, + kErrorTypeValidation, _("Argument \"pos\" must be a [row, col] array")); return; } @@ -78,12 +78,12 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) int64_t col = pos.items[1].data.integer; if (row <= 0 || row > win->w_buffer->b_ml.ml_line_count) { - api_set_error(err, Validation, _("Cursor position outside buffer")); + _api_set_error(err, kErrorTypeValidation, _("Cursor position outside buffer")); return; } if (col > MAXCOL || col < 0) { - api_set_error(err, Validation, _("Column value outside range")); + _api_set_error(err, kErrorTypeValidation, _("Column value outside range")); return; } @@ -132,7 +132,7 @@ void nvim_win_set_height(Window window, Integer height, Error *err) } if (height > INT_MAX || height < INT_MIN) { - api_set_error(err, Validation, _("Height value outside range")); + _api_set_error(err, kErrorTypeValidation, _("Height value outside range")); return; } @@ -177,7 +177,7 @@ void nvim_win_set_width(Window window, Integer width, Error *err) } if (width > INT_MAX || width < INT_MIN) { - api_set_error(err, Validation, _("Width value outside range")); + _api_set_error(err, kErrorTypeValidation, _("Width value outside range")); return; } @@ -387,6 +387,8 @@ Boolean nvim_win_is_valid(Window window) FUNC_API_SINCE(1) { Error stub = ERROR_INIT; - return find_window_by_handle(window, &stub) != NULL; + Boolean ret = find_window_by_handle(window, &stub) != NULL; + xfree(stub.msg); + return ret; } diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 7cef0d81ed..56dc35c31d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6524,6 +6524,7 @@ static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr) end: api_free_array(args); api_free_object(result); + xfree(err.msg); } /* @@ -13794,6 +13795,7 @@ static void f_rpcrequest(typval_T *argvars, typval_T *rettv, FunPtr fptr) end: api_free_object(result); + xfree(err.msg); } // "rpcstart()" function (DEPRECATED) @@ -16523,7 +16525,7 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr) curbuf->b_p_swf = false; (void)setfname(curbuf, (char_u *)buf, NULL, true); // Save the job id and pid in b:terminal_job_{id,pid} - Error err; + Error err = ERROR_INIT; dict_set_var(curbuf->b_vars, cstr_as_string("terminal_job_id"), INTEGER_OBJ(rettv->vval.v_number), false, false, &err); dict_set_var(curbuf->b_vars, cstr_as_string("terminal_job_pid"), @@ -16532,6 +16534,7 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr) Terminal *term = terminal_open(topts); data->term = term; data->refcount++; + xfree(err.msg); return; } diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index b2c6ef852c..06cdf7d1f1 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -192,7 +192,7 @@ Object channel_send_call(uint64_t id, Channel *channel = NULL; if (!(channel = pmap_get(uint64_t)(channels, id)) || channel->closed) { - api_set_error(err, Exception, _("Invalid channel \"%" PRIu64 "\""), id); + _api_set_error(err, kErrorTypeException, _("Invalid channel \"%" PRIu64 "\""), id); api_free_array(args); return NIL; } @@ -212,7 +212,7 @@ Object channel_send_call(uint64_t id, if (frame.errored) { if (frame.result.type == kObjectTypeString) { - api_set_error(err, Exception, "%s", frame.result.data.string.data); + _api_set_error(err, kErrorTypeException, "%s", frame.result.data.string.data); } else if (frame.result.type == kObjectTypeArray) { // Should be an error in the form [type, message] Array array = frame.result.data.array; @@ -220,14 +220,13 @@ Object channel_send_call(uint64_t id, && (array.items[0].data.integer == kErrorTypeException || array.items[0].data.integer == kErrorTypeValidation) && array.items[1].type == kObjectTypeString) { - err->type = (ErrorType) array.items[0].data.integer; - xstrlcpy(err->msg, array.items[1].data.string.data, sizeof(err->msg)); - err->set = true; + _api_set_error(err, (ErrorType)array.items[0].data.integer, "%s", + array.items[1].data.string.data); } else { - api_set_error(err, Exception, "%s", "unknown error"); + _api_set_error(err, kErrorTypeException, "%s", "unknown error"); } } else { - api_set_error(err, Exception, "%s", "unknown error"); + _api_set_error(err, kErrorTypeException, "%s", "unknown error"); } api_free_object(frame.result); @@ -412,38 +411,38 @@ static void handle_request(Channel *channel, msgpack_object *request) channel->id); call_set_error(channel, buf); } - return; - } - - // Retrieve the request handler - MsgpackRpcRequestHandler handler; - msgpack_object *method = msgpack_rpc_method(request); - - if (method) { - handler = msgpack_rpc_get_handler_for(method->via.bin.ptr, - method->via.bin.size); } else { - handler.fn = msgpack_rpc_handle_missing_method; - handler.async = true; - } + // Retrieve the request handler + MsgpackRpcRequestHandler handler; + msgpack_object *method = msgpack_rpc_method(request); - Array args = ARRAY_DICT_INIT; - if (!msgpack_rpc_to_array(msgpack_rpc_args(request), &args)) { - handler.fn = msgpack_rpc_handle_invalid_arguments; - handler.async = true; - } + if (method) { + handler = msgpack_rpc_get_handler_for(method->via.bin.ptr, + method->via.bin.size); + } else { + handler.fn = msgpack_rpc_handle_missing_method; + handler.async = true; + } - RequestEvent *event_data = xmalloc(sizeof(RequestEvent)); - event_data->channel = channel; - event_data->handler = handler; - event_data->args = args; - event_data->request_id = request_id; - incref(channel); - if (handler.async) { - on_request_event((void **)&event_data); - } else { - multiqueue_put(channel->events, on_request_event, 1, event_data); + Array args = ARRAY_DICT_INIT; + if (!msgpack_rpc_to_array(msgpack_rpc_args(request), &args)) { + handler.fn = msgpack_rpc_handle_invalid_arguments; + handler.async = true; + } + + RequestEvent *event_data = xmalloc(sizeof(RequestEvent)); + event_data->channel = channel; + event_data->handler = handler; + event_data->args = args; + event_data->request_id = request_id; + incref(channel); + if (handler.async) { + on_request_event((void **)&event_data); + } else { + multiqueue_put(channel->events, on_request_event, 1, event_data); + } } + xfree(error.msg); } static void on_request_event(void **argv) @@ -470,6 +469,7 @@ static void on_request_event(void **argv) api_free_array(args); decref(channel); xfree(e); + xfree(error.msg); } static bool channel_write(Channel *channel, WBuffer *buffer) @@ -512,12 +512,13 @@ static bool channel_write(Channel *channel, WBuffer *buffer) static void send_error(Channel *channel, uint64_t id, char *err) { Error e = ERROR_INIT; - api_set_error(&e, Exception, "%s", err); + _api_set_error(&e, kErrorTypeException, "%s", err); channel_write(channel, serialize_response(channel->id, id, &e, NIL, &out_buffer)); + xfree(e.msg); } static void send_request(Channel *channel, diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index 967ce31c1b..c273343b41 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -475,8 +475,7 @@ Object msgpack_rpc_handle_missing_method(uint64_t channel_id, Array args, Error *error) { - snprintf(error->msg, sizeof(error->msg), "Invalid method name"); - error->set = true; + _api_set_error(error, error->type, "Invalid method name"); return NIL; } @@ -485,8 +484,7 @@ Object msgpack_rpc_handle_invalid_arguments(uint64_t channel_id, Array args, Error *error) { - snprintf(error->msg, sizeof(error->msg), "Invalid method arguments"); - error->set = true; + _api_set_error(error, error->type, "Invalid method arguments"); return NIL; } @@ -572,29 +570,29 @@ void msgpack_rpc_validate(uint64_t *response_id, *response_id = NO_RESPONSE; // Validate the basic structure of the msgpack-rpc payload if (req->type != MSGPACK_OBJECT_ARRAY) { - api_set_error(err, Validation, _("Message is not an array")); + _api_set_error(err, kErrorTypeValidation, _("Message is not an array")); return; } if (req->via.array.size == 0) { - api_set_error(err, Validation, _("Message is empty")); + _api_set_error(err, kErrorTypeValidation, _("Message is empty")); return; } if (req->via.array.ptr[0].type != MSGPACK_OBJECT_POSITIVE_INTEGER) { - api_set_error(err, Validation, _("Message type must be an integer")); + _api_set_error(err, kErrorTypeValidation, _("Message type must be an integer")); return; } uint64_t type = req->via.array.ptr[0].via.u64; if (type != kMessageTypeRequest && type != kMessageTypeNotification) { - api_set_error(err, Validation, _("Unknown message type")); + _api_set_error(err, kErrorTypeValidation, _("Unknown message type")); return; } if ((type == kMessageTypeRequest && req->via.array.size != 4) || (type == kMessageTypeNotification && req->via.array.size != 3)) { - api_set_error(err, Validation, _("Request array size should be 4 (request) " + _api_set_error(err, kErrorTypeValidation, _("Request array size should be 4 (request) " "or 3 (notification)")); return; } @@ -602,19 +600,19 @@ void msgpack_rpc_validate(uint64_t *response_id, if (type == kMessageTypeRequest) { msgpack_object *id_obj = msgpack_rpc_msg_id(req); if (!id_obj) { - api_set_error(err, Validation, _("ID must be a positive integer")); + _api_set_error(err, kErrorTypeValidation, _("ID must be a positive integer")); return; } *response_id = id_obj->via.u64; } if (!msgpack_rpc_method(req)) { - api_set_error(err, Validation, _("Method must be a string")); + _api_set_error(err, kErrorTypeValidation, _("Method must be a string")); return; } if (!msgpack_rpc_args(req)) { - api_set_error(err, Validation, _("Parameters must be an array")); + _api_set_error(err, kErrorTypeValidation, _("Parameters must be an array")); return; } } diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 19b9bdc19f..43e4ea87e3 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -633,13 +633,14 @@ static int term_movecursor(VTermPos new, VTermPos old, int visible, static void buf_set_term_title(buf_T *buf, char *title) FUNC_ATTR_NONNULL_ALL { - Error err; + Error err = ERROR_INIT; dict_set_var(buf->b_vars, STATIC_CSTR_AS_STRING("term_title"), STRING_OBJ(cstr_as_string(title)), false, false, &err); + xfree(err.msg); } static int term_settermprop(VTermProp prop, VTermValue *val, void *data) @@ -1220,12 +1221,15 @@ static bool is_focused(Terminal *term) #define GET_CONFIG_VALUE(k, o) \ do { \ - Error err; \ + Error err = ERROR_INIT; \ /* Only called from terminal_open where curbuf->terminal is the */ \ /* context */ \ o = dict_get_value(curbuf->b_vars, cstr_as_string(k), &err); \ + xfree(err.msg); \ if (o.type == kObjectTypeNil) { \ - o = dict_get_value(&globvardict, cstr_as_string(k), &err); \ + Error err2 = ERROR_INIT; \ + o = dict_get_value(&globvardict, cstr_as_string(k), &err2); \ + xfree(err2.msg); \ } \ } while (0) diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index 3f2ccd4746..921f67fb7d 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -228,7 +228,7 @@ static int get_key_code_timeout(void) if (nvim_get_option(cstr_as_string("ttimeout"), &err).data.boolean) { ms = nvim_get_option(cstr_as_string("ttimeoutlen"), &err).data.integer; } - + xfree(err.msg); return (int)ms; } diff --git a/test/functional/provider/python3_spec.lua b/test/functional/provider/python3_spec.lua index a4e9a49c8a..89a546675f 100644 --- a/test/functional/provider/python3_spec.lua +++ b/test/functional/provider/python3_spec.lua @@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each) local eval, command, feed = helpers.eval, helpers.command, helpers.feed local eq, clear, insert = helpers.eq, helpers.clear, helpers.insert local expect, write_file = helpers.expect, helpers.write_file +local feed_command = helpers.feed_command do clear() @@ -30,6 +31,15 @@ describe('python3 commands and functions', function() eq({100, 0}, eval('g:set_by_python3')) end) + it('does not truncate error message <1 MB', function() + -- XXX: Python limits the error name to 200 chars, so this test is + -- mostly bogus. + local very_long_symbol = string.rep('a', 1200) + feed_command(':silent! py3 print('..very_long_symbol..' b)') + -- Truncated error message would not contain this (last) line. + eq('SyntaxError: invalid syntax', eval('v:errmsg')) + end) + it('python3_execute with nested commands', function() command([[python3 vim.command('python3 vim.command("python3 vim.command(\'let set_by_nested_python3 = 555\')")')]]) eq(555, eval('g:set_by_nested_python3')) From 2a49163103827465f25810f5f4e3d4305159f209 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 23 Apr 2017 15:59:59 +0200 Subject: [PATCH 147/257] api_clear_error() --- src/nvim/api/buffer.c | 2 +- src/nvim/api/private/helpers.c | 3 +- src/nvim/api/tabpage.c | 2 +- src/nvim/api/vim.c | 2 +- src/nvim/api/window.c | 2 +- src/nvim/eval.c | 7 ++-- src/nvim/msgpack_rpc/channel.c | 66 +++++++++++++++++----------------- src/nvim/terminal.c | 9 +++-- src/nvim/tui/input.c | 2 +- 9 files changed, 48 insertions(+), 47 deletions(-) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 2f306ebfc8..81d25d7c95 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -640,7 +640,7 @@ Boolean nvim_buf_is_valid(Buffer buffer) { Error stub = ERROR_INIT; Boolean ret = find_buffer_by_handle(buffer, &stub) != NULL; - xfree(stub.msg); + api_clear_error(&stub); return ret; } diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index e6632525e1..547ac29bed 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -800,7 +800,8 @@ void api_free_dictionary(Dictionary value) xfree(value.items); } -void api_free_error(Error *value) +void api_clear_error(Error *value) + FUNC_ATTR_NONNULL_ALL { xfree(value->msg); value->msg = NULL; diff --git a/src/nvim/api/tabpage.c b/src/nvim/api/tabpage.c index e6d5f7edad..6f2f9e1d2a 100644 --- a/src/nvim/api/tabpage.c +++ b/src/nvim/api/tabpage.c @@ -194,7 +194,7 @@ Boolean nvim_tabpage_is_valid(Tabpage tabpage) { Error stub = ERROR_INIT; Boolean ret = find_tab_by_handle(tabpage, &stub) != NULL; - xfree(stub.msg); + api_clear_error(&stub); return ret; } diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index bd4a196367..2c78ffdec1 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -799,7 +799,7 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) validation_error: api_free_array(results); theend: - api_free_error(&nested_error); + api_clear_error(&nested_error); return rv; } diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index 254ab1c09f..b8326c1198 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -388,7 +388,7 @@ Boolean nvim_win_is_valid(Window window) { Error stub = ERROR_INIT; Boolean ret = find_window_by_handle(window, &stub) != NULL; - xfree(stub.msg); + api_clear_error(&stub); return ret; } diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 56dc35c31d..1e174712a3 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6524,7 +6524,7 @@ static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr) end: api_free_array(args); api_free_object(result); - xfree(err.msg); + api_clear_error(&err); } /* @@ -13795,7 +13795,7 @@ static void f_rpcrequest(typval_T *argvars, typval_T *rettv, FunPtr fptr) end: api_free_object(result); - xfree(err.msg); + api_clear_error(&err); } // "rpcstart()" function (DEPRECATED) @@ -16528,13 +16528,14 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr) Error err = ERROR_INIT; dict_set_var(curbuf->b_vars, cstr_as_string("terminal_job_id"), INTEGER_OBJ(rettv->vval.v_number), false, false, &err); + api_clear_error(&err); dict_set_var(curbuf->b_vars, cstr_as_string("terminal_job_pid"), INTEGER_OBJ(pid), false, false, &err); + api_clear_error(&err); Terminal *term = terminal_open(topts); data->term = term; data->refcount++; - xfree(err.msg); return; } diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 06cdf7d1f1..bd7f84fed9 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -411,38 +411,38 @@ static void handle_request(Channel *channel, msgpack_object *request) channel->id); call_set_error(channel, buf); } - } else { - // Retrieve the request handler - MsgpackRpcRequestHandler handler; - msgpack_object *method = msgpack_rpc_method(request); - - if (method) { - handler = msgpack_rpc_get_handler_for(method->via.bin.ptr, - method->via.bin.size); - } else { - handler.fn = msgpack_rpc_handle_missing_method; - handler.async = true; - } - - Array args = ARRAY_DICT_INIT; - if (!msgpack_rpc_to_array(msgpack_rpc_args(request), &args)) { - handler.fn = msgpack_rpc_handle_invalid_arguments; - handler.async = true; - } - - RequestEvent *event_data = xmalloc(sizeof(RequestEvent)); - event_data->channel = channel; - event_data->handler = handler; - event_data->args = args; - event_data->request_id = request_id; - incref(channel); - if (handler.async) { - on_request_event((void **)&event_data); - } else { - multiqueue_put(channel->events, on_request_event, 1, event_data); - } + api_clear_error(&error); + return; + } + // Retrieve the request handler + MsgpackRpcRequestHandler handler; + msgpack_object *method = msgpack_rpc_method(request); + + if (method) { + handler = msgpack_rpc_get_handler_for(method->via.bin.ptr, + method->via.bin.size); + } else { + handler.fn = msgpack_rpc_handle_missing_method; + handler.async = true; + } + + Array args = ARRAY_DICT_INIT; + if (!msgpack_rpc_to_array(msgpack_rpc_args(request), &args)) { + handler.fn = msgpack_rpc_handle_invalid_arguments; + handler.async = true; + } + + RequestEvent *event_data = xmalloc(sizeof(RequestEvent)); + event_data->channel = channel; + event_data->handler = handler; + event_data->args = args; + event_data->request_id = request_id; + incref(channel); + if (handler.async) { + on_request_event((void **)&event_data); + } else { + multiqueue_put(channel->events, on_request_event, 1, event_data); } - xfree(error.msg); } static void on_request_event(void **argv) @@ -469,7 +469,7 @@ static void on_request_event(void **argv) api_free_array(args); decref(channel); xfree(e); - xfree(error.msg); + api_clear_error(&error); } static bool channel_write(Channel *channel, WBuffer *buffer) @@ -518,7 +518,7 @@ static void send_error(Channel *channel, uint64_t id, char *err) &e, NIL, &out_buffer)); - xfree(e.msg); + api_clear_error(&e); } static void send_request(Channel *channel, diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 43e4ea87e3..c44fe15be5 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -640,7 +640,7 @@ static void buf_set_term_title(buf_T *buf, char *title) false, false, &err); - xfree(err.msg); + api_clear_error(&err); } static int term_settermprop(VTermProp prop, VTermValue *val, void *data) @@ -1225,11 +1225,10 @@ static bool is_focused(Terminal *term) /* Only called from terminal_open where curbuf->terminal is the */ \ /* context */ \ o = dict_get_value(curbuf->b_vars, cstr_as_string(k), &err); \ - xfree(err.msg); \ + api_clear_error(&err); \ if (o.type == kObjectTypeNil) { \ - Error err2 = ERROR_INIT; \ - o = dict_get_value(&globvardict, cstr_as_string(k), &err2); \ - xfree(err2.msg); \ + o = dict_get_value(&globvardict, cstr_as_string(k), &err); \ + api_clear_error(&err); \ } \ } while (0) diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index 921f67fb7d..be016668fc 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -228,7 +228,7 @@ static int get_key_code_timeout(void) if (nvim_get_option(cstr_as_string("ttimeout"), &err).data.boolean) { ms = nvim_get_option(cstr_as_string("ttimeoutlen"), &err).data.integer; } - xfree(err.msg); + api_clear_error(&err); return (int)ms; } From 62c3f436a96e2102ec5c1e3af974c8e57fe4e76c Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 23 Apr 2017 16:43:07 +0200 Subject: [PATCH 148/257] api_clear_error: Skip if error was not set. --- src/nvim/api/private/helpers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 547ac29bed..3bf584ff2f 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -803,6 +803,9 @@ void api_free_dictionary(Dictionary value) void api_clear_error(Error *value) FUNC_ATTR_NONNULL_ALL { + if (!value->set) { + return; + } xfree(value->msg); value->msg = NULL; } From 2ed91f222f1dddda10fbdc9cb80df2be7d4c2da3 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 23 Apr 2017 19:58:13 +0200 Subject: [PATCH 149/257] api/internal: Remove `set` field from Error type. --- scripts/gendispatch.lua | 6 +++--- src/nvim/api/buffer.c | 4 ++-- src/nvim/api/private/defs.h | 6 ++++-- src/nvim/api/private/helpers.c | 11 ++++++----- src/nvim/api/ui.c | 4 ++-- src/nvim/api/vim.c | 6 +++--- src/nvim/eval.c | 4 ++-- src/nvim/msgpack_rpc/channel.c | 2 +- src/nvim/msgpack_rpc/helpers.c | 6 +++--- 9 files changed, 26 insertions(+), 23 deletions(-) diff --git a/scripts/gendispatch.lua b/scripts/gendispatch.lua index 683962aa60..53af67cce4 100644 --- a/scripts/gendispatch.lua +++ b/scripts/gendispatch.lua @@ -225,7 +225,7 @@ for i = 1, #functions do end output:write('\n') output:write('\n if (args.size != '..#fn.parameters..') {') - output:write('\n _api_set_error(error, error->type, "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') + output:write('\n _api_set_error(error, kErrorTypeException, "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') output:write('\n goto cleanup;') output:write('\n }\n') @@ -250,7 +250,7 @@ for i = 1, #functions do output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;') end output:write('\n } else {') - output:write('\n _api_set_error(error, error->type, "Wrong type for argument '..j..', expecting '..param[1]..'");') + output:write('\n _api_set_error(error, kErrorTypeException, "Wrong type for argument '..j..', expecting '..param[1]..'");') output:write('\n goto cleanup;') output:write('\n }\n') else @@ -290,7 +290,7 @@ for i = 1, #functions do output:write('error);\n') end -- and check for the error - output:write('\n if (error->set) {') + output:write('\n if (ERROR_SET(error)) {') output:write('\n goto cleanup;') output:write('\n }\n') else diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 81d25d7c95..cffc7a2e38 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -65,7 +65,7 @@ String buffer_get_line(Buffer buffer, Integer index, Error *err) index = convert_index(index); Array slice = nvim_buf_get_lines(0, buffer, index, index+1, true, err); - if (!err->set && slice.size) { + if (!ERROR_SET(err) && slice.size) { rv = slice.items[0].data.string; } @@ -203,7 +203,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, } end: - if (err->set) { + if (ERROR_SET(err)) { for (size_t i = 0; i < rv.size; i++) { xfree(rv.items[i].data.string.data); } diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h index a07422bd12..60bf38265f 100644 --- a/src/nvim/api/private/defs.h +++ b/src/nvim/api/private/defs.h @@ -8,9 +8,11 @@ #define ARRAY_DICT_INIT {.size = 0, .capacity = 0, .items = NULL} #define STRING_INIT {.data = NULL, .size = 0} #define OBJECT_INIT { .type = kObjectTypeNil } -#define ERROR_INIT { .set = false, .msg = NULL } +#define ERROR_INIT { .type = kErrorTypeNone, .msg = NULL } #define REMOTE_TYPE(type) typedef handle_T type +#define ERROR_SET(e) ((e)->type != kErrorTypeNone) + #ifdef INCLUDE_GENERATED_DECLARATIONS # define ArrayOf(...) Array # define DictionaryOf(...) Dictionary @@ -20,6 +22,7 @@ typedef int handle_T; // Basic types typedef enum { + kErrorTypeNone = -1, kErrorTypeException, kErrorTypeValidation } ErrorType; @@ -39,7 +42,6 @@ typedef enum { typedef struct { ErrorType type; char *msg; - bool set; } Error; typedef bool Boolean; diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 3bf584ff2f..58534d78a0 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -69,7 +69,7 @@ bool try_end(Error *err) ET_ERROR, NULL, &should_free); - _api_set_error(err, err->type, "%s", msg); + _api_set_error(err, kErrorTypeException, "%s", msg); free_global_msglist(); if (should_free) { @@ -80,7 +80,7 @@ bool try_end(Error *err) discard_current_exception(); } - return err->set; + return ERROR_SET(err); } /// Recursively expands a vimscript value in a dict @@ -803,11 +803,12 @@ void api_free_dictionary(Dictionary value) void api_clear_error(Error *value) FUNC_ATTR_NONNULL_ALL { - if (!value->set) { + if (!ERROR_SET(value)) { return; } xfree(value->msg); value->msg = NULL; + value->type = kErrorTypeNone; } Dictionary api_metadata(void) @@ -953,7 +954,7 @@ static void set_option_value_for(char *key, break; } - if (err->set) { + if (ERROR_SET(err)) { return; } @@ -981,6 +982,7 @@ static void set_option_value_err(char *key, void _api_set_error(Error *err, ErrorType errType, const char *format, ...) FUNC_ATTR_NONNULL_ALL { + assert(kErrorTypeNone != errType); va_list args1; va_list args2; va_start(args1, format); @@ -994,6 +996,5 @@ void _api_set_error(Error *err, ErrorType errType, const char *format, ...) vsnprintf(err->msg, bufsize, format, args2); va_end(args2); - err->set = true; err->type = errType; } diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 534274db0f..4c39bc57eb 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -97,7 +97,7 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, for (size_t i = 0; i < options.size; i++) { ui_set_option(ui, options.items[i].key, options.items[i].value, err); - if (err->set) { + if (ERROR_SET(err)) { xfree(ui); return; } @@ -165,7 +165,7 @@ void nvim_ui_set_option(uint64_t channel_id, String name, UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); ui_set_option(ui, name, value, error); - if (!error->set) { + if (!ERROR_SET(error)) { ui_refresh(); } } diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 2c78ffdec1..924ea419a1 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -165,7 +165,7 @@ String nvim_command_output(String str, Error *err) nvim_command(str, err); do_cmdline_cmd("redir END"); - if (err->set) { + if (ERROR_SET(err)) { return (String) STRING_INIT; } @@ -776,7 +776,7 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) MsgpackRpcRequestHandler handler = msgpack_rpc_get_handler_for(name.data, name.size); Object result = handler.fn(channel_id, args, &nested_error); - if (nested_error.set) { + if (ERROR_SET(&nested_error)) { // error handled after loop break; } @@ -785,7 +785,7 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) } ADD(rv, ARRAY_OBJ(results)); - if (nested_error.set) { + if (ERROR_SET(&nested_error)) { Array errval = ARRAY_DICT_INIT; ADD(errval, INTEGER_OBJ((Integer)i)); ADD(errval, INTEGER_OBJ(nested_error.type)); diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 1e174712a3..d7feed8bfd 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6512,7 +6512,7 @@ static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr) Error err = ERROR_INIT; Object result = fn(INTERNAL_CALL, args, &err); - if (err.set) { + if (ERROR_SET(&err)) { nvim_err_writeln(cstr_as_string(err.msg)); goto end; } @@ -13784,7 +13784,7 @@ static void f_rpcrequest(typval_T *argvars, typval_T *rettv, FunPtr fptr) restore_funccal(save_funccalp); } - if (err.set) { + if (ERROR_SET(&err)) { nvim_err_writeln(cstr_as_string(err.msg)); goto end; } diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index bd7f84fed9..36a3210c70 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -397,7 +397,7 @@ static void handle_request(Channel *channel, msgpack_object *request) Error error = ERROR_INIT; msgpack_rpc_validate(&request_id, request, &error); - if (error.set) { + if (ERROR_SET(&error)) { // Validation failed, send response with error if (channel_write(channel, serialize_response(channel->id, diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index c273343b41..800f5edb85 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -475,7 +475,7 @@ Object msgpack_rpc_handle_missing_method(uint64_t channel_id, Array args, Error *error) { - _api_set_error(error, error->type, "Invalid method name"); + _api_set_error(error, kErrorTypeException, "Invalid method name"); return NIL; } @@ -484,7 +484,7 @@ Object msgpack_rpc_handle_invalid_arguments(uint64_t channel_id, Array args, Error *error) { - _api_set_error(error, error->type, "Invalid method arguments"); + _api_set_error(error, kErrorTypeException, "Invalid method arguments"); return NIL; } @@ -517,7 +517,7 @@ void msgpack_rpc_serialize_response(uint64_t response_id, msgpack_pack_int(pac, 1); msgpack_pack_uint64(pac, response_id); - if (err->set) { + if (ERROR_SET(err)) { // error represented by a [type, message] array msgpack_pack_array(pac, 2); msgpack_rpc_from_integer(err->type, pac); From 3fbc660d57f4726044662bde1bf52c527e45fb98 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 23 Apr 2017 21:54:44 +0200 Subject: [PATCH 150/257] api_set_error(): rename --- scripts/gendispatch.lua | 4 +-- src/nvim/api/buffer.c | 36 ++++++++++---------- src/nvim/api/private/helpers.c | 62 +++++++++++++++++----------------- src/nvim/api/ui.c | 18 +++++----- src/nvim/api/vim.c | 26 +++++++------- src/nvim/api/window.c | 10 +++--- src/nvim/msgpack_rpc/channel.c | 12 +++---- src/nvim/msgpack_rpc/helpers.c | 20 +++++------ 8 files changed, 94 insertions(+), 94 deletions(-) diff --git a/scripts/gendispatch.lua b/scripts/gendispatch.lua index 53af67cce4..0ee3ae6475 100644 --- a/scripts/gendispatch.lua +++ b/scripts/gendispatch.lua @@ -225,7 +225,7 @@ for i = 1, #functions do end output:write('\n') output:write('\n if (args.size != '..#fn.parameters..') {') - output:write('\n _api_set_error(error, kErrorTypeException, "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') + output:write('\n api_set_error(error, kErrorTypeException, "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);') output:write('\n goto cleanup;') output:write('\n }\n') @@ -250,7 +250,7 @@ for i = 1, #functions do output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;') end output:write('\n } else {') - output:write('\n _api_set_error(error, kErrorTypeException, "Wrong type for argument '..j..', expecting '..param[1]..'");') + output:write('\n api_set_error(error, kErrorTypeException, "Wrong type for argument '..j..', expecting '..param[1]..'");') output:write('\n goto cleanup;') output:write('\n }\n') else diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index cffc7a2e38..4d6081bb5e 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -171,7 +171,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, end = normalize_index(buf, end, &oob); if (strict_indexing && oob) { - _api_set_error(err, kErrorTypeValidation, _("Index out of bounds")); + api_set_error(err, kErrorTypeValidation, _("Index out of bounds")); return rv; } @@ -187,7 +187,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i; if (lnum > LONG_MAX) { - _api_set_error(err, kErrorTypeValidation, _("Line index is too high")); + api_set_error(err, kErrorTypeValidation, _("Line index is too high")); goto end; } @@ -283,13 +283,13 @@ void nvim_buf_set_lines(uint64_t channel_id, end = normalize_index(buf, end, &oob); if (strict_indexing && oob) { - _api_set_error(err, kErrorTypeValidation, _("Index out of bounds")); + api_set_error(err, kErrorTypeValidation, _("Index out of bounds")); return; } if (start > end) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("Argument \"start\" is higher than \"end\"")); return; @@ -304,7 +304,7 @@ void nvim_buf_set_lines(uint64_t channel_id, for (size_t i = 0; i < new_len; i++) { if (replacement.items[i].type != kObjectTypeString) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("All items in the replacement array must be strings")); goto end; @@ -317,7 +317,7 @@ void nvim_buf_set_lines(uint64_t channel_id, lines[i] = xmallocz(l.size); for (size_t j = 0; j < l.size; j++) { if (l.data[j] == '\n' && channel_id != INTERNAL_CALL) { - _api_set_error(err, kErrorTypeException, _("string cannot contain newlines")); + api_set_error(err, kErrorTypeException, _("string cannot contain newlines")); new_len = i + 1; goto end; } @@ -330,7 +330,7 @@ void nvim_buf_set_lines(uint64_t channel_id, switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf); if (u_save((linenr_T)(start - 1), (linenr_T)end) == FAIL) { - _api_set_error(err, kErrorTypeException, _("Failed to save undo information")); + api_set_error(err, kErrorTypeException, _("Failed to save undo information")); goto end; } @@ -340,7 +340,7 @@ void nvim_buf_set_lines(uint64_t channel_id, size_t to_delete = (new_len < old_len) ? (size_t)(old_len - new_len) : 0; for (size_t i = 0; i < to_delete; i++) { if (ml_delete((linenr_T)start, false) == FAIL) { - _api_set_error(err, kErrorTypeException, _("Failed to delete line")); + api_set_error(err, kErrorTypeException, _("Failed to delete line")); goto end; } } @@ -357,12 +357,12 @@ void nvim_buf_set_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i; if (lnum > LONG_MAX) { - _api_set_error(err, kErrorTypeValidation, _("Index value is too high")); + api_set_error(err, kErrorTypeValidation, _("Index value is too high")); goto end; } if (ml_replace((linenr_T)lnum, (char_u *)lines[i], false) == FAIL) { - _api_set_error(err, kErrorTypeException, _("Failed to replace line")); + api_set_error(err, kErrorTypeException, _("Failed to replace line")); goto end; } // Mark lines that haven't been passed to the buffer as they need @@ -375,12 +375,12 @@ void nvim_buf_set_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i - 1; if (lnum > LONG_MAX) { - _api_set_error(err, kErrorTypeValidation, _("Index value is too high")); + api_set_error(err, kErrorTypeValidation, _("Index value is too high")); goto end; } if (ml_append((linenr_T)lnum, (char_u *)lines[i], 0, false) == FAIL) { - _api_set_error(err, kErrorTypeException, _("Failed to insert line")); + api_set_error(err, kErrorTypeException, _("Failed to insert line")); goto end; } @@ -627,7 +627,7 @@ void nvim_buf_set_name(Buffer buffer, String name, Error *err) } if (ren_ret == FAIL) { - _api_set_error(err, kErrorTypeException, _("Failed to rename buffer")); + api_set_error(err, kErrorTypeException, _("Failed to rename buffer")); } } @@ -680,7 +680,7 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) } if (name.size != 1) { - _api_set_error(err, kErrorTypeValidation, _("Mark name must be a single character")); + api_set_error(err, kErrorTypeValidation, _("Mark name must be a single character")); return rv; } @@ -698,7 +698,7 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) } if (posp == NULL) { - _api_set_error(err, kErrorTypeValidation, _("Invalid mark name")); + api_set_error(err, kErrorTypeValidation, _("Invalid mark name")); return rv; } @@ -753,11 +753,11 @@ Integer nvim_buf_add_highlight(Buffer buffer, } if (line < 0 || line >= MAXLNUM) { - _api_set_error(err, kErrorTypeValidation, _("Line number outside range")); + api_set_error(err, kErrorTypeValidation, _("Line number outside range")); return 0; } if (col_start < 0 || col_start > MAXCOL) { - _api_set_error(err, kErrorTypeValidation, _("Column value outside range")); + api_set_error(err, kErrorTypeValidation, _("Column value outside range")); return 0; } if (col_end < 0 || col_end > MAXCOL) { @@ -794,7 +794,7 @@ void nvim_buf_clear_highlight(Buffer buffer, } if (line_start < 0 || line_start >= MAXLNUM) { - _api_set_error(err, kErrorTypeValidation, _("Line number outside range")); + api_set_error(err, kErrorTypeValidation, _("Line number outside range")); return; } if (line_end < 0 || line_end > MAXLNUM) { diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 58534d78a0..d7274920b6 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -61,7 +61,7 @@ bool try_end(Error *err) discard_current_exception(); } - _api_set_error(err, kErrorTypeException, _("Keyboard interrupt")); + api_set_error(err, kErrorTypeException, _("Keyboard interrupt")); got_int = false; } else if (msg_list != NULL && *msg_list != NULL) { int should_free; @@ -69,14 +69,14 @@ bool try_end(Error *err) ET_ERROR, NULL, &should_free); - _api_set_error(err, kErrorTypeException, "%s", msg); + api_set_error(err, kErrorTypeException, "%s", msg); free_global_msglist(); if (should_free) { xfree(msg); } } else if (did_throw) { - _api_set_error(err, kErrorTypeException, "%s", current_exception->value); + api_set_error(err, kErrorTypeException, "%s", current_exception->value); discard_current_exception(); } @@ -93,7 +93,7 @@ Object dict_get_value(dict_T *dict, String key, Error *err) dictitem_T *const di = tv_dict_find(dict, key.data, (ptrdiff_t)key.size); if (di == NULL) { - _api_set_error(err, kErrorTypeValidation, _("Key not found")); + api_set_error(err, kErrorTypeValidation, _("Key not found")); return (Object) OBJECT_INIT; } @@ -117,17 +117,17 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, Object rv = OBJECT_INIT; if (dict->dv_lock) { - _api_set_error(err, kErrorTypeException, _("Dictionary is locked")); + api_set_error(err, kErrorTypeException, _("Dictionary is locked")); return rv; } if (key.size == 0) { - _api_set_error(err, kErrorTypeValidation, _("Empty variable names aren't allowed")); + api_set_error(err, kErrorTypeValidation, _("Empty variable names aren't allowed")); return rv; } if (key.size > INT_MAX) { - _api_set_error(err, kErrorTypeValidation, _("Key length is too high")); + api_set_error(err, kErrorTypeValidation, _("Key length is too high")); return rv; } @@ -135,13 +135,13 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, if (di != NULL) { if (di->di_flags & DI_FLAGS_RO) { - _api_set_error(err, kErrorTypeException, _("Key is read-only: %s"), key.data); + api_set_error(err, kErrorTypeException, _("Key is read-only: %s"), key.data); return rv; } else if (di->di_flags & DI_FLAGS_FIX) { - _api_set_error(err, kErrorTypeException, _("Key is fixed: %s"), key.data); + api_set_error(err, kErrorTypeException, _("Key is fixed: %s"), key.data); return rv; } else if (di->di_flags & DI_FLAGS_LOCK) { - _api_set_error(err, kErrorTypeException, _("Key is locked: %s"), key.data); + api_set_error(err, kErrorTypeException, _("Key is locked: %s"), key.data); return rv; } } @@ -150,7 +150,7 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, // Delete the key if (di == NULL) { // Doesn't exist, fail - _api_set_error(err, kErrorTypeValidation, _("Key \"%s\" doesn't exist"), key.data); + api_set_error(err, kErrorTypeValidation, _("Key \"%s\" doesn't exist"), key.data); } else { // Return the old value if (retval) { @@ -202,7 +202,7 @@ Object get_option_from(void *from, int type, String name, Error *err) Object rv = OBJECT_INIT; if (name.size == 0) { - _api_set_error(err, kErrorTypeValidation, _("Empty option name")); + api_set_error(err, kErrorTypeValidation, _("Empty option name")); return rv; } @@ -213,7 +213,7 @@ Object get_option_from(void *from, int type, String name, Error *err) type, from); if (!flags) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("Invalid option name \"%s\""), name.data); @@ -232,13 +232,13 @@ Object get_option_from(void *from, int type, String name, Error *err) rv.data.string.data = stringval; rv.data.string.size = strlen(stringval); } else { - _api_set_error(err, + api_set_error(err, kErrorTypeException, _("Unable to get value for option \"%s\""), name.data); } } else { - _api_set_error(err, + api_set_error(err, kErrorTypeException, _("Unknown type for option \"%s\""), name.data); @@ -257,14 +257,14 @@ Object get_option_from(void *from, int type, String name, Error *err) void set_option_to(void *to, int type, String name, Object value, Error *err) { if (name.size == 0) { - _api_set_error(err, kErrorTypeValidation, _("Empty option name")); + api_set_error(err, kErrorTypeValidation, _("Empty option name")); return; } int flags = get_option_value_strict(name.data, NULL, NULL, type, to); if (flags == 0) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("Invalid option name \"%s\""), name.data); @@ -273,13 +273,13 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (value.type == kObjectTypeNil) { if (type == SREQ_GLOBAL) { - _api_set_error(err, + api_set_error(err, kErrorTypeException, _("Unable to unset option \"%s\""), name.data); return; } else if (!(flags & SOPT_GLOBAL)) { - _api_set_error(err, + api_set_error(err, kErrorTypeException, _("Cannot unset option \"%s\" " "because it doesn't have a global value"), @@ -295,7 +295,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (flags & SOPT_BOOL) { if (value.type != kObjectTypeBoolean) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("Option \"%s\" requires a boolean value"), name.data); @@ -306,7 +306,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) set_option_value_for(name.data, val, NULL, opt_flags, type, to, err); } else if (flags & SOPT_NUM) { if (value.type != kObjectTypeInteger) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("Option \"%s\" requires an integer value"), name.data); @@ -314,7 +314,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) } if (value.data.integer > INT_MAX || value.data.integer < INT_MIN) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("Value for option \"%s\" is outside range"), name.data); @@ -325,7 +325,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) set_option_value_for(name.data, val, NULL, opt_flags, type, to, err); } else { if (value.type != kObjectTypeString) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("Option \"%s\" requires a string value"), name.data); @@ -560,7 +560,7 @@ buf_T *find_buffer_by_handle(Buffer buffer, Error *err) buf_T *rv = handle_get_buffer(buffer); if (!rv) { - _api_set_error(err, kErrorTypeValidation, _("Invalid buffer id")); + api_set_error(err, kErrorTypeValidation, _("Invalid buffer id")); } return rv; @@ -575,7 +575,7 @@ win_T *find_window_by_handle(Window window, Error *err) win_T *rv = handle_get_window(window); if (!rv) { - _api_set_error(err, kErrorTypeValidation, _("Invalid window id")); + api_set_error(err, kErrorTypeValidation, _("Invalid window id")); } return rv; @@ -590,7 +590,7 @@ tabpage_T *find_tab_by_handle(Tabpage tabpage, Error *err) tabpage_T *rv = handle_get_tabpage(tabpage); if (!rv) { - _api_set_error(err, kErrorTypeValidation, _("Invalid tabpage id")); + api_set_error(err, kErrorTypeValidation, _("Invalid tabpage id")); } return rv; @@ -658,7 +658,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) case kObjectTypeInteger: if (obj.data.integer > VARNUMBER_MAX || obj.data.integer < VARNUMBER_MIN) { - _api_set_error(err, kErrorTypeValidation, _("Integer value outside range")); + api_set_error(err, kErrorTypeValidation, _("Integer value outside range")); return false; } @@ -712,7 +712,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) String key = item.key; if (key.size == 0) { - _api_set_error(err, kErrorTypeValidation, + api_set_error(err, kErrorTypeValidation, _("Empty dictionary keys aren't allowed")); // cleanup tv_dict_free(dict); @@ -936,7 +936,7 @@ static void set_option_value_for(char *key, if (try_end(err)) { return; } - _api_set_error(err, + api_set_error(err, kErrorTypeException, _("Problem while switching windows")); return; @@ -975,11 +975,11 @@ static void set_option_value_err(char *key, return; } - _api_set_error(err, kErrorTypeException, "%s", errmsg); + api_set_error(err, kErrorTypeException, "%s", errmsg); } } -void _api_set_error(Error *err, ErrorType errType, const char *format, ...) +void api_set_error(Error *err, ErrorType errType, const char *format, ...) FUNC_ATTR_NONNULL_ALL { assert(kErrorTypeNone != errType); diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 4c39bc57eb..26c0a8119b 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -55,12 +55,12 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (pmap_has(uint64_t)(connected_uis, channel_id)) { - _api_set_error(err, kErrorTypeException, _("UI already attached for channel")); + api_set_error(err, kErrorTypeException, _("UI already attached for channel")); return; } if (width <= 0 || height <= 0) { - _api_set_error(err, kErrorTypeValidation, + api_set_error(err, kErrorTypeValidation, _("Expected width > 0 and height > 0")); return; } @@ -126,7 +126,7 @@ void nvim_ui_detach(uint64_t channel_id, Error *err) FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - _api_set_error(err, kErrorTypeException, _("UI is not attached for channel")); + api_set_error(err, kErrorTypeException, _("UI is not attached for channel")); return; } remote_ui_disconnect(channel_id); @@ -138,12 +138,12 @@ void nvim_ui_try_resize(uint64_t channel_id, Integer width, FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - _api_set_error(err, kErrorTypeException, _("UI is not attached for channel")); + api_set_error(err, kErrorTypeException, _("UI is not attached for channel")); return; } if (width <= 0 || height <= 0) { - _api_set_error(err, kErrorTypeValidation, + api_set_error(err, kErrorTypeValidation, _("Expected width > 0 and height > 0")); return; } @@ -159,7 +159,7 @@ void nvim_ui_set_option(uint64_t channel_id, String name, FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - _api_set_error(error, kErrorTypeException, _("UI is not attached for channel")); + api_set_error(error, kErrorTypeException, _("UI is not attached for channel")); return; } UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); @@ -173,19 +173,19 @@ void nvim_ui_set_option(uint64_t channel_id, String name, static void ui_set_option(UI *ui, String name, Object value, Error *error) { if (strcmp(name.data, "rgb") == 0) { if (value.type != kObjectTypeBoolean) { - _api_set_error(error, kErrorTypeValidation, _("rgb must be a Boolean")); + api_set_error(error, kErrorTypeValidation, _("rgb must be a Boolean")); return; } ui->rgb = value.data.boolean; } else if (strcmp(name.data, "popupmenu_external") == 0) { if (value.type != kObjectTypeBoolean) { - _api_set_error(error, kErrorTypeValidation, + api_set_error(error, kErrorTypeValidation, _("popupmenu_external must be a Boolean")); return; } ui->pum_external = value.data.boolean; } else { - _api_set_error(error, kErrorTypeValidation, _("No such ui option")); + api_set_error(error, kErrorTypeValidation, _("No such ui option")); } } diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 924ea419a1..16c630b0e6 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -188,7 +188,7 @@ Object nvim_eval(String expr, Error *err) typval_T rettv; if (eval0((char_u *)expr.data, &rettv, NULL, true) == FAIL) { - _api_set_error(err, kErrorTypeException, "Failed to evaluate expression"); + api_set_error(err, kErrorTypeException, "Failed to evaluate expression"); } if (!try_end(err)) { @@ -214,7 +214,7 @@ Object nvim_call_function(String fname, Array args, Error *err) { Object rv = OBJECT_INIT; if (args.size > MAX_FUNC_ARGS) { - _api_set_error(err, kErrorTypeValidation, + api_set_error(err, kErrorTypeValidation, _("Function called with too many arguments.")); return rv; } @@ -237,7 +237,7 @@ Object nvim_call_function(String fname, Array args, Error *err) curwin->w_cursor.lnum, curwin->w_cursor.lnum, &dummy, true, NULL, NULL); if (r == FAIL) { - _api_set_error(err, kErrorTypeException, _("Error calling function.")); + api_set_error(err, kErrorTypeException, _("Error calling function.")); } if (!try_end(err)) { rv = vim_to_object(&rettv); @@ -262,7 +262,7 @@ Integer nvim_strwidth(String str, Error *err) FUNC_API_SINCE(1) { if (str.size > INT_MAX) { - _api_set_error(err, kErrorTypeValidation, _("String length is too high")); + api_set_error(err, kErrorTypeValidation, _("String length is too high")); return 0; } @@ -318,7 +318,7 @@ void nvim_set_current_dir(String dir, Error *err) FUNC_API_SINCE(1) { if (dir.size >= MAXPATHL) { - _api_set_error(err, kErrorTypeValidation, _("Directory string is too long")); + api_set_error(err, kErrorTypeValidation, _("Directory string is too long")); return; } @@ -330,7 +330,7 @@ void nvim_set_current_dir(String dir, Error *err) if (vim_chdir((char_u *)string, kCdScopeGlobal)) { if (!try_end(err)) { - _api_set_error(err, kErrorTypeException, _("Failed to change directory")); + api_set_error(err, kErrorTypeException, _("Failed to change directory")); } return; } @@ -538,7 +538,7 @@ void nvim_set_current_buf(Buffer buffer, Error *err) try_start(); int result = do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, buf->b_fnum, 0); if (!try_end(err) && result == FAIL) { - _api_set_error(err, + api_set_error(err, kErrorTypeException, _("Failed to switch to buffer %d"), buffer); @@ -591,7 +591,7 @@ void nvim_set_current_win(Window window, Error *err) try_start(); goto_tabpage_win(win_find_tabpage(win), win); if (!try_end(err) && win != curwin) { - _api_set_error(err, + api_set_error(err, kErrorTypeException, _("Failed to switch to window %d"), window); @@ -645,7 +645,7 @@ void nvim_set_current_tabpage(Tabpage tabpage, Error *err) try_start(); goto_tabpage_tp(tp, true, true); if (!try_end(err) && tp != curtab) { - _api_set_error(err, + api_set_error(err, kErrorTypeException, _("Failed to switch to tabpage %d"), tabpage); @@ -744,21 +744,21 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) size_t i; // also used for freeing the variables for (i = 0; i < calls.size; i++) { if (calls.items[i].type != kObjectTypeArray) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("All items in calls array must be arrays")); goto validation_error; } Array call = calls.items[i].data.array; if (call.size != 2) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("All items in calls array must be arrays of size 2")); goto validation_error; } if (call.items[0].type != kObjectTypeString) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("name must be String")); goto validation_error; @@ -766,7 +766,7 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) String name = call.items[0].data.string; if (call.items[1].type != kObjectTypeArray) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("args must be Array")); goto validation_error; diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index b8326c1198..dd52b2d690 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -64,7 +64,7 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) if (pos.size != 2 || pos.items[0].type != kObjectTypeInteger || pos.items[1].type != kObjectTypeInteger) { - _api_set_error(err, + api_set_error(err, kErrorTypeValidation, _("Argument \"pos\" must be a [row, col] array")); return; @@ -78,12 +78,12 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) int64_t col = pos.items[1].data.integer; if (row <= 0 || row > win->w_buffer->b_ml.ml_line_count) { - _api_set_error(err, kErrorTypeValidation, _("Cursor position outside buffer")); + api_set_error(err, kErrorTypeValidation, _("Cursor position outside buffer")); return; } if (col > MAXCOL || col < 0) { - _api_set_error(err, kErrorTypeValidation, _("Column value outside range")); + api_set_error(err, kErrorTypeValidation, _("Column value outside range")); return; } @@ -132,7 +132,7 @@ void nvim_win_set_height(Window window, Integer height, Error *err) } if (height > INT_MAX || height < INT_MIN) { - _api_set_error(err, kErrorTypeValidation, _("Height value outside range")); + api_set_error(err, kErrorTypeValidation, _("Height value outside range")); return; } @@ -177,7 +177,7 @@ void nvim_win_set_width(Window window, Integer width, Error *err) } if (width > INT_MAX || width < INT_MIN) { - _api_set_error(err, kErrorTypeValidation, _("Width value outside range")); + api_set_error(err, kErrorTypeValidation, _("Width value outside range")); return; } diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 36a3210c70..3cf85316d9 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -192,7 +192,7 @@ Object channel_send_call(uint64_t id, Channel *channel = NULL; if (!(channel = pmap_get(uint64_t)(channels, id)) || channel->closed) { - _api_set_error(err, kErrorTypeException, _("Invalid channel \"%" PRIu64 "\""), id); + api_set_error(err, kErrorTypeException, _("Invalid channel \"%" PRIu64 "\""), id); api_free_array(args); return NIL; } @@ -212,7 +212,7 @@ Object channel_send_call(uint64_t id, if (frame.errored) { if (frame.result.type == kObjectTypeString) { - _api_set_error(err, kErrorTypeException, "%s", frame.result.data.string.data); + api_set_error(err, kErrorTypeException, "%s", frame.result.data.string.data); } else if (frame.result.type == kObjectTypeArray) { // Should be an error in the form [type, message] Array array = frame.result.data.array; @@ -220,13 +220,13 @@ Object channel_send_call(uint64_t id, && (array.items[0].data.integer == kErrorTypeException || array.items[0].data.integer == kErrorTypeValidation) && array.items[1].type == kObjectTypeString) { - _api_set_error(err, (ErrorType)array.items[0].data.integer, "%s", + api_set_error(err, (ErrorType)array.items[0].data.integer, "%s", array.items[1].data.string.data); } else { - _api_set_error(err, kErrorTypeException, "%s", "unknown error"); + api_set_error(err, kErrorTypeException, "%s", "unknown error"); } } else { - _api_set_error(err, kErrorTypeException, "%s", "unknown error"); + api_set_error(err, kErrorTypeException, "%s", "unknown error"); } api_free_object(frame.result); @@ -512,7 +512,7 @@ static bool channel_write(Channel *channel, WBuffer *buffer) static void send_error(Channel *channel, uint64_t id, char *err) { Error e = ERROR_INIT; - _api_set_error(&e, kErrorTypeException, "%s", err); + api_set_error(&e, kErrorTypeException, "%s", err); channel_write(channel, serialize_response(channel->id, id, &e, diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index 800f5edb85..0ad1d9ae4b 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -475,7 +475,7 @@ Object msgpack_rpc_handle_missing_method(uint64_t channel_id, Array args, Error *error) { - _api_set_error(error, kErrorTypeException, "Invalid method name"); + api_set_error(error, kErrorTypeException, "Invalid method name"); return NIL; } @@ -484,7 +484,7 @@ Object msgpack_rpc_handle_invalid_arguments(uint64_t channel_id, Array args, Error *error) { - _api_set_error(error, kErrorTypeException, "Invalid method arguments"); + api_set_error(error, kErrorTypeException, "Invalid method arguments"); return NIL; } @@ -570,29 +570,29 @@ void msgpack_rpc_validate(uint64_t *response_id, *response_id = NO_RESPONSE; // Validate the basic structure of the msgpack-rpc payload if (req->type != MSGPACK_OBJECT_ARRAY) { - _api_set_error(err, kErrorTypeValidation, _("Message is not an array")); + api_set_error(err, kErrorTypeValidation, _("Message is not an array")); return; } if (req->via.array.size == 0) { - _api_set_error(err, kErrorTypeValidation, _("Message is empty")); + api_set_error(err, kErrorTypeValidation, _("Message is empty")); return; } if (req->via.array.ptr[0].type != MSGPACK_OBJECT_POSITIVE_INTEGER) { - _api_set_error(err, kErrorTypeValidation, _("Message type must be an integer")); + api_set_error(err, kErrorTypeValidation, _("Message type must be an integer")); return; } uint64_t type = req->via.array.ptr[0].via.u64; if (type != kMessageTypeRequest && type != kMessageTypeNotification) { - _api_set_error(err, kErrorTypeValidation, _("Unknown message type")); + api_set_error(err, kErrorTypeValidation, _("Unknown message type")); return; } if ((type == kMessageTypeRequest && req->via.array.size != 4) || (type == kMessageTypeNotification && req->via.array.size != 3)) { - _api_set_error(err, kErrorTypeValidation, _("Request array size should be 4 (request) " + api_set_error(err, kErrorTypeValidation, _("Request array size should be 4 (request) " "or 3 (notification)")); return; } @@ -600,19 +600,19 @@ void msgpack_rpc_validate(uint64_t *response_id, if (type == kMessageTypeRequest) { msgpack_object *id_obj = msgpack_rpc_msg_id(req); if (!id_obj) { - _api_set_error(err, kErrorTypeValidation, _("ID must be a positive integer")); + api_set_error(err, kErrorTypeValidation, _("ID must be a positive integer")); return; } *response_id = id_obj->via.u64; } if (!msgpack_rpc_method(req)) { - _api_set_error(err, kErrorTypeValidation, _("Method must be a string")); + api_set_error(err, kErrorTypeValidation, _("Method must be a string")); return; } if (!msgpack_rpc_args(req)) { - _api_set_error(err, kErrorTypeValidation, _("Parameters must be an array")); + api_set_error(err, kErrorTypeValidation, _("Parameters must be an array")); return; } } From e2936ed39768c07e810cd3c3e6255cf48fba494f Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 23 Apr 2017 22:06:02 +0200 Subject: [PATCH 151/257] tui/input.c: Use default 'ttimeoutlen' if option get fails. Should never happen, but better to be explicit. Helped-by: oni-link --- src/nvim/tui/input.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index be016668fc..b86ab8cf2f 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -223,10 +223,12 @@ static int get_key_code_timeout(void) { Integer ms = -1; // Check 'ttimeout' to determine if we should send ESC after 'ttimeoutlen'. - // See :help 'ttimeout' for more information Error err = ERROR_INIT; if (nvim_get_option(cstr_as_string("ttimeout"), &err).data.boolean) { - ms = nvim_get_option(cstr_as_string("ttimeoutlen"), &err).data.integer; + Object rv = nvim_get_option(cstr_as_string("ttimeoutlen"), &err); + if (!ERROR_SET(&err)) { + ms = rv.data.integer; + } } api_clear_error(&err); return (int)ms; From 086c354a0aad2769042dc91bf5bad021109f56e4 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 23 Apr 2017 22:30:08 +0200 Subject: [PATCH 152/257] api: Do not translate error messages. Also re-word some error messages: - "Key does not exist: %s" - "Invalid channel: %" - "Request array size must be 4 (request) or 3 (notification)" - "String cannot contain newlines" References #6150 --- src/nvim/api/buffer.c | 38 +++++++++--------- src/nvim/api/private/helpers.c | 60 ++++++++++++++-------------- src/nvim/api/ui.c | 18 ++++----- src/nvim/api/vim.c | 26 ++++++------ src/nvim/api/window.c | 10 ++--- src/nvim/msgpack_rpc/channel.c | 7 ++-- src/nvim/msgpack_rpc/helpers.c | 18 ++++----- src/nvim/po/fi.po | 6 +-- src/nvim/po/uk.po | 6 +-- test/functional/api/buffer_spec.lua | 2 +- test/functional/api/tabpage_spec.lua | 2 +- test/functional/api/vim_spec.lua | 4 +- test/functional/api/window_spec.lua | 2 +- 13 files changed, 102 insertions(+), 97 deletions(-) diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 4d6081bb5e..ae5728ee21 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -171,7 +171,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, end = normalize_index(buf, end, &oob); if (strict_indexing && oob) { - api_set_error(err, kErrorTypeValidation, _("Index out of bounds")); + api_set_error(err, kErrorTypeValidation, "Index out of bounds"); return rv; } @@ -187,7 +187,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i; if (lnum > LONG_MAX) { - api_set_error(err, kErrorTypeValidation, _("Line index is too high")); + api_set_error(err, kErrorTypeValidation, "Line index is too high"); goto end; } @@ -283,7 +283,7 @@ void nvim_buf_set_lines(uint64_t channel_id, end = normalize_index(buf, end, &oob); if (strict_indexing && oob) { - api_set_error(err, kErrorTypeValidation, _("Index out of bounds")); + api_set_error(err, kErrorTypeValidation, "Index out of bounds"); return; } @@ -291,7 +291,7 @@ void nvim_buf_set_lines(uint64_t channel_id, if (start > end) { api_set_error(err, kErrorTypeValidation, - _("Argument \"start\" is higher than \"end\"")); + "Argument \"start\" is higher than \"end\""); return; } @@ -306,7 +306,7 @@ void nvim_buf_set_lines(uint64_t channel_id, if (replacement.items[i].type != kObjectTypeString) { api_set_error(err, kErrorTypeValidation, - _("All items in the replacement array must be strings")); + "All items in the replacement array must be strings"); goto end; } @@ -317,7 +317,8 @@ void nvim_buf_set_lines(uint64_t channel_id, lines[i] = xmallocz(l.size); for (size_t j = 0; j < l.size; j++) { if (l.data[j] == '\n' && channel_id != INTERNAL_CALL) { - api_set_error(err, kErrorTypeException, _("string cannot contain newlines")); + api_set_error(err, kErrorTypeException, + "String cannot contain newlines"); new_len = i + 1; goto end; } @@ -330,7 +331,7 @@ void nvim_buf_set_lines(uint64_t channel_id, switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf); if (u_save((linenr_T)(start - 1), (linenr_T)end) == FAIL) { - api_set_error(err, kErrorTypeException, _("Failed to save undo information")); + api_set_error(err, kErrorTypeException, "Failed to save undo information"); goto end; } @@ -340,7 +341,7 @@ void nvim_buf_set_lines(uint64_t channel_id, size_t to_delete = (new_len < old_len) ? (size_t)(old_len - new_len) : 0; for (size_t i = 0; i < to_delete; i++) { if (ml_delete((linenr_T)start, false) == FAIL) { - api_set_error(err, kErrorTypeException, _("Failed to delete line")); + api_set_error(err, kErrorTypeException, "Failed to delete line"); goto end; } } @@ -357,12 +358,12 @@ void nvim_buf_set_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i; if (lnum > LONG_MAX) { - api_set_error(err, kErrorTypeValidation, _("Index value is too high")); + api_set_error(err, kErrorTypeValidation, "Index value is too high"); goto end; } if (ml_replace((linenr_T)lnum, (char_u *)lines[i], false) == FAIL) { - api_set_error(err, kErrorTypeException, _("Failed to replace line")); + api_set_error(err, kErrorTypeException, "Failed to replace line"); goto end; } // Mark lines that haven't been passed to the buffer as they need @@ -375,12 +376,12 @@ void nvim_buf_set_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i - 1; if (lnum > LONG_MAX) { - api_set_error(err, kErrorTypeValidation, _("Index value is too high")); + api_set_error(err, kErrorTypeValidation, "Index value is too high"); goto end; } if (ml_append((linenr_T)lnum, (char_u *)lines[i], 0, false) == FAIL) { - api_set_error(err, kErrorTypeException, _("Failed to insert line")); + api_set_error(err, kErrorTypeException, "Failed to insert line"); goto end; } @@ -627,7 +628,7 @@ void nvim_buf_set_name(Buffer buffer, String name, Error *err) } if (ren_ret == FAIL) { - api_set_error(err, kErrorTypeException, _("Failed to rename buffer")); + api_set_error(err, kErrorTypeException, "Failed to rename buffer"); } } @@ -680,7 +681,8 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) } if (name.size != 1) { - api_set_error(err, kErrorTypeValidation, _("Mark name must be a single character")); + api_set_error(err, kErrorTypeValidation, + "Mark name must be a single character"); return rv; } @@ -698,7 +700,7 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) } if (posp == NULL) { - api_set_error(err, kErrorTypeValidation, _("Invalid mark name")); + api_set_error(err, kErrorTypeValidation, "Invalid mark name"); return rv; } @@ -753,11 +755,11 @@ Integer nvim_buf_add_highlight(Buffer buffer, } if (line < 0 || line >= MAXLNUM) { - api_set_error(err, kErrorTypeValidation, _("Line number outside range")); + api_set_error(err, kErrorTypeValidation, "Line number outside range"); return 0; } if (col_start < 0 || col_start > MAXCOL) { - api_set_error(err, kErrorTypeValidation, _("Column value outside range")); + api_set_error(err, kErrorTypeValidation, "Column value outside range"); return 0; } if (col_end < 0 || col_end > MAXCOL) { @@ -794,7 +796,7 @@ void nvim_buf_clear_highlight(Buffer buffer, } if (line_start < 0 || line_start >= MAXLNUM) { - api_set_error(err, kErrorTypeValidation, _("Line number outside range")); + api_set_error(err, kErrorTypeValidation, "Line number outside range"); return; } if (line_end < 0 || line_end > MAXLNUM) { diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index d7274920b6..69cb19c14f 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -61,7 +61,7 @@ bool try_end(Error *err) discard_current_exception(); } - api_set_error(err, kErrorTypeException, _("Keyboard interrupt")); + api_set_error(err, kErrorTypeException, "Keyboard interrupt"); got_int = false; } else if (msg_list != NULL && *msg_list != NULL) { int should_free; @@ -93,8 +93,8 @@ Object dict_get_value(dict_T *dict, String key, Error *err) dictitem_T *const di = tv_dict_find(dict, key.data, (ptrdiff_t)key.size); if (di == NULL) { - api_set_error(err, kErrorTypeValidation, _("Key not found")); - return (Object) OBJECT_INIT; + api_set_error(err, kErrorTypeValidation, "Key not found"); + return (Object)OBJECT_INIT; } return vim_to_object(&di->di_tv); @@ -117,17 +117,18 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, Object rv = OBJECT_INIT; if (dict->dv_lock) { - api_set_error(err, kErrorTypeException, _("Dictionary is locked")); + api_set_error(err, kErrorTypeException, "Dictionary is locked"); return rv; } if (key.size == 0) { - api_set_error(err, kErrorTypeValidation, _("Empty variable names aren't allowed")); + api_set_error(err, kErrorTypeValidation, + "Empty variable names aren't allowed"); return rv; } if (key.size > INT_MAX) { - api_set_error(err, kErrorTypeValidation, _("Key length is too high")); + api_set_error(err, kErrorTypeValidation, "Key length is too high"); return rv; } @@ -135,13 +136,13 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, if (di != NULL) { if (di->di_flags & DI_FLAGS_RO) { - api_set_error(err, kErrorTypeException, _("Key is read-only: %s"), key.data); + api_set_error(err, kErrorTypeException, "Key is read-only: %s", key.data); return rv; } else if (di->di_flags & DI_FLAGS_FIX) { - api_set_error(err, kErrorTypeException, _("Key is fixed: %s"), key.data); + api_set_error(err, kErrorTypeException, "Key is fixed: %s", key.data); return rv; } else if (di->di_flags & DI_FLAGS_LOCK) { - api_set_error(err, kErrorTypeException, _("Key is locked: %s"), key.data); + api_set_error(err, kErrorTypeException, "Key is locked: %s", key.data); return rv; } } @@ -150,7 +151,8 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, // Delete the key if (di == NULL) { // Doesn't exist, fail - api_set_error(err, kErrorTypeValidation, _("Key \"%s\" doesn't exist"), key.data); + api_set_error(err, kErrorTypeValidation, "Key does not exist: %s", + key.data); } else { // Return the old value if (retval) { @@ -202,7 +204,7 @@ Object get_option_from(void *from, int type, String name, Error *err) Object rv = OBJECT_INIT; if (name.size == 0) { - api_set_error(err, kErrorTypeValidation, _("Empty option name")); + api_set_error(err, kErrorTypeValidation, "Empty option name"); return rv; } @@ -215,7 +217,7 @@ Object get_option_from(void *from, int type, String name, Error *err) if (!flags) { api_set_error(err, kErrorTypeValidation, - _("Invalid option name \"%s\""), + "Invalid option name \"%s\"", name.data); return rv; } @@ -234,13 +236,13 @@ Object get_option_from(void *from, int type, String name, Error *err) } else { api_set_error(err, kErrorTypeException, - _("Unable to get value for option \"%s\""), + "Unable to get value for option \"%s\"", name.data); } } else { api_set_error(err, kErrorTypeException, - _("Unknown type for option \"%s\""), + "Unknown type for option \"%s\"", name.data); } @@ -257,7 +259,7 @@ Object get_option_from(void *from, int type, String name, Error *err) void set_option_to(void *to, int type, String name, Object value, Error *err) { if (name.size == 0) { - api_set_error(err, kErrorTypeValidation, _("Empty option name")); + api_set_error(err, kErrorTypeValidation, "Empty option name"); return; } @@ -266,7 +268,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (flags == 0) { api_set_error(err, kErrorTypeValidation, - _("Invalid option name \"%s\""), + "Invalid option name \"%s\"", name.data); return; } @@ -275,14 +277,14 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (type == SREQ_GLOBAL) { api_set_error(err, kErrorTypeException, - _("Unable to unset option \"%s\""), + "Unable to unset option \"%s\"", name.data); return; } else if (!(flags & SOPT_GLOBAL)) { api_set_error(err, kErrorTypeException, - _("Cannot unset option \"%s\" " - "because it doesn't have a global value"), + "Cannot unset option \"%s\" " + "because it doesn't have a global value", name.data); return; } else { @@ -297,7 +299,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (value.type != kObjectTypeBoolean) { api_set_error(err, kErrorTypeValidation, - _("Option \"%s\" requires a boolean value"), + "Option \"%s\" requires a boolean value", name.data); return; } @@ -308,7 +310,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (value.type != kObjectTypeInteger) { api_set_error(err, kErrorTypeValidation, - _("Option \"%s\" requires an integer value"), + "Option \"%s\" requires an integer value", name.data); return; } @@ -316,7 +318,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (value.data.integer > INT_MAX || value.data.integer < INT_MIN) { api_set_error(err, kErrorTypeValidation, - _("Value for option \"%s\" is outside range"), + "Value for option \"%s\" is outside range", name.data); return; } @@ -327,7 +329,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (value.type != kObjectTypeString) { api_set_error(err, kErrorTypeValidation, - _("Option \"%s\" requires a string value"), + "Option \"%s\" requires a string value", name.data); return; } @@ -560,7 +562,7 @@ buf_T *find_buffer_by_handle(Buffer buffer, Error *err) buf_T *rv = handle_get_buffer(buffer); if (!rv) { - api_set_error(err, kErrorTypeValidation, _("Invalid buffer id")); + api_set_error(err, kErrorTypeValidation, "Invalid buffer id"); } return rv; @@ -575,7 +577,7 @@ win_T *find_window_by_handle(Window window, Error *err) win_T *rv = handle_get_window(window); if (!rv) { - api_set_error(err, kErrorTypeValidation, _("Invalid window id")); + api_set_error(err, kErrorTypeValidation, "Invalid window id"); } return rv; @@ -590,7 +592,7 @@ tabpage_T *find_tab_by_handle(Tabpage tabpage, Error *err) tabpage_T *rv = handle_get_tabpage(tabpage); if (!rv) { - api_set_error(err, kErrorTypeValidation, _("Invalid tabpage id")); + api_set_error(err, kErrorTypeValidation, "Invalid tabpage id"); } return rv; @@ -658,7 +660,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) case kObjectTypeInteger: if (obj.data.integer > VARNUMBER_MAX || obj.data.integer < VARNUMBER_MIN) { - api_set_error(err, kErrorTypeValidation, _("Integer value outside range")); + api_set_error(err, kErrorTypeValidation, "Integer value outside range"); return false; } @@ -713,7 +715,7 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) if (key.size == 0) { api_set_error(err, kErrorTypeValidation, - _("Empty dictionary keys aren't allowed")); + "Empty dictionary keys aren't allowed"); // cleanup tv_dict_free(dict); return false; @@ -938,7 +940,7 @@ static void set_option_value_for(char *key, } api_set_error(err, kErrorTypeException, - _("Problem while switching windows")); + "Problem while switching windows"); return; } set_option_value_err(key, numval, stringval, opt_flags, err); diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 26c0a8119b..f0da0d1812 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -55,13 +55,13 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, kErrorTypeException, _("UI already attached for channel")); + api_set_error(err, kErrorTypeException, "UI already attached for channel"); return; } if (width <= 0 || height <= 0) { api_set_error(err, kErrorTypeValidation, - _("Expected width > 0 and height > 0")); + "Expected width > 0 and height > 0"); return; } UI *ui = xcalloc(1, sizeof(UI)); @@ -126,7 +126,7 @@ void nvim_ui_detach(uint64_t channel_id, Error *err) FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, kErrorTypeException, _("UI is not attached for channel")); + api_set_error(err, kErrorTypeException, "UI is not attached for channel"); return; } remote_ui_disconnect(channel_id); @@ -138,13 +138,13 @@ void nvim_ui_try_resize(uint64_t channel_id, Integer width, FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, kErrorTypeException, _("UI is not attached for channel")); + api_set_error(err, kErrorTypeException, "UI is not attached for channel"); return; } if (width <= 0 || height <= 0) { api_set_error(err, kErrorTypeValidation, - _("Expected width > 0 and height > 0")); + "Expected width > 0 and height > 0"); return; } @@ -159,7 +159,7 @@ void nvim_ui_set_option(uint64_t channel_id, String name, FUNC_API_SINCE(1) FUNC_API_NOEVAL { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(error, kErrorTypeException, _("UI is not attached for channel")); + api_set_error(error, kErrorTypeException, "UI is not attached for channel"); return; } UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); @@ -173,19 +173,19 @@ void nvim_ui_set_option(uint64_t channel_id, String name, static void ui_set_option(UI *ui, String name, Object value, Error *error) { if (strcmp(name.data, "rgb") == 0) { if (value.type != kObjectTypeBoolean) { - api_set_error(error, kErrorTypeValidation, _("rgb must be a Boolean")); + api_set_error(error, kErrorTypeValidation, "rgb must be a Boolean"); return; } ui->rgb = value.data.boolean; } else if (strcmp(name.data, "popupmenu_external") == 0) { if (value.type != kObjectTypeBoolean) { api_set_error(error, kErrorTypeValidation, - _("popupmenu_external must be a Boolean")); + "popupmenu_external must be a Boolean"); return; } ui->pum_external = value.data.boolean; } else { - api_set_error(error, kErrorTypeValidation, _("No such ui option")); + api_set_error(error, kErrorTypeValidation, "No such ui option"); } } diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 16c630b0e6..da00fbc6e3 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -166,7 +166,7 @@ String nvim_command_output(String str, Error *err) do_cmdline_cmd("redir END"); if (ERROR_SET(err)) { - return (String) STRING_INIT; + return (String)STRING_INIT; } return cstr_to_string((char *)get_vim_var_str(VV_COMMAND_OUTPUT)); @@ -215,7 +215,7 @@ Object nvim_call_function(String fname, Array args, Error *err) Object rv = OBJECT_INIT; if (args.size > MAX_FUNC_ARGS) { api_set_error(err, kErrorTypeValidation, - _("Function called with too many arguments.")); + "Function called with too many arguments."); return rv; } @@ -237,7 +237,7 @@ Object nvim_call_function(String fname, Array args, Error *err) curwin->w_cursor.lnum, curwin->w_cursor.lnum, &dummy, true, NULL, NULL); if (r == FAIL) { - api_set_error(err, kErrorTypeException, _("Error calling function.")); + api_set_error(err, kErrorTypeException, "Error calling function."); } if (!try_end(err)) { rv = vim_to_object(&rettv); @@ -262,7 +262,7 @@ Integer nvim_strwidth(String str, Error *err) FUNC_API_SINCE(1) { if (str.size > INT_MAX) { - api_set_error(err, kErrorTypeValidation, _("String length is too high")); + api_set_error(err, kErrorTypeValidation, "String length is too high"); return 0; } @@ -318,7 +318,7 @@ void nvim_set_current_dir(String dir, Error *err) FUNC_API_SINCE(1) { if (dir.size >= MAXPATHL) { - api_set_error(err, kErrorTypeValidation, _("Directory string is too long")); + api_set_error(err, kErrorTypeValidation, "Directory string is too long"); return; } @@ -330,7 +330,7 @@ void nvim_set_current_dir(String dir, Error *err) if (vim_chdir((char_u *)string, kCdScopeGlobal)) { if (!try_end(err)) { - api_set_error(err, kErrorTypeException, _("Failed to change directory")); + api_set_error(err, kErrorTypeException, "Failed to change directory"); } return; } @@ -540,7 +540,7 @@ void nvim_set_current_buf(Buffer buffer, Error *err) if (!try_end(err) && result == FAIL) { api_set_error(err, kErrorTypeException, - _("Failed to switch to buffer %d"), + "Failed to switch to buffer %d", buffer); } } @@ -593,7 +593,7 @@ void nvim_set_current_win(Window window, Error *err) if (!try_end(err) && win != curwin) { api_set_error(err, kErrorTypeException, - _("Failed to switch to window %d"), + "Failed to switch to window %d", window); } } @@ -647,7 +647,7 @@ void nvim_set_current_tabpage(Tabpage tabpage, Error *err) if (!try_end(err) && tp != curtab) { api_set_error(err, kErrorTypeException, - _("Failed to switch to tabpage %d"), + "Failed to switch to tabpage %d", tabpage); } } @@ -746,21 +746,21 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) if (calls.items[i].type != kObjectTypeArray) { api_set_error(err, kErrorTypeValidation, - _("All items in calls array must be arrays")); + "All items in calls array must be arrays"); goto validation_error; } Array call = calls.items[i].data.array; if (call.size != 2) { api_set_error(err, kErrorTypeValidation, - _("All items in calls array must be arrays of size 2")); + "All items in calls array must be arrays of size 2"); goto validation_error; } if (call.items[0].type != kObjectTypeString) { api_set_error(err, kErrorTypeValidation, - _("name must be String")); + "Name must be String"); goto validation_error; } String name = call.items[0].data.string; @@ -768,7 +768,7 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) if (call.items[1].type != kObjectTypeArray) { api_set_error(err, kErrorTypeValidation, - _("args must be Array")); + "Args must be Array"); goto validation_error; } Array args = call.items[1].data.array; diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index dd52b2d690..859bf88398 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -66,7 +66,7 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) || pos.items[1].type != kObjectTypeInteger) { api_set_error(err, kErrorTypeValidation, - _("Argument \"pos\" must be a [row, col] array")); + "Argument \"pos\" must be a [row, col] array"); return; } @@ -78,12 +78,12 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) int64_t col = pos.items[1].data.integer; if (row <= 0 || row > win->w_buffer->b_ml.ml_line_count) { - api_set_error(err, kErrorTypeValidation, _("Cursor position outside buffer")); + api_set_error(err, kErrorTypeValidation, "Cursor position outside buffer"); return; } if (col > MAXCOL || col < 0) { - api_set_error(err, kErrorTypeValidation, _("Column value outside range")); + api_set_error(err, kErrorTypeValidation, "Column value outside range"); return; } @@ -132,7 +132,7 @@ void nvim_win_set_height(Window window, Integer height, Error *err) } if (height > INT_MAX || height < INT_MIN) { - api_set_error(err, kErrorTypeValidation, _("Height value outside range")); + api_set_error(err, kErrorTypeValidation, "Height value outside range"); return; } @@ -177,7 +177,7 @@ void nvim_win_set_width(Window window, Integer width, Error *err) } if (width > INT_MAX || width < INT_MIN) { - api_set_error(err, kErrorTypeValidation, _("Width value outside range")); + api_set_error(err, kErrorTypeValidation, "Width value outside range"); return; } diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 3cf85316d9..59594357de 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -192,7 +192,7 @@ Object channel_send_call(uint64_t id, Channel *channel = NULL; if (!(channel = pmap_get(uint64_t)(channels, id)) || channel->closed) { - api_set_error(err, kErrorTypeException, _("Invalid channel \"%" PRIu64 "\""), id); + api_set_error(err, kErrorTypeException, "Invalid channel: %" PRIu64, id); api_free_array(args); return NIL; } @@ -212,7 +212,8 @@ Object channel_send_call(uint64_t id, if (frame.errored) { if (frame.result.type == kObjectTypeString) { - api_set_error(err, kErrorTypeException, "%s", frame.result.data.string.data); + api_set_error(err, kErrorTypeException, "%s", + frame.result.data.string.data); } else if (frame.result.type == kObjectTypeArray) { // Should be an error in the form [type, message] Array array = frame.result.data.array; @@ -221,7 +222,7 @@ Object channel_send_call(uint64_t id, || array.items[0].data.integer == kErrorTypeValidation) && array.items[1].type == kObjectTypeString) { api_set_error(err, (ErrorType)array.items[0].data.integer, "%s", - array.items[1].data.string.data); + array.items[1].data.string.data); } else { api_set_error(err, kErrorTypeException, "%s", "unknown error"); } diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index 0ad1d9ae4b..0228582d37 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -570,49 +570,49 @@ void msgpack_rpc_validate(uint64_t *response_id, *response_id = NO_RESPONSE; // Validate the basic structure of the msgpack-rpc payload if (req->type != MSGPACK_OBJECT_ARRAY) { - api_set_error(err, kErrorTypeValidation, _("Message is not an array")); + api_set_error(err, kErrorTypeValidation, "Message is not an array"); return; } if (req->via.array.size == 0) { - api_set_error(err, kErrorTypeValidation, _("Message is empty")); + api_set_error(err, kErrorTypeValidation, "Message is empty"); return; } if (req->via.array.ptr[0].type != MSGPACK_OBJECT_POSITIVE_INTEGER) { - api_set_error(err, kErrorTypeValidation, _("Message type must be an integer")); + api_set_error(err, kErrorTypeValidation, "Message type must be an integer"); return; } uint64_t type = req->via.array.ptr[0].via.u64; if (type != kMessageTypeRequest && type != kMessageTypeNotification) { - api_set_error(err, kErrorTypeValidation, _("Unknown message type")); + api_set_error(err, kErrorTypeValidation, "Unknown message type"); return; } if ((type == kMessageTypeRequest && req->via.array.size != 4) || (type == kMessageTypeNotification && req->via.array.size != 3)) { - api_set_error(err, kErrorTypeValidation, _("Request array size should be 4 (request) " - "or 3 (notification)")); + api_set_error(err, kErrorTypeValidation, + "Request array size must be 4 (request) or 3 (notification)"); return; } if (type == kMessageTypeRequest) { msgpack_object *id_obj = msgpack_rpc_msg_id(req); if (!id_obj) { - api_set_error(err, kErrorTypeValidation, _("ID must be a positive integer")); + api_set_error(err, kErrorTypeValidation, "ID must be a positive integer"); return; } *response_id = id_obj->via.u64; } if (!msgpack_rpc_method(req)) { - api_set_error(err, kErrorTypeValidation, _("Method must be a string")); + api_set_error(err, kErrorTypeValidation, "Method must be a string"); return; } if (!msgpack_rpc_args(req)) { - api_set_error(err, kErrorTypeValidation, _("Parameters must be an array")); + api_set_error(err, kErrorTypeValidation, "Parameters must be an array"); return; } } diff --git a/src/nvim/po/fi.po b/src/nvim/po/fi.po index d817144151..3551c07ff2 100644 --- a/src/nvim/po/fi.po +++ b/src/nvim/po/fi.po @@ -116,7 +116,7 @@ msgstr "merkkijono ei saa sisältää rivinvaihtoja" #. Doesn't exist, fail #, fuzzy, c-format -#~ msgid "Key \"%s\" doesn't exist" +#~ msgid "Key does not exist: %s" #~ msgstr "Tiedostoa %s ei ole" #, fuzzy @@ -3986,7 +3986,7 @@ msgid "Calling shell to execute: \"%s\"" msgstr "Kutsutaan kuorta suorittamaan: %s" #, c-format -#~ msgid "Invalid channel \"%\"" +#~ msgid "Invalid channel: %" #~ msgstr "" #~ msgid "Message is not an array" @@ -4003,7 +4003,7 @@ msgstr "Kutsutaan kuorta suorittamaan: %s" #~ msgid "Unknown message type" #~ msgstr "E574: Tuntematon rekisterityyppi %d" -#~ msgid "Request array size should be 4 (request) or 3 (notification)" +#~ msgid "Request array size must be 4 (request) or 3 (notification)" #~ msgstr "" #~ msgid "ID must be a positive integer" diff --git a/src/nvim/po/uk.po b/src/nvim/po/uk.po index cff140508b..2c203f808f 100644 --- a/src/nvim/po/uk.po +++ b/src/nvim/po/uk.po @@ -82,7 +82,7 @@ msgid "Key length is too high" msgstr "Довжина ключа завелика" #, c-format -msgid "Key \"%s\" doesn't exist" +msgid "Key does not exist: %s" msgstr "Ключ «%s» не існує" msgid "Empty option name" @@ -3719,7 +3719,7 @@ msgid "Calling shell to execute: \"%s\"" msgstr "Викликається оболонка щоб виконати: «%s»" #, c-format -msgid "Invalid channel \"%\"" +msgid "Invalid channel: %" msgstr "Некоректний канал «%»" msgid "Message is not an array" @@ -3734,7 +3734,7 @@ msgstr "Повідомлення має бути цілим числом" msgid "Unknown message type" msgstr "Невідомий тип повідомлення" -msgid "Request array size should be 4 (request) or 3 (notification)" +msgid "Request array size must be 4 (request) or 3 (notification)" msgstr "Розмір масиву запиту має бути 4 (запит) чи 3 (повідомлення)" msgid "ID must be a positive integer" diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua index c3002618b0..9699ea8f85 100644 --- a/test/functional/api/buffer_spec.lua +++ b/test/functional/api/buffer_spec.lua @@ -271,7 +271,7 @@ describe('api/buf', function() eq(1, funcs.exists('b:lua')) curbufmeths.del_var('lua') eq(0, funcs.exists('b:lua')) - eq({false, 'Key "lua" doesn\'t exist'}, meth_pcall(curbufmeths.del_var, 'lua')) + eq({false, 'Key does not exist: lua'}, meth_pcall(curbufmeths.del_var, 'lua')) curbufmeths.set_var('lua', 1) command('lockvar b:lua') eq({false, 'Key is locked: lua'}, meth_pcall(curbufmeths.del_var, 'lua')) diff --git a/test/functional/api/tabpage_spec.lua b/test/functional/api/tabpage_spec.lua index d7ef53a88f..260a91a80c 100644 --- a/test/functional/api/tabpage_spec.lua +++ b/test/functional/api/tabpage_spec.lua @@ -34,7 +34,7 @@ describe('api/tabpage', function() eq(1, funcs.exists('t:lua')) curtabmeths.del_var('lua') eq(0, funcs.exists('t:lua')) - eq({false, 'Key "lua" doesn\'t exist'}, meth_pcall(curtabmeths.del_var, 'lua')) + eq({false, 'Key does not exist: lua'}, meth_pcall(curtabmeths.del_var, 'lua')) curtabmeths.set_var('lua', 1) command('lockvar t:lua') eq({false, 'Key is locked: lua'}, meth_pcall(curtabmeths.del_var, 'lua')) diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 60f30dcfe6..5b173f3196 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -119,7 +119,7 @@ describe('api', function() eq(1, funcs.exists('g:lua')) meths.del_var('lua') eq(0, funcs.exists('g:lua')) - eq({false, 'Key "lua" doesn\'t exist'}, meth_pcall(meths.del_var, 'lua')) + eq({false, 'Key does not exist: lua'}, meth_pcall(meths.del_var, 'lua')) meths.set_var('lua', 1) command('lockvar lua') eq({false, 'Key is locked: lua'}, meth_pcall(meths.del_var, 'lua')) @@ -439,7 +439,7 @@ describe('api', function() } status, err = pcall(meths.call_atomic, req) eq(false, status) - ok(err:match('args must be Array') ~= nil) + ok(err:match('Args must be Array') ~= nil) -- call before was done, but not after eq(1, meths.get_var('avar')) eq({''}, meths.buf_get_lines(0, 0, -1, true)) diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index deffc68994..6882f50a3e 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -139,7 +139,7 @@ describe('api/win', function() eq(1, funcs.exists('w:lua')) curwinmeths.del_var('lua') eq(0, funcs.exists('w:lua')) - eq({false, 'Key "lua" doesn\'t exist'}, meth_pcall(curwinmeths.del_var, 'lua')) + eq({false, 'Key does not exist: lua'}, meth_pcall(curwinmeths.del_var, 'lua')) curwinmeths.set_var('lua', 1) command('lockvar w:lua') eq({false, 'Key is locked: lua'}, meth_pcall(curwinmeths.del_var, 'lua')) From 8dc3eca49ba4203fb28ae4d70f3bfac35442199a Mon Sep 17 00:00:00 2001 From: Patrick Jackson Date: Mon, 24 Apr 2017 03:39:48 -0700 Subject: [PATCH 153/257] api/dispatch: Mark generated functions table readonly (#6576) --- scripts/geneval.lua | 1 + src/nvim/eval.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/geneval.lua b/scripts/geneval.lua index b1ba76296c..b17ecb1a0c 100644 --- a/scripts/geneval.lua +++ b/scripts/geneval.lua @@ -41,6 +41,7 @@ funcsdata:close() gperfpipe:write([[ %language=ANSI-C %global-table +%readonly-tables %define initializer-suffix ,0,0,NULL,NULL %define word-array-name functions %define hash-function-name hash_internal_func_gperf diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d7feed8bfd..c02d172458 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6009,7 +6009,7 @@ char_u *get_expr_name(expand_T *xp, int idx) /// @param[in] name Name of the function. /// /// Returns pointer to the function definition or NULL if not found. -static VimLFuncDef *find_internal_func(const char *const name) +static const VimLFuncDef *find_internal_func(const char *const name) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE FUNC_ATTR_NONNULL_ALL { size_t len = strlen(name); @@ -6378,7 +6378,7 @@ call_func( } } else { // Find the function name in the table, call its implementation. - VimLFuncDef *const fdef = find_internal_func((const char *)fname); + const VimLFuncDef *const fdef = find_internal_func((const char *)fname); if (fdef != NULL) { if (argcount < fdef->min_argc) { error = ERROR_TOOFEW; From 26fad863bad65ab66ca34b0879b13868d8aa0d97 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 24 Apr 2017 18:27:33 +0300 Subject: [PATCH 154/257] ci: When using restarting tests kill make with the shell --- ci/common/suite.sh | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 568d5d5bee..75bdb5abfb 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -82,21 +82,27 @@ run_test_wd() { local output_file="$(mktemp)" local status_file="$(mktemp)" + local sid_file="$(mktemp)" local restarts=5 local prev_tmpsize=-1 while test $restarts -gt 0 ; do : > "${status_file}" - ( - set -o pipefail - ret=0 - if ! eval "$cmd" 2>&1 | tee -a "$output_file" ; then - ret=1 - fi - echo "$ret" > "$status_file" - exit $ret - ) & - local pid=$! + setsid \ + env \ + output_file="$output_file" \ + status_file="$status_file" \ + sid_file="$sid_file" \ + cmd="$cmd" \ + sh -c ' + set -o pipefail + ps -o sid= > "$sid_file" + ret=0 + if ! eval "$cmd" 2>&1 | tee -a "$output_file" ; then + ret=1 + fi + echo "$ret" > "$status_file" + ' while test "$(stat -c "%s" "$status_file")" -eq 0 ; do prev_tmpsize=$tmpsize sleep $timeout @@ -106,13 +112,13 @@ run_test_wd() { break fi done - restarts=$[ restarts - 1 ] + restarts=$(( restarts - 1 )) if test "$(stat -c "%s" "$status_file")" -eq 0 ; then # status file not updated, assuming hang - kill -KILL $pid + pkill -KILL -s$(cat "$sid_file") if test $restarts -eq 0 ; then if test "x$hang_ok" = "x" ; then - fail "${test_name}" E "Test hang up" + fail "$test_name" E "Test hang up" fi else echo "Test ${test_name} hang up, restarting" @@ -121,11 +127,15 @@ run_test_wd() { else local new_failed="$(cat "$status_file")" if test "x$new_failed" != "x0" ; then - fail "${test_name}" F "Test failed in run_test_wd" + fail "$test_name" F "Test failed in run_test_wd" fi - return 0 + break fi done + + rm -f "$output_file" + rm -f "$status_file" + rm -f "$sid_file" } ended_successfully() { From 3a0117c850a69b70bf2a39e9f2e61220a1e7f228 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 24 Apr 2017 18:34:47 +0300 Subject: [PATCH 155/257] ci: Do not accidentally kill something unneeded --- ci/common/suite.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 75bdb5abfb..986c145736 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -87,7 +87,8 @@ run_test_wd() { local restarts=5 local prev_tmpsize=-1 while test $restarts -gt 0 ; do - : > "${status_file}" + : > "$status_file" + : > "$sid_file" setsid \ env \ output_file="$output_file" \ @@ -114,8 +115,18 @@ run_test_wd() { done restarts=$(( restarts - 1 )) if test "$(stat -c "%s" "$status_file")" -eq 0 ; then - # status file not updated, assuming hang + # Status file not updated, assuming hang + + # SID not known, this should not ever happen + if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then + fail "$test_name" E "Shell did not run" + break + fi + + # Kill all processes which belong to one session: should get rid of test + # processes as well as sh itself. pkill -KILL -s$(cat "$sid_file") + if test $restarts -eq 0 ; then if test "x$hang_ok" = "x" ; then fail "$test_name" E "Test hang up" From fc16d02c3dc8482fb41501f834083146680f41f8 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 24 Apr 2017 19:30:28 +0300 Subject: [PATCH 156/257] ci: Do not use pipefail --- ci/common/suite.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 986c145736..4fa8256ee8 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -96,7 +96,6 @@ run_test_wd() { sid_file="$sid_file" \ cmd="$cmd" \ sh -c ' - set -o pipefail ps -o sid= > "$sid_file" ret=0 if ! eval "$cmd" 2>&1 | tee -a "$output_file" ; then From 4ccef05829bc9956207299215672c2e8c3e51c43 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 24 Apr 2017 21:43:27 +0300 Subject: [PATCH 157/257] ci: Make $cmd failure fail the build without -o pipefail --- ci/common/suite.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 4fa8256ee8..c4120c8584 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -97,11 +97,13 @@ run_test_wd() { cmd="$cmd" \ sh -c ' ps -o sid= > "$sid_file" - ret=0 - if ! eval "$cmd" 2>&1 | tee -a "$output_file" ; then - ret=1 - fi - echo "$ret" > "$status_file" + ( + ret=0 + if ! eval "$cmd" 2>&1 ; then + ret=1 + fi + echo "$ret" > "$status_file" + ) | tee -a "$output_file" ' while test "$(stat -c "%s" "$status_file")" -eq 0 ; do prev_tmpsize=$tmpsize From 85903cb0e6a2428c5a071ed78b12a9f95e56792b Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 24 Apr 2017 22:14:32 +0300 Subject: [PATCH 158/257] ci: Make scripts in common be dash-compatible `ulimit` may still be not present: dash and busybox support it, but posh does not. --- ci/common/build.sh | 31 ++++++++++---------- ci/common/suite.sh | 4 +-- ci/common/test.sh | 72 +++++++++++++++++++++++++++++----------------- 3 files changed, 62 insertions(+), 45 deletions(-) diff --git a/ci/common/build.sh b/ci/common/build.sh index 129622b522..56c24bb3fb 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -7,10 +7,10 @@ build_make() { } build_deps() { - if [[ "${BUILD_32BIT}" == ON ]]; then + if test "x${BUILD_32BIT}" = xON ; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" fi - if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then + if test "x${FUNCTIONALTEST}" = "xfunctionaltest-lua" ; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON" fi @@ -18,16 +18,15 @@ build_deps() { # If there is a valid cache and we're not forced to recompile, # use cached third-party dependencies. - if [[ -f "${CACHE_MARKER}" ]] && [[ "${BUILD_NVIM_DEPS}" != true ]]; then - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - local statcmd="stat -f '%Sm'" - else - local statcmd="stat -c '%y'" + if test -f "${CACHE_MARKER}" && test "x${BUILD_NVIM_DEPS}" != xtrue ; then + local statcmd="stat -c '%y'" + if test "x${TRAVIS_OS_NAME}" = xosx ; then + statcmd="stat -f '%Sm'" fi echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))." - mkdir -p "$(dirname "${DEPS_BUILD_DIR}")" - mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}" + mkdir -p "$(dirname "${DEPS_BUILD_DIR}")" + mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}" else mkdir -p "${DEPS_BUILD_DIR}" fi @@ -46,10 +45,10 @@ build_deps() { } prepare_build() { - if [[ -n "${CLANG_SANITIZER}" ]]; then + if test -n "${CLANG_SANITIZER}" ; then CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON" fi - if [[ "${BUILD_32BIT}" == ON ]]; then + if test "x${BUILD_32BIT}" = xON ; then CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" fi @@ -61,24 +60,24 @@ prepare_build() { build_nvim() { echo "Building nvim." - if ! top_make nvim; then + if ! top_make nvim ; then exit 1 fi - if [ "$CLANG_SANITIZER" != "TSAN" ]; then + if test "x$CLANG_SANITIZER" != xTSAN ; then echo "Building libnvim." - if ! top_make libnvim; then + if ! top_make libnvim ; then exit 1 fi echo "Building nvim-test." - if ! top_make nvim-test; then + if ! top_make nvim-test ; then exit 1 fi fi # Invoke nvim to trigger *San early. - if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall'); then + if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall') ; then asan_check "${LOG_DIR}" exit 1 fi diff --git a/ci/common/suite.sh b/ci/common/suite.sh index c4120c8584..9eba5ca664 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -151,12 +151,12 @@ run_test_wd() { } ended_successfully() { - if [[ -f "${FAIL_SUMMARY_FILE}" ]]; then + if test -f "${FAIL_SUMMARY_FILE}" ; then echo 'Test failed, complete summary:' cat "${FAIL_SUMMARY_FILE}" return 1 fi - if ! [[ -f "${END_MARKER}" ]] ; then + if ! test -f "${END_MARKER}" ; then echo 'ended_successfully called before end marker was touched' return 1 fi diff --git a/ci/common/test.sh b/ci/common/test.sh index d911d9bc18..0958e0505d 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -1,5 +1,5 @@ -source "${CI_DIR}/common/build.sh" -source "${CI_DIR}/common/suite.sh" +. "${CI_DIR}/common/build.sh" +. "${CI_DIR}/common/suite.sh" print_core() { local app="$1" @@ -9,7 +9,7 @@ print_core() { return 0 fi echo "======= Core file $core =======" - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then + if test "x${TRAVIS_OS_NAME}" = xosx ; then lldb -Q -o "bt all" -f "${app}" -c "${core}" else gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}" @@ -23,13 +23,13 @@ check_core_dumps() { shift fi local app="${1:-${BUILD_DIR}/bin/nvim}" - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then + if test "x${TRAVIS_OS_NAME}" = xosx ; then local cores="$(find /cores/ -type f -print)" else local cores="$(find ./ -type f -name 'core.*' -print)" fi - if [ -z "${cores}" ]; then + if test -z "${cores}" ; then return fi local core @@ -61,7 +61,7 @@ check_logs() { cat "${log}" err=1 done - if [[ -n "${err}" ]]; then + if test -n "${err}" ; then fail 'logs' E 'Runtime errors detected.' fi } @@ -76,7 +76,7 @@ asan_check() { run_unittests() {( enter_suite unittests - ulimit -c unlimited + ulimit -c unlimited || true if ! build_make unittest ; then fail 'unittests' F 'Unit tests failed' fi @@ -86,7 +86,7 @@ run_unittests() {( run_functionaltests() {( enter_suite functionaltests - ulimit -c unlimited + ulimit -c unlimited || true if ! build_make ${FUNCTIONALTEST}; then fail 'functionaltests' F 'Functional tests failed' fi @@ -98,7 +98,7 @@ run_functionaltests() {( run_oldtests() {( enter_suite oldtests - ulimit -c unlimited + ulimit -c unlimited || true if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then reset fail 'oldtests' F 'Legacy tests failed' @@ -109,6 +109,26 @@ run_oldtests() {( exit_suite )} +check_runtime_files() {( + local test_name="$1" ; shift + local message="$1" ; shift + local tst="$1" ; shift + + cd runtime + for file in $(git ls-files "$@") ; do + # Check that test is not trying to work with files with spaces/etc + # Prefer failing the build over using more robust construct because files + # with IFS are not welcome. + if ! test -e "$file" ; then + fail "$test_name" E \ + "It appears that $file is only a part of the file name" + fi + if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then + fail "$test_name" F "$(printf "$message" "$file")" + fi + done +)} + install_nvim() {( enter_suite 'install_nvim' if ! build_make install ; then @@ -117,34 +137,32 @@ install_nvim() {( fi "${INSTALL_PREFIX}/bin/nvim" --version - "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' || { + if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then echo "Running ':help' in the installed nvim failed." echo "Maybe the helptags have not been generated properly." fail 'help' F 'Failed running :help' - } + fi - local genvimsynf=syntax/vim/generated.vim # Check that all runtime files were installed - for file in doc/tags $genvimsynf $( - cd runtime ; git ls-files | grep -e '.vim$' -e '.ps$' -e '.dict$' -e '.py$' -e '.tutor$' - ) ; do - if ! test -e "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then - fail 'runtime-install' F "It appears that $file is not installed." - fi - done + check_runtime_files \ + 'runtime-install' \ + 'It appears that %s is not installed.' \ + -e \ + '*.vim' '*.ps' '*.dict' '*.py' '*.tutor' + + # Check that some runtime files are installed and are executables + check_runtime_files \ + 'not-exe' \ + 'It appears that %s is not installed or is not executable.' \ + -x \ + '*.awk' '*.sh' '*.bat' # Check that generated syntax file has function names, #5060. + local genvimsynf=syntax/vim/generated.vim local gpat='syn keyword vimFuncName .*eval' - if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf"; then + if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat." fi - for file in $( - cd runtime ; git ls-files | grep -e '.awk$' -e '.sh$' -e '.bat$' - ) ; do - if ! test -x "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then - fail 'not-exe' F "It appears that $file is not installed or is not executable." - fi - done exit_suite )} From 74d5705ca9de7ce0a1edef65590594a55c1a4ea3 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 24 Apr 2017 22:17:34 +0300 Subject: [PATCH 159/257] ci: Source ci/common/test.sh in run_test_wd subshell --- ci/common/suite.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 9eba5ca664..860e7f79ea 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -95,7 +95,9 @@ run_test_wd() { status_file="$status_file" \ sid_file="$sid_file" \ cmd="$cmd" \ + CI_DIR="$CI_DIR" \ sh -c ' + . "${CI_DIR}/common/test.sh" ps -o sid= > "$sid_file" ( ret=0 From ee4daa65723df100ce58d132243747aad48d4f12 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 24 Apr 2017 23:11:13 +0300 Subject: [PATCH 160/257] ci: Remove `x` from `test x` --- ci/common/build.sh | 12 ++++++------ ci/common/suite.sh | 8 ++++---- ci/common/test.sh | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ci/common/build.sh b/ci/common/build.sh index 56c24bb3fb..8c2406698a 100644 --- a/ci/common/build.sh +++ b/ci/common/build.sh @@ -7,10 +7,10 @@ build_make() { } build_deps() { - if test "x${BUILD_32BIT}" = xON ; then + if test "${BUILD_32BIT}" = ON ; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" fi - if test "x${FUNCTIONALTEST}" = "xfunctionaltest-lua" ; then + if test "${FUNCTIONALTEST}" = "functionaltest-lua" ; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON" fi @@ -18,9 +18,9 @@ build_deps() { # If there is a valid cache and we're not forced to recompile, # use cached third-party dependencies. - if test -f "${CACHE_MARKER}" && test "x${BUILD_NVIM_DEPS}" != xtrue ; then + if test -f "${CACHE_MARKER}" && test "${BUILD_NVIM_DEPS}" != "true" ; then local statcmd="stat -c '%y'" - if test "x${TRAVIS_OS_NAME}" = xosx ; then + if test "${TRAVIS_OS_NAME}" = osx ; then statcmd="stat -f '%Sm'" fi echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))." @@ -48,7 +48,7 @@ prepare_build() { if test -n "${CLANG_SANITIZER}" ; then CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON" fi - if test "x${BUILD_32BIT}" = xON ; then + if test "${BUILD_32BIT}" = ON ; then CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" fi @@ -64,7 +64,7 @@ build_nvim() { exit 1 fi - if test "x$CLANG_SANITIZER" != xTSAN ; then + if test "$CLANG_SANITIZER" != "TSAN" ; then echo "Building libnvim." if ! top_make libnvim ; then exit 1 diff --git a/ci/common/suite.sh b/ci/common/suite.sh index 860e7f79ea..a6fe7dd650 100644 --- a/ci/common/suite.sh +++ b/ci/common/suite.sh @@ -24,7 +24,7 @@ exit_suite() { echo "${FAIL_SUMMARY}" fi export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}" - if test "x$1" != "x--continue" ; then + if test "$1" != "--continue" ; then exit $FAILED else local saved_failed=$FAILED @@ -61,7 +61,7 @@ run_test() { run_test_wd() { local hang_ok= - if test "x$1" = "x--allow-hang" ; then + if test "$1" = "--allow-hang" ; then hang_ok=1 shift fi @@ -131,7 +131,7 @@ run_test_wd() { pkill -KILL -s$(cat "$sid_file") if test $restarts -eq 0 ; then - if test "x$hang_ok" = "x" ; then + if test -z "$hang_ok" ; then fail "$test_name" E "Test hang up" fi else @@ -140,7 +140,7 @@ run_test_wd() { fi else local new_failed="$(cat "$status_file")" - if test "x$new_failed" != "x0" ; then + if test "$new_failed" != "0" ; then fail "$test_name" F "Test failed in run_test_wd" fi break diff --git a/ci/common/test.sh b/ci/common/test.sh index 0958e0505d..a4b7680830 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -9,7 +9,7 @@ print_core() { return 0 fi echo "======= Core file $core =======" - if test "x${TRAVIS_OS_NAME}" = xosx ; then + if test "${TRAVIS_OS_NAME}" = osx ; then lldb -Q -o "bt all" -f "${app}" -c "${core}" else gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}" @@ -23,7 +23,7 @@ check_core_dumps() { shift fi local app="${1:-${BUILD_DIR}/bin/nvim}" - if test "x${TRAVIS_OS_NAME}" = xosx ; then + if test "${TRAVIS_OS_NAME}" = osx ; then local cores="$(find /cores/ -type f -print)" else local cores="$(find ./ -type f -name 'core.*' -print)" From 8f346a322bc18949ae256203ffa801d7ba1dd1c0 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 24 Apr 2017 22:45:03 +0200 Subject: [PATCH 161/257] test/fs: sanity check for literal "~" directory (#6579) If the CWD contains a directory with the literal name "~" then the tests will have bogus failures. --- src/nvim/os/fs.c | 4 +- test/unit/os/fs_spec.lua | 52 +++++++++++++++----------- test/unit/path_spec.lua | 81 ++++++++++++++++++++-------------------- 3 files changed, 73 insertions(+), 64 deletions(-) diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index c39ff5d358..aaa750db50 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -61,9 +61,9 @@ void fs_init(void) } -/// Change to the given directory. +/// Changes the current directory to `path`. /// -/// @return `0` on success, a libuv error code on failure. +/// @return 0 on success, or negative error code. int os_chdir(const char *path) FUNC_ATTR_NONNULL_ALL { diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua index 860ebfdbcb..23eb05b4b8 100644 --- a/test/unit/os/fs_spec.lua +++ b/test/unit/os/fs_spec.lua @@ -35,7 +35,6 @@ for i = 0, 255 do end local fcontents = s:rep(16) -local buffer = "" local directory = nil local absolute_executable = nil local executable_name = nil @@ -65,7 +64,11 @@ local function os_getperm(filename) return tonumber(perm) end -describe('fs function', function() +describe('fs.c', function() + local function os_isdir(name) + return fs.os_isdir(to_cstr(name)) + end + before_each(function() lfs.mkdir('unit-test-directory'); @@ -91,32 +94,37 @@ describe('fs function', function() end) describe('os_dirname', function() - local length - - local function os_dirname(buf, len) - return fs.os_dirname(buf, len) - end - - before_each(function() - length = (string.len(lfs.currentdir())) + 1 - buffer = cstr(length, '') + itp('returns OK and writes current directory to the buffer', function() + local length = string.len(lfs.currentdir()) + 1 + local buf = cstr(length, '') + eq(OK, fs.os_dirname(buf, length)) + eq(lfs.currentdir(), ffi.string(buf)) end) - itp('returns OK and writes current directory into the buffer if it is large\n enough', function() - eq(OK, (os_dirname(buffer, length))) - eq(lfs.currentdir(), (ffi.string(buffer))) - end) - - -- What kind of other failing cases are possible? itp('returns FAIL if the buffer is too small', function() - local buf = cstr((length - 1), '') - eq(FAIL, (os_dirname(buf, (length - 1)))) + local length = string.len(lfs.currentdir()) + 1 + local buf = cstr(length - 1, '') + eq(FAIL, fs.os_dirname(buf, length - 1)) end) end) - local function os_isdir(name) - return fs.os_isdir((to_cstr(name))) - end + describe('os_chdir', function() + itp('fails with path="~"', function() + eq(false, os_isdir('~')) -- sanity check: no literal "~" directory. + local length = 4096 + local expected_cwd = cstr(length, '') + local cwd = cstr(length, '') + eq(OK, fs.os_dirname(expected_cwd, length)) + + -- os_chdir returns 0 for success, not OK (1). + neq(0, fs.os_chdir('~')) -- fail + neq(0, fs.os_chdir('~/')) -- fail + + eq(OK, fs.os_dirname(cwd, length)) + -- CWD did not change. + eq(ffi.string(expected_cwd), ffi.string(cwd)) + end) + end) describe('os_isdir', function() itp('returns false if an empty string is given', function() diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua index 470f971e68..6b9e2c8695 100644 --- a/test/unit/path_spec.lua +++ b/test/unit/path_spec.lua @@ -13,7 +13,7 @@ local OK = helpers.OK local FAIL = helpers.FAIL cimport('string.h') -local path = cimport('./src/nvim/path.h') +local cimp = cimport('./src/nvim/os/os.h', './src/nvim/path.h') local length = 0 local buffer = nil @@ -30,7 +30,7 @@ describe('path function', function() local function path_full_dir_name(directory, buf, len) directory = to_cstr(directory) - return path.path_full_dir_name(directory, buf, len) + return cimp.path_full_dir_name(directory, buf, len) end before_each(function() @@ -69,7 +69,7 @@ describe('path function', function() local function path_full_compare(s1, s2, cn) s1 = to_cstr(s1) s2 = to_cstr(s2) - return path.path_full_compare(s1, s2, cn or 0) + return cimp.path_full_compare(s1, s2, cn or 0) end local f1 = 'f1.o' @@ -86,31 +86,31 @@ describe('path function', function() end) itp('returns kEqualFiles when passed the same file', function() - eq(path.kEqualFiles, (path_full_compare(f1, f1))) + eq(cimp.kEqualFiles, (path_full_compare(f1, f1))) end) itp('returns kEqualFileNames when files that dont exist and have same name', function() - eq(path.kEqualFileNames, (path_full_compare('null.txt', 'null.txt', true))) + eq(cimp.kEqualFileNames, (path_full_compare('null.txt', 'null.txt', true))) end) itp('returns kBothFilesMissing when files that dont exist', function() - eq(path.kBothFilesMissing, (path_full_compare('null.txt', 'null.txt'))) + eq(cimp.kBothFilesMissing, (path_full_compare('null.txt', 'null.txt'))) end) itp('returns kDifferentFiles when passed different files', function() - eq(path.kDifferentFiles, (path_full_compare(f1, f2))) - eq(path.kDifferentFiles, (path_full_compare(f2, f1))) + eq(cimp.kDifferentFiles, (path_full_compare(f1, f2))) + eq(cimp.kDifferentFiles, (path_full_compare(f2, f1))) end) itp('returns kOneFileMissing if only one does not exist', function() - eq(path.kOneFileMissing, (path_full_compare(f1, 'null.txt'))) - eq(path.kOneFileMissing, (path_full_compare('null.txt', f1))) + eq(cimp.kOneFileMissing, (path_full_compare(f1, 'null.txt'))) + eq(cimp.kOneFileMissing, (path_full_compare('null.txt', f1))) end) end) describe('path_tail', function() local function path_tail(file) - local res = path.path_tail((to_cstr(file))) + local res = cimp.path_tail((to_cstr(file))) neq(NULL, res) return ffi.string(res) end @@ -126,7 +126,7 @@ describe('path function', function() describe('path_tail_with_sep', function() local function path_tail_with_sep(file) - local res = path.path_tail_with_sep((to_cstr(file))) + local res = cimp.path_tail_with_sep((to_cstr(file))) neq(NULL, res) return ffi.string(res) end @@ -159,11 +159,11 @@ describe('path function', function() -- strcmp. local function invocation_path_tail(invk) local plen = ffi.new('size_t[?]', 1) - local ptail = path.invocation_path_tail((to_cstr(invk)), plen) + local ptail = cimp.invocation_path_tail((to_cstr(invk)), plen) neq(NULL, ptail) -- it does not change the output if len==NULL - local tail2 = path.invocation_path_tail((to_cstr(invk)), NULL) + local tail2 = cimp.invocation_path_tail((to_cstr(invk)), NULL) neq(NULL, tail2) eq((ffi.string(ptail)), (ffi.string(tail2))) return ptail, plen[0] @@ -204,7 +204,7 @@ describe('path function', function() end) itp('is equivalent to path_tail when args do not contain a path separator', function() - local ptail = path.path_tail(to_cstr("a/b/c x y z")) + local ptail = cimp.path_tail(to_cstr("a/b/c x y z")) neq(NULL, ptail) local tail = ffi.string(ptail) local invk, _ = invocation_path_tail("a/b/c x y z") @@ -212,7 +212,7 @@ describe('path function', function() end) itp('is not equivalent to path_tail when args contain a path separator', function() - local ptail = path.path_tail(to_cstr("a/b/c x y/z")) + local ptail = cimp.path_tail(to_cstr("a/b/c x y/z")) neq(NULL, ptail) local invk, _ = invocation_path_tail("a/b/c x y/z") neq((ffi.string(ptail)), (ffi.string(invk))) @@ -221,7 +221,7 @@ describe('path function', function() describe('path_next_component', function() local function path_next_component(file) - local res = path.path_next_component((to_cstr(file))) + local res = cimp.path_next_component((to_cstr(file))) neq(NULL, res) return ffi.string(res) end @@ -238,25 +238,25 @@ describe('path function', function() describe('path_shorten_fname', function() itp('returns NULL if `full_path` is NULL', function() local dir = to_cstr('some/directory/file.txt') - eq(NULL, (path.path_shorten_fname(NULL, dir))) + eq(NULL, (cimp.path_shorten_fname(NULL, dir))) end) itp('returns NULL if the path and dir does not match', function() local dir = to_cstr('not/the/same') local full = to_cstr('as/this.txt') - eq(NULL, (path.path_shorten_fname(full, dir))) + eq(NULL, (cimp.path_shorten_fname(full, dir))) end) itp('returns NULL if the path is not separated properly', function() local dir = to_cstr('some/very/long/') local full = to_cstr('some/very/long/directory/file.txt') - eq(NULL, (path.path_shorten_fname(full, dir))) + eq(NULL, (cimp.path_shorten_fname(full, dir))) end) itp('shortens the filename if `dir_name` is the start of `full_path`', function() local full = to_cstr('some/very/long/directory/file.txt') local dir = to_cstr('some/very/long') - eq('directory/file.txt', (ffi.string(path.path_shorten_fname(full, dir)))) + eq('directory/file.txt', (ffi.string(cimp.path_shorten_fname(full, dir)))) end) end) end) @@ -277,23 +277,23 @@ describe('path_shorten_fname_if_possible', function() itp('returns shortened path if possible', function() lfs.chdir('ut_directory') local full = to_cstr(lfs.currentdir() .. '/subdir/file.txt') - eq('subdir/file.txt', (ffi.string(path.path_shorten_fname_if_possible(full)))) + eq('subdir/file.txt', (ffi.string(cimp.path_shorten_fname_if_possible(full)))) end) itp('returns `full_path` if a shorter version is not possible', function() local old = lfs.currentdir() lfs.chdir('ut_directory') local full = old .. '/subdir/file.txt' - eq(full, (ffi.string(path.path_shorten_fname_if_possible(to_cstr(full))))) + eq(full, (ffi.string(cimp.path_shorten_fname_if_possible(to_cstr(full))))) end) itp('returns NULL if `full_path` is NULL', function() - eq(NULL, (path.path_shorten_fname_if_possible(NULL))) + eq(NULL, (cimp.path_shorten_fname_if_possible(NULL))) end) end) end) -describe('more path function', function() +describe('path.c', function() setup(function() lfs.mkdir('unit-test-directory'); io.open('unit-test-directory/test.file', 'w').close() @@ -315,7 +315,7 @@ describe('more path function', function() describe('vim_FullName', function() local function vim_FullName(filename, buf, len, force) filename = to_cstr(filename) - return path.vim_FullName(filename, buf, len, force) + return cimp.vim_FullName(filename, buf, len, force) end before_each(function() @@ -326,7 +326,7 @@ describe('more path function', function() itp('fails if given filename is NULL', function() local force_expansion = 1 - local result = path.vim_FullName(NULL, buffer, length, force_expansion) + local result = cimp.vim_FullName(NULL, buffer, length, force_expansion) eq(FAIL, result) end) @@ -335,7 +335,7 @@ describe('more path function', function() local filename = 'foo/bar/bazzzzzzz/buz/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/a' local too_short_len = 8 local buf = cstr(too_short_len, '') - local result = path.vim_FullName(filename, buf, too_short_len, force_expansion) + local result = cimp.vim_FullName(filename, buf, too_short_len, force_expansion) local expected = string.sub(filename, 1, (too_short_len - 1)) eq(expected, (ffi.string(buf))) eq(FAIL, result) @@ -357,7 +357,7 @@ describe('more path function', function() eq(FAIL, result) end) - itp('concatenates given filename if it does not contain a slash', function() + itp('concatenates filename if it does not contain a slash', function() local force_expansion = 1 local result = vim_FullName('test.file', buffer, length, force_expansion) local expected = lfs.currentdir() .. '/test.file' @@ -365,7 +365,7 @@ describe('more path function', function() eq(OK, result) end) - itp('concatenates given filename if it is a directory but does not contain a\n slash', function() + itp('concatenates directory name if it does not contain a slash', function() local force_expansion = 1 local result = vim_FullName('..', buffer, length, force_expansion) local expected = lfs.currentdir() .. '/..' @@ -395,6 +395,7 @@ describe('more path function', function() end) itp('fails and uses filename when the path is relative to HOME', function() + eq(false, cimp.os_isdir('~')) -- sanity check: no literal "~" directory. local force_expansion = 1 local absolute_path = '~/home.file' local result = vim_FullName(absolute_path, buffer, length, force_expansion) @@ -414,7 +415,7 @@ describe('more path function', function() local filename = to_cstr('unit-test-directory/test.file') -- Don't use the wrapper here but pass a cstring directly to the c -- function. - local result = path.vim_FullName(filename, buffer, length, force_expansion) + local result = cimp.vim_FullName(filename, buffer, length, force_expansion) eq(lfs.currentdir() .. '/unit-test-directory/test.file', (ffi.string(buffer))) eq('unit-test-directory/test.file', (ffi.string(filename))) eq(OK, result) @@ -423,7 +424,7 @@ describe('more path function', function() itp('works with directories that have one path component', function() local force_expansion = 1 local filename = to_cstr('/tmp') - local result = path.vim_FullName(filename, buffer, length, force_expansion) + local result = cimp.vim_FullName(filename, buffer, length, force_expansion) eq('/tmp', ffi.string(buffer)) eq(OK, result) end) @@ -432,7 +433,7 @@ describe('more path function', function() describe('path_fix_case', function() local function fix_case(file) local c_file = to_cstr(file) - path.path_fix_case(c_file) + cimp.path_fix_case(c_file) return ffi.string(c_file) end @@ -456,41 +457,41 @@ describe('more path function', function() itp('joins given paths with a slash', function() local path1 = cstr(100, 'path1') local to_append = to_cstr('path2') - eq(OK, (path.append_path(path1, to_append, 100))) + eq(OK, (cimp.append_path(path1, to_append, 100))) eq("path1/path2", (ffi.string(path1))) end) itp('joins given paths without adding an unnecessary slash', function() local path1 = cstr(100, 'path1/') local to_append = to_cstr('path2') - eq(OK, path.append_path(path1, to_append, 100)) + eq(OK, cimp.append_path(path1, to_append, 100)) eq("path1/path2", (ffi.string(path1))) end) itp('fails and uses filename if there is not enough space left for to_append', function() local path1 = cstr(11, 'path1/') local to_append = to_cstr('path2') - eq(FAIL, (path.append_path(path1, to_append, 11))) + eq(FAIL, (cimp.append_path(path1, to_append, 11))) end) itp('does not append a slash if to_append is empty', function() local path1 = cstr(6, 'path1') local to_append = to_cstr('') - eq(OK, (path.append_path(path1, to_append, 6))) + eq(OK, (cimp.append_path(path1, to_append, 6))) eq('path1', (ffi.string(path1))) end) itp('does not append unnecessary dots', function() local path1 = cstr(6, 'path1') local to_append = to_cstr('.') - eq(OK, (path.append_path(path1, to_append, 6))) + eq(OK, (cimp.append_path(path1, to_append, 6))) eq('path1', (ffi.string(path1))) end) itp('copies to_append to path, if path is empty', function() local path1 = cstr(7, '') local to_append = to_cstr('/path2') - eq(OK, (path.append_path(path1, to_append, 7))) + eq(OK, (cimp.append_path(path1, to_append, 7))) eq('/path2', (ffi.string(path1))) end) end) @@ -498,7 +499,7 @@ describe('more path function', function() describe('path_is_absolute_path', function() local function path_is_absolute_path(filename) filename = to_cstr(filename) - return path.path_is_absolute_path(filename) + return cimp.path_is_absolute_path(filename) end itp('returns true if filename starts with a slash', function() From a0acb2e19521298b3d80aa1cfaaef5f476218e01 Mon Sep 17 00:00:00 2001 From: Drew Neil Date: Tue, 25 Apr 2017 10:04:32 +0100 Subject: [PATCH 162/257] doc: Revise nvim-from-vim advice (#6505) --- runtime/doc/nvim.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/doc/nvim.txt b/runtime/doc/nvim.txt index bd483e9949..8dd329cee6 100644 --- a/runtime/doc/nvim.txt +++ b/runtime/doc/nvim.txt @@ -16,11 +16,11 @@ differences from Vim. ============================================================================== Transitioning from Vim *nvim-from-vim* -To start the transition, link your previous configuration so Nvim can use it: +To start the transition, create `~/.config/nvim/init.vim` with these contents: > - mkdir ~/.config - ln -s ~/.vim ~/.config/nvim - ln -s ~/.vimrc ~/.config/nvim/init.vim + set runtimepath+=~/.vim,~/.vim/after + set packpath+=~/.vim + source ~/.vimrc < Note: If your system sets `$XDG_CONFIG_HOME`, use that instead of `~/.config` in the code above. Nvim follows the XDG |base-directories| convention. From 22932d8ac22f6dba3b3df068c6932bf3ad478d92 Mon Sep 17 00:00:00 2001 From: relnod Date: Tue, 25 Apr 2017 20:45:59 +0200 Subject: [PATCH 163/257] refactor/single-include (#6586) --- src/nvim/CMakeLists.txt | 4 ---- src/nvim/popupmnu.h | 2 ++ src/nvim/quickfix.h | 3 +++ src/nvim/regexp.h | 4 ++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index db5e62fd67..9e9e9b6026 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -432,13 +432,9 @@ set(NO_SINGLE_CHECK_HEADERS if_cscope_defs.h misc2.h msgpack_rpc/server.h - option.h os/shell.h os_unix.h os/win_defs.h - popupmnu.h - quickfix.h - regexp.h regexp_defs.h sha256.h sign_defs.h diff --git a/src/nvim/popupmnu.h b/src/nvim/popupmnu.h index 2b181f2c4a..7e1588dbdd 100644 --- a/src/nvim/popupmnu.h +++ b/src/nvim/popupmnu.h @@ -1,6 +1,8 @@ #ifndef NVIM_POPUPMNU_H #define NVIM_POPUPMNU_H +#include "nvim/types.h" + /// Used for popup menu items. typedef struct { char_u *pum_text; // main menu text diff --git a/src/nvim/quickfix.h b/src/nvim/quickfix.h index bb9c2c3193..fdeb8d1a2f 100644 --- a/src/nvim/quickfix.h +++ b/src/nvim/quickfix.h @@ -1,6 +1,9 @@ #ifndef NVIM_QUICKFIX_H #define NVIM_QUICKFIX_H +#include "nvim/types.h" +#include "nvim/ex_cmds_defs.h" + /* flags for skip_vimgrep_pat() */ #define VGR_GLOBAL 1 #define VGR_NOJUMP 2 diff --git a/src/nvim/regexp.h b/src/nvim/regexp.h index 37513d8c27..97595c4d29 100644 --- a/src/nvim/regexp.h +++ b/src/nvim/regexp.h @@ -1,6 +1,10 @@ #ifndef NVIM_REGEXP_H #define NVIM_REGEXP_H +#include "nvim/types.h" +#include "nvim/buffer_defs.h" +#include "nvim/regexp_defs.h" + /* Second argument for vim_regcomp(). */ #define RE_MAGIC 1 /* 'magic' option */ #define RE_STRING 2 /* match in string instead of buffer text */ From 7e571bca5d5e00e9e33e266b983a48bb4014183f Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 25 Apr 2017 15:05:33 -0400 Subject: [PATCH 164/257] tui: Only set cursor color if the highlight group is valid (#6585) Closes #6584 --- src/nvim/tui/tui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index ae7551098d..e1b97f5306 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -587,9 +587,11 @@ static void tui_set_mode(UI *ui, ModeShape mode) if (c.id != 0 && ui->rgb) { int attr = syn_id2attr(c.id); - attrentry_T *aep = syn_cterm_attr2entry(attr); - data->params[0].i = aep->rgb_bg_color; - unibi_out(ui, data->unibi_ext.set_cursor_color); + if (attr > 0) { + attrentry_T *aep = syn_cterm_attr2entry(attr); + data->params[0].i = aep->rgb_bg_color; + unibi_out(ui, data->unibi_ext.set_cursor_color); + } } } From 88023d51238698dd625c26300142d3dbe5770b73 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Fri, 24 Feb 2017 09:35:27 +0000 Subject: [PATCH 165/257] api/ui: externalize tabline --- runtime/doc/msgpack_rpc.txt | 11 +++++- src/nvim/api/ui.c | 12 +++++- src/nvim/screen.c | 36 +++++++++++++++++- src/nvim/tui/tui.c | 1 + src/nvim/ui.c | 34 +++++++++++++++++ src/nvim/ui.h | 9 ++++- src/nvim/ui_bridge.c | 1 + src/nvim/window.c | 4 ++ test/functional/ui/tabline_spec.lua | 58 +++++++++++++++++++++++++++++ 9 files changed, 161 insertions(+), 5 deletions(-) create mode 100644 test/functional/ui/tabline_spec.lua diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 77cbc2f3d8..c550631a32 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -266,7 +266,11 @@ a dictionary with these (optional) keys: most 256 different colors). `popupmenu_external` Instead of drawing the completion popupmenu on the grid, Nvim will send higher-level events to - the ui and let it draw the popupmenu. + the UI and let it draw the popupmenu. + Defaults to false. + `tabline_external` Instead of drawing the tabline on the grid, + Nvim will send higher-level events to + the UI and let it draw the tabline. Defaults to false. Nvim will then send msgpack-rpc notifications, with the method name "redraw" @@ -436,5 +440,10 @@ states might be represented as separate modes. ["popupmenu_hide"] The popupmenu is hidden. +["tabline_update", curtab, tabs] + Nvim will send this event when drawing tabline. curtab is the tab id + of the current tab. tabs is an arrays of the form: + [tabid, { "name": name }] + ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index f0da0d1812..28fc641dec 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -69,6 +69,7 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, ui->height = (int)height; ui->rgb = true; ui->pum_external = false; + ui->tabline_external = false; ui->resize = remote_ui_resize; ui->clear = remote_ui_clear; ui->eol_clear = remote_ui_eol_clear; @@ -171,19 +172,26 @@ void nvim_ui_set_option(uint64_t channel_id, String name, } static void ui_set_option(UI *ui, String name, Object value, Error *error) { - if (strcmp(name.data, "rgb") == 0) { + if (strequal(name.data, "rgb")) { if (value.type != kObjectTypeBoolean) { api_set_error(error, kErrorTypeValidation, "rgb must be a Boolean"); return; } ui->rgb = value.data.boolean; - } else if (strcmp(name.data, "popupmenu_external") == 0) { + } else if (strequal(name.data, "popupmenu_external")) { if (value.type != kObjectTypeBoolean) { api_set_error(error, kErrorTypeValidation, "popupmenu_external must be a Boolean"); return; } ui->pum_external = value.data.boolean; + } else if (strequal(name.data, "tabline_external")) { + if (value.type != kObjectTypeBoolean) { + api_set_error(error, kErrorTypeValidation, + "tabline_external must be a Boolean"); + return; + } + ui->tabline_external = value.data.boolean; } else { api_set_error(error, kErrorTypeValidation, "No such ui option"); } diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 10dc86d5fa..ed85b6e8b8 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -132,6 +132,7 @@ #include "nvim/version.h" #include "nvim/window.h" #include "nvim/os/time.h" +#include "nvim/api/private/helpers.h" #define MB_FILLER_CHAR '<' /* character used when a double-width character * doesn't fit. */ @@ -6885,8 +6886,13 @@ static void draw_tabline(void) if (ScreenLines == NULL) { return; } - redraw_tabline = false; + if (ui_is_widget_external(kUITabline)) { + draw_tabline_ext(); + return; + } + + redraw_tabline = false; if (tabline_height() < 1) return; @@ -7027,6 +7033,34 @@ static void draw_tabline(void) redraw_tabline = FALSE; } +// send tabline update to external ui +void draw_tabline_ext(void) +{ + win_T *cwp; + + Array args = ARRAY_DICT_INIT; + ADD(args, INTEGER_OBJ(curtab->handle)); + Array tabs = ARRAY_DICT_INIT; + FOR_ALL_TABS(tp) { + if (tp == curtab) { + cwp = curwin; + } else { + cwp = tp->tp_curwin; + } + get_trans_bufname(cwp->w_buffer); + Array tab = ARRAY_DICT_INIT; + ADD(tab, INTEGER_OBJ(tp->handle)); + + Dictionary tab_info = ARRAY_DICT_INIT; + PUT(tab_info, "name", STRING_OBJ(cstr_to_string((char *)NameBuff))); + ADD(tab, DICTIONARY_OBJ(tab_info)); + ADD(tabs, ARRAY_OBJ(tab)); + } + ADD(args, ARRAY_OBJ(tabs)); + + ui_event("tabline_update", args); +} + /* * Get buffer name for "buf" into NameBuff[]. * Takes care of special buffer names and translates special characters. diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index e1b97f5306..cd94fe9d49 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -110,6 +110,7 @@ UI *tui_start(void) ui->stop = tui_stop; ui->rgb = p_tgc; ui->pum_external = false; + ui->tabline_external = false; ui->resize = tui_resize; ui->clear = tui_clear; ui->eol_clear = tui_eol_clear; diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 69916fa4cd..6dcc3de1b0 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -58,6 +58,10 @@ static int busy = 0; static int height, width; static int old_mode_idx = -1; +static bool tabline_external = false; +static bool cmdline_external = false; +static bool wildmenu_external = false; + // UI_CALL invokes a function on all registered UI instances. The functions can // have 0-5 arguments (configurable by SELECT_NTH). // @@ -167,17 +171,20 @@ void ui_refresh(void) int width = INT_MAX, height = INT_MAX; bool pum_external = true; + bool tabline_external = true; for (size_t i = 0; i < ui_count; i++) { UI *ui = uis[i]; width = MIN(ui->width, width); height = MIN(ui->height, height); pum_external &= ui->pum_external; + tabline_external &= ui->tabline_external; } row = col = 0; screen_resize(width, height); pum_set_external(pum_external); + ui_set_widget_external(kUITabline, tabline_external); ui_mode_info_set(); old_mode_idx = -1; ui_cursor_shape(); @@ -557,3 +564,30 @@ void ui_cursor_shape(void) conceal_check_cursur_line(); } +bool ui_is_widget_external(UIWidget widget) +{ + switch (widget) { + case kUITabline: + return tabline_external; + case kUICmdline: + return cmdline_external; + case kUIWildmenu: + return wildmenu_external; + } + return false; +} + +void ui_set_widget_external(UIWidget widget, bool external) +{ + switch (widget) { + case kUITabline: + tabline_external = external; + break; + case kUICmdline: + cmdline_external = external; + break; + case kUIWildmenu: + wildmenu_external = external; + break; + } +} diff --git a/src/nvim/ui.h b/src/nvim/ui.h index fcf52ac9e1..a1ff449eaf 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -8,6 +8,13 @@ #include "api/private/defs.h" #include "nvim/buffer_defs.h" +// values for externalized widgets +typedef enum { + kUITabline, + kUICmdline, + kUIWildmenu +} UIWidget; + typedef struct { bool bold, underline, undercurl, italic, reverse; int foreground, background, special; @@ -16,7 +23,7 @@ typedef struct { typedef struct ui_t UI; struct ui_t { - bool rgb, pum_external; + bool rgb, pum_external, tabline_external; int width, height; void *data; void (*resize)(UI *ui, int rows, int columns); diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c index 5697c765ba..9a3fcab13c 100644 --- a/src/nvim/ui_bridge.c +++ b/src/nvim/ui_bridge.c @@ -58,6 +58,7 @@ UI *ui_bridge_attach(UI *ui, ui_main_fn ui_main, event_scheduler scheduler) rv->ui = ui; rv->bridge.rgb = ui->rgb; rv->bridge.pum_external = ui->pum_external; + rv->bridge.tabline_external = ui->tabline_external; rv->bridge.stop = ui_bridge_stop; rv->bridge.resize = ui_bridge_resize; rv->bridge.clear = ui_bridge_clear; diff --git a/src/nvim/window.c b/src/nvim/window.c index 60bba19b07..effce8b413 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -48,6 +48,7 @@ #include "nvim/syntax.h" #include "nvim/terminal.h" #include "nvim/undo.h" +#include "nvim/ui.h" #include "nvim/os/os.h" @@ -5223,6 +5224,9 @@ static void last_status_rec(frame_T *fr, int statusline) */ int tabline_height(void) { + if (ui_is_widget_external(kUITabline)) { + return 0; + } assert(first_tabpage); switch (p_stal) { case 0: return 0; diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua new file mode 100644 index 0000000000..018e008e4a --- /dev/null +++ b/test/functional/ui/tabline_spec.lua @@ -0,0 +1,58 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq + +if helpers.pending_win32(pending) then return end + +describe('External tab line', function() + local screen + local tabs, curtab + + before_each(function() + clear() + screen = Screen.new(25, 5) + screen:attach({rgb=true, tabline_external=true}) + screen:set_on_event_handler(function(name, data) + if name == "tabline_update" then + curtab, tabs = unpack(data) + end + end) + end) + + after_each(function() + screen:detach() + end) + + describe("'tabline'", function() + it('tabline', function() + local expected = { + {1, {['name'] = '[No Name]'}}, + {2, {['name'] = '[No Name]'}}, + } + feed(":tabnew") + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + | + ]], nil, nil, function() + eq(2, curtab) + eq(expected, tabs) + end) + + feed(":tabNext") + screen:expect([[ + ^ | + ~ | + ~ | + ~ | + | + ]], nil, nil, function() + eq(1, curtab) + eq(expected, tabs) + end) + + end) + end) +end) From 00843902d3472ac4e74106fc06fa60e599914496 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 25 Apr 2017 02:17:15 +0200 Subject: [PATCH 166/257] api/ui: externalize tabline - Work with a bool[] array parallel to the UIWidget enum. - Rename some functions. - Documentation. --- runtime/doc/msgpack_rpc.txt | 25 ++++++------ src/nvim/api/ui.c | 40 +++++++++++++++---- src/nvim/popupmnu.c | 9 +---- src/nvim/screen.c | 18 +++------ src/nvim/tui/tui.c | 5 ++- src/nvim/ui.c | 51 +++++++++--------------- src/nvim/ui.h | 10 +++-- src/nvim/ui_bridge.c | 6 ++- src/nvim/window.c | 4 +- test/functional/ui/screen_basic_spec.lua | 38 +++++++++++++++--- test/functional/ui/tabline_spec.lua | 10 ++--- test/functional/viml/completion_spec.lua | 4 +- 12 files changed, 124 insertions(+), 96 deletions(-) diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index c550631a32..7adc4ca2e9 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -251,9 +251,9 @@ connect to another with different type codes. 6. Remote UIs *rpc-remote-ui* GUIs can be implemented as external processes communicating with Nvim over the -RPC API. Currently the UI model consists of a terminal-like grid with one -single, monospace font size. Some elements (UI "widgets") can be drawn -separately from the grid. +RPC API. The UI model consists of a terminal-like grid with a single, +monospace font size. Some elements (UI "widgets") can be drawn separately from +the grid ("externalized"). After connecting to Nvim (usually a spawned, embedded instance) use the |nvim_ui_attach| API method to tell Nvim that your program wants to draw the @@ -264,14 +264,13 @@ a dictionary with these (optional) keys: colors. Set to false to use terminal color codes (at most 256 different colors). - `popupmenu_external` Instead of drawing the completion popupmenu on - the grid, Nvim will send higher-level events to - the UI and let it draw the popupmenu. - Defaults to false. - `tabline_external` Instead of drawing the tabline on the grid, - Nvim will send higher-level events to - the UI and let it draw the tabline. - Defaults to false. + `ui_ext` String array of "externalized" widgets. + Widgets in this list will not be drawn by + Nvim; only high-level data will be published + in new UI event kinds. Valid names: + popupmenu |ui-ext-popupmenu| + tabline |ui-ext-tabline| + Defaults to empty. Nvim will then send msgpack-rpc notifications, with the method name "redraw" and a single argument, an array of screen updates (described below). These @@ -421,6 +420,7 @@ properties specified in the corresponding item. The set of modes reported will change in new versions of Nvim, for instance more submodes and temporary states might be represented as separate modes. + *ui-ext-popupmenu* ["popupmenu_show", items, selected, row, col] When `popupmenu_external` is set to true, nvim will not draw the popupmenu on the grid, instead when the popupmenu is to be displayed @@ -440,9 +440,10 @@ states might be represented as separate modes. ["popupmenu_hide"] The popupmenu is hidden. + *ui-ext-tabline* ["tabline_update", curtab, tabs] Nvim will send this event when drawing tabline. curtab is the tab id - of the current tab. tabs is an arrays of the form: + of the current tab. tabs is an array of the form: [tabid, { "name": name }] ============================================================================== diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 28fc641dec..08d285eedc 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -68,8 +68,6 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, ui->width = (int)width; ui->height = (int)height; ui->rgb = true; - ui->pum_external = false; - ui->tabline_external = false; ui->resize = remote_ui_resize; ui->clear = remote_ui_clear; ui->eol_clear = remote_ui_eol_clear; @@ -96,6 +94,8 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, ui->set_icon = remote_ui_set_icon; ui->event = remote_ui_event; + memset(ui->ui_ext, 0, sizeof(ui->ui_ext)); + for (size_t i = 0; i < options.size; i++) { ui_set_option(ui, options.items[i].key, options.items[i].value, err); if (ERROR_SET(err)) { @@ -171,7 +171,8 @@ void nvim_ui_set_option(uint64_t channel_id, String name, } } -static void ui_set_option(UI *ui, String name, Object value, Error *error) { +static void ui_set_option(UI *ui, String name, Object value, Error *error) +{ if (strequal(name.data, "rgb")) { if (value.type != kObjectTypeBoolean) { api_set_error(error, kErrorTypeValidation, "rgb must be a Boolean"); @@ -179,19 +180,42 @@ static void ui_set_option(UI *ui, String name, Object value, Error *error) { } ui->rgb = value.data.boolean; } else if (strequal(name.data, "popupmenu_external")) { + // LEGACY: Deprecated option, use `ui_ext` instead. if (value.type != kObjectTypeBoolean) { api_set_error(error, kErrorTypeValidation, "popupmenu_external must be a Boolean"); return; } - ui->pum_external = value.data.boolean; - } else if (strequal(name.data, "tabline_external")) { - if (value.type != kObjectTypeBoolean) { + ui->ui_ext[kUIPopupmenu] = value.data.boolean; + } else if (strequal(name.data, "ui_ext")) { + if (value.type != kObjectTypeArray) { api_set_error(error, kErrorTypeValidation, - "tabline_external must be a Boolean"); + "ui_ext must be an Array"); return; } - ui->tabline_external = value.data.boolean; + + for (size_t i = 0; i < value.data.array.size; i++) { + Object item = value.data.array.items[i]; + if (item.type != kObjectTypeString) { + api_set_error(error, kErrorTypeValidation, + "ui_ext: item must be a String"); + return; + } + char *name = item.data.string.data; + if (strequal(name, "cmdline")) { + ui->ui_ext[kUICmdline] = true; + } else if (strequal(name, "popupmenu")) { + ui->ui_ext[kUIPopupmenu] = true; + } else if (strequal(name, "tabline")) { + ui->ui_ext[kUITabline] = true; + } else if (strequal(name, "wildmenu")) { + ui->ui_ext[kUIWildmenu] = true; + } else { + api_set_error(error, kErrorTypeValidation, + "ui_ext: unknown widget: %s", name); + return; + } + } } else { api_set_error(error, kErrorTypeValidation, "No such ui option"); } diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 6e81c5a171..b8650d8c62 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -41,9 +41,7 @@ static int pum_row; // top row of pum static int pum_col; // left column of pum static bool pum_is_visible = false; - static bool pum_external = false; -static bool pum_wants_external = false; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "popupmnu.c.generated.h" @@ -80,7 +78,7 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed) if (!pum_is_visible) { // To keep the code simple, we only allow changing the // draw mode when the popup menu is not being displayed - pum_external = pum_wants_external; + pum_external = ui_is_external(kUIPopupmenu); } redo: @@ -751,8 +749,3 @@ int pum_get_height(void) { return pum_height; } - -void pum_set_external(bool external) -{ - pum_wants_external = external; -} diff --git a/src/nvim/screen.c b/src/nvim/screen.c index ed85b6e8b8..a6563534aa 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -6886,14 +6886,13 @@ static void draw_tabline(void) if (ScreenLines == NULL) { return; } + redraw_tabline = false; - if (ui_is_widget_external(kUITabline)) { - draw_tabline_ext(); + if (ui_is_external(kUITabline)) { + ui_ext_tabline_update(); return; } - redraw_tabline = false; - if (tabline_height() < 1) return; @@ -7033,20 +7032,13 @@ static void draw_tabline(void) redraw_tabline = FALSE; } -// send tabline update to external ui -void draw_tabline_ext(void) +void ui_ext_tabline_update(void) { - win_T *cwp; - Array args = ARRAY_DICT_INIT; ADD(args, INTEGER_OBJ(curtab->handle)); Array tabs = ARRAY_DICT_INIT; FOR_ALL_TABS(tp) { - if (tp == curtab) { - cwp = curwin; - } else { - cwp = tp->tp_curwin; - } + win_T *cwp = (tp == curtab) ? curwin : tp->tp_curwin; get_trans_bufname(cwp->w_buffer); Array tab = ARRAY_DICT_INIT; ADD(tab, INTEGER_OBJ(tp->handle)); diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index cd94fe9d49..21abc19c47 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -109,8 +109,6 @@ UI *tui_start(void) UI *ui = xcalloc(1, sizeof(UI)); ui->stop = tui_stop; ui->rgb = p_tgc; - ui->pum_external = false; - ui->tabline_external = false; ui->resize = tui_resize; ui->clear = tui_clear; ui->eol_clear = tui_eol_clear; @@ -136,6 +134,9 @@ UI *tui_start(void) ui->set_title = tui_set_title; ui->set_icon = tui_set_icon; ui->event = tui_event; + + memset(ui->ui_ext, 0, sizeof(ui->ui_ext)); + return ui_bridge_attach(ui, tui_main, tui_scheduler); } diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 6dcc3de1b0..713dffb46c 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -47,6 +47,7 @@ #define MAX_UI_COUNT 16 static UI *uis[MAX_UI_COUNT]; +static bool ui_ext[UI_WIDGETS] = { 0 }; static size_t ui_count = 0; static int row = 0, col = 0; static struct { @@ -58,10 +59,6 @@ static int busy = 0; static int height, width; static int old_mode_idx = -1; -static bool tabline_external = false; -static bool cmdline_external = false; -static bool wildmenu_external = false; - // UI_CALL invokes a function on all registered UI instances. The functions can // have 0-5 arguments (configurable by SELECT_NTH). // @@ -170,21 +167,25 @@ void ui_refresh(void) } int width = INT_MAX, height = INT_MAX; - bool pum_external = true; - bool tabline_external = true; + bool ext_widgets[UI_WIDGETS]; + for (UIWidget i = 0; (int)i < UI_WIDGETS; i++) { + ext_widgets[i] = true; + } for (size_t i = 0; i < ui_count; i++) { UI *ui = uis[i]; width = MIN(ui->width, width); height = MIN(ui->height, height); - pum_external &= ui->pum_external; - tabline_external &= ui->tabline_external; + for (UIWidget i = 0; (int)i < UI_WIDGETS; i++) { + ext_widgets[i] &= ui->ui_ext[i]; + } } row = col = 0; screen_resize(width, height); - pum_set_external(pum_external); - ui_set_widget_external(kUITabline, tabline_external); + for (UIWidget i = 0; (int)i < UI_WIDGETS; i++) { + ui_set_external(i, ext_widgets[i]); + } ui_mode_info_set(); old_mode_idx = -1; ui_cursor_shape(); @@ -564,30 +565,16 @@ void ui_cursor_shape(void) conceal_check_cursur_line(); } -bool ui_is_widget_external(UIWidget widget) +/// Returns true if `widget` is externalized. +bool ui_is_external(UIWidget widget) { - switch (widget) { - case kUITabline: - return tabline_external; - case kUICmdline: - return cmdline_external; - case kUIWildmenu: - return wildmenu_external; - } - return false; + return ui_ext[widget]; } -void ui_set_widget_external(UIWidget widget, bool external) +/// Sets `widget` as "external". +/// Such widgets are not drawn by Nvim; external UIs are expected to handle +/// higher-level UI events and present the data. +void ui_set_external(UIWidget widget, bool external) { - switch (widget) { - case kUITabline: - tabline_external = external; - break; - case kUICmdline: - cmdline_external = external; - break; - case kUIWildmenu: - wildmenu_external = external; - break; - } + ui_ext[widget] = external; } diff --git a/src/nvim/ui.h b/src/nvim/ui.h index a1ff449eaf..9338ab3ea3 100644 --- a/src/nvim/ui.h +++ b/src/nvim/ui.h @@ -8,12 +8,13 @@ #include "api/private/defs.h" #include "nvim/buffer_defs.h" -// values for externalized widgets typedef enum { + kUICmdline = 0, + kUIPopupmenu, kUITabline, - kUICmdline, - kUIWildmenu + kUIWildmenu, } UIWidget; +#define UI_WIDGETS (kUIWildmenu + 1) typedef struct { bool bold, underline, undercurl, italic, reverse; @@ -23,7 +24,8 @@ typedef struct { typedef struct ui_t UI; struct ui_t { - bool rgb, pum_external, tabline_external; + bool rgb; + bool ui_ext[UI_WIDGETS]; ///< Externalized widgets int width, height; void *data; void (*resize)(UI *ui, int rows, int columns); diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c index 9a3fcab13c..b7b12ae39e 100644 --- a/src/nvim/ui_bridge.c +++ b/src/nvim/ui_bridge.c @@ -57,8 +57,6 @@ UI *ui_bridge_attach(UI *ui, ui_main_fn ui_main, event_scheduler scheduler) UIBridgeData *rv = xcalloc(1, sizeof(UIBridgeData)); rv->ui = ui; rv->bridge.rgb = ui->rgb; - rv->bridge.pum_external = ui->pum_external; - rv->bridge.tabline_external = ui->tabline_external; rv->bridge.stop = ui_bridge_stop; rv->bridge.resize = ui_bridge_resize; rv->bridge.clear = ui_bridge_clear; @@ -86,6 +84,10 @@ UI *ui_bridge_attach(UI *ui, ui_main_fn ui_main, event_scheduler scheduler) rv->bridge.set_icon = ui_bridge_set_icon; rv->scheduler = scheduler; + for (UIWidget i = 0; (int)i < UI_WIDGETS; i++) { + rv->bridge.ui_ext[i] = ui->ui_ext[i]; + } + rv->ui_main = ui_main; uv_mutex_init(&rv->mutex); uv_cond_init(&rv->cond); diff --git a/src/nvim/window.c b/src/nvim/window.c index effce8b413..69c0a838ea 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -5224,8 +5224,8 @@ static void last_status_rec(frame_T *fr, int statusline) */ int tabline_height(void) { - if (ui_is_widget_external(kUITabline)) { - return 0; + if (ui_is_external(kUITabline)) { + return 0; } assert(first_tabpage); switch (p_stal) { diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index d9cb3d7b6f..d6aa1aa993 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -6,7 +6,7 @@ local insert = helpers.insert local eq = helpers.eq local eval = helpers.eval -describe('Initial screen', function() +describe('screen', function() local screen local nvim_argv = {helpers.nvim_prog, '-u', 'NONE', '-i', 'NONE', '-N', '--cmd', 'set shortmess+=I background=light noswapfile belloff= noshowcmd noruler', @@ -27,7 +27,7 @@ describe('Initial screen', function() screen:detach() end) - it('is the default initial screen', function() + it('default initial screen', function() screen:expect([[ ^ | {0:~ }| @@ -565,12 +565,40 @@ describe('Screen', function() ]]) end) end) +end) - it('nvim_ui_attach() handles very large width/height #2180', function() - screen:detach() - screen = Screen.new(999, 999) +describe('nvim_ui_attach()', function() + before_each(function() + clear() + end) + it('handles very large width/height #2180', function() + local screen = Screen.new(999, 999) screen:attach() eq(999, eval('&lines')) eq(999, eval('&columns')) end) + it('"ui_ext" widgets', function() + local screen = Screen.new() + screen:attach({ui_ext={ + 'cmdline', + 'popupmenu', + 'tabline', + 'wildmenu', + }}) + end) + it('invalid "ui_ext" returns error', function() + local screen = Screen.new() + + local status, rv = pcall(function() screen:attach({ui_ext={'foo'}}) end) + eq(false, status) + eq('ui_ext: unknown widget: foo', rv:match("ui_ext:.*")) + + status, rv = pcall(function() screen:attach({ui_ext={'cmdline','foo'}}) end) + eq(false, status) + eq('ui_ext: unknown widget: foo', rv:match("ui_ext:.*")) + + status, rv = pcall(function() screen:attach({ui_ext={'cmdline',1}}) end) + eq(false, status) + eq('ui_ext: item must be a String', rv:match("ui_ext:.*")) + end) end) diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua index 018e008e4a..c62dd0c94b 100644 --- a/test/functional/ui/tabline_spec.lua +++ b/test/functional/ui/tabline_spec.lua @@ -2,16 +2,14 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq -if helpers.pending_win32(pending) then return end - -describe('External tab line', function() +describe('ui/tabline', function() local screen local tabs, curtab before_each(function() clear() screen = Screen.new(25, 5) - screen:attach({rgb=true, tabline_external=true}) + screen:attach({rgb=true, ui_ext={'tabline'}}) screen:set_on_event_handler(function(name, data) if name == "tabline_update" then curtab, tabs = unpack(data) @@ -23,8 +21,8 @@ describe('External tab line', function() screen:detach() end) - describe("'tabline'", function() - it('tabline', function() + describe('externalized', function() + it('publishes UI events', function() local expected = { {1, {['name'] = '[No Name]'}}, {2, {['name'] = '[No Name]'}}, diff --git a/test/functional/viml/completion_spec.lua b/test/functional/viml/completion_spec.lua index b35e8d4f94..5f5e9437dc 100644 --- a/test/functional/viml/completion_spec.lua +++ b/test/functional/viml/completion_spec.lua @@ -868,13 +868,13 @@ describe('completion', function() end) end) -describe('External completion popupmenu', function() +describe('ui/externalized/popupmenu', function() local screen local items, selected, anchor before_each(function() clear() screen = Screen.new(60, 8) - screen:attach({rgb=true, popupmenu_external=true}) + screen:attach({rgb=true, ui_ext={'popupmenu'}}) screen:set_default_attr_ids({ [1] = {bold=true, foreground=Screen.colors.Blue}, [2] = {bold = true}, From c8e1af93de90b2e23579f726fd4aa6a65f9387b6 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 25 Apr 2017 10:14:29 +0200 Subject: [PATCH 167/257] api: nvim_ui_attach(): Flatten ext_* options. --- runtime/doc/msgpack_rpc.txt | 10 ++--- src/nvim/api/ui.c | 57 +++++++++++------------- test/functional/ui/screen_basic_spec.lua | 24 ++-------- test/functional/ui/tabline_spec.lua | 2 +- test/functional/viml/completion_spec.lua | 2 +- 5 files changed, 34 insertions(+), 61 deletions(-) diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index 7adc4ca2e9..da9b2360e3 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -264,13 +264,11 @@ a dictionary with these (optional) keys: colors. Set to false to use terminal color codes (at most 256 different colors). - `ui_ext` String array of "externalized" widgets. - Widgets in this list will not be drawn by + `ext_popupmenu` Externalize the popupmenu. |ui-ext-popupmenu| + `ext_tabline` Externalize the tabline. |ui-ext-tabline| + Externalized widgets will not be drawn by Nvim; only high-level data will be published - in new UI event kinds. Valid names: - popupmenu |ui-ext-popupmenu| - tabline |ui-ext-tabline| - Defaults to empty. + in new UI event kinds. Nvim will then send msgpack-rpc notifications, with the method name "redraw" and a single argument, an array of screen updates (described below). These diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 08d285eedc..3c0e8bc049 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -173,13 +173,33 @@ void nvim_ui_set_option(uint64_t channel_id, String name, static void ui_set_option(UI *ui, String name, Object value, Error *error) { +#define UI_EXT_OPTION(o, e) \ + do { \ + if (strequal(name.data, #o)) { \ + if (value.type != kObjectTypeBoolean) { \ + api_set_error(error, kErrorTypeValidation, #o " must be a Boolean"); \ + return; \ + } \ + ui->ui_ext[(e)] = value.data.boolean; \ + return; \ + } \ + } while (0) + if (strequal(name.data, "rgb")) { if (value.type != kObjectTypeBoolean) { api_set_error(error, kErrorTypeValidation, "rgb must be a Boolean"); return; } ui->rgb = value.data.boolean; - } else if (strequal(name.data, "popupmenu_external")) { + return; + } + + UI_EXT_OPTION(ext_cmdline, kUICmdline); + UI_EXT_OPTION(ext_popupmenu, kUIPopupmenu); + UI_EXT_OPTION(ext_tabline, kUITabline); + UI_EXT_OPTION(ext_wildmenu, kUIWildmenu); + + if (strequal(name.data, "popupmenu_external")) { // LEGACY: Deprecated option, use `ui_ext` instead. if (value.type != kObjectTypeBoolean) { api_set_error(error, kErrorTypeValidation, @@ -187,38 +207,11 @@ static void ui_set_option(UI *ui, String name, Object value, Error *error) return; } ui->ui_ext[kUIPopupmenu] = value.data.boolean; - } else if (strequal(name.data, "ui_ext")) { - if (value.type != kObjectTypeArray) { - api_set_error(error, kErrorTypeValidation, - "ui_ext must be an Array"); - return; - } - - for (size_t i = 0; i < value.data.array.size; i++) { - Object item = value.data.array.items[i]; - if (item.type != kObjectTypeString) { - api_set_error(error, kErrorTypeValidation, - "ui_ext: item must be a String"); - return; - } - char *name = item.data.string.data; - if (strequal(name, "cmdline")) { - ui->ui_ext[kUICmdline] = true; - } else if (strequal(name, "popupmenu")) { - ui->ui_ext[kUIPopupmenu] = true; - } else if (strequal(name, "tabline")) { - ui->ui_ext[kUITabline] = true; - } else if (strequal(name, "wildmenu")) { - ui->ui_ext[kUIWildmenu] = true; - } else { - api_set_error(error, kErrorTypeValidation, - "ui_ext: unknown widget: %s", name); - return; - } - } - } else { - api_set_error(error, kErrorTypeValidation, "No such ui option"); + return; } + + api_set_error(error, kErrorTypeValidation, "No such ui option"); +#undef UI_EXT_OPTION } static void push_call(UI *ui, char *name, Array args) diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index d6aa1aa993..5d89416e4a 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -577,28 +577,10 @@ describe('nvim_ui_attach()', function() eq(999, eval('&lines')) eq(999, eval('&columns')) end) - it('"ui_ext" widgets', function() + it('invalid option returns error', function() local screen = Screen.new() - screen:attach({ui_ext={ - 'cmdline', - 'popupmenu', - 'tabline', - 'wildmenu', - }}) - end) - it('invalid "ui_ext" returns error', function() - local screen = Screen.new() - - local status, rv = pcall(function() screen:attach({ui_ext={'foo'}}) end) + local status, rv = pcall(function() screen:attach({foo={'foo'}}) end) eq(false, status) - eq('ui_ext: unknown widget: foo', rv:match("ui_ext:.*")) - - status, rv = pcall(function() screen:attach({ui_ext={'cmdline','foo'}}) end) - eq(false, status) - eq('ui_ext: unknown widget: foo', rv:match("ui_ext:.*")) - - status, rv = pcall(function() screen:attach({ui_ext={'cmdline',1}}) end) - eq(false, status) - eq('ui_ext: item must be a String', rv:match("ui_ext:.*")) + eq('No such ui option', rv:match("No such .*")) end) end) diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua index c62dd0c94b..aa7b432c09 100644 --- a/test/functional/ui/tabline_spec.lua +++ b/test/functional/ui/tabline_spec.lua @@ -9,7 +9,7 @@ describe('ui/tabline', function() before_each(function() clear() screen = Screen.new(25, 5) - screen:attach({rgb=true, ui_ext={'tabline'}}) + screen:attach({rgb=true, ext_tabline=true}) screen:set_on_event_handler(function(name, data) if name == "tabline_update" then curtab, tabs = unpack(data) diff --git a/test/functional/viml/completion_spec.lua b/test/functional/viml/completion_spec.lua index 5f5e9437dc..0e5278345c 100644 --- a/test/functional/viml/completion_spec.lua +++ b/test/functional/viml/completion_spec.lua @@ -874,7 +874,7 @@ describe('ui/externalized/popupmenu', function() before_each(function() clear() screen = Screen.new(60, 8) - screen:attach({rgb=true, ui_ext={'popupmenu'}}) + screen:attach({rgb=true, ext_popupmenu=true}) screen:set_default_attr_ids({ [1] = {bold=true, foreground=Screen.colors.Blue}, [2] = {bold = true}, From 6944abad2f3f443027af1966a2a310034d2179b2 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 25 Apr 2017 11:13:29 +0200 Subject: [PATCH 168/257] api/ext_tabline: List of Dicts. --- runtime/doc/msgpack_rpc.txt | 7 ++++--- src/nvim/screen.c | 11 +++++------ test/functional/ui/tabline_spec.lua | 25 +++++++++++++------------ third-party/cmake/BuildLuarocks.cmake | 2 +- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/runtime/doc/msgpack_rpc.txt b/runtime/doc/msgpack_rpc.txt index da9b2360e3..261e68cfb1 100644 --- a/runtime/doc/msgpack_rpc.txt +++ b/runtime/doc/msgpack_rpc.txt @@ -440,9 +440,10 @@ states might be represented as separate modes. *ui-ext-tabline* ["tabline_update", curtab, tabs] - Nvim will send this event when drawing tabline. curtab is the tab id - of the current tab. tabs is an array of the form: - [tabid, { "name": name }] + Tabline was updated. UIs should present this data in a custom tabline + widget. + curtab: Current Tabpage + tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...] ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/src/nvim/screen.c b/src/nvim/screen.c index a6563534aa..de24156579 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -7038,15 +7038,14 @@ void ui_ext_tabline_update(void) ADD(args, INTEGER_OBJ(curtab->handle)); Array tabs = ARRAY_DICT_INIT; FOR_ALL_TABS(tp) { + Dictionary tab_info = ARRAY_DICT_INIT; + PUT(tab_info, "tab", TABPAGE_OBJ(tp->handle)); + win_T *cwp = (tp == curtab) ? curwin : tp->tp_curwin; get_trans_bufname(cwp->w_buffer); - Array tab = ARRAY_DICT_INIT; - ADD(tab, INTEGER_OBJ(tp->handle)); - - Dictionary tab_info = ARRAY_DICT_INIT; PUT(tab_info, "name", STRING_OBJ(cstr_to_string((char *)NameBuff))); - ADD(tab, DICTIONARY_OBJ(tab_info)); - ADD(tabs, ARRAY_OBJ(tab)); + + ADD(tabs, DICTIONARY_OBJ(tab_info)); } ADD(args, ARRAY_OBJ(tabs)); diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua index aa7b432c09..2d5faf394b 100644 --- a/test/functional/ui/tabline_spec.lua +++ b/test/functional/ui/tabline_spec.lua @@ -1,10 +1,10 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') -local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq +local clear, command, eq = helpers.clear, helpers.command, helpers.eq describe('ui/tabline', function() local screen - local tabs, curtab + local event_tabs, event_curtab before_each(function() clear() @@ -12,7 +12,7 @@ describe('ui/tabline', function() screen:attach({rgb=true, ext_tabline=true}) screen:set_on_event_handler(function(name, data) if name == "tabline_update" then - curtab, tabs = unpack(data) + event_curtab, event_tabs = unpack(data) end end) end) @@ -23,11 +23,12 @@ describe('ui/tabline', function() describe('externalized', function() it('publishes UI events', function() - local expected = { - {1, {['name'] = '[No Name]'}}, - {2, {['name'] = '[No Name]'}}, + command("tabedit another-tab") + + local expected_tabs = { + {tab = { id = 1 }, name = '[No Name]'}, + {tab = { id = 2 }, name = 'another-tab'}, } - feed(":tabnew") screen:expect([[ ^ | ~ | @@ -35,11 +36,11 @@ describe('ui/tabline', function() ~ | | ]], nil, nil, function() - eq(2, curtab) - eq(expected, tabs) + eq(2, event_curtab) + eq(expected_tabs, event_tabs) end) - feed(":tabNext") + command("tabNext") screen:expect([[ ^ | ~ | @@ -47,8 +48,8 @@ describe('ui/tabline', function() ~ | | ]], nil, nil, function() - eq(1, curtab) - eq(expected, tabs) + eq(1, event_curtab) + eq(expected_tabs, event_tabs) end) end) diff --git a/third-party/cmake/BuildLuarocks.cmake b/third-party/cmake/BuildLuarocks.cmake index 7312b6f91b..88ddaf44ce 100644 --- a/third-party/cmake/BuildLuarocks.cmake +++ b/third-party/cmake/BuildLuarocks.cmake @@ -167,7 +167,7 @@ if(USE_BUNDLED_BUSTED) add_custom_command(OUTPUT ${HOSTDEPS_LIB_DIR}/luarocks/rocks/nvim-client COMMAND ${LUAROCKS_BINARY} - ARGS build https://raw.githubusercontent.com/neovim/lua-client/0.0.1-25/nvim-client-0.0.1-25.rockspec ${LUAROCKS_BUILDARGS} + ARGS build https://raw.githubusercontent.com/neovim/lua-client/0.0.1-26/nvim-client-0.0.1-26.rockspec ${LUAROCKS_BUILDARGS} DEPENDS luv) add_custom_target(nvim-client DEPENDS ${HOSTDEPS_LIB_DIR}/luarocks/rocks/nvim-client) From 67552621943a18cb38db8dc38bfb7639807ebdf5 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 26 Apr 2017 14:51:21 +0200 Subject: [PATCH 169/257] test: inccommand_spec: Avoid indeterminism. (#6592) --- test/functional/ui/inccommand_spec.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua index a7be1a9dc8..8bdc4601c0 100644 --- a/test/functional/ui/inccommand_spec.lua +++ b/test/functional/ui/inccommand_spec.lua @@ -805,6 +805,7 @@ describe(":substitute, inccommand=split", function() it('does not show split window for :s/', function() feed("2gg") feed(":s/tw") + screen:sleep(1) screen:expect([[ Inc substitution on | two lines | From e20691ccb47731b378e029e1223d3e87744f25c6 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 26 Apr 2017 16:50:36 -0400 Subject: [PATCH 170/257] defaults_spec: Test changing :filetype/:syntax in -c, after defaults --- test/functional/options/defaults_spec.lua | 41 ++++++++++++++++++----- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index f43d8eeafa..dc73679bb4 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -23,13 +23,13 @@ describe('startup defaults', function() if helpers.pending_win32(pending) then return end local function expect_filetype(expected) - local screen = Screen.new(48, 4) + local screen = Screen.new(50, 4) screen:attach() command('filetype') screen:expect([[ - ^ | - ~ | - ~ | + ^ | + ~ | + ~ | ]]..expected ) end @@ -37,31 +37,49 @@ describe('startup defaults', function() it('enabled by `-u NORC`', function() init_session('-u', 'NORC') expect_filetype( - 'filetype detection:ON plugin:ON indent:ON |') + 'filetype detection:ON plugin:ON indent:ON |') end) it('disabled by `-u NONE`', function() init_session('-u', 'NONE') expect_filetype( - 'filetype detection:OFF plugin:OFF indent:OFF |') + 'filetype detection:OFF plugin:OFF indent:OFF |') end) it('overridden by early `filetype on`', function() init_session('-u', 'NORC', '--cmd', 'filetype on') expect_filetype( - 'filetype detection:ON plugin:OFF indent:OFF |') + 'filetype detection:ON plugin:OFF indent:OFF |') end) it('overridden by early `filetype plugin on`', function() init_session('-u', 'NORC', '--cmd', 'filetype plugin on') expect_filetype( - 'filetype detection:ON plugin:ON indent:OFF |') + 'filetype detection:ON plugin:ON indent:OFF |') end) it('overridden by early `filetype indent on`', function() init_session('-u', 'NORC', '--cmd', 'filetype indent on') expect_filetype( - 'filetype detection:ON plugin:OFF indent:ON |') + 'filetype detection:ON plugin:OFF indent:ON |') + end) + + it('adjusted by late `filetype off`', function() + init_session('-u', 'NORC', '-c', 'filetype off') + expect_filetype( + 'filetype detection:OFF plugin:(on) indent:(on) |') + end) + + it('adjusted by late `filetype plugin off`', function() + init_session('-u', 'NORC', '-c', 'filetype plugin off') + expect_filetype( + 'filetype detection:ON plugin:OFF indent:ON |') + end) + + it('adjusted by late `filetype indent off`', function() + init_session('-u', 'NORC', '-c', 'filetype indent off') + expect_filetype( + 'filetype detection:ON plugin:ON indent:OFF |') end) end) @@ -80,6 +98,11 @@ describe('startup defaults', function() init_session('-u', 'NORC', '--cmd', 'syntax off') eq(0, eval('exists("g:syntax_on")')) end) + + it('adjusted by late `syntax off`', function() + init_session('-u', 'NORC', '-c', 'syntax off') + eq(0, eval('exists("g:syntax_on")')) + end) end) describe('packpath', function() From 56911050e0e8b1917ef6d750cf8dac6fdcb9ef06 Mon Sep 17 00:00:00 2001 From: relnod Date: Thu, 27 Apr 2017 21:43:27 +0200 Subject: [PATCH 171/257] refactor/single-include (#6604) --- src/nvim/CMakeLists.txt | 5 ----- src/nvim/sha256.h | 1 + src/nvim/sign_defs.h | 2 ++ src/nvim/spell.h | 2 ++ src/nvim/spellfile.h | 1 + src/nvim/tag.h | 3 +++ 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 9e9e9b6026..691f230b6e 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -436,12 +436,7 @@ set(NO_SINGLE_CHECK_HEADERS os_unix.h os/win_defs.h regexp_defs.h - sha256.h - sign_defs.h - spell.h - spellfile.h syntax_defs.h - tag.h terminal.h tui/tui.h undo.h diff --git a/src/nvim/sha256.h b/src/nvim/sha256.h index a118826542..deb881a288 100644 --- a/src/nvim/sha256.h +++ b/src/nvim/sha256.h @@ -2,6 +2,7 @@ #define NVIM_SHA256_H #include // for uint32_t +#include #include "nvim/types.h" // for char_u diff --git a/src/nvim/sign_defs.h b/src/nvim/sign_defs.h index 7288a48e21..3778f4287e 100644 --- a/src/nvim/sign_defs.h +++ b/src/nvim/sign_defs.h @@ -1,6 +1,8 @@ #ifndef NVIM_SIGN_DEFS_H #define NVIM_SIGN_DEFS_H +#include "nvim/pos.h" + // signs: line annotations typedef struct signlist signlist_T; diff --git a/src/nvim/spell.h b/src/nvim/spell.h index e950644a6d..ad66df4c5d 100644 --- a/src/nvim/spell.h +++ b/src/nvim/spell.h @@ -4,6 +4,8 @@ #include #include "nvim/spell_defs.h" +#include "nvim/ex_cmds_defs.h" +#include "nvim/globals.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "spell.h.generated.h" diff --git a/src/nvim/spellfile.h b/src/nvim/spellfile.h index 89acddda0d..633ee014a7 100644 --- a/src/nvim/spellfile.h +++ b/src/nvim/spellfile.h @@ -5,6 +5,7 @@ #include "nvim/spell_defs.h" #include "nvim/types.h" +#include "nvim/ex_cmds_defs.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "spellfile.h.generated.h" diff --git a/src/nvim/tag.h b/src/nvim/tag.h index 5d4bcddf94..a8fddd05da 100644 --- a/src/nvim/tag.h +++ b/src/nvim/tag.h @@ -1,6 +1,9 @@ #ifndef NVIM_TAG_H #define NVIM_TAG_H +#include "nvim/types.h" +#include "nvim/ex_cmds_defs.h" + /* * Values for do_tag(). */ From 2b6a3819e5d0135102e0a771be9272e73ea88389 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 28 Apr 2017 02:20:40 +0200 Subject: [PATCH 172/257] build_stl_str_hl: Array name should be plural. --- src/nvim/buffer.c | 149 +++++++++++++++++++++++----------------------- 1 file changed, 74 insertions(+), 75 deletions(-) diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 46f2cdac79..e0812b4aed 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3060,7 +3060,7 @@ int build_stl_str_hl( StlClickRecord *tabtab ) { - int groupitem[STL_MAX_ITEM]; + int groupitems[STL_MAX_ITEM]; struct stl_item { // Where the item starts in the status line output buffer char_u *start; @@ -3080,7 +3080,7 @@ int build_stl_str_hl( ClickFunc, Trunc } type; - } item[STL_MAX_ITEM]; + } items[STL_MAX_ITEM]; #define TMPLEN 70 char_u tmp[TMPLEN]; char_u *usefmt = fmt; @@ -3182,16 +3182,16 @@ int build_stl_str_hl( if (groupdepth > 0) { continue; } - item[curitem].type = Separate; - item[curitem++].start = out_p; + items[curitem].type = Separate; + items[curitem++].start = out_p; continue; } // STL_TRUNCMARK: Where to begin truncating if the statusline is too long. if (*fmt_p == STL_TRUNCMARK) { fmt_p++; - item[curitem].type = Trunc; - item[curitem++].start = out_p; + items[curitem].type = Trunc; + items[curitem++].start = out_p; continue; } @@ -3207,7 +3207,7 @@ int build_stl_str_hl( // Determine how long the group is. // Note: We set the current output position to null // so `vim_strsize` will work. - char_u *t = item[groupitem[groupdepth]].start; + char_u *t = items[groupitems[groupdepth]].start; *out_p = NUL; long group_len = vim_strsize(t); @@ -3217,11 +3217,11 @@ int build_stl_str_hl( // move the output pointer back to where the group started. // Note: This erases any non-item characters that were in the group. // Otherwise there would be no reason to do this step. - if (curitem > groupitem[groupdepth] + 1 - && item[groupitem[groupdepth]].minwid == 0) { + if (curitem > groupitems[groupdepth] + 1 + && items[groupitems[groupdepth]].minwid == 0) { bool has_normal_items = false; - for (long n = groupitem[groupdepth] + 1; n < curitem; n++) { - if (item[n].type == Normal || item[n].type == Highlight) { + for (long n = groupitems[groupdepth] + 1; n < curitem; n++) { + if (items[n].type == Normal || items[n].type == Highlight) { has_normal_items = true; break; } @@ -3235,18 +3235,18 @@ int build_stl_str_hl( // If the group is longer than it is allowed to be // truncate by removing bytes from the start of the group text. - if (group_len > item[groupitem[groupdepth]].maxwid) { + if (group_len > items[groupitems[groupdepth]].maxwid) { // { Determine the number of bytes to remove long n; if (has_mbyte) { /* Find the first character that should be included. */ n = 0; - while (group_len >= item[groupitem[groupdepth]].maxwid) { + while (group_len >= items[groupitems[groupdepth]].maxwid) { group_len -= ptr2cells(t + n); n += (*mb_ptr2len)(t + n); } } else { - n = (long)(out_p - t) - item[groupitem[groupdepth]].maxwid + 1; + n = (long)(out_p - t) - items[groupitems[groupdepth]].maxwid + 1; } // } @@ -3257,24 +3257,24 @@ int build_stl_str_hl( memmove(t + 1, t + n, (size_t)(out_p - (t + n))); out_p = out_p - n + 1; /* Fill up space left over by half a double-wide char. */ - while (++group_len < item[groupitem[groupdepth]].minwid) + while (++group_len < items[groupitems[groupdepth]].minwid) *out_p++ = fillchar; // } /* correct the start of the items for the truncation */ - for (int idx = groupitem[groupdepth] + 1; idx < curitem; idx++) { + for (int idx = groupitems[groupdepth] + 1; idx < curitem; idx++) { // Shift everything back by the number of removed bytes - item[idx].start -= n; + items[idx].start -= n; // If the item was partially or completely truncated, set its // start to the start of the group - if (item[idx].start < t) { - item[idx].start = t; + if (items[idx].start < t) { + items[idx].start = t; } } // If the group is shorter than the minimum width, add padding characters. - } else if (abs(item[groupitem[groupdepth]].minwid) > group_len) { - long min_group_width = item[groupitem[groupdepth]].minwid; + } else if (abs(items[groupitems[groupdepth]].minwid) > group_len) { + long min_group_width = items[groupitems[groupdepth]].minwid; // If the group is left-aligned, add characters to the right. if (min_group_width < 0) { min_group_width = 0 - min_group_width; @@ -3293,8 +3293,8 @@ int build_stl_str_hl( // } // Adjust item start positions - for (int n = groupitem[groupdepth] + 1; n < curitem; n++) { - item[n].start += group_len; + for (int n = groupitems[groupdepth] + 1; n < curitem; n++) { + items[n].start += group_len; } // Prepend the fill characters @@ -3332,9 +3332,9 @@ int build_stl_str_hl( // User highlight groups override the min width field // to denote the styling to use. if (*fmt_p == STL_USER_HL) { - item[curitem].type = Highlight; - item[curitem].start = out_p; - item[curitem].minwid = minwid > 9 ? 1 : minwid; + items[curitem].type = Highlight; + items[curitem].start = out_p; + items[curitem].minwid = minwid > 9 ? 1 : minwid; fmt_p++; curitem++; continue; @@ -3369,17 +3369,17 @@ int build_stl_str_hl( /* %X ends the close label, go back to the previously * define tab label nr. */ for (long n = curitem - 1; n >= 0; --n) - if (item[n].type == TabPage && item[n].minwid >= 0) { - minwid = item[n].minwid; + if (items[n].type == TabPage && items[n].minwid >= 0) { + minwid = items[n].minwid; break; } } else /* close nrs are stored as negative values */ minwid = -minwid; } - item[curitem].type = TabPage; - item[curitem].start = out_p; - item[curitem].minwid = minwid; + items[curitem].type = TabPage; + items[curitem].start = out_p; + items[curitem].minwid = minwid; fmt_p++; curitem++; continue; @@ -3394,10 +3394,10 @@ int build_stl_str_hl( if (*fmt_p != STL_CLICK_FUNC) { break; } - item[curitem].type = ClickFunc; - item[curitem].start = out_p; - item[curitem].cmd = xmemdupz(t, (size_t) (((char *) fmt_p - t))); - item[curitem].minwid = minwid; + items[curitem].type = ClickFunc; + items[curitem].start = out_p; + items[curitem].cmd = xmemdupz(t, (size_t) (((char *) fmt_p - t))); + items[curitem].minwid = minwid; fmt_p++; curitem++; continue; @@ -3420,11 +3420,11 @@ int build_stl_str_hl( // Denotes the start of a new group if (*fmt_p == '(') { - groupitem[groupdepth++] = curitem; - item[curitem].type = Group; - item[curitem].start = out_p; - item[curitem].minwid = minwid; - item[curitem].maxwid = maxwid; + groupitems[groupdepth++] = curitem; + items[curitem].type = Group; + items[curitem].start = out_p; + items[curitem].minwid = minwid; + items[curitem].maxwid = maxwid; fmt_p++; curitem++; continue; @@ -3451,7 +3451,7 @@ int build_stl_str_hl( case STL_FULLPATH: case STL_FILENAME: { - // Set fillable to false to that ' ' in the filename will not + // Set fillable to false so that ' ' in the filename will not // get replaced with the fillchar fillable = false; if (buf_spname(wp->w_buffer) != NULL) { @@ -3703,9 +3703,9 @@ int build_stl_str_hl( // Create a highlight item based on the name if (*fmt_p == '#') { - item[curitem].type = Highlight; - item[curitem].start = out_p; - item[curitem].minwid = -syn_namen2id(t, (int)(fmt_p - t)); + items[curitem].type = Highlight; + items[curitem].start = out_p; + items[curitem].minwid = -syn_namen2id(t, (int)(fmt_p - t)); curitem++; fmt_p++; } @@ -3716,8 +3716,8 @@ int build_stl_str_hl( // If we made it this far, the item is normal and starts at // our current position in the output buffer. // Non-normal items would have `continued`. - item[curitem].start = out_p; - item[curitem].type = Normal; + items[curitem].start = out_p; + items[curitem].type = Normal; // Copy the item string into the output buffer if (str != NULL && *str) { @@ -3874,7 +3874,7 @@ int build_stl_str_hl( // Otherwise, there was nothing to print so mark the item as empty } else { - item[curitem].type = Empty; + items[curitem].type = Empty; } // Only free the string buffer if we allocated it. @@ -3899,8 +3899,7 @@ int build_stl_str_hl( } // We have now processed the entire statusline format string. - // What follows is post-processing to handle alignment and - // highlighting factors. + // What follows is post-processing to handle alignment and highlighting. int width = vim_strsize(out); if (maxwidth > 0 && width > maxwidth) { @@ -3915,13 +3914,13 @@ int build_stl_str_hl( // Otherwise, look for the truncation item } else { // Default to truncating at the first item - trunc_p = item[0].start; + trunc_p = items[0].start; item_idx = 0; for (int i = 0; i < itemcnt; i++) - if (item[i].type == Trunc) { - // Truncate at %< item. - trunc_p = item[i].start; + if (items[i].type == Trunc) { + // Truncate at %< items. + trunc_p = items[i].start; item_idx = i; break; } @@ -3954,7 +3953,7 @@ int build_stl_str_hl( // Ignore any items in the statusline that occur after // the truncation point for (int i = 0; i < itemcnt; i++) { - if (item[i].start > trunc_p) { + if (items[i].start > trunc_p) { itemcnt = i; break; } @@ -4009,12 +4008,12 @@ int build_stl_str_hl( for (int i = item_idx; i < itemcnt; i++) { // Items starting at or after the end of the truncated section need // to be moved backwards. - if (item[i].start >= trunc_end_p) { - item[i].start -= item_offset; + if (items[i].start >= trunc_end_p) { + items[i].start -= item_offset; // Anything inside the truncated area is set to start // at the `<` truncation character. } else { - item[i].start = trunc_p; + items[i].start = trunc_p; } } // } @@ -4030,7 +4029,7 @@ int build_stl_str_hl( // figuring out how many groups there are. int num_separators = 0; for (int i = 0; i < itemcnt; i++) { - if (item[i].type == Separate) { + if (items[i].type == Separate) { num_separators++; } } @@ -4042,7 +4041,7 @@ int build_stl_str_hl( int separator_locations[STL_MAX_ITEM]; int index = 0; for (int i = 0; i < itemcnt; i++) { - if (item[i].type == Separate) { + if (items[i].type == Separate) { separator_locations[index] = i; index++; } @@ -4055,16 +4054,16 @@ int build_stl_str_hl( for (int i = 0; i < num_separators; i++) { int dislocation = (i == (num_separators - 1)) ? final_spaces : standard_spaces; - char_u *sep_loc = item[separator_locations[i]].start + dislocation; - STRMOVE(sep_loc, item[separator_locations[i]].start); - for (char_u *s = item[separator_locations[i]].start; s < sep_loc; s++) { + char_u *sep_loc = items[separator_locations[i]].start + dislocation; + STRMOVE(sep_loc, items[separator_locations[i]].start); + for (char_u *s = items[separator_locations[i]].start; s < sep_loc; s++) { *s = fillchar; } for (int item_idx = separator_locations[i] + 1; item_idx < itemcnt; item_idx++) { - item[item_idx].start += dislocation; + items[item_idx].start += dislocation; } } @@ -4076,9 +4075,9 @@ int build_stl_str_hl( if (hltab != NULL) { struct stl_hlrec *sp = hltab; for (long l = 0; l < itemcnt; l++) { - if (item[l].type == Highlight) { - sp->start = item[l].start; - sp->userhl = item[l].minwid; + if (items[l].type == Highlight) { + sp->start = items[l].start; + sp->userhl = items[l].minwid; sp++; } } @@ -4090,14 +4089,14 @@ int build_stl_str_hl( if (tabtab != NULL) { StlClickRecord *cur_tab_rec = tabtab; for (long l = 0; l < itemcnt; l++) { - if (item[l].type == TabPage) { - cur_tab_rec->start = (char *) item[l].start; - if (item[l].minwid == 0) { + if (items[l].type == TabPage) { + cur_tab_rec->start = (char *) items[l].start; + if (items[l].minwid == 0) { cur_tab_rec->def.type = kStlClickDisabled; cur_tab_rec->def.tabnr = 0; } else { - int tabnr = item[l].minwid; - if (item[l].minwid > 0) { + int tabnr = items[l].minwid; + if (items[l].minwid > 0) { cur_tab_rec->def.type = kStlClickTabSwitch; } else { cur_tab_rec->def.type = kStlClickTabClose; @@ -4107,11 +4106,11 @@ int build_stl_str_hl( } cur_tab_rec->def.func = NULL; cur_tab_rec++; - } else if (item[l].type == ClickFunc) { - cur_tab_rec->start = (char *) item[l].start; + } else if (items[l].type == ClickFunc) { + cur_tab_rec->start = (char *) items[l].start; cur_tab_rec->def.type = kStlClickFuncRun; - cur_tab_rec->def.tabnr = item[l].minwid; - cur_tab_rec->def.func = item[l].cmd; + cur_tab_rec->def.tabnr = items[l].minwid; + cur_tab_rec->def.func = items[l].cmd; cur_tab_rec++; } } From 0ddebbc354273ada61734e5d35517ac49362c2d9 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 28 Apr 2017 05:27:47 +0200 Subject: [PATCH 173/257] lint --- src/nvim/buffer.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index e0812b4aed..7477118d6f 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3256,12 +3256,13 @@ int build_stl_str_hl( // { Move the truncated output memmove(t + 1, t + n, (size_t)(out_p - (t + n))); out_p = out_p - n + 1; - /* Fill up space left over by half a double-wide char. */ - while (++group_len < items[groupitems[groupdepth]].minwid) + // Fill up space left over by half a double-wide char. + while (++group_len < items[groupitems[groupdepth]].minwid) { *out_p++ = fillchar; + } // } - /* correct the start of the items for the truncation */ + // correct the start of the items for the truncation for (int idx = groupitems[groupdepth] + 1; idx < curitem; idx++) { // Shift everything back by the number of removed bytes items[idx].start -= n; @@ -3366,16 +3367,17 @@ int build_stl_str_hl( if (*fmt_p == STL_TABPAGENR || *fmt_p == STL_TABCLOSENR) { if (*fmt_p == STL_TABCLOSENR) { if (minwid == 0) { - /* %X ends the close label, go back to the previously - * define tab label nr. */ - for (long n = curitem - 1; n >= 0; --n) + // %X ends the close label, go back to the previous tab label nr. + for (long n = curitem - 1; n >= 0; n--) { if (items[n].type == TabPage && items[n].minwid >= 0) { minwid = items[n].minwid; break; } - } else - /* close nrs are stored as negative values */ + } + } else { + // close nrs are stored as negative values minwid = -minwid; + } } items[curitem].type = TabPage; items[curitem].start = out_p; @@ -3396,7 +3398,7 @@ int build_stl_str_hl( } items[curitem].type = ClickFunc; items[curitem].start = out_p; - items[curitem].cmd = xmemdupz(t, (size_t) (((char *) fmt_p - t))); + items[curitem].cmd = xmemdupz(t, (size_t)(((char *)fmt_p - t))); items[curitem].minwid = minwid; fmt_p++; curitem++; @@ -3917,13 +3919,14 @@ int build_stl_str_hl( trunc_p = items[0].start; item_idx = 0; - for (int i = 0; i < itemcnt; i++) + for (int i = 0; i < itemcnt; i++) { if (items[i].type == Trunc) { // Truncate at %< items. trunc_p = items[i].start; item_idx = i; break; } + } } // If the truncation point we found is beyond the maximum @@ -4052,11 +4055,11 @@ int build_stl_str_hl( standard_spaces * (num_separators - 1); for (int i = 0; i < num_separators; i++) { - int dislocation = (i == (num_separators - 1)) ? - final_spaces : standard_spaces; - char_u *sep_loc = items[separator_locations[i]].start + dislocation; - STRMOVE(sep_loc, items[separator_locations[i]].start); - for (char_u *s = items[separator_locations[i]].start; s < sep_loc; s++) { + int dislocation = (i == (num_separators - 1)) + ? final_spaces : standard_spaces; + char_u *seploc = items[separator_locations[i]].start + dislocation; + STRMOVE(seploc, items[separator_locations[i]].start); + for (char_u *s = items[separator_locations[i]].start; s < seploc; s++) { *s = fillchar; } @@ -4090,7 +4093,7 @@ int build_stl_str_hl( StlClickRecord *cur_tab_rec = tabtab; for (long l = 0; l < itemcnt; l++) { if (items[l].type == TabPage) { - cur_tab_rec->start = (char *) items[l].start; + cur_tab_rec->start = (char *)items[l].start; if (items[l].minwid == 0) { cur_tab_rec->def.type = kStlClickDisabled; cur_tab_rec->def.tabnr = 0; @@ -4107,7 +4110,7 @@ int build_stl_str_hl( cur_tab_rec->def.func = NULL; cur_tab_rec++; } else if (items[l].type == ClickFunc) { - cur_tab_rec->start = (char *) items[l].start; + cur_tab_rec->start = (char *)items[l].start; cur_tab_rec->def.type = kStlClickFuncRun; cur_tab_rec->def.tabnr = items[l].minwid; cur_tab_rec->def.func = items[l].cmd; From 7044aa6e8256844bc1bd23eb61d4a41ca6d418d0 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 28 Apr 2017 07:01:46 +0200 Subject: [PATCH 174/257] api/ext_tabline: `curtab` should be a Tabpage handle. --- src/nvim/screen.c | 2 +- test/functional/ui/tabline_spec.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index de24156579..f2709c48fd 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -7035,7 +7035,7 @@ static void draw_tabline(void) void ui_ext_tabline_update(void) { Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ(curtab->handle)); + ADD(args, TABPAGE_OBJ(curtab->handle)); Array tabs = ARRAY_DICT_INIT; FOR_ALL_TABS(tp) { Dictionary tab_info = ARRAY_DICT_INIT; diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua index 2d5faf394b..56331a33b5 100644 --- a/test/functional/ui/tabline_spec.lua +++ b/test/functional/ui/tabline_spec.lua @@ -36,7 +36,7 @@ describe('ui/tabline', function() ~ | | ]], nil, nil, function() - eq(2, event_curtab) + eq({ id = 2 }, event_curtab) eq(expected_tabs, event_tabs) end) @@ -48,7 +48,7 @@ describe('ui/tabline', function() ~ | | ]], nil, nil, function() - eq(1, event_curtab) + eq({ id = 1 }, event_curtab) eq(expected_tabs, event_tabs) end) From 3ea10077534cb1dcb1597ffcf85e601fa0c0e27b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 13 Mar 2017 15:02:37 +0100 Subject: [PATCH 175/257] api: nvim_get_mode() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Asynchronous API functions are served immediately, which means pending input could change the state of Nvim shortly after an async API function result is returned. nvim_get_mode() is different: - If RPCs are known to be blocked, it responds immediately (without flushing the input/event queue) - else it is handled just-in-time before waiting for input, after pending input was processed. This makes the result more reliable (but not perfect). Internally this is handled as a special case, but _semantically_ nothing has changed: API users never know when input flushes, so this internal special-case doesn't violate that. As far as API users are concerned, nvim_get_mode() is just another asynchronous API function. In all cases nvim_get_mode() never blocks for more than the time it takes to flush the input/event queue (~µs). Note: This doesn't address #6166; nvim_get_mode() will provoke #6166 if e.g. `d` is operator-pending. Closes #6159 --- runtime/doc/help.txt | 5 -- runtime/doc/intro.txt | 5 -- runtime/doc/message.txt | 4 -- src/nvim/api/vim.c | 21 ++++++ src/nvim/eval.c | 55 ++-------------- src/nvim/event/loop.c | 3 +- src/nvim/event/multiqueue.c | 35 ++++++++++ src/nvim/memory.c | 4 -- src/nvim/msgpack_rpc/channel.c | 10 +++ src/nvim/msgpack_rpc/helpers.c | 2 +- src/nvim/normal.c | 5 +- src/nvim/os/input.c | 16 +++++ src/nvim/state.c | 49 ++++++++++++++ src/nvim/tui/tui.c | 3 - test/functional/api/vim_spec.lua | 106 ++++++++++++++++++++++++++++++- test/functional/helpers.lua | 4 +- 16 files changed, 250 insertions(+), 77 deletions(-) diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt index f71f46bad3..3837cf3e26 100644 --- a/runtime/doc/help.txt +++ b/runtime/doc/help.txt @@ -154,22 +154,17 @@ Interfaces ~ |if_cscop.txt| using Cscope with Vim |if_pyth.txt| Python interface |if_ruby.txt| Ruby interface -|debugger.txt| Interface with a debugger |sign.txt| debugging signs Versions ~ |vim_diff.txt| Main differences between Nvim and Vim |vi_diff.txt| Main differences between Vim and Vi - *sys-file-list* -Remarks about specific systems ~ -|os_win32.txt| MS-Windows *standard-plugin-list* Standard plugins ~ |pi_gzip.txt| Reading and writing compressed files |pi_netrw.txt| Reading and writing files over a network |pi_paren.txt| Highlight matching parens |pi_tar.txt| Tar file explorer -|pi_vimball.txt| Create a self-installing Vim script |pi_zip.txt| Zip archive explorer LOCAL ADDITIONS: *local-additions* diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt index a5f9106bb0..bc34b69508 100644 --- a/runtime/doc/intro.txt +++ b/runtime/doc/intro.txt @@ -34,11 +34,6 @@ It can be accessed from within Vim with the or key and with the is not located in the default place. You can jump to subjects like with tags: Use CTRL-] to jump to a subject under the cursor, use CTRL-T to jump back. -This manual refers to Vim on various machines. There may be small differences -between different computers and terminals. Besides the remarks given in this -document, there is a separate document for each supported system, see -|sys-file-list|. - *pronounce* Vim is pronounced as one word, like Jim, not vi-ai-em. It's written with a capital, since it's a name, again like Jim. diff --git a/runtime/doc/message.txt b/runtime/doc/message.txt index d0bdba41ab..5c2dddc8b3 100644 --- a/runtime/doc/message.txt +++ b/runtime/doc/message.txt @@ -40,10 +40,6 @@ Note: If the output has been stopped with "q" at the more prompt, it will only be displayed up to this point. The previous command output is cleared when another command produces output. -If you are using translated messages, the first printed line tells who -maintains the messages or the translations. You can use this to contact the -maintainer when you spot a mistake. - If you want to find help on a specific (error) message, use the ID at the start of the message. For example, to get help on the message: > diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index da00fbc6e3..7c57a5b456 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -11,6 +11,7 @@ #include "nvim/api/vim.h" #include "nvim/ascii.h" +#include "nvim/log.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/defs.h" #include "nvim/api/buffer.h" @@ -27,6 +28,7 @@ #include "nvim/eval.h" #include "nvim/eval/typval.h" #include "nvim/option.h" +#include "nvim/state.h" #include "nvim/syntax.h" #include "nvim/getchar.h" #include "nvim/os/input.h" @@ -701,6 +703,25 @@ Dictionary nvim_get_color_map(void) } +/// Gets the current mode. +/// mode: Mode string. |mode()| +/// blocking: true if Nvim is waiting for input. +/// +/// @returns Dictionary { "mode": String, "blocking": Boolean } +Dictionary nvim_get_mode(void) + FUNC_API_SINCE(2) FUNC_API_ASYNC +{ + Dictionary rv = ARRAY_DICT_INIT; + char *modestr = get_mode(); + bool blocked = input_blocking(); + ILOG("blocked=%d", blocked); + + PUT(rv, "mode", STRING_OBJ(cstr_as_string(modestr))); + PUT(rv, "blocking", BOOLEAN_OBJ(blocked)); + + return rv; +} + Array nvim_get_api_info(uint64_t channel_id) FUNC_API_SINCE(1) FUNC_API_ASYNC FUNC_API_NOEVAL { diff --git a/src/nvim/eval.c b/src/nvim/eval.c index c02d172458..b0f47d8e45 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -12575,59 +12575,18 @@ static void f_mkdir(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } -/* - * "mode()" function - */ +/// "mode()" function static void f_mode(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u buf[3]; + char *mode = get_mode(); - buf[1] = NUL; - buf[2] = NUL; - - if (VIsual_active) { - if (VIsual_select) - buf[0] = VIsual_mode + 's' - 'v'; - else - buf[0] = VIsual_mode; - } else if (State == HITRETURN || State == ASKMORE || State == SETWSIZE - || State == CONFIRM) { - buf[0] = 'r'; - if (State == ASKMORE) - buf[1] = 'm'; - else if (State == CONFIRM) - buf[1] = '?'; - } else if (State == EXTERNCMD) - buf[0] = '!'; - else if (State & INSERT) { - if (State & VREPLACE_FLAG) { - buf[0] = 'R'; - buf[1] = 'v'; - } else if (State & REPLACE_FLAG) - buf[0] = 'R'; - else - buf[0] = 'i'; - } else if (State & CMDLINE) { - buf[0] = 'c'; - if (exmode_active) - buf[1] = 'v'; - } else if (exmode_active) { - buf[0] = 'c'; - buf[1] = 'e'; - } else if (State & TERM_FOCUS) { - buf[0] = 't'; - } else { - buf[0] = 'n'; - if (finish_op) - buf[1] = 'o'; + // Clear out the minor mode when the argument is not a non-zero number or + // non-empty string. + if (!non_zero_arg(&argvars[0])) { + mode[1] = NUL; } - /* Clear out the minor mode when the argument is not a non-zero number or - * non-empty string. */ - if (!non_zero_arg(&argvars[0])) - buf[1] = NUL; - - rettv->vval.v_string = vim_strsave(buf); + rettv->vval.v_string = (char_u *)mode; rettv->v_type = VAR_STRING; } diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c index 6963978581..c709ce9a1c 100644 --- a/src/nvim/event/loop.c +++ b/src/nvim/event/loop.c @@ -44,8 +44,7 @@ void loop_poll_events(Loop *loop, int ms) // we do not block indefinitely for I/O. uv_timer_start(&loop->poll_timer, timer_cb, (uint64_t)ms, (uint64_t)ms); } else if (ms == 0) { - // For ms == 0, we need to do a non-blocking event poll by - // setting the run mode to UV_RUN_NOWAIT. + // For ms == 0, do a non-blocking event poll. mode = UV_RUN_NOWAIT; } diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c index a17bae31e3..b144347fdb 100644 --- a/src/nvim/event/multiqueue.c +++ b/src/nvim/event/multiqueue.c @@ -55,6 +55,7 @@ #include "nvim/event/multiqueue.h" #include "nvim/memory.h" +#include "nvim/log.h" #include "nvim/os/time.h" typedef struct multiqueue_item MultiQueueItem; @@ -151,6 +152,40 @@ void multiqueue_process_events(MultiQueue *this) } } +void multiqueue_process_debug(MultiQueue *this) +{ + assert(this); + QUEUE *start = QUEUE_HEAD(&this->headtail); + QUEUE *cur = start; + // MultiQueue *start = this; + // MultiQueue *cur = start; + do { + MultiQueueItem *item = multiqueue_node_data(cur); + Event ev; + if (item->link) { + assert(!this->parent); + // get the next node in the linked queue + MultiQueue *linked = item->data.queue; + assert(!multiqueue_empty(linked)); + MultiQueueItem *child = + multiqueue_node_data(QUEUE_HEAD(&linked->headtail)); + ev = child->data.item.event; + } else { + ev = item->data.item.event; + } + + // Event event = multiqueue_get(this); + // if (event.handler) { + // event.handler(event.argv); + // } + + ILOG("ev: priority=%d, handler=%p arg1=%s", ev.priority, ev.handler, + ev.argv ? ev.argv[0] : "(null)"); + + cur = cur->next; + } while (cur && cur != start); +} + /// Removes all events without processing them. void multiqueue_purge_events(MultiQueue *this) { diff --git a/src/nvim/memory.c b/src/nvim/memory.c index 0ee4776581..74c58fb203 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -345,10 +345,6 @@ char *xstpcpy(char *restrict dst, const char *restrict src) /// WARNING: xstpncpy will ALWAYS write maxlen bytes. If src is shorter than /// maxlen, zeroes will be written to the remaining bytes. /// -/// TODO(aktau): I don't see a good reason to have this last behaviour, and -/// it is potentially wasteful. Could we perhaps deviate from the standard -/// and not zero the rest of the buffer? -/// /// @param dst /// @param src /// @param maxlen diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 59594357de..799e6eadef 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -28,7 +28,9 @@ #include "nvim/map.h" #include "nvim/log.h" #include "nvim/misc1.h" +#include "nvim/state.h" #include "nvim/lib/kvec.h" +#include "nvim/os/input.h" #define CHANNEL_BUFFER_SIZE 0xffff @@ -433,6 +435,14 @@ static void handle_request(Channel *channel, msgpack_object *request) handler.async = true; } + if (handler.async) { + char buf[256] = { 0 }; + memcpy(buf, method->via.bin.ptr, MIN(255, method->via.bin.size)); + if (strcmp("nvim_get_mode", buf) == 0) { + handler.async = input_blocking(); + } + } + RequestEvent *event_data = xmalloc(sizeof(RequestEvent)); event_data->channel = channel; event_data->handler = handler; diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index 0228582d37..91ef5524ea 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -76,7 +76,7 @@ typedef struct { size_t idx; } MPToAPIObjectStackItem; -/// Convert type used by msgpack parser to Neovim own API type +/// Convert type used by msgpack parser to Nvim API type. /// /// @param[in] obj Msgpack value to convert. /// @param[out] arg Location where result of conversion will be saved. diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 51da9429b6..09ad7beb4b 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -14,6 +14,7 @@ #include #include "nvim/vim.h" +#include "nvim/log.h" #include "nvim/ascii.h" #include "nvim/normal.h" #include "nvim/buffer.h" @@ -541,7 +542,7 @@ static bool normal_handle_special_visual_command(NormalState *s) return false; } -static bool normal_need_aditional_char(NormalState *s) +static bool normal_need_additional_char(NormalState *s) { int flags = nv_cmds[s->idx].cmd_flags; bool pending_op = s->oa.op_type != OP_NOP; @@ -1083,7 +1084,7 @@ static int normal_execute(VimState *state, int key) } // Get an additional character if we need one. - if (normal_need_aditional_char(s)) { + if (normal_need_additional_char(s)) { normal_get_additional_char(s); } diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 7b5e14dd19..26f2be6c02 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -23,6 +23,7 @@ #include "nvim/main.h" #include "nvim/misc1.h" #include "nvim/state.h" +#include "nvim/log.h" #define READ_BUFFER_SIZE 0xfff #define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4) @@ -38,6 +39,7 @@ static RBuffer *input_buffer = NULL; static bool input_eof = false; static int global_fd = 0; static int events_enabled = 0; +static bool blocking = false; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/input.c.generated.h" @@ -327,13 +329,27 @@ static unsigned int handle_mouse_event(char **ptr, uint8_t *buf, return bufsize; } +/// @return true if the main loop is blocked and waiting for input. +bool input_blocking(void) +{ + return blocking; +} + static bool input_poll(int ms) { if (do_profiling == PROF_YES && ms) { prof_inchar_enter(); } + if ((ms == - 1 || ms > 0) + && !(events_enabled || input_ready() || input_eof) + ) { + blocking = true; + multiqueue_process_debug(main_loop.events); + multiqueue_process_events(main_loop.events); + } LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, ms, input_ready() || input_eof); + blocking = false; if (do_profiling == PROF_YES && ms) { prof_inchar_exit(); diff --git a/src/nvim/state.c b/src/nvim/state.c index 210708c3f4..be6aa21664 100644 --- a/src/nvim/state.c +++ b/src/nvim/state.c @@ -98,3 +98,52 @@ int get_real_state(void) return State; } +/// @returns[allocated] mode string +char *get_mode(void) +{ + char *buf = xcalloc(3, sizeof(char)); + + if (VIsual_active) { + if (VIsual_select) { + buf[0] = (char)(VIsual_mode + 's' - 'v'); + } else { + buf[0] = (char)VIsual_mode; + } + } else if (State == HITRETURN || State == ASKMORE || State == SETWSIZE + || State == CONFIRM) { + buf[0] = 'r'; + if (State == ASKMORE) { + buf[1] = 'm'; + } else if (State == CONFIRM) { + buf[1] = '?'; + } + } else if (State == EXTERNCMD) { + buf[0] = '!'; + } else if (State & INSERT) { + if (State & VREPLACE_FLAG) { + buf[0] = 'R'; + buf[1] = 'v'; + } else if (State & REPLACE_FLAG) { + buf[0] = 'R'; + } else { + buf[0] = 'i'; + } + } else if (State & CMDLINE) { + buf[0] = 'c'; + if (exmode_active) { + buf[1] = 'v'; + } + } else if (exmode_active) { + buf[0] = 'c'; + buf[1] = 'e'; + } else if (State & TERM_FOCUS) { + buf[0] = 't'; + } else { + buf[0] = 'n'; + if (finish_op) { + buf[1] = 'o'; + } + } + + return buf; +} diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 21abc19c47..356221f7ce 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -74,9 +74,6 @@ typedef struct { bool out_isatty; SignalWatcher winch_handle, cont_handle; bool cont_received; - // Event scheduled by the ui bridge. Since the main thread suspends until - // the event is handled, it is fine to use a single field instead of a queue - Event scheduled_event; UGrid grid; kvec_t(Rect) invalid_regions; int out_fd; diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 5b173f3196..d06dd4c487 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -9,6 +9,7 @@ local funcs = helpers.funcs local request = helpers.request local meth_pcall = helpers.meth_pcall local command = helpers.command +local wait = helpers.wait describe('api', function() before_each(clear) @@ -221,6 +222,109 @@ describe('api', function() end) end) + local function appendfile(fname, text) + local file = io.open(fname, 'a') + file:write(text) + file:flush() + file:close() + end + + describe('nvim_get_mode', function() + it("during normal-mode `g` returns blocking=true", function() + nvim("input", "o") -- add a line + eq({mode='i', blocking=false}, nvim("get_mode")) + nvim("input", [[]]) + eq(2, nvim("eval", "line('.')")) + eq({mode='n', blocking=false}, nvim("get_mode")) + + nvim("input", "g") + eq({mode='n', blocking=true}, nvim("get_mode")) + + nvim("input", "k") -- complete the operator + eq(1, nvim("eval", "line('.')")) -- verify the completed operator + eq({mode='n', blocking=false}, nvim("get_mode")) + end) + + it("returns the correct result multiple consecutive times", function() + for _ = 1,5 do + eq({mode='n', blocking=false}, nvim("get_mode")) + end + nvim("input", "g") + for _ = 1,4 do + eq({mode='n', blocking=true}, nvim("get_mode")) + end + nvim("input", "g") + for _ = 1,7 do + eq({mode='n', blocking=false}, nvim("get_mode")) + end + end) + + it("during normal-mode CTRL-W, returns blocking=true", function() + nvim("input", "") + eq({mode='n', blocking=true}, nvim("get_mode")) + + nvim("input", "s") -- complete the operator + eq(2, nvim("eval", "winnr('$')")) -- verify the completed operator + eq({mode='n', blocking=false}, nvim("get_mode")) + end) + + it("during press-enter prompt returns blocking=true", function() + eq({mode='n', blocking=false}, nvim("get_mode")) + command("echom 'msg1'") + command("echom 'msg2'") + command("echom 'msg3'") + command("echom 'msg4'") + command("echom 'msg5'") + eq({mode='n', blocking=false}, nvim("get_mode")) + nvim("input", ":messages") + eq({mode='r', blocking=true}, nvim("get_mode")) + end) + + it("during getchar() returns blocking=false", function() + nvim("input", ":let g:test_input = nr2char(getchar())") + -- Events are enabled during getchar(), RPC calls are *not* blocked. #5384 + eq({mode='n', blocking=false}, nvim("get_mode")) + eq(0, nvim("eval", "exists('g:test_input')")) + nvim("input", "J") + eq("J", nvim("eval", "g:test_input")) + eq({mode='n', blocking=false}, nvim("get_mode")) + end) + + -- TODO: bug #6247#issuecomment-286403810 + it("batched with input", function() + eq({mode='n', blocking=false}, nvim("get_mode")) + command("echom 'msg1'") + command("echom 'msg2'") + command("echom 'msg3'") + command("echom 'msg4'") + command("echom 'msg5'") + + local req = { + {'nvim_get_mode', {}}, + {'nvim_input', {':messages'}}, + {'nvim_get_mode', {}}, + {'nvim_eval', {'1'}}, + } + eq({{{mode='n', blocking=false}, + 13, + {mode='n', blocking=false}, -- TODO: should be blocked=true + 1}, + NIL}, meths.call_atomic(req)) + eq({mode='r', blocking=true}, nvim("get_mode")) + end) + -- TODO: bug #6166 + it("during insert-mode map-pending, returns blocking=true #6166", function() + command("inoremap xx foo") + nvim("input", "ix") + eq({mode='i', blocking=true}, nvim("get_mode")) + end) + -- TODO: bug #6166 + it("during normal-mode gU, returns blocking=false #6166", function() + nvim("input", "gu") + eq({mode='no', blocking=false}, nvim("get_mode")) + end) + end) + describe('nvim_replace_termcodes', function() it('escapes K_SPECIAL as K_SPECIAL KS_SPECIAL KE_FILLER', function() eq('\128\254X', helpers.nvim('replace_termcodes', '\128', true, true, true)) @@ -459,7 +563,7 @@ describe('api', function() eq(very_long_name, err:match('Ax+Z?')) end) - it("doesn't leak memory on incorrect argument types", function() + it("does not leak memory on incorrect argument types", function() local status, err = pcall(nvim, 'set_current_dir',{'not', 'a', 'dir'}) eq(false, status) ok(err:match(': Wrong type for argument 1, expecting String') ~= nil) diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 0f30910450..2919165280 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -385,9 +385,9 @@ local function curbuf(method, ...) end local function wait() - -- Execute 'vim_eval' (a deferred function) to block + -- Execute 'nvim_eval' (a deferred function) to block -- until all pending input is processed. - session:request('vim_eval', '1') + session:request('nvim_eval', '1') end -- sleeps the test runner (_not_ the nvim instance) From acfd2a2a29ae852ecc965ca888eb5049400bf39d Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 14 Mar 2017 00:44:03 +0100 Subject: [PATCH 176/257] input.c: Process only safe events before blocking. Introduce multiqueue_process_priority() to process only events at or above a certain priority. --- src/nvim/api/vim.c | 1 - src/nvim/event/defs.h | 5 ++ src/nvim/event/multiqueue.c | 105 ++++++++++++++++--------------- src/nvim/event/multiqueue.h | 2 +- src/nvim/msgpack_rpc/channel.c | 32 +++++----- src/nvim/os/input.c | 10 +-- test/functional/api/vim_spec.lua | 8 --- 7 files changed, 84 insertions(+), 79 deletions(-) diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 7c57a5b456..a00afc24fa 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -714,7 +714,6 @@ Dictionary nvim_get_mode(void) Dictionary rv = ARRAY_DICT_INIT; char *modestr = get_mode(); bool blocked = input_blocking(); - ILOG("blocked=%d", blocked); PUT(rv, "mode", STRING_OBJ(cstr_as_string(modestr))); PUT(rv, "blocking", BOOLEAN_OBJ(blocked)); diff --git a/src/nvim/event/defs.h b/src/nvim/event/defs.h index e5335d9f25..509a3f8e7f 100644 --- a/src/nvim/event/defs.h +++ b/src/nvim/event/defs.h @@ -6,6 +6,11 @@ #define EVENT_HANDLER_MAX_ARGC 6 +typedef enum { + kEvPriorityNormal = 1, + kEvPriorityAsync = 2, // safe to run in any state +} EventPriority; + typedef void (*argv_callback)(void **argv); typedef struct message { int priority; diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c index b144347fdb..a479a032f4 100644 --- a/src/nvim/event/multiqueue.c +++ b/src/nvim/event/multiqueue.c @@ -127,6 +127,7 @@ void multiqueue_free(MultiQueue *this) xfree(this); } +/// Removes the next item and returns its Event. Event multiqueue_get(MultiQueue *this) { return multiqueue_empty(this) ? NILEVENT : multiqueue_remove(this); @@ -145,45 +146,38 @@ void multiqueue_process_events(MultiQueue *this) { assert(this); while (!multiqueue_empty(this)) { - Event event = multiqueue_get(this); + Event event = multiqueue_remove(this); if (event.handler) { event.handler(event.argv); } } } -void multiqueue_process_debug(MultiQueue *this) +void multiqueue_process_priority(MultiQueue *this, int priority) { assert(this); QUEUE *start = QUEUE_HEAD(&this->headtail); - QUEUE *cur = start; - // MultiQueue *start = this; - // MultiQueue *cur = start; - do { + QUEUE *cur = start; + while (!multiqueue_empty(this)) { MultiQueueItem *item = multiqueue_node_data(cur); - Event ev; - if (item->link) { - assert(!this->parent); - // get the next node in the linked queue - MultiQueue *linked = item->data.queue; - assert(!multiqueue_empty(linked)); - MultiQueueItem *child = - multiqueue_node_data(QUEUE_HEAD(&linked->headtail)); - ev = child->data.item.event; + assert(!item->link || !this->parent); // Only a parent queue has link-nodes + Event ev = multiqueueitem_get_event(item, false); + + if (ev.priority >= priority) { + if (ev.handler) { + ev.handler(ev.argv); + } + // Processed. Remove this item and get the new head. + (void)multiqueue_remove(this); + cur = QUEUE_HEAD(&this->headtail); } else { - ev = item->data.item.event; + // Not processed. Skip this item and get the next one. + cur = cur->next->next; + if (!cur || cur == start) { + break; + } } - - // Event event = multiqueue_get(this); - // if (event.handler) { - // event.handler(event.argv); - // } - - ILOG("ev: priority=%d, handler=%p arg1=%s", ev.priority, ev.handler, - ev.argv ? ev.argv[0] : "(null)"); - - cur = cur->next; - } while (cur && cur != start); + } } /// Removes all events without processing them. @@ -213,36 +207,48 @@ size_t multiqueue_size(MultiQueue *this) return this->size; } +/// Gets an Event from an item. +/// +/// @param remove Remove the node from its queue, and free it. +static Event multiqueueitem_get_event(MultiQueueItem *item, bool remove) +{ + assert(item != NULL); + Event ev; + if (item->link) { + // get the next node in the linked queue + MultiQueue *linked = item->data.queue; + assert(!multiqueue_empty(linked)); + MultiQueueItem *child = + multiqueue_node_data(QUEUE_HEAD(&linked->headtail)); + ev = child->data.item.event; + // remove the child node + if (remove) { + QUEUE_REMOVE(&child->node); + xfree(child); + } + } else { + // remove the corresponding link node in the parent queue + if (remove && item->data.item.parent_item) { + QUEUE_REMOVE(&item->data.item.parent_item->node); + xfree(item->data.item.parent_item); + item->data.item.parent_item = NULL; + } + ev = item->data.item.event; + } + return ev; +} + static Event multiqueue_remove(MultiQueue *this) { assert(!multiqueue_empty(this)); QUEUE *h = QUEUE_HEAD(&this->headtail); QUEUE_REMOVE(h); MultiQueueItem *item = multiqueue_node_data(h); - Event rv; - - if (item->link) { - assert(!this->parent); - // remove the next node in the linked queue - MultiQueue *linked = item->data.queue; - assert(!multiqueue_empty(linked)); - MultiQueueItem *child = - multiqueue_node_data(QUEUE_HEAD(&linked->headtail)); - QUEUE_REMOVE(&child->node); - rv = child->data.item.event; - xfree(child); - } else { - if (this->parent) { - // remove the corresponding link node in the parent queue - QUEUE_REMOVE(&item->data.item.parent_item->node); - xfree(item->data.item.parent_item); - } - rv = item->data.item.event; - } - + assert(!item->link || !this->parent); // Only a parent queue has link-nodes + Event ev = multiqueueitem_get_event(item, true); this->size--; xfree(item); - return rv; + return ev; } static void multiqueue_push(MultiQueue *this, Event event) @@ -250,6 +256,7 @@ static void multiqueue_push(MultiQueue *this, Event event) MultiQueueItem *item = xmalloc(sizeof(MultiQueueItem)); item->link = false; item->data.item.event = event; + item->data.item.parent_item = NULL; QUEUE_INSERT_TAIL(&this->headtail, &item->node); if (this->parent) { // push link node to the parent queue diff --git a/src/nvim/event/multiqueue.h b/src/nvim/event/multiqueue.h index def6b95a10..72145482aa 100644 --- a/src/nvim/event/multiqueue.h +++ b/src/nvim/event/multiqueue.h @@ -10,7 +10,7 @@ typedef struct multiqueue MultiQueue; typedef void (*put_callback)(MultiQueue *multiq, void *data); #define multiqueue_put(q, h, ...) \ - multiqueue_put_event(q, event_create(1, h, __VA_ARGS__)); + multiqueue_put_event(q, event_create(kEvPriorityNormal, h, __VA_ARGS__)); #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 799e6eadef..9e43924db1 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -435,24 +435,26 @@ static void handle_request(Channel *channel, msgpack_object *request) handler.async = true; } - if (handler.async) { - char buf[256] = { 0 }; - memcpy(buf, method->via.bin.ptr, MIN(255, method->via.bin.size)); - if (strcmp("nvim_get_mode", buf) == 0) { - handler.async = input_blocking(); - } - } - - RequestEvent *event_data = xmalloc(sizeof(RequestEvent)); - event_data->channel = channel; - event_data->handler = handler; - event_data->args = args; - event_data->request_id = request_id; + RequestEvent *evdata = xmalloc(sizeof(RequestEvent)); + evdata->channel = channel; + evdata->handler = handler; + evdata->args = args; + evdata->request_id = request_id; incref(channel); if (handler.async) { - on_request_event((void **)&event_data); + bool is_get_mode = sizeof("nvim_get_mode") - 1 == method->via.bin.size + && !strncmp("nvim_get_mode", method->via.bin.ptr, method->via.bin.size); + + if (is_get_mode && !input_blocking()) { + // Schedule on the main loop with special priority. #6247 + Event ev = event_create(kEvPriorityAsync, on_request_event, 1, evdata); + multiqueue_put_event(channel->events, ev); + } else { + // Invoke immediately. + on_request_event((void **)&evdata); + } } else { - multiqueue_put(channel->events, on_request_event, 1, event_data); + multiqueue_put(channel->events, on_request_event, 1, evdata); } } diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 26f2be6c02..de6d4a9010 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -341,12 +341,12 @@ static bool input_poll(int ms) prof_inchar_enter(); } - if ((ms == - 1 || ms > 0) - && !(events_enabled || input_ready() || input_eof) - ) { + if ((ms == - 1 || ms > 0) && !events_enabled && !input_eof) { + // We have discovered that the pending input will provoke a blocking wait. + // Process any events marked with priority `kEvPriorityAsync`: these events + // must be handled after flushing input. See channel.c:handle_request #6247 blocking = true; - multiqueue_process_debug(main_loop.events); - multiqueue_process_events(main_loop.events); + multiqueue_process_priority(main_loop.events, kEvPriorityAsync); } LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, ms, input_ready() || input_eof); blocking = false; diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index d06dd4c487..7c79d8832f 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -9,7 +9,6 @@ local funcs = helpers.funcs local request = helpers.request local meth_pcall = helpers.meth_pcall local command = helpers.command -local wait = helpers.wait describe('api', function() before_each(clear) @@ -222,13 +221,6 @@ describe('api', function() end) end) - local function appendfile(fname, text) - local file = io.open(fname, 'a') - file:write(text) - file:flush() - file:close() - end - describe('nvim_get_mode', function() it("during normal-mode `g` returns blocking=true", function() nvim("input", "o") -- add a line From f17a8185191b778960953508a5bf9b5f95b0560c Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 27 Apr 2017 13:54:54 +0200 Subject: [PATCH 177/257] api/nvim_get_mode: Use child-queue instead of "priority". --- src/nvim/api/vim.c | 1 - src/nvim/event/multiqueue.c | 1 - src/nvim/msgpack_rpc/channel.c | 7 +++---- src/nvim/msgpack_rpc/channel.h | 5 +++++ src/nvim/normal.c | 1 - src/nvim/os/input.c | 8 +++----- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index a00afc24fa..11f15b5ad1 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -11,7 +11,6 @@ #include "nvim/api/vim.h" #include "nvim/ascii.h" -#include "nvim/log.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/defs.h" #include "nvim/api/buffer.h" diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c index a479a032f4..66a261b554 100644 --- a/src/nvim/event/multiqueue.c +++ b/src/nvim/event/multiqueue.c @@ -55,7 +55,6 @@ #include "nvim/event/multiqueue.h" #include "nvim/memory.h" -#include "nvim/log.h" #include "nvim/os/time.h" typedef struct multiqueue_item MultiQueueItem; diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c index 9e43924db1..911f2a6fa4 100644 --- a/src/nvim/msgpack_rpc/channel.c +++ b/src/nvim/msgpack_rpc/channel.c @@ -28,7 +28,6 @@ #include "nvim/map.h" #include "nvim/log.h" #include "nvim/misc1.h" -#include "nvim/state.h" #include "nvim/lib/kvec.h" #include "nvim/os/input.h" @@ -91,6 +90,7 @@ static msgpack_sbuffer out_buffer; /// Initializes the module void channel_init(void) { + ch_before_blocking_events = multiqueue_new_child(main_loop.events); channels = pmap_new(uint64_t)(); event_strings = pmap_new(cstr_t)(); msgpack_sbuffer_init(&out_buffer); @@ -446,9 +446,8 @@ static void handle_request(Channel *channel, msgpack_object *request) && !strncmp("nvim_get_mode", method->via.bin.ptr, method->via.bin.size); if (is_get_mode && !input_blocking()) { - // Schedule on the main loop with special priority. #6247 - Event ev = event_create(kEvPriorityAsync, on_request_event, 1, evdata); - multiqueue_put_event(channel->events, ev); + // Defer the event to a special queue used by os/input.c. #6247 + multiqueue_put(ch_before_blocking_events, on_request_event, 1, evdata); } else { // Invoke immediately. on_request_event((void **)&evdata); diff --git a/src/nvim/msgpack_rpc/channel.h b/src/nvim/msgpack_rpc/channel.h index 0d92976d02..f8fe6f129b 100644 --- a/src/nvim/msgpack_rpc/channel.h +++ b/src/nvim/msgpack_rpc/channel.h @@ -11,6 +11,11 @@ #define METHOD_MAXLEN 512 +/// HACK: os/input.c drains this queue immediately before blocking for input. +/// Events on this queue are async-safe, but they need the resolved state +/// of os_inchar(), so they are processed "just-in-time". +MultiQueue *ch_before_blocking_events; + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "msgpack_rpc/channel.h.generated.h" #endif diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 09ad7beb4b..f73e3079b9 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -14,7 +14,6 @@ #include #include "nvim/vim.h" -#include "nvim/log.h" #include "nvim/ascii.h" #include "nvim/normal.h" #include "nvim/buffer.h" diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index de6d4a9010..31e06ce404 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -23,7 +23,7 @@ #include "nvim/main.h" #include "nvim/misc1.h" #include "nvim/state.h" -#include "nvim/log.h" +#include "nvim/msgpack_rpc/channel.h" #define READ_BUFFER_SIZE 0xfff #define INPUT_BUFFER_SIZE (READ_BUFFER_SIZE * 4) @@ -342,11 +342,9 @@ static bool input_poll(int ms) } if ((ms == - 1 || ms > 0) && !events_enabled && !input_eof) { - // We have discovered that the pending input will provoke a blocking wait. - // Process any events marked with priority `kEvPriorityAsync`: these events - // must be handled after flushing input. See channel.c:handle_request #6247 + // The pending input provoked a blocking wait. Do special events now. #6247 blocking = true; - multiqueue_process_priority(main_loop.events, kEvPriorityAsync); + multiqueue_process_events(ch_before_blocking_events); } LOOP_PROCESS_EVENTS_UNTIL(&main_loop, NULL, ms, input_ready() || input_eof); blocking = false; From 8f59d1483934f91011b755406251136c406e77f6 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 27 Apr 2017 14:38:41 +0200 Subject: [PATCH 178/257] event: Remove "priority" concept. It was replaced by the "child queue" concept (MultiQueue). --- src/nvim/event/defs.h | 13 +++---------- src/nvim/event/multiqueue.c | 27 --------------------------- src/nvim/event/multiqueue.h | 2 +- src/nvim/message.c | 2 +- src/nvim/tui/input.c | 4 ++-- src/nvim/tui/tui.c | 2 +- src/nvim/ui.c | 2 +- src/nvim/ui_bridge.c | 4 ++-- 8 files changed, 11 insertions(+), 45 deletions(-) diff --git a/src/nvim/event/defs.h b/src/nvim/event/defs.h index 509a3f8e7f..cc875d74b9 100644 --- a/src/nvim/event/defs.h +++ b/src/nvim/event/defs.h @@ -6,23 +6,16 @@ #define EVENT_HANDLER_MAX_ARGC 6 -typedef enum { - kEvPriorityNormal = 1, - kEvPriorityAsync = 2, // safe to run in any state -} EventPriority; - typedef void (*argv_callback)(void **argv); typedef struct message { - int priority; argv_callback handler; void *argv[EVENT_HANDLER_MAX_ARGC]; } Event; typedef void(*event_scheduler)(Event event, void *data); -#define VA_EVENT_INIT(event, p, h, a) \ +#define VA_EVENT_INIT(event, h, a) \ do { \ assert(a <= EVENT_HANDLER_MAX_ARGC); \ - (event)->priority = p; \ (event)->handler = h; \ if (a) { \ va_list args; \ @@ -34,11 +27,11 @@ typedef void(*event_scheduler)(Event event, void *data); } \ } while (0) -static inline Event event_create(int priority, argv_callback cb, int argc, ...) +static inline Event event_create(argv_callback cb, int argc, ...) { assert(argc <= EVENT_HANDLER_MAX_ARGC); Event event; - VA_EVENT_INIT(&event, priority, cb, argc); + VA_EVENT_INIT(&event, cb, argc); return event; } diff --git a/src/nvim/event/multiqueue.c b/src/nvim/event/multiqueue.c index 66a261b554..ef9f3f1870 100644 --- a/src/nvim/event/multiqueue.c +++ b/src/nvim/event/multiqueue.c @@ -152,33 +152,6 @@ void multiqueue_process_events(MultiQueue *this) } } -void multiqueue_process_priority(MultiQueue *this, int priority) -{ - assert(this); - QUEUE *start = QUEUE_HEAD(&this->headtail); - QUEUE *cur = start; - while (!multiqueue_empty(this)) { - MultiQueueItem *item = multiqueue_node_data(cur); - assert(!item->link || !this->parent); // Only a parent queue has link-nodes - Event ev = multiqueueitem_get_event(item, false); - - if (ev.priority >= priority) { - if (ev.handler) { - ev.handler(ev.argv); - } - // Processed. Remove this item and get the new head. - (void)multiqueue_remove(this); - cur = QUEUE_HEAD(&this->headtail); - } else { - // Not processed. Skip this item and get the next one. - cur = cur->next->next; - if (!cur || cur == start) { - break; - } - } - } -} - /// Removes all events without processing them. void multiqueue_purge_events(MultiQueue *this) { diff --git a/src/nvim/event/multiqueue.h b/src/nvim/event/multiqueue.h index 72145482aa..a688107665 100644 --- a/src/nvim/event/multiqueue.h +++ b/src/nvim/event/multiqueue.h @@ -10,7 +10,7 @@ typedef struct multiqueue MultiQueue; typedef void (*put_callback)(MultiQueue *multiq, void *data); #define multiqueue_put(q, h, ...) \ - multiqueue_put_event(q, event_create(kEvPriorityNormal, h, __VA_ARGS__)); + multiqueue_put_event(q, event_create(h, __VA_ARGS__)); #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/message.c b/src/nvim/message.c index 146937c25a..696855e3aa 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -604,7 +604,7 @@ void msg_schedule_emsgf(const char *const fmt, ...) va_end(ap); char *s = xstrdup((char *)IObuff); - loop_schedule(&main_loop, event_create(1, msg_emsgf_event, 1, s)); + loop_schedule(&main_loop, event_create(msg_emsgf_event, 1, s)); } /* diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index b86ab8cf2f..3d37fabeee 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -102,7 +102,7 @@ static void flush_input(TermInput *input, bool wait_until_empty) size_t drain_boundary = wait_until_empty ? 0 : 0xff; do { uv_mutex_lock(&input->key_buffer_mutex); - loop_schedule(&main_loop, event_create(1, wait_input_enqueue, 1, input)); + loop_schedule(&main_loop, event_create(wait_input_enqueue, 1, input)); input->waiting = true; while (input->waiting) { uv_cond_wait(&input->key_buffer_cond, &input->key_buffer_mutex); @@ -352,7 +352,7 @@ static void read_cb(Stream *stream, RBuffer *buf, size_t c, void *data, stream_close(&input->read_stream, NULL, NULL); multiqueue_put(input->loop->fast_events, restart_reading, 1, input); } else { - loop_schedule(&main_loop, event_create(1, input_done_event, 0)); + loop_schedule(&main_loop, event_create(input_done_event, 0)); } return; } diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 356221f7ce..5653924154 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -773,7 +773,7 @@ static void tui_suspend(UI *ui) // before continuing. This is done in another callback to avoid // loop_poll_events recursion multiqueue_put_event(data->loop->fast_events, - event_create(1, suspend_event, 1, ui)); + event_create(suspend_event, 1, ui)); } static void tui_set_title(UI *ui, char *title) diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 713dffb46c..924a4192bc 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -198,7 +198,7 @@ static void ui_refresh_event(void **argv) void ui_schedule_refresh(void) { - loop_schedule(&main_loop, event_create(1, ui_refresh_event, 0)); + loop_schedule(&main_loop, event_create(ui_refresh_event, 0)); } void ui_resize(int new_width, int new_height) diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c index b7b12ae39e..d790770892 100644 --- a/src/nvim/ui_bridge.c +++ b/src/nvim/ui_bridge.c @@ -40,13 +40,13 @@ static argv_callback uilog_event = NULL; uilog_event = ui_bridge_##name##_event; \ } \ ((UIBridgeData *)ui)->scheduler( \ - event_create(1, ui_bridge_##name##_event, argc, __VA_ARGS__), UI(ui)); \ + event_create(ui_bridge_##name##_event, argc, __VA_ARGS__), UI(ui)); \ } while (0) #else // Schedule a function call on the UI bridge thread. #define UI_CALL(ui, name, argc, ...) \ ((UIBridgeData *)ui)->scheduler( \ - event_create(1, ui_bridge_##name##_event, argc, __VA_ARGS__), UI(ui)) + event_create(ui_bridge_##name##_event, argc, __VA_ARGS__), UI(ui)) #endif #define INT2PTR(i) ((void *)(uintptr_t)i) From 409e56b1392c431a36c0a48cac58d6df3cf424d7 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 28 Apr 2017 20:42:06 +0200 Subject: [PATCH 179/257] vim-patch:818078ddfbb8 Updated runtime files and translations. https://github.com/vim/vim/commit/818078ddfbb8cc2546f697c5675a251d095722ec --- runtime/doc/index.txt | 4 +- runtime/doc/map.txt | 7 + runtime/doc/starting.txt | 3 + runtime/doc/various.txt | 25 ++++ runtime/syntax/sh.vim | 6 +- src/nvim/po/eo.po | 295 ++++++++++++++++++++++++++++--------- src/nvim/po/fr.po | 309 ++++++++++++++++++++++++++++++--------- 7 files changed, 505 insertions(+), 144 deletions(-) diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 0dc8fff975..7267a45d41 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -982,7 +982,7 @@ tag command action in Command-line editing mode ~ |c_CTRL-E| CTRL-E cursor to end of command-line |'cedit'| CTRL-F default value for 'cedit': opens the command-line window; otherwise not used - CTRL-G not used +|c_CTRL-G| CTRL-G next match when 'incsearch' is active |c_| delete the character in front of the cursor |c_digraph| {char1} {char2} enter digraph when 'digraph' is on @@ -1015,7 +1015,7 @@ tag command action in Command-line editing mode ~ insert the contents of a register or object under the cursor literally CTRL-S (used for terminal control flow) - CTRL-T not used +|c_CTRL-T| CTRL-T previous match when 'incsearch' is active |c_CTRL-U| CTRL-U remove all characters |c_CTRL-V| CTRL-V insert next non-digit literally, insert three digit decimal number as a single byte. diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 3ba1ce1f17..25bd2d18ee 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -437,6 +437,9 @@ with a space. Note: When using mappings for Visual mode, you can use the "'<" mark, which is the start of the last selected Visual area in the current buffer |'<|. +The |:filter| command can be used to select what mappings to list. The +pattern is matched against the {lhs} and {rhs} in the raw form. + *:map-verbose* When 'verbose' is non-zero, listing a key map will also display where it was last defined. Example: > @@ -1136,6 +1139,10 @@ scripts. " Command has the -register attribute b Command is local to current buffer (see below for details on attributes) + The list can be filtered on command name with + |:filter|, e.g., to list all commands with "Pyth" in + the name: > + filter Pyth command :com[mand] {cmd} List the user-defined commands that start with {cmd} diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 14e8c5d76f..c93c3d0741 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1184,6 +1184,9 @@ running) you have additional options: file. This list is read on startup and only changes afterwards with ":rshada!". Also see |v:oldfiles|. The number can be used with |c_#<|. + The output can be filtered with |:filter|, e.g.: > + filter /\.vim/ oldfiles +< The filtering happens on the file name. :bro[wse] o[ldfiles][!] List file names as with |:oldfiles|, and then prompt diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index fd81064d5b..cee13c9ee8 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -85,6 +85,8 @@ g8 Print the hex values of the bytes used in the on paper see |:hardcopy|. In the GUI you can use the File.Print menu entry. See |ex-flags| for [flags]. + The |:filter| command can be used to only show lines + matching a pattern. :[range]p[rint] {count} [flags] Print {count} lines, starting with [range] (default @@ -461,6 +463,29 @@ m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support| :redi[r] END End redirecting messages. + *:filt* *:filter* +:filt[er][!] {pat} {command} +:filt[er][!] /{pat}/ {command} + Restrict the output of {command} to lines matching + with {pat}. For example, to list only xml files: > + :filter /\.xml$/ oldfiles +< If the [!] is given, restrict the output of {command} + to lines that do NOT match {pat}. + + {pat} is a Vim search pattern. Instead of enclosing + it in / any non-ID character (see |'isident'|) can be + used, so long as it does not appear in {pat}. Without + the enclosing character the pattern cannot include the + bar character. + + The pattern is matched against the relevant part of + the output, not necessarily the whole line. Only some + commands support filtering, try it out to check if it + works. + + Only normal messages are filtered, error messages are + not. + *:sil* *:silent* *:silent!* :sil[ent][!] {command} Execute {command} silently. Normal messages will not be given or added to the message history. diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 2fe13fbde6..ef90ebea22 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Aug 23, 2016 -" Version: 161 +" Last Change: Aug 26, 2016 +" Version: 162 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) @@ -500,7 +500,7 @@ syn match shDerefString contained "\\["']" nextgroup=shDerefPattern if exists("b:is_bash") " bash : ${parameter:offset} " bash : ${parameter:offset:length} - syn region shDerefOff contained start=':' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple + syn region shDerefOff contained start=':\ze[^-=?+]' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple syn region shDerefOff contained start=':\s-' end='\ze:' end='\ze}' contains=shDeref,shDerefSimple,shDerefEscape nextgroup=shDerefLen,shDeref,shDerefSimple syn match shDerefLen contained ":[^}]\+" contains=shDeref,shDerefSimple diff --git a/src/nvim/po/eo.po b/src/nvim/po/eo.po index b7bc6397ef..10cab0342e 100644 --- a/src/nvim/po/eo.po +++ b/src/nvim/po/eo.po @@ -23,8 +23,8 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Esperanto)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-02 16:21+0200\n" -"PO-Revision-Date: 2016-07-02 17:05+0200\n" +"POT-Creation-Date: 2016-08-26 20:54+0200\n" +"PO-Revision-Date: 2016-08-26 20:30+0200\n" "Last-Translator: Dominique PELLÉ \n" "Language-Team: \n" "Language: eo\n" @@ -56,6 +56,9 @@ msgstr "E82: Ne eblas disponigi iun ajn bufron, nun eliras..." msgid "E83: Cannot allocate buffer, using other one..." msgstr "E83: Ne eblas disponigi bufron, nun uzas alian..." +msgid "E931: Buffer cannot be registered" +msgstr "E931: Bufro ne povas esti registrita" + msgid "E515: No buffers were unloaded" msgstr "E515: Neniu bufro estis malŝargita" @@ -206,6 +209,33 @@ msgstr "" msgid "Signs for %s:" msgstr "Emfazaj simbolaĵoj de %s:" +msgid "E901: gethostbyname() in channel_open()" +msgstr "E901: gethostbyname() en channel_open()" + +msgid "E898: socket() in channel_open()" +msgstr "E898: gethostbyname() en channel_open()" + +msgid "E903: received command with non-string argument" +msgstr "E903: ricevis komandon kun argumento, kiu ne estas ĉeno" + +msgid "E904: last argument for expr/call must be a number" +msgstr "E904: lasta argumento de \"expr/call\" devas esti nombro" + +msgid "E904: third argument for call must be a list" +msgstr "E904: tria argumento de \"call\" devas esti listo" + +#, c-format +msgid "E905: received unknown command: %s" +msgstr "E905: nekonata komando ricevita: %s" + +#, c-format +msgid "E630: %s(): write while not connected" +msgstr "E630: %s(): konservo dum nekonektita" + +#, c-format +msgid "E631: %s(): write failed" +msgstr "E631: %s(): Konservo malsukcesis" + #, c-format msgid " line=% id=%d name=%s" msgstr " linio=% id=%d nomo=%s" @@ -432,10 +462,6 @@ msgstr "E719: Uzo de [:] ne eblas kun Vortaro" msgid "E734: Wrong variable type for %s=" msgstr "E734: Nevalida datumtipo de variablo de %s=" -#, c-format -msgid "E130: Unknown function: %s" -msgstr "E130: Nekonata funkcio: %s" - #, c-format msgid "E461: Illegal variable name: %s" msgstr "E461: Nevalida nomo de variablo: %s" @@ -474,10 +500,6 @@ msgstr "E711: Lista valoro ne havas sufiĉe da eroj" msgid "E690: Missing \"in\" after :for" msgstr "E690: \"in\" mankas post \":for\"" -#, c-format -msgid "E107: Missing parentheses: %s" -msgstr "E107: Mankas krampoj: %s" - #, c-format msgid "E108: No such variable: \"%s\"" msgstr "E108: Ne estas tia variablo: \"%s\"" @@ -534,59 +556,115 @@ msgstr "E114: Mankas citilo: %s" msgid "E115: Missing quote: %s" msgstr "E115: Mankas citilo: %s" -#, c-format -msgid "E696: Missing comma in List: %s" -msgstr "E696: Mankas komo en Listo: %s" - -#, c-format -msgid "E697: Missing end of List ']': %s" -msgstr "E697: Mankas fino de Listo ']': %s" - msgid "Not enough memory to set references, garbage collection aborted!" msgstr "Ne sufiĉa memoro por valorigi referencojn, senrubigado ĉesigita!" -#, c-format -msgid "E720: Missing colon in Dictionary: %s" -msgstr "E720: Mankas dupunkto en la vortaro: %s" - -#, c-format -msgid "E721: Duplicate key in Dictionary: \"%s\"" -msgstr "E721: Ripetita ŝlosilo en la vortaro: \"%s\"" - -#, c-format -msgid "E722: Missing comma in Dictionary: %s" -msgstr "E722: Mankas komo en la vortaro: %s" - -#, c-format -msgid "E723: Missing end of Dictionary '}': %s" -msgstr "E723: Mankas fino de vortaro '}': %s" - msgid "E724: variable nested too deep for displaying" msgstr "E724: variablo ingita tro profunde por vidigi" -#, c-format -msgid "E740: Too many arguments for function %s" -msgstr "E740: Tro da argumentoj por funkcio: %s" +msgid "E805: Using a Float as a Number" +msgstr "E805: Uzo de Glitpunktnombro kiel Nombro" + +msgid "E703: Using a Funcref as a Number" +msgstr "E703: Uzo de Funcref kiel Nombro" + +msgid "E745: Using a List as a Number" +msgstr "E745: Uzo de Listo kiel Nombro" + +msgid "E728: Using a Dictionary as a Number" +msgstr "E728: Uzo de Vortaro kiel Nombro" + +msgid "E910: Using a Job as a Number" +msgstr "E910: Uzo de Tasko kiel Nombro" + +msgid "E913: Using a Channel as a Number" +msgstr "E913: Uzo de Kanalo kiel Nombro" + +msgid "E891: Using a Funcref as a Float" +msgstr "E891: Uzo de Funcref kiel Glitpunktnombro" + +msgid "E892: Using a String as a Float" +msgstr "E892: Uzo de Ĉeno kiel Glitpunktnombro" + +msgid "E893: Using a List as a Float" +msgstr "E893: Uzo de Listo kiel Glitpunktnombro" + +msgid "E894: Using a Dictionary as a Float" +msgstr "E894: Uzo de Vortaro kiel Glitpunktnombro" + +msgid "E907: Using a special value as a Float" +msgstr "E907: Uzo de speciala valoro kiel Glitpunktnombro" + +msgid "E911: Using a Job as a Float" +msgstr "E911: Uzo de Tasko kiel Glitpunktnombro" + +msgid "E914: Using a Channel as a Float" +msgstr "E914: Uzo de Kanalo kiel Glitpunktnombro" + +msgid "E729: using Funcref as a String" +msgstr "E729: uzo de Funcref kiel Ĉeno" + +msgid "E730: using List as a String" +msgstr "E730: uzo de Listo kiel Ĉeno" + +msgid "E731: using Dictionary as a String" +msgstr "E731: uzo de Vortaro kiel Ĉeno" + +msgid "E908: using an invalid value as a String" +msgstr "E908: uzo de nevalida valoro kiel Ĉeno" #, c-format -msgid "E116: Invalid arguments for function %s" -msgstr "E116: Nevalidaj argumentoj por funkcio: %s" +msgid "E795: Cannot delete variable %s" +msgstr "E795: Ne eblas forviŝi variablon %s" #, c-format -msgid "E117: Unknown function: %s" -msgstr "E117: Nekonata funkcio: %s" +msgid "E704: Funcref variable name must start with a capital: %s" +msgstr "E704: Nomo de variablo Funcref devas finiĝi per majusklo: %s" #, c-format -msgid "E119: Not enough arguments for function: %s" -msgstr "E119: Ne sufiĉe da argumentoj por funkcio: %s" +msgid "E705: Variable name conflicts with existing function: %s" +msgstr "E705: Nomo de variablo konfliktas kun ekzistanta funkcio: %s" #, c-format -msgid "E120: Using not in a script context: %s" -msgstr "E120: estas uzata ekster kunteksto de skripto: %s" +msgid "E741: Value is locked: %s" +msgstr "E741: Valoro estas ŝlosita: %s" + +msgid "Unknown" +msgstr "Nekonata" #, c-format -msgid "E725: Calling dict function without Dictionary: %s" -msgstr "E725: Alvoko de funkcio dict sen Vortaro: %s" +msgid "E742: Cannot change value of %s" +msgstr "E742: Ne eblas ŝanĝi valoron de %s" + +msgid "E698: variable nested too deep for making a copy" +msgstr "E698: variablo ingita tro profunde por fari kopion" + +msgid "" +"\n" +"# global variables:\n" +msgstr "" +"\n" +"# mallokaj variabloj:\n" + +msgid "" +"\n" +"\tLast set from " +msgstr "" +"\n" +"\tLaste ŝaltita de " + +msgid "map() argument" +msgstr "argumento de map()" + +msgid "filter() argument" +msgstr "argumento de filter()" + +#, c-format +msgid "E686: Argument of %s must be a List" +msgstr "E686: Argumento de %s devas esti Listo" + +msgid "E928: String required" +msgstr "E928: Ĉeno bezonata" msgid "E808: Number or Float required" msgstr "E808: Nombro aŭ Glitpunktnombro bezonata" @@ -594,9 +672,6 @@ msgstr "E808: Nombro aŭ Glitpunktnombro bezonata" msgid "add() argument" msgstr "argumento de add()" -msgid "E699: Too many arguments" -msgstr "E699: Tro da argumentoj" - msgid "E785: complete() can only be used in Insert mode" msgstr "E785: complete() uzeblas nur en Enmeta reĝimo" @@ -636,6 +711,10 @@ msgstr "E786: Amplekso nepermesebla" msgid "E701: Invalid type for len()" msgstr "E701: Nevalida datumtipo de len()" +#, c-format +msgid "E798: ID is reserved for \":match\": %ld" +msgstr "E798: ID estas rezervita por \":match\": %ld" + msgid "E726: Stride is zero" msgstr "E726: Paŝo estas nul" @@ -1054,6 +1133,10 @@ msgstr "Bedaŭrinde, la helpdosiero \"%s\" ne troveblas" msgid "E150: Not a directory: %s" msgstr "E150: Ne estas dosierujo: %s" +#, c-format +msgid "E151: No match: %s" +msgstr "E151: Neniu kongruo: %s" + #, c-format msgid "E152: Cannot open %s for writing" msgstr "E152: Ne eblas malfermi %s en skribreĝimo" @@ -1095,6 +1178,9 @@ msgstr "E159: Mankas numero de simbolo" msgid "E158: Invalid buffer name: %s" msgstr "E158: Nevalida nomo de bufro: %s" +msgid "E934: Cannot jump to a buffer that does not have a name" +msgstr "E934: Ne eblas salti al sennoma bufro" + #, c-format msgid "E157: Invalid sign ID: %" msgstr "E157: Nevalida identigilo de simbolo: %" @@ -1105,6 +1191,9 @@ msgstr " (nesubtenata)" msgid "[Deleted]" msgstr "[Forviŝita]" +msgid "No old files" +msgstr "Neniu malnova dosiero" + msgid "Entering Debug mode. Type \"cont\" to continue." msgstr "Eniras sencimigan reĝimon. Tajpu \"cont\" por daŭrigi." @@ -1204,6 +1293,10 @@ msgstr "linio %: rulas \"%s\"" msgid "finished sourcing %s" msgstr "finis ruli %s" +#, c-format +msgid "continuing in %s" +msgstr "daŭrigas en %s" + msgid "modeline" msgstr "reĝimlinio" @@ -1932,9 +2025,6 @@ msgstr "E462: Ne eblis prepari por reŝargi \"%s\"" msgid "E321: Could not reload \"%s\"" msgstr "E321: Ne eblis reŝargi \"%s\"" -msgid "--Deleted--" -msgstr "--Forviŝita--" - #, c-format msgid "auto-removing autocommand: %s " msgstr "aŭto-forviŝas aŭtokomandon: %s " @@ -1944,6 +2034,12 @@ msgstr "aŭto-forviŝas aŭtokomandon: %s " msgid "E367: No such group: \"%s\"" msgstr "E367: Ne ekzistas tia grupo: \"%s\"" +msgid "W19: Deleting augroup that is still in use" +msgstr "W19: Forviŝo de augroup kiu estas ankoraŭ uzata" + +msgid "--Deleted--" +msgstr "--Forviŝita--" + #, c-format msgid "E215: Illegal character after *: %s" msgstr "E215: Nevalida signo post *: %s" @@ -2005,8 +2101,10 @@ msgid "E351: Cannot delete fold with current 'foldmethod'" msgstr "E351: Ne eblas forviŝi faldon per la aktuala 'foldmethod'" #, c-format -msgid "+--%3ld lines folded " -msgstr "+--%3ld linioj falditaj " +msgid "+--%3ld line folded " +msgid_plural "+--%3ld lines folded " +msgstr[0] "+--%3ld linio faldita " +msgstr[1] "+--%3ld linioj falditaj " #. buffer has already been read msgid "E222: Add to read buffer" @@ -2550,6 +2648,7 @@ msgstr "%-5s: %s%*s (Uzo: %s)" msgid "" "\n" +" a: Find assignments to this symbol\n" " c: Find functions calling this function\n" " d: Find functions called by this function\n" " e: Find this egrep pattern\n" @@ -2558,9 +2657,9 @@ msgid "" " i: Find files #including this file\n" " s: Find this C symbol\n" " t: Find this text string\n" -" a: Find assignments to this symbol\n" msgstr "" "\n" +" a: Trovi valirizojn al tiu simbolo\n" " c: Trovi funkciojn, kiuj alvokas tiun funkcion\n" " d: Trovi funkciojn alvokataj de tiu funkcio\n" " e: Trovi tiun egrep-ŝablonon\n" @@ -2569,7 +2668,6 @@ msgstr "" " i: Trovi dosierojn, kiuj inkluzivas (#include) tiun dosieron\n" " s: Trovi tiun C-simbolon\n" " t: Trovi tiun ĉenon\n" -" a: Trovi valirizojn al tiu simbolo\n" msgid "E568: duplicate cscope database not added" msgstr "E568: ripetita datumbazo de cscope ne aldonita" @@ -2613,6 +2711,14 @@ msgstr "neniu konekto de cscope\n" msgid " # pid database name prepend path\n" msgstr " # pid nomo de datumbazo prefiksa vojo\n" +#, c-format +msgid "E696: Missing comma in List: %s" +msgstr "E696: Mankas komo en Listo: %s" + +#, c-format +msgid "E697: Missing end of List ']': %s" +msgstr "E697: Mankas fino de Listo ']': %s" + msgid "Unknown option argument" msgstr "Nekonata argumento de opcio" @@ -3861,15 +3967,18 @@ msgstr "(%d de %d)%s%s: " msgid " (line deleted)" msgstr " (forviŝita linio)" +#, c-format +msgid "%serror list %d of %d; %d errors " +msgstr "%slisto de eraroj %d de %d; %d eraroj" + msgid "E380: At bottom of quickfix stack" msgstr "E380: Ĉe la subo de stako de rapidriparo" msgid "E381: At top of quickfix stack" msgstr "E381: Ĉe la supro de stako de rapidriparo" -#, c-format -msgid "error list %d of %d; %d errors" -msgstr "listo de eraroj %d de %d; %d eraroj" +msgid "No entries" +msgstr "Neniu ano" msgid "E382: Cannot write, 'buftype' option is set" msgstr "E382: Ne eblas skribi, opcio 'buftype' estas ŝaltita" @@ -4082,9 +4191,6 @@ msgstr " hebrea" msgid " Arabic" msgstr " araba" -msgid " (lang)" -msgstr " (lingvo)" - msgid " (paste)" msgstr " (algluo)" @@ -4179,8 +4285,47 @@ msgstr "" "# Lasta serĉa ŝablono %s:\n" "~" -msgid "E759: Format error in spell file" -msgstr "E759: Eraro de formato en literuma dosiero" +msgid "E756: Spell checking is not enabled" +msgstr "E756: Literumilo ne estas ŝaltita" + +#, c-format +msgid "Warning: Cannot find word list \"%s_%s.spl\" or \"%s_ascii.spl\"" +msgstr "Averto: Ne eblas trovi vortliston \"%s_%s.spl\" aŭ \"%s_ascii.spl\"" + +#, c-format +msgid "Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\"" +msgstr "Averto: Ne eblas trovi vortliston \"%s.%s.spl\" aŭ \"%s.ascii.spl\"" + +msgid "E797: SpellFileMissing autocommand deleted buffer" +msgstr "E797: Aŭtokomando SpellFileMissing forviŝis bufron" + +#, c-format +msgid "Warning: region %s not supported" +msgstr "Averto: regiono %s ne subtenata" + +msgid "Sorry, no suggestions" +msgstr "Bedaŭrinde ne estas sugestoj" + +#, c-format +msgid "Sorry, only %ld suggestions" +msgstr "Bedaŭrinde estas nur %ld sugestoj" + +#. for when 'cmdheight' > 1 +#. avoid more prompt +#, c-format +msgid "Change \"%.*s\" to:" +msgstr "Anstataŭigi \"%.*s\" per:" + +#, c-format +msgid " < \"%.*s\"" +msgstr " < \"%.*s\"" + +msgid "E752: No previous spell replacement" +msgstr "E752: Neniu antaŭa literuma anstataŭigo" + +#, c-format +msgid "E753: Not found: %s" +msgstr "E753: Netrovita: %s" msgid "E758: Truncated spell file" msgstr "E758: Trunkita literuma dosiero" @@ -4226,8 +4371,24 @@ msgid "E770: Unsupported section in spell file" msgstr "E770: Nesubtenata sekcio en literuma dosiero" #, c-format -msgid "Warning: region %s not supported" -msgstr "Averto: regiono %s ne subtenata" +msgid "E778: This does not look like a .sug file: %s" +msgstr "E778: Tio ne ŝajnas esti dosiero .sug: %s" + +#, c-format +msgid "E779: Old .sug file, needs to be updated: %s" +msgstr "E779: Malnova dosiero .sug, bezonas ĝisdatigon: %s" + +#, c-format +msgid "E780: .sug file is for newer version of Vim: %s" +msgstr "E780: Dosiero .sug estas por pli nova versio de Vim: %s" + +#, c-format +msgid "E781: .sug file doesn't match .spl file: %s" +msgstr "E781: Dosiero .sug ne kongruas kun dosiero .spl: %s" + +#, c-format +msgid "E782: error while reading .sug file: %s" +msgstr "E782: eraro dum legado de dosiero .sug: %s" #, c-format msgid "Reading affix file %s ..." diff --git a/src/nvim/po/fr.po b/src/nvim/po/fr.po index 2d99d67099..4b1b0476ca 100644 --- a/src/nvim/po/fr.po +++ b/src/nvim/po/fr.po @@ -15,8 +15,8 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Franais)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-07-02 16:21+0200\n" -"PO-Revision-Date: 2016-07-02 17:06+0200\n" +"POT-Creation-Date: 2016-08-26 20:54+0200\n" +"PO-Revision-Date: 2016-08-26 20:34+0200\n" "Last-Translator: Dominique Pell \n" "Language-Team: \n" "Language: fr\n" @@ -53,6 +53,9 @@ msgid "E83: Cannot allocate buffer, using other one..." msgstr "" "E83: L'allocation du tampon a chou : arrtez Vim, librez de la mmoire" +msgid "E931: Buffer cannot be registered" +msgstr "E931: Le tampon ne peut pas tre enregistr" + msgid "E515: No buffers were unloaded" msgstr "E515: Aucun tampon n'a t dcharg" @@ -220,6 +223,33 @@ msgstr "" msgid "Signs for %s:" msgstr "Symboles dans %s :" +msgid "E901: gethostbyname() in channel_open()" +msgstr "E901: gethostbyname() dans channel_open()" + +msgid "E898: socket() in channel_open()" +msgstr "E898: socket() dans channel_open()" + +msgid "E903: received command with non-string argument" +msgstr "E903: commande reue avec une argument qui n'est pas une chane" + +msgid "E904: last argument for expr/call must be a number" +msgstr "E904: le dernier argument de expr/call doit tre un nombre" + +msgid "E904: third argument for call must be a list" +msgstr "E904: le troisime argument de \"call\" doit tre une liste" + +#, c-format +msgid "E905: received unknown command: %s" +msgstr "E905: commande inconnue reue : %s" + +#, c-format +msgid "E630: %s(): write while not connected" +msgstr "E630: %s() : criture sans tre connect" + +#, c-format +msgid "E631: %s(): write failed" +msgstr "E631: %s() : erreur d'criture" + #, c-format msgid " line=% id=%d name=%s" msgstr " ligne=% id=%d nom=%s" @@ -489,10 +519,6 @@ msgstr "E719: Utilisation de [:] impossible avec un Dictionnaire" msgid "E734: Wrong variable type for %s=" msgstr "E734: Type de variable erron avec %s=" -#, c-format -msgid "E130: Unknown function: %s" -msgstr "E130: Fonction inconnue : %s" - #, c-format msgid "E461: Illegal variable name: %s" msgstr "E461: Nom de variable invalide : %s" @@ -533,10 +559,6 @@ msgstr "E711: La Liste n'a pas assez d' msgid "E690: Missing \"in\" after :for" msgstr "E690: \"in\" manquant aprs :for" -#, c-format -msgid "E107: Missing parentheses: %s" -msgstr "E107: Parenthses manquantes : %s" - #, c-format msgid "E108: No such variable: \"%s\"" msgstr "E108: Variable inexistante : %s" @@ -598,60 +620,119 @@ msgstr "E114: Il manque \" msgid "E115: Missing quote: %s" msgstr "E115: Il manque ' la fin de %s" -#, c-format -msgid "E696: Missing comma in List: %s" -msgstr "E696: Il manque une virgule dans la Liste %s" - -#, c-format -msgid "E697: Missing end of List ']': %s" -msgstr "E697: Il manque ']' la fin de la Liste %s" - msgid "Not enough memory to set references, garbage collection aborted!" msgstr "" "Pas assez de mmoire pour les rfrences, arrt du ramassage de mites !" -#, c-format -msgid "E720: Missing colon in Dictionary: %s" -msgstr "E720: Il manque ':' dans le Dictionnaire %s" - -#, c-format -msgid "E721: Duplicate key in Dictionary: \"%s\"" -msgstr "E721: Cl \"%s\" duplique dans le Dictionnaire" - -#, c-format -msgid "E722: Missing comma in Dictionary: %s" -msgstr "E722: Il manque une virgule dans le Dictionnaire %s" - -#, c-format -msgid "E723: Missing end of Dictionary '}': %s" -msgstr "E723: Il manque '}' la fin du Dictionnaire %s" - msgid "E724: variable nested too deep for displaying" msgstr "E724: variable trop imbrique pour tre affiche" -#, c-format -msgid "E740: Too many arguments for function %s" -msgstr "E740: Trop d'arguments pour la fonction %s" +msgid "E805: Using a Float as a Number" +msgstr "E805: Utilisation d'un Flottant comme un Nombre" + +msgid "E703: Using a Funcref as a Number" +msgstr "E703: Utilisation d'une Funcref comme un Nombre" + +msgid "E745: Using a List as a Number" +msgstr "E745: Utilisation d'une Liste comme un Nombre" + +msgid "E728: Using a Dictionary as a Number" +msgstr "E728: Utilisation d'un Dictionnaire comme un Nombre" + +msgid "E910: Using a Job as a Number" +msgstr "E910: Utilisation d'une Tche comme un Nombre" + +msgid "E913: Using a Channel as a Number" +msgstr "E913: Utilisation d'un Canal comme un Nombre" + +msgid "E891: Using a Funcref as a Float" +msgstr "E891: Utilisation d'une Funcref comme un Flottant" + +msgid "E892: Using a String as a Float" +msgstr "E892: Utilisation d'une Chane comme un Flottant" + +msgid "E893: Using a List as a Float" +msgstr "E893: Utilisation d'une Liste comme un Flottant" + +msgid "E894: Using a Dictionary as a Float" +msgstr "E894: Utilisation d'un Dictionnaire comme un Flottant" + +msgid "E907: Using a special value as a Float" +msgstr "E907: Utilisation d'une valeur spciale comme un Flottant" + +msgid "E911: Using a Job as a Float" +msgstr "E911: Utilisation d'une Tche comme un Flottant" + +msgid "E914: Using a Channel as a Float" +msgstr "E914: Utilisation d'un Canal comme un Flottant" + +msgid "E729: using Funcref as a String" +msgstr "E729: Utilisation d'une Funcref comme une Chane" + +msgid "E730: using List as a String" +msgstr "E730: Utilisation d'une Liste comme une Chane" + +msgid "E731: using Dictionary as a String" +msgstr "E731: Utilisation d'un Dictionnaire comme une Chane" + +msgid "E908: using an invalid value as a String" +msgstr "E908: Utilisation d'une valeur invalide comme une Chane" #, c-format -msgid "E116: Invalid arguments for function %s" -msgstr "E116: Arguments invalides pour la fonction %s" +msgid "E795: Cannot delete variable %s" +msgstr "E795: Impossible de supprimer la variable %s" #, c-format -msgid "E117: Unknown function: %s" -msgstr "E117: Fonction inconnue : %s" +msgid "E704: Funcref variable name must start with a capital: %s" +msgstr "E704: Le nom d'une Funcref doit commencer par une majuscule : %s" #, c-format -msgid "E119: Not enough arguments for function: %s" -msgstr "E119: La fonction %s n'a pas reu assez d'arguments" +msgid "E705: Variable name conflicts with existing function: %s" +msgstr "E705: Le nom d'une variable entre en conflit avec la fonction %s" #, c-format -msgid "E120: Using not in a script context: %s" -msgstr "E120: utilis en dehors d'un script : %s" +msgid "E741: Value is locked: %s" +msgstr "E741: La valeur de %s est verrouille" + +msgid "Unknown" +msgstr "Inconnu" #, c-format -msgid "E725: Calling dict function without Dictionary: %s" -msgstr "E725: Appel d'une fonction dict sans Dictionnaire : %s" +msgid "E742: Cannot change value of %s" +msgstr "E742: Impossible de modifier la valeur de %s" + +msgid "E698: variable nested too deep for making a copy" +msgstr "E698: variable trop imbrique pour en faire une copie" + +# AB - La version franaise est capitalise pour tre en accord avec les autres +# commentaires enregistrs dans le fichier viminfo. +msgid "" +"\n" +"# global variables:\n" +msgstr "" +"\n" +"# Variables globales:\n" + +# DB - Plus prcis ("la dernire fois") ? +msgid "" +"\n" +"\tLast set from " +msgstr "" +"\n" +"\tModifi la dernire fois dans " + +msgid "map() argument" +msgstr "argument de map()" + +msgid "filter() argument" +msgstr "argument de filter()" + +#, c-format +msgid "E686: Argument of %s must be a List" +msgstr "E686: L'argument de %s doit tre une Liste" + +msgid "E928: String required" +msgstr "E928: Chane requis" msgid "E808: Number or Float required" msgstr "E808: Nombre ou Flottant requis" @@ -659,9 +740,6 @@ msgstr "E808: Nombre ou Flottant requis" msgid "add() argument" msgstr "argument de add()" -msgid "E699: Too many arguments" -msgstr "E699: Trop d'arguments" - msgid "E785: complete() can only be used in Insert mode" msgstr "E785: complete() n'est utilisable que dans le mode Insertion" @@ -704,6 +782,10 @@ msgstr "E786: Les plages ne sont pas autoris msgid "E701: Invalid type for len()" msgstr "E701: Type invalide avec len()" +#, c-format +msgid "E798: ID is reserved for \":match\": %ld" +msgstr "E798: ID est rserv pour \":match\": %ld" + msgid "E726: Stride is zero" msgstr "E726: Le pas est nul" @@ -1192,15 +1274,17 @@ msgstr "D msgid "E150: Not a directory: %s" msgstr "E150: %s n'est pas un rpertoire" -# AB - La version anglaise est plus prcise, mais trop technique. +#, c-format +msgid "E151: No match: %s" +msgstr "E151: Aucune correspondance : %s" + #, c-format msgid "E152: Cannot open %s for writing" -msgstr "E152: Impossible d'crire %s" +msgstr "E152: Impossible d'ouvrir %s en criture" -# AB - La version anglaise est plus prcise, mais trop technique. #, c-format msgid "E153: Unable to open %s for reading" -msgstr "E153: Impossible de lire %s" +msgstr "E153: Impossible d'ouvrir %s en lecture" #, c-format msgid "E670: Mix of help file encodings within a language: %s" @@ -1247,6 +1331,9 @@ msgstr "E159: Il manque l'ID du symbole" msgid "E158: Invalid buffer name: %s" msgstr "E158: Le tampon %s est introuvable" +msgid "E934: Cannot jump to a buffer that does not have a name" +msgstr "E934: Impossible de sauter un tampon sans nom" + # AB - Vu le code source, la version franaise est meilleure que la # version anglaise. #, c-format @@ -1259,6 +1346,9 @@ msgstr " (non support msgid "[Deleted]" msgstr "[Effac]" +msgid "No old files" +msgstr "Aucun vieux fichier" + # AB - La version franaise de la premire phrase ne me satisfait pas. # DB - Suggestion. msgid "Entering Debug mode. Type \"cont\" to continue." @@ -1309,7 +1399,8 @@ msgid "E162: No write since last change for buffer \"%s\"" msgstr "E162: Le tampon %s n'a pas t enregistr" msgid "Warning: Entered other buffer unexpectedly (check autocommands)" -msgstr "Alerte : Entre inattendue dans un autre tampon (vrifier autocommandes)" +msgstr "" +"Alerte : Entre inattendue dans un autre tampon (vrifier autocommandes)" msgid "E163: There is only one file to edit" msgstr "E163: Il n'y a qu'un seul fichier diter" @@ -1360,6 +1451,11 @@ msgstr "ligne % : sourcement de \"%s\"" msgid "finished sourcing %s" msgstr "fin du sourcement de %s" +# AB - Ce texte fait partie d'un message de dbogage. +#, c-format +msgid "continuing in %s" +msgstr "de retour dans %s" + msgid "modeline" msgstr "ligne de mode" @@ -2108,9 +2204,6 @@ msgstr "E462: Impossible de pr msgid "E321: Could not reload \"%s\"" msgstr "E321: Impossible de recharger \"%s\"" -msgid "--Deleted--" -msgstr "--Effac--" - #, c-format msgid "auto-removing autocommand: %s " msgstr "Autocommandes marques pour auto-suppression : %s " @@ -2120,6 +2213,12 @@ msgstr "Autocommandes marqu msgid "E367: No such group: \"%s\"" msgstr "E367: Aucun groupe \"%s\"" +msgid "W19: Deleting augroup that is still in use" +msgstr "W19: Effacement d'augroup toujours en usage" + +msgid "--Deleted--" +msgstr "--Effac--" + #, c-format msgid "E215: Illegal character after *: %s" msgstr "E215: Caractre non valide aprs * : %s" @@ -2182,8 +2281,10 @@ msgid "E351: Cannot delete fold with current 'foldmethod'" msgstr "E351: Impossible de supprimer un repli avec la 'foldmethod'e actuelle" #, c-format -msgid "+--%3ld lines folded " -msgstr "+--%3ld lignes replies " +msgid "+--%3ld line folded " +msgid_plural "+--%3ld lines folded " +msgstr[0] "+--%3ld ligne replie " +msgstr[1] "+--%3ld lignes replies " #. buffer has already been read msgid "E222: Add to read buffer" @@ -2735,6 +2836,7 @@ msgstr "%-5s: %s%*s (Utilisation : %s)" msgid "" "\n" +" a: Find assignments to this symbol\n" " c: Find functions calling this function\n" " d: Find functions called by this function\n" " e: Find this egrep pattern\n" @@ -2743,9 +2845,9 @@ msgid "" " i: Find files #including this file\n" " s: Find this C symbol\n" " t: Find this text string\n" -" a: Find assignments to this symbol\n" msgstr "" "\n" +" a: Trouver les affectations ce symbole\n" " c: Trouver les fonctions appelant cette fonction\n" " d: Trouver les fonctions appeles par cette fonction\n" " e: Trouver ce motif egrep\n" @@ -2754,7 +2856,6 @@ msgstr "" " i: Trouver les fichiers qui #incluent ce fichier\n" " s: Trouver ce symbole C\n" " t: Trouver cette chane\n" -" a: Trouver les assignements ce symbole\n" msgid "E568: duplicate cscope database not added" msgstr "E568: base de donnes cscope redondante non ajoute" @@ -2799,6 +2900,14 @@ msgstr "aucune connexion cscope\n" msgid " # pid database name prepend path\n" msgstr " # pid nom de la base de donnes chemin\n" +#, c-format +msgid "E696: Missing comma in List: %s" +msgstr "E696: Il manque une virgule dans la Liste %s" + +#, c-format +msgid "E697: Missing end of List ']': %s" +msgstr "E697: Il manque ']' la fin de la Liste %s" + msgid "Unknown option argument" msgstr "Option inconnue" @@ -4038,15 +4147,18 @@ msgstr "(%d sur %d)%s%s : " msgid " (line deleted)" msgstr " (ligne efface)" +#, c-format +msgid "%serror list %d of %d; %d errors " +msgstr "%sliste d'erreurs %d sur %d ; %d erreurs" + msgid "E380: At bottom of quickfix stack" msgstr "E380: En bas de la pile quickfix" msgid "E381: At top of quickfix stack" msgstr "E381: Au sommet de la pile quickfix" -#, c-format -msgid "error list %d of %d; %d errors" -msgstr "liste d'erreurs %d sur %d ; %d erreurs" +msgid "No entries" +msgstr "Aucune entre" msgid "E382: Cannot write, 'buftype' option is set" msgstr "E382: criture impossible, l'option 'buftype' est active" @@ -4257,9 +4369,6 @@ msgstr " h msgid " Arabic" msgstr " arabe" -msgid " (lang)" -msgstr " (langue)" - msgid " (paste)" msgstr " (collage)" @@ -4354,8 +4463,48 @@ msgstr "" "# Dernier motif de recherche %s :\n" "~" -msgid "E759: Format error in spell file" -msgstr "E759: Erreur de format du fichier orthographique" +msgid "E756: Spell checking is not enabled" +msgstr "E756: La vrification orthographique n'est pas active" + +#, c-format +msgid "Warning: Cannot find word list \"%s_%s.spl\" or \"%s_ascii.spl\"" +msgstr "Alerte : Liste de mots \"%s_%s.spl\" ou \"%s_ascii.spl\" introuvable" + +#, c-format +msgid "Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\"" +msgstr "Alerte : Liste de mots \"%s.%s.spl\" ou \"%s.ascii.spl\" introuvable" + +msgid "E797: SpellFileMissing autocommand deleted buffer" +msgstr "E797: L'autocommande SpellFileMissing a effac le tampon" + +#, c-format +msgid "Warning: region %s not supported" +msgstr "Alerte : rgion %s non supporte" + +msgid "Sorry, no suggestions" +msgstr "Dsol, aucune suggestion" + +#, c-format +msgid "Sorry, only %ld suggestions" +msgstr "Dsol, seulement %ld suggestions" + +#. for when 'cmdheight' > 1 +#. avoid more prompt +#, c-format +msgid "Change \"%.*s\" to:" +msgstr "Remplacer \"%.*s\" par :" + +# DB - todo : l'intrt de traduire ce message m'chappe. +#, c-format +msgid " < \"%.*s\"" +msgstr " < \"%.*s\"" + +msgid "E752: No previous spell replacement" +msgstr "E752: Pas de suggestion orthographique prcdente" + +#, c-format +msgid "E753: Not found: %s" +msgstr "E753: Introuvable : %s" msgid "E758: Truncated spell file" msgstr "E758: Fichier orthographique tronqu" @@ -4401,8 +4550,24 @@ msgid "E770: Unsupported section in spell file" msgstr "E770: Section non supporte dans le fichier orthographique" #, c-format -msgid "Warning: region %s not supported" -msgstr "Alerte : rgion %s non supporte" +msgid "E778: This does not look like a .sug file: %s" +msgstr "E778: %s ne semble pas tre un fichier .sug" + +#, c-format +msgid "E779: Old .sug file, needs to be updated: %s" +msgstr "E779: Fichier de suggestions obsolte, mise jour ncessaire : %s" + +#, c-format +msgid "E780: .sug file is for newer version of Vim: %s" +msgstr "E780: Fichier .sug prvu pour une version de Vim plus rcente : %s" + +#, c-format +msgid "E781: .sug file doesn't match .spl file: %s" +msgstr "E781: Le fichier .sug ne correspond pas au fichier .spl : %s" + +#, c-format +msgid "E782: error while reading .sug file: %s" +msgstr "E782: Erreur lors de la lecture de fichier de suggestions : %s" #, c-format msgid "Reading affix file %s ..." From f09651ea78b833d6d05db89c41df603b741ab000 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 28 Apr 2017 21:01:49 +0200 Subject: [PATCH 180/257] vim-patch:36f44c21da2e Updated runtime files. https://github.com/vim/vim/commit/36f44c21da2e912c008683a0c4447fca2a071e9a --- runtime/doc/eval.txt | 4 +++- runtime/doc/options.txt | 13 ++++++---- runtime/doc/starting.txt | 2 +- runtime/synmenu.vim | 52 +++++++++++++++++++--------------------- 4 files changed, 38 insertions(+), 33 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 107dd28ecd..90575e3438 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3044,6 +3044,8 @@ delete({fname} [, {flags}]) *delete()* When {flags} is "rf": Deletes the directory by the name {fname} and everything in it, recursively. BE CAREFUL! + Note: on MS-Windows it is not possible to delete a directory + that is being used. The result is a Number, which is 0 if the delete operation was successful and -1 when the deletion failed or partly failed. @@ -6167,7 +6169,7 @@ rpcstop({channel}) {Nvim} *rpcstop()* connecting to |v:servername|. screenattr(row, col) *screenattr()* - Like screenchar(), but return the attribute. This is a rather + Like |screenchar()|, but return the attribute. This is a rather arbitrary number that can only be used to compare to the attribute at other positions. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 6b96271c4a..cef01eb27b 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2219,10 +2219,15 @@ A jump table for the options with a short description can be found at |Q_op|. *'exrc'* *'ex'* *'noexrc'* *'noex'* 'exrc' 'ex' boolean (default off) global - Enables the reading of .nvimrc and .exrc in the current directory. - If you switch this option on you should also consider setting the - 'secure' option (see |initialization|). Using this option comes - with a potential security risk, use with care! + Enables the reading of .vimrc and .exrc in the current directory. + Setting this option is a potential security leak. E.g., consider + unpacking a package or fetching files from github, a .vimrc in there + might be a trojan horse. BETTER NOT SET THIS OPTION! + Instead, define an autocommand in your .vimrc to set options for a + matching directory. + + If you do switch this option on you should also consider setting the + 'secure' option (see |initialization|). This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. Also see |init.vim| and |gui-init|. diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index c93c3d0741..f7c47125f1 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -425,7 +425,7 @@ accordingly. Vim proceeds in this order: - The environment variable EXINIT. The value of $EXINIT is used as an Ex command line. - c. If the 'exrc' option is on (which is not the default), the current + c. 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 ".nvimrc" (for Unix) diff --git a/runtime/synmenu.vim b/runtime/synmenu.vim index 01dad3c7f2..81e3667298 100644 --- a/runtime/synmenu.vim +++ b/runtime/synmenu.vim @@ -61,7 +61,6 @@ an 50.10.320 &Syntax.AB.Ascii\ Doc :cal SetSyn("asciidoc") an 50.10.330 &Syntax.AB.ASP\ with\ VBScript :cal SetSyn("aspvbs") an 50.10.340 &Syntax.AB.ASP\ with\ Perl :cal SetSyn("aspperl") an 50.10.350 &Syntax.AB.Assembly.680x0 :cal SetSyn("asm68k") -an 50.10.355 &Syntax.AB.Assembly.AVR :cal SetSyn("avra") an 50.10.360 &Syntax.AB.Assembly.Flat :cal SetSyn("fasm") an 50.10.370 &Syntax.AB.Assembly.GNU :cal SetSyn("asm") an 50.10.380 &Syntax.AB.Assembly.GNU\ H-8300 :cal SetSyn("asmh8300") @@ -162,31 +161,31 @@ an 50.30.290 &Syntax.DE.Doxygen.C\ with\ doxygen :cal SetSyn("c.doxygen") an 50.30.300 &Syntax.DE.Doxygen.C++\ with\ doxygen :cal SetSyn("cpp.doxygen") an 50.30.310 &Syntax.DE.Doxygen.IDL\ with\ doxygen :cal SetSyn("idl.doxygen") an 50.30.320 &Syntax.DE.Doxygen.Java\ with\ doxygen :cal SetSyn("java.doxygen") -an 50.30.320 &Syntax.DE.Doxygen.DataScript\ with\ doxygen :cal SetSyn("datascript.doxygen") -an 50.30.330 &Syntax.DE.Dracula :cal SetSyn("dracula") -an 50.30.340 &Syntax.DE.DSSSL :cal SetSyn("dsl") -an 50.30.350 &Syntax.DE.DTD :cal SetSyn("dtd") -an 50.30.360 &Syntax.DE.DTML\ (Zope) :cal SetSyn("dtml") -an 50.30.370 &Syntax.DE.DTrace :cal SetSyn("dtrace") -an 50.30.380 &Syntax.DE.Dts/dtsi :cal SetSyn("dts") -an 50.30.390 &Syntax.DE.Dylan.Dylan :cal SetSyn("dylan") -an 50.30.400 &Syntax.DE.Dylan.Dylan\ interface :cal SetSyn("dylanintr") -an 50.30.410 &Syntax.DE.Dylan.Dylan\ lid :cal SetSyn("dylanlid") -an 50.30.430 &Syntax.DE.EDIF :cal SetSyn("edif") -an 50.30.440 &Syntax.DE.Eiffel :cal SetSyn("eiffel") -an 50.30.450 &Syntax.DE.Elinks\ config :cal SetSyn("elinks") -an 50.30.460 &Syntax.DE.Elm\ filter\ rules :cal SetSyn("elmfilt") -an 50.30.470 &Syntax.DE.Embedix\ Component\ Description :cal SetSyn("ecd") -an 50.30.480 &Syntax.DE.ERicsson\ LANGuage :cal SetSyn("erlang") -an 50.30.490 &Syntax.DE.ESMTP\ rc :cal SetSyn("esmtprc") -an 50.30.500 &Syntax.DE.ESQL-C :cal SetSyn("esqlc") -an 50.30.510 &Syntax.DE.Essbase\ script :cal SetSyn("csc") -an 50.30.520 &Syntax.DE.Esterel :cal SetSyn("esterel") -an 50.30.530 &Syntax.DE.Eterm\ config :cal SetSyn("eterm") -an 50.30.540 &Syntax.DE.Eviews :cal SetSyn("eviews") -an 50.30.550 &Syntax.DE.Exim\ conf :cal SetSyn("exim") -an 50.30.560 &Syntax.DE.Expect :cal SetSyn("expect") -an 50.30.570 &Syntax.DE.Exports :cal SetSyn("exports") +an 50.30.330 &Syntax.DE.Doxygen.DataScript\ with\ doxygen :cal SetSyn("datascript.doxygen") +an 50.30.340 &Syntax.DE.Dracula :cal SetSyn("dracula") +an 50.30.350 &Syntax.DE.DSSSL :cal SetSyn("dsl") +an 50.30.360 &Syntax.DE.DTD :cal SetSyn("dtd") +an 50.30.370 &Syntax.DE.DTML\ (Zope) :cal SetSyn("dtml") +an 50.30.380 &Syntax.DE.DTrace :cal SetSyn("dtrace") +an 50.30.390 &Syntax.DE.Dts/dtsi :cal SetSyn("dts") +an 50.30.400 &Syntax.DE.Dylan.Dylan :cal SetSyn("dylan") +an 50.30.410 &Syntax.DE.Dylan.Dylan\ interface :cal SetSyn("dylanintr") +an 50.30.420 &Syntax.DE.Dylan.Dylan\ lid :cal SetSyn("dylanlid") +an 50.30.440 &Syntax.DE.EDIF :cal SetSyn("edif") +an 50.30.450 &Syntax.DE.Eiffel :cal SetSyn("eiffel") +an 50.30.460 &Syntax.DE.Elinks\ config :cal SetSyn("elinks") +an 50.30.470 &Syntax.DE.Elm\ filter\ rules :cal SetSyn("elmfilt") +an 50.30.480 &Syntax.DE.Embedix\ Component\ Description :cal SetSyn("ecd") +an 50.30.490 &Syntax.DE.ERicsson\ LANGuage :cal SetSyn("erlang") +an 50.30.500 &Syntax.DE.ESMTP\ rc :cal SetSyn("esmtprc") +an 50.30.510 &Syntax.DE.ESQL-C :cal SetSyn("esqlc") +an 50.30.520 &Syntax.DE.Essbase\ script :cal SetSyn("csc") +an 50.30.530 &Syntax.DE.Esterel :cal SetSyn("esterel") +an 50.30.540 &Syntax.DE.Eterm\ config :cal SetSyn("eterm") +an 50.30.550 &Syntax.DE.Eviews :cal SetSyn("eviews") +an 50.30.560 &Syntax.DE.Exim\ conf :cal SetSyn("exim") +an 50.30.570 &Syntax.DE.Expect :cal SetSyn("expect") +an 50.30.580 &Syntax.DE.Exports :cal SetSyn("exports") an 50.40.100 &Syntax.FG.Falcon :cal SetSyn("falcon") an 50.40.110 &Syntax.FG.Fantom :cal SetSyn("fan") an 50.40.120 &Syntax.FG.Fetchmail :cal SetSyn("fetchmail") @@ -328,7 +327,6 @@ an 50.70.270 &Syntax.M.Messages\ (/var/log) :cal SetSyn("messages") an 50.70.280 &Syntax.M.Metafont :cal SetSyn("mf") an 50.70.290 &Syntax.M.MetaPost :cal SetSyn("mp") an 50.70.300 &Syntax.M.MGL :cal SetSyn("mgl") -an 50.70.305 &Syntax.M.MIX :cal SetSyn("mix") an 50.70.310 &Syntax.M.MMIX :cal SetSyn("mmix") an 50.70.320 &Syntax.M.Modconf :cal SetSyn("modconf") an 50.70.330 &Syntax.M.Model :cal SetSyn("model") From a53409b564458f7a94c8fcd0725d1953dee58dce Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 28 Apr 2017 21:06:44 +0200 Subject: [PATCH 181/257] vim-patch:89bcfda6834a Updated runtime files. Remove version checks for Vim older than 6.0. https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5 --- runtime/autoload/rubycomplete.vim | 36 ++- runtime/compiler/cucumber.vim | 4 +- runtime/compiler/haml.vim | 4 +- runtime/compiler/rake.vim | 6 +- runtime/compiler/rspec.vim | 3 +- runtime/compiler/rubyunit.vim | 2 + runtime/compiler/sass.vim | 4 +- runtime/doc/eval.txt | 26 +- runtime/ftplugin/cucumber.vim | 28 +- runtime/ftplugin/eruby.vim | 2 +- runtime/ftplugin/git.vim | 4 +- runtime/ftplugin/gitcommit.vim | 17 +- runtime/ftplugin/gitrebase.vim | 5 +- runtime/ftplugin/haml.vim | 2 +- runtime/ftplugin/markdown.vim | 32 ++- runtime/ftplugin/ruby.vim | 151 ++++++----- runtime/ftplugin/sass.vim | 5 +- runtime/ftplugin/scss.vim | 3 +- runtime/indent/cucumber.vim | 21 +- runtime/indent/eruby.vim | 43 ++- runtime/indent/fortran.vim | 5 +- runtime/indent/gitconfig.vim | 9 +- runtime/indent/haml.vim | 7 +- runtime/indent/liquid.vim | 11 +- runtime/indent/ruby.vim | 229 +++++++++++++--- runtime/indent/sass.vim | 6 +- runtime/syntax/a65.vim | 43 ++- runtime/syntax/abap.vim | 65 ++--- runtime/syntax/abaqus.vim | 33 +-- runtime/syntax/abc.vim | 39 +-- runtime/syntax/abel.vim | 79 +++--- runtime/syntax/acedb.vim | 53 ++-- runtime/syntax/aflex.vim | 54 ++-- runtime/syntax/ahdl.vim | 41 ++- runtime/syntax/amiga.vim | 41 ++- runtime/syntax/aml.vim | 55 ++-- runtime/syntax/ampl.vim | 48 ++-- runtime/syntax/antlr.vim | 30 +-- runtime/syntax/apache.vim | 63 ++--- runtime/syntax/apachestyle.vim | 33 +-- runtime/syntax/aptconf.vim | 7 +- runtime/syntax/arduino.vim | 13 +- runtime/syntax/asm.vim | 51 ++-- runtime/syntax/asm68k.vim | 91 +++---- runtime/syntax/asmh8300.vim | 37 +-- runtime/syntax/asn.vim | 55 ++-- runtime/syntax/aspperl.vim | 18 +- runtime/syntax/aspvbs.vim | 50 ++-- runtime/syntax/asterisk.vim | 70 +++-- runtime/syntax/asteriskvm.vim | 39 ++- runtime/syntax/atlas.vim | 57 ++-- runtime/syntax/automake.vim | 54 ++-- runtime/syntax/ave.vim | 43 ++- runtime/syntax/ayacc.vim | 60 ++--- runtime/syntax/b.vim | 97 +++---- runtime/syntax/baan.vim | 67 ++--- runtime/syntax/basic.vim | 51 ++-- runtime/syntax/bc.vim | 37 +-- runtime/syntax/bib.vim | 44 ++-- runtime/syntax/bindzone.vim | 63 ++--- runtime/syntax/blank.vim | 27 +- runtime/syntax/bst.vim | 47 ++-- runtime/syntax/btm.vim | 71 +++-- runtime/syntax/bzr.vim | 33 +-- runtime/syntax/cabal.vim | 39 +-- runtime/syntax/cfg.vim | 38 +-- runtime/syntax/ch.vim | 37 +-- runtime/syntax/change.vim | 25 +- runtime/syntax/changelog.vim | 62 ++--- runtime/syntax/chaskell.vim | 6 +- runtime/syntax/cheetah.vim | 33 +-- runtime/syntax/chill.vim | 115 ++++---- runtime/syntax/cl.vim | 69 ++--- runtime/syntax/clean.vim | 81 +++--- runtime/syntax/clipper.vim | 47 ++-- runtime/syntax/cmake.vim | 47 ++-- runtime/syntax/cobol.vim | 93 +++---- runtime/syntax/coco.vim | 5 +- runtime/syntax/config.vim | 39 +-- runtime/syntax/cpp.vim | 54 ++-- runtime/syntax/crontab.vim | 53 ++-- runtime/syntax/csc.vim | 67 ++--- runtime/syntax/csh.vim | 92 +++---- runtime/syntax/csp.vim | 75 +++--- runtime/syntax/css.vim | 257 +++++++++--------- runtime/syntax/cterm.vim | 71 +++-- runtime/syntax/cuda.vim | 13 +- runtime/syntax/cupl.vim | 61 ++--- runtime/syntax/cuplsim.vim | 47 ++-- runtime/syntax/cvs.vim | 33 +-- runtime/syntax/cweb.vim | 31 +-- runtime/syntax/cynlib.vim | 37 +-- runtime/syntax/cynpp.vim | 32 +-- runtime/syntax/datascript.vim | 5 +- runtime/syntax/dcd.vim | 35 +-- runtime/syntax/dcl.vim | 81 +++--- runtime/syntax/debchangelog.vim | 37 +-- runtime/syntax/debcontrol.vim | 55 ++-- runtime/syntax/debsources.vim | 4 +- runtime/syntax/def.vim | 33 +-- runtime/syntax/desc.vim | 56 ++-- runtime/syntax/desktop.vim | 55 ++-- runtime/syntax/diva.vim | 40 +-- runtime/syntax/django.vim | 43 ++- runtime/syntax/dnsmasq.vim | 6 +- runtime/syntax/docbk.vim | 34 +-- runtime/syntax/dosbatch.vim | 67 ++--- runtime/syntax/dosini.vim | 29 +-- runtime/syntax/dot.vim | 47 ++-- runtime/syntax/dracula.vim | 31 +-- runtime/syntax/dtd.vim | 54 ++-- runtime/syntax/dtml.vim | 39 +-- runtime/syntax/dtrace.vim | 13 +- runtime/syntax/dylan.vim | 73 +++--- runtime/syntax/dylanintr.vim | 35 +-- runtime/syntax/dylanlid.vim | 25 +- runtime/syntax/ecd.vim | 34 +-- runtime/syntax/edif.vim | 41 +-- runtime/syntax/eiffel.vim | 97 +++---- runtime/syntax/elf.vim | 47 ++-- runtime/syntax/elmfilt.vim | 49 ++-- runtime/syntax/erlang.vim | 211 +++++++-------- runtime/syntax/eruby.vim | 2 +- runtime/syntax/esmtprc.vim | 7 +- runtime/syntax/esqlc.vim | 37 +-- runtime/syntax/esterel.vim | 38 +-- runtime/syntax/euphoria3.vim | 6 +- runtime/syntax/euphoria4.vim | 6 +- runtime/syntax/eviews.vim | 63 ++--- runtime/syntax/exim.vim | 42 ++- runtime/syntax/expect.vim | 49 ++-- runtime/syntax/exports.vim | 43 ++- runtime/syntax/fasm.vim | 5 +- runtime/syntax/fdcc.vim | 87 +++---- runtime/syntax/fgl.vim | 39 +-- runtime/syntax/flexwiki.vim | 6 +- runtime/syntax/focexec.vim | 47 ++-- runtime/syntax/form.vim | 79 +++--- runtime/syntax/forth.vim | 101 +++---- runtime/syntax/fortran.vim | 6 +- runtime/syntax/foxpro.vim | 57 ++-- runtime/syntax/fstab.vim | 108 ++++---- runtime/syntax/fvwm2m4.vim | 21 +- runtime/syntax/gdb.vim | 41 ++- runtime/syntax/gdmo.vim | 47 ++-- runtime/syntax/gedcom.vim | 37 +-- runtime/syntax/gitcommit.vim | 9 +- runtime/syntax/gitrebase.vim | 4 +- runtime/syntax/gitsendemail.vim | 8 +- runtime/syntax/gkrellmrc.vim | 60 ++--- runtime/syntax/gnash.vim | 7 +- runtime/syntax/gnuplot.vim | 73 +++--- runtime/syntax/gp.vim | 50 ++-- runtime/syntax/grads.vim | 43 ++- runtime/syntax/gretl.vim | 61 ++--- runtime/syntax/groovy.vim | 137 +++++----- runtime/syntax/gsp.vim | 19 +- runtime/syntax/gtkrc.vim | 94 +++---- runtime/syntax/haml.vim | 4 +- runtime/syntax/hamster.vim | 30 +-- runtime/syntax/haskell.vim | 116 ++++----- runtime/syntax/haste.vim | 7 +- runtime/syntax/hastepreproc.vim | 19 +- runtime/syntax/hb.vim | 43 ++- runtime/syntax/hercules.vim | 46 ++-- runtime/syntax/hex.vim | 51 ++-- runtime/syntax/hog.vim | 5 +- runtime/syntax/hostsaccess.vim | 8 +- runtime/syntax/html.vim | 134 +++++----- runtime/syntax/htmlcheetah.vim | 18 +- runtime/syntax/htmldjango.vim | 18 +- runtime/syntax/htmlm4.vim | 20 +- runtime/syntax/htmlos.vim | 75 +++--- runtime/syntax/ia64.vim | 73 +++--- runtime/syntax/icemenu.vim | 6 +- runtime/syntax/icon.vim | 87 +++---- runtime/syntax/idlang.vim | 53 ++-- runtime/syntax/inform.vim | 114 ++++---- runtime/syntax/inittab.vim | 46 ++-- runtime/syntax/ipfilter.vim | 7 +- runtime/syntax/ishd.vim | 53 ++-- runtime/syntax/iss.vim | 69 +++-- runtime/syntax/ist.vim | 45 ++-- runtime/syntax/jal.vim | 127 +++++---- runtime/syntax/jam.vim | 165 ++++++------ runtime/syntax/jargon.vim | 29 +-- runtime/syntax/java.vim | 137 +++++----- runtime/syntax/javacc.vim | 37 +-- runtime/syntax/javascript.vim | 90 +++---- runtime/syntax/jess.vim | 59 ++--- runtime/syntax/jgraph.vim | 29 +-- runtime/syntax/jproperties.vim | 39 +-- runtime/syntax/json.vim | 59 ++--- runtime/syntax/jsp.vim | 51 ++-- runtime/syntax/kix.vim | 82 +++--- runtime/syntax/kscript.vim | 49 ++-- runtime/syntax/kwt.vim | 45 ++-- runtime/syntax/lace.vim | 71 +++-- runtime/syntax/latte.vim | 43 +-- runtime/syntax/ldif.vim | 30 +-- runtime/syntax/lex.vim | 7 +- runtime/syntax/lhaskell.vim | 46 +--- runtime/syntax/lifelines.vim | 71 +++-- runtime/syntax/lilo.vim | 116 ++++----- runtime/syntax/lisp.vim | 97 ++++--- runtime/syntax/lite.vim | 61 ++--- runtime/syntax/logtalk.vim | 73 +++--- runtime/syntax/lotos.vim | 35 +-- runtime/syntax/lout.vim | 75 +++--- runtime/syntax/lpc.vim | 167 ++++++------ runtime/syntax/lprolog.vim | 55 ++-- runtime/syntax/lscript.vim | 49 ++-- runtime/syntax/lss.vim | 108 ++++---- runtime/syntax/lua.vim | 63 ++--- runtime/syntax/m4.vim | 53 ++-- runtime/syntax/make.vim | 63 ++--- runtime/syntax/maple.vim | 145 +++++------ runtime/syntax/markdown.vim | 31 ++- runtime/syntax/mason.vim | 36 +-- runtime/syntax/master.vim | 27 +- runtime/syntax/matlab.vim | 75 +++--- runtime/syntax/maxima.vim | 65 ++--- runtime/syntax/mel.vim | 75 +++--- runtime/syntax/mf.vim | 63 ++--- runtime/syntax/mgl.vim | 67 +++-- runtime/syntax/mgp.vim | 46 ++-- runtime/syntax/mma.vim | 70 +++-- runtime/syntax/mmix.vim | 59 ++--- runtime/syntax/mmp.vim | 10 +- runtime/syntax/modsim3.vim | 44 ++-- runtime/syntax/modula2.vim | 47 ++-- runtime/syntax/modula3.vim | 31 +-- runtime/syntax/monk.vim | 47 ++-- runtime/syntax/moo.vim | 4 +- runtime/syntax/mp.vim | 37 +-- runtime/syntax/msidl.vim | 57 ++-- runtime/syntax/msmessages.vim | 7 +- runtime/syntax/msql.vim | 69 ++--- runtime/syntax/mupad.vim | 42 ++- runtime/syntax/mush.vim | 58 ++--- runtime/syntax/muttrc.vim | 307 +++++++++++----------- runtime/syntax/mysql.vim | 41 ++- runtime/syntax/named.vim | 85 +++--- runtime/syntax/nasm.vim | 174 ++++++------- runtime/syntax/nastran.vim | 62 ++--- runtime/syntax/natural.vim | 11 +- runtime/syntax/ncf.vim | 67 +++-- runtime/syntax/netrw.vim | 5 +- runtime/syntax/nqc.vim | 87 +++---- runtime/syntax/nroff.vim | 93 +++---- runtime/syntax/nsis.vim | 77 +++--- runtime/syntax/obj.vim | 47 ++-- runtime/syntax/objcpp.vim | 18 +- runtime/syntax/ocaml.vim | 111 ++++---- runtime/syntax/occam.vim | 64 ++--- runtime/syntax/omnimark.vim | 39 +-- runtime/syntax/openroad.vim | 48 ++-- runtime/syntax/opl.vim | 31 +-- runtime/syntax/ora.vim | 48 ++-- runtime/syntax/papp.vim | 29 +-- runtime/syntax/pascal.vim | 87 +++---- runtime/syntax/pcap.vim | 33 +-- runtime/syntax/pccts.vim | 57 ++-- runtime/syntax/perl6.vim | 329 ++++++++++++----------- runtime/syntax/pfmain.vim | 50 ++-- runtime/syntax/php.vim | 200 ++++++-------- runtime/syntax/pic.vim | 49 ++-- runtime/syntax/pike.vim | 85 +++--- runtime/syntax/pilrc.vim | 44 ++-- runtime/syntax/pine.vim | 33 +-- runtime/syntax/pli.vim | 96 +++---- runtime/syntax/plm.vim | 63 ++--- runtime/syntax/plp.vim | 18 +- runtime/syntax/plsql.vim | 91 +++---- runtime/syntax/po.vim | 95 +++---- runtime/syntax/pod.vim | 39 +-- runtime/syntax/postscr.vim | 109 ++++---- runtime/syntax/pov.vim | 10 +- runtime/syntax/povini.vim | 10 +- runtime/syntax/ppd.vim | 35 +-- runtime/syntax/ppwiz.vim | 49 ++-- runtime/syntax/prescribe.vim | 33 +-- runtime/syntax/procmail.vim | 45 ++-- runtime/syntax/progress.vim | 77 +++--- runtime/syntax/prolog.vim | 62 ++--- runtime/syntax/promela.vim | 7 +- runtime/syntax/proto.vim | 5 +- runtime/syntax/psf.vim | 34 +-- runtime/syntax/ptcap.vim | 52 ++-- runtime/syntax/purifylog.vim | 99 ++++--- runtime/syntax/pyrex.vim | 44 ++-- runtime/syntax/python.vim | 86 +++--- runtime/syntax/radiance.vim | 51 ++-- runtime/syntax/ratpoison.vim | 49 ++-- runtime/syntax/rc.vim | 87 +++---- runtime/syntax/rcs.vim | 35 +-- runtime/syntax/rcslog.vim | 27 +- runtime/syntax/rebol.vim | 101 +++---- runtime/syntax/redif.vim | 6 +- runtime/syntax/registry.vim | 40 ++- runtime/syntax/remind.vim | 52 ++-- runtime/syntax/resolv.vim | 52 ++-- runtime/syntax/reva.vim | 9 +- runtime/syntax/rexx.vim | 121 ++++----- runtime/syntax/rib.vim | 31 +-- runtime/syntax/robots.vim | 36 +-- runtime/syntax/rpcgen.vim | 40 +-- runtime/syntax/rpl.vim | 123 ++++----- runtime/syntax/rtf.vim | 47 ++-- runtime/syntax/ruby.vim | 419 +++++++++++++++++++++--------- runtime/syntax/samba.vim | 35 +-- runtime/syntax/sas.vim | 103 ++++---- runtime/syntax/sass.vim | 12 +- runtime/syntax/sather.vim | 73 +++--- runtime/syntax/scala.vim | 5 +- runtime/syntax/scheme.vim | 55 ++-- runtime/syntax/scilab.vim | 71 +++-- runtime/syntax/sd.vim | 40 ++- runtime/syntax/sdl.vim | 58 ++--- runtime/syntax/sed.vim | 80 +++--- runtime/syntax/sendpr.vim | 7 +- runtime/syntax/sgml.vim | 7 +- runtime/syntax/sgmldecl.vim | 43 ++- runtime/syntax/sgmllnx.vim | 45 ++-- runtime/syntax/sh.vim | 7 +- runtime/syntax/sicad.vim | 77 ++---- runtime/syntax/simula.vim | 68 +++-- runtime/syntax/sinda.vim | 59 ++--- runtime/syntax/sindacmp.vim | 33 +-- runtime/syntax/sindaout.vim | 49 ++-- runtime/syntax/sisu.vim | 6 +- runtime/syntax/skill.vim | 57 ++-- runtime/syntax/sl.vim | 73 +++--- runtime/syntax/slang.vim | 77 +++--- runtime/syntax/slice.vim | 49 ++-- runtime/syntax/slrnrc.vim | 71 +++-- runtime/syntax/slrnsc.vim | 57 ++-- runtime/syntax/sm.vim | 48 ++-- runtime/syntax/smarty.vim | 38 ++- runtime/syntax/smcl.vim | 5 +- runtime/syntax/smil.vim | 57 ++-- runtime/syntax/smith.vim | 31 +-- runtime/syntax/sml.vim | 91 +++---- runtime/syntax/snnsnet.vim | 28 +- runtime/syntax/snnspat.vim | 34 +-- runtime/syntax/snnsres.vim | 28 +- runtime/syntax/snobol4.vim | 77 +++--- runtime/syntax/spec.vim | 135 +++++----- runtime/syntax/specman.vim | 81 +++--- runtime/syntax/spice.vim | 39 +-- runtime/syntax/splint.vim | 111 ++++---- runtime/syntax/spup.vim | 127 +++++---- runtime/syntax/spyce.vim | 17 +- runtime/syntax/sql.vim | 7 +- runtime/syntax/sqlanywhere.vim | 7 +- runtime/syntax/sqlforms.vim | 50 ++-- runtime/syntax/sqlhana.vim | 7 +- runtime/syntax/sqlinformix.vim | 59 ++--- runtime/syntax/sqlj.vim | 37 +-- runtime/syntax/sqr.vim | 113 +++----- runtime/syntax/squid.vim | 43 ++- runtime/syntax/srec.vim | 49 ++-- runtime/syntax/sshconfig.vim | 74 +++--- runtime/syntax/sshdconfig.vim | 80 +++--- runtime/syntax/st.vim | 43 ++- runtime/syntax/stata.vim | 5 +- runtime/syntax/stp.vim | 55 ++-- runtime/syntax/strace.vim | 50 ++-- runtime/syntax/svn.vim | 39 +-- runtime/syntax/systemverilog.vim | 42 +-- runtime/syntax/tads.vim | 87 +++---- runtime/syntax/tags.vim | 33 +-- runtime/syntax/tak.vim | 61 ++--- runtime/syntax/takcmp.vim | 37 +-- runtime/syntax/takout.vim | 47 ++-- runtime/syntax/taskdata.vim | 7 +- runtime/syntax/taskedit.vim | 7 +- runtime/syntax/tasm.vim | 47 ++-- runtime/syntax/tcl.vim | 77 +++--- runtime/syntax/tex.vim | 39 +-- runtime/syntax/texinfo.vim | 69 +++-- runtime/syntax/texmf.vim | 58 ++--- runtime/syntax/tf.vim | 71 +++-- runtime/syntax/tli.vim | 37 +-- runtime/syntax/tpp.vim | 59 ++--- runtime/syntax/trasys.vim | 63 ++--- runtime/syntax/trustees.vim | 5 +- runtime/syntax/tsalt.vim | 75 +++--- runtime/syntax/tsscl.vim | 53 ++-- runtime/syntax/tssgm.vim | 49 ++-- runtime/syntax/tssop.vim | 39 +-- runtime/syntax/uc.vim | 103 ++++---- runtime/syntax/uil.vim | 56 ++-- runtime/syntax/upstart.vim | 5 +- runtime/syntax/vb.vim | 63 ++--- runtime/syntax/vera.vim | 129 +++++---- runtime/syntax/verilog.vim | 57 ++-- runtime/syntax/verilogams.vim | 61 ++--- runtime/syntax/vhdl.vim | 55 ++-- runtime/syntax/virata.vim | 98 ++++--- runtime/syntax/vmasm.vim | 75 +++--- runtime/syntax/vrml.vim | 73 +++--- runtime/syntax/vroom.vim | 7 +- runtime/syntax/vsejcl.vim | 35 +-- runtime/syntax/wdiff.vim | 26 +- runtime/syntax/web.vim | 15 +- runtime/syntax/webmacro.vim | 53 ++-- runtime/syntax/winbatch.vim | 41 ++- runtime/syntax/wml.vim | 60 ++--- runtime/syntax/wsml.vim | 76 +++--- runtime/syntax/xdefaults.vim | 57 ++-- runtime/syntax/xf86conf.vim | 8 +- runtime/syntax/xkb.vim | 62 ++--- runtime/syntax/xmath.vim | 65 ++--- runtime/syntax/xpm.vim | 31 +-- runtime/syntax/xpm2.vim | 36 +-- runtime/syntax/xs.vim | 47 ++-- runtime/syntax/xxd.vim | 27 +- runtime/syntax/yacc.vim | 3 - runtime/syntax/z8a.vim | 43 ++- 420 files changed, 9255 insertions(+), 12890 deletions(-) diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim index e1064c8a58..440dfd42e9 100644 --- a/runtime/autoload/rubycomplete.vim +++ b/runtime/autoload/rubycomplete.vim @@ -93,7 +93,7 @@ function! s:GetBufferRubyEntity( name, type, ... ) let stopline = 1 - let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?' + let crex = '^\s*\<' . a:type . '\>\s*\<' . escape(a:name, '*') . '\>\s*\(<\s*.*\s*\)\?' let [lnum,lcol] = searchpos( crex, 'w' ) "let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' ) @@ -149,7 +149,7 @@ function! s:GetRubyVarType(v) let ctors = ctors.'\)' let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)' - let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr + let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr let [lnum,lcol] = searchpos(sstr,'nb',stopline) if lnum != 0 && lcol != 0 let str = matchstr(getline(lnum),fstr,lcol) @@ -266,6 +266,28 @@ class VimRubyCompletion end end + def load_gems + fpath = VIM::evaluate("get(g:, 'rubycomplete_gemfile_path', 'Gemfile')") + return unless File.file?(fpath) && File.readable?(fpath) + want_bundler = VIM::evaluate("get(g:, 'rubycomplete_use_bundler')") + parse_file = !want_bundler + begin + require 'bundler' + Bundler.setup + Bundler.require + rescue Exception + parse_file = true + end + if parse_file + File.new(fpath).each_line do |line| + begin + require $1 if /\s*gem\s*['"]([^'"]+)/.match(line) + rescue Exception + end + end + end + end + def load_buffer_class(name) dprint "load_buffer_class(%s) START" % name classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")') @@ -588,6 +610,10 @@ class VimRubyCompletion load_rails end + want_gems = VIM::evaluate("get(g:, 'rubycomplete_load_gemfile')") + load_gems unless want_gems.to_i.zero? + + input = VIM::Buffer.current.line cpos = VIM::Window.current.cursor[1] - 1 input = input[0..cpos] @@ -678,7 +704,9 @@ class VimRubyCompletion cv = eval("self.class.constants") vartype = get_var_type( receiver ) dprint "vartype: %s" % vartype - if vartype != '' + + invalid_vartype = ['', "gets"] + if !invalid_vartype.include?(vartype) load_buffer_class( vartype ) begin @@ -706,7 +734,7 @@ class VimRubyCompletion methods.concat m.instance_methods(false) } end - variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0 + variables += add_rails_columns( "#{vartype}" ) if vartype && !invalid_vartype.include?(vartype) when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/ message = $1 diff --git a/runtime/compiler/cucumber.vim b/runtime/compiler/cucumber.vim index c020be6e3b..17ce3627c1 100644 --- a/runtime/compiler/cucumber.vim +++ b/runtime/compiler/cucumber.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Cucumber " Maintainer: Tim Pope -" Last Change: 2010 Aug 09 +" Last Change: 2016 Aug 29 if exists("current_compiler") finish @@ -19,7 +19,7 @@ CompilerSet makeprg=cucumber CompilerSet errorformat= \%W%m\ (Cucumber::Undefined), - \%E%m\ (%.%#), + \%E%m\ (%\\S%#), \%Z%f:%l, \%Z%f:%l:%.%# diff --git a/runtime/compiler/haml.vim b/runtime/compiler/haml.vim index b06a672df7..9464c3dc85 100644 --- a/runtime/compiler/haml.vim +++ b/runtime/compiler/haml.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Haml " Maintainer: Tim Pope -" Last Change: 2013 May 30 +" Last Change: 2016 Aug 29 if exists("current_compiler") finish @@ -15,7 +15,7 @@ endif let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=haml\ -c +CompilerSet makeprg=haml CompilerSet errorformat= \Haml\ %trror\ on\ line\ %l:\ %m, diff --git a/runtime/compiler/rake.vim b/runtime/compiler/rake.vim index 3bd9da0daf..8490f2a9e9 100644 --- a/runtime/compiler/rake.vim +++ b/runtime/compiler/rake.vim @@ -27,7 +27,11 @@ CompilerSet errorformat= \%\\s%#[%f:%l:\ %#%m, \%\\s%#%f:%l:\ %#%m, \%\\s%#%f:%l:, - \%m\ [%f:%l]: + \%m\ [%f:%l]:, + \%+Erake\ aborted!, + \%+EDon't\ know\ how\ to\ build\ task\ %.%#, + \%+Einvalid\ option:%.%#, + \%+Irake\ %\\S%\\+%\\s%\\+#\ %.%# let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/compiler/rspec.vim b/runtime/compiler/rspec.vim index 7c340bab15..c77bd70da7 100644 --- a/runtime/compiler/rspec.vim +++ b/runtime/compiler/rspec.vim @@ -22,9 +22,10 @@ CompilerSet errorformat= \%f:%l:\ %tarning:\ %m, \%E%.%#:in\ `load':\ %f:%l:%m, \%E%f:%l:in\ `%*[^']':\ %m, - \%-Z\ \ \ \ \ \#\ %f:%l:%.%#, + \%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#, \%E\ \ %\\d%\\+)%.%#, \%C\ \ \ \ \ %m, + \%C%\\s%#, \%-G%.%# let &cpo = s:cpo_save diff --git a/runtime/compiler/rubyunit.vim b/runtime/compiler/rubyunit.vim index 93a0c8e653..ed0639b581 100644 --- a/runtime/compiler/rubyunit.vim +++ b/runtime/compiler/rubyunit.vim @@ -17,6 +17,8 @@ let s:cpo_save = &cpo set cpo-=C CompilerSet makeprg=testrb +" CompilerSet makeprg=ruby\ -Itest +" CompilerSet makeprg=m CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:, \%C%m\ [%f:%l]:, diff --git a/runtime/compiler/sass.vim b/runtime/compiler/sass.vim index 376a52b303..9c540ac443 100644 --- a/runtime/compiler/sass.vim +++ b/runtime/compiler/sass.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Sass " Maintainer: Tim Pope -" Last Change: 2013 May 30 +" Last Change: 2016 Aug 29 if exists("current_compiler") finish @@ -15,7 +15,7 @@ endif let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=sass\ -c +CompilerSet makeprg=sass CompilerSet errorformat= \%f:%l:%m\ (Sass::Syntax%trror), diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 90575e3438..b40f91ff35 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -631,13 +631,17 @@ It's possible to form a variable name with curly braces, see Expression syntax summary, from least to most significant: -|expr1| expr2 ? expr1 : expr1 if-then-else +|expr1| expr2 + expr2 ? expr1 : expr1 if-then-else -|expr2| expr3 || expr3 .. logical OR +|expr2| expr3 + expr3 || expr3 .. logical OR -|expr3| expr4 && expr4 .. logical AND +|expr3| expr4 + expr4 && expr4 .. logical AND -|expr4| expr5 == expr5 equal +|expr4| expr5 + expr5 == expr5 equal expr5 != expr5 not equal expr5 > expr5 greater than expr5 >= expr5 greater than or equal @@ -654,24 +658,28 @@ Expression syntax summary, from least to most significant: expr5 is expr5 same |List| instance expr5 isnot expr5 different |List| instance -|expr5| expr6 + expr6 .. number addition or list concatenation +|expr5| expr6 + expr6 + expr6 .. number addition or list concatenation expr6 - expr6 .. number subtraction expr6 . expr6 .. string concatenation -|expr6| expr7 * expr7 .. number multiplication +|expr6| expr7 + expr7 * expr7 .. number multiplication expr7 / expr7 .. number division expr7 % expr7 .. number modulo -|expr7| ! expr7 logical NOT +|expr7| expr8 + ! expr7 logical NOT - expr7 unary minus + expr7 unary plus -|expr8| expr8[expr1] byte of a String or item of a |List| +|expr8| expr9 + expr8[expr1] byte of a String or item of a |List| expr8[expr1 : expr1] substring of a String or sublist of a |List| expr8.name entry in a |Dictionary| expr8(expr1, ...) function call with |Funcref| variable -|expr9| number number constant +|expr9| number number constant "string" string constant, backslash is special 'string' string constant, ' is doubled [expr1, ...] |List| diff --git a/runtime/ftplugin/cucumber.vim b/runtime/ftplugin/cucumber.vim index 2ec1a5976f..f4848d1c60 100644 --- a/runtime/ftplugin/cucumber.vim +++ b/runtime/ftplugin/cucumber.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Cucumber " Maintainer: Tim Pope -" Last Change: 2013 Jun 01 +" Last Change: 2016 Aug 29 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) @@ -19,27 +19,23 @@ setlocal omnifunc=CucumberComplete let b:undo_ftplugin = "setl fo< com< cms< ofu<" let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??') +if !exists("b:cucumber_steps_glob") + let b:cucumber_steps_glob = b:cucumber_root.'/**/*.rb' +endif if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps") - nnoremap :exe jump('edit',v:count) - nnoremap [ :exe jump('edit',v:count) - nnoremap ] :exe jump('edit',v:count) - nnoremap ] :exe jump('split',v:count) - nnoremap :exe jump('split',v:count) - nnoremap d :exe jump('split',v:count) - nnoremap :exe jump('split',v:count) - nnoremap } :exe jump('pedit',v:count) - nnoremap [d :exe jump('pedit',v:count) - nnoremap ]d :exe jump('pedit',v:count) + cnoremap foldopen if &foldopen =~# 'tag'exe 'norm! zv'endif + nnoremap