File ChangeLog changed (mode: 100644) (index 95145e8e9..1aea4fa7e) |
167 |
167 |
Make :goto preserve custom and tree views. Thanks to |
Make :goto preserve custom and tree views. Thanks to |
168 |
168 |
asmodeus812 (Svetlozar Iliev). |
asmodeus812 (Svetlozar Iliev). |
169 |
169 |
|
|
|
170 |
|
Improve error message on trying to :unlet a builtin variable. |
|
171 |
|
|
170 |
172 |
Fixed line number column not including padding to the left of it. |
Fixed line number column not including padding to the left of it. |
171 |
173 |
|
|
172 |
174 |
Fixed local options not being loaded on Ctrl-W x. |
Fixed local options not being loaded on Ctrl-W x. |
File src/engine/variables.c changed (mode: 100644) (index 37b37535f..f4df059ba) |
... |
... |
unlet_variables(const char cmd[]) |
740 |
740 |
*p++ = *cmd++; |
*p++ = *cmd++; |
741 |
741 |
*p++ = *cmd++; |
*p++ = *cmd++; |
742 |
742 |
} |
} |
|
743 |
|
else if(starts_with_lit(cmd, "v:")) |
|
744 |
|
{ |
|
745 |
|
/* Parse the name, but don't set the type to get a sensible error message |
|
746 |
|
* about unsupported variable type. */ |
|
747 |
|
*p++ = *cmd++; |
|
748 |
|
*p++ = *cmd++; |
|
749 |
|
} |
743 |
750 |
|
|
744 |
751 |
/* Copy variable name. */ |
/* Copy variable name. */ |
745 |
752 |
while(*cmd != '\0' && char_is_one_of(ENV_VAR_NAME_CHARS, *cmd) && |
while(*cmd != '\0' && char_is_one_of(ENV_VAR_NAME_CHARS, *cmd) && |
File tests/variables/unlet.c changed (mode: 100644) (index 11f662629..1823f3325) |
1 |
1 |
#include <stic.h> |
#include <stic.h> |
2 |
2 |
|
|
|
3 |
|
#include "../../src/engine/text_buffer.h" |
3 |
4 |
#include "../../src/engine/variables.h" |
#include "../../src/engine/variables.h" |
4 |
5 |
#include "../../src/utils/env.h" |
#include "../../src/utils/env.h" |
5 |
6 |
|
|
|
... |
... |
TEST(envvar_table_updates_do_not_crash) |
23 |
24 |
TEST(cannot_unlet_builtin_vars) |
TEST(cannot_unlet_builtin_vars) |
24 |
25 |
{ |
{ |
25 |
26 |
assert_success(setvar("v:test", var_from_bool(1))); |
assert_success(setvar("v:test", var_from_bool(1))); |
|
27 |
|
|
|
28 |
|
vle_tb_clear(vle_err); |
26 |
29 |
assert_failure(unlet_variables("v:test")); |
assert_failure(unlet_variables("v:test")); |
|
30 |
|
assert_string_equal("Unsupported variable type: v:test", |
|
31 |
|
vle_tb_get_data(vle_err)); |
|
32 |
|
|
27 |
33 |
assert_true(getvar("v:test").type == VTYPE_INT); |
assert_true(getvar("v:test").type == VTYPE_INT); |
28 |
34 |
} |
} |
29 |
35 |
|
|