xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 16673ad450bf396b49a45b1cab38b4cb66758755

Improve error message on trying to :unlet v:var
Old error: "Trailing characters"
New error: "Unsupported variable type: v:var"
Author: xaizek
Author date (UTC): 2024-11-02 16:42
Committer name: xaizek
Committer date (UTC): 2024-11-02 19:20
Parent(s): 6d34ab9a27694a66e0c02237c4b980459cd5e360
Signing key: 99DC5E4DB05F6BE2
Tree: 90d000c2214a6cecab71f34fb7d254852d07ab17
File Lines added Lines deleted
ChangeLog 2 0
src/engine/variables.c 7 0
tests/variables/unlet.c 6 0
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
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master