Commit 3ae34ad2158e9bb08da2ef00087a403e961ae30c
Fix :normal running cmds with trailing whitespace
The handler was using version of argument that has trailing whitespace
truncated, so something like `:normal 1 ` was handled as `normal 1`.
Author: xaizek
Author date (UTC): 2025-07-01 12:11
Committer name: xaizek
Committer date (UTC): 2025-07-01 12:24
Parent(s): e38f2b5340b709a4250e760f377a21c23dbb0ebd
Signing key: 99DC5E4DB05F6BE2
Tree: 0bd9758993adf6d0d8b17ca53b9bf861c5e1939d
File ChangeLog changed (mode: 100644) (index c481dd7f9..b49503ba7) |
110 |
110 |
Fixed abort due to assertion on displaying a statusbar message with a |
Fixed abort due to assertion on displaying a statusbar message with a |
111 |
111 |
newline when 'shortmess' includes "T". Thanks to agguser. |
newline when 'shortmess' includes "T". Thanks to agguser. |
112 |
112 |
|
|
|
113 |
|
Fixed :normal not being able to run commands which end with whitespace. |
|
114 |
|
|
113 |
115 |
0.14-beta to 0.14 (2025-02-08) |
0.14-beta to 0.14 (2025-02-08) |
114 |
116 |
|
|
115 |
117 |
Improved documentation on zh/zl menu keys a bit. |
Improved documentation on zh/zl menu keys a bit. |
File src/cmd_handlers.c changed (mode: 100644) (index 70dfac96e..7751a99fd) |
... |
... |
map_or_remap(const cmd_info_t *cmd_info, int no_remap) |
3992 |
3992 |
static int |
static int |
3993 |
3993 |
normal_cmd(const cmd_info_t *cmd_info) |
normal_cmd(const cmd_info_t *cmd_info) |
3994 |
3994 |
{ |
{ |
3995 |
|
wchar_t *const wide = to_wide(cmd_info->args); |
|
|
3995 |
|
wchar_t *const wide = to_wide(cmd_info->raw_args); |
3996 |
3996 |
if(wide == NULL) |
if(wide == NULL) |
3997 |
3997 |
{ |
{ |
3998 |
3998 |
show_error_msgf("Command Error", "Failed to convert to wide string: %s", |
show_error_msgf("Command Error", "Failed to convert to wide string: %s", |
3999 |
|
cmd_info->args); |
|
|
3999 |
|
cmd_info->raw_args); |
4000 |
4000 |
return 0; |
return 0; |
4001 |
4001 |
} |
} |
4002 |
4002 |
|
|
File tests/commands/normal.c changed (mode: 100644) (index 5967b6267..858b2be89) |
... |
... |
TEARDOWN() |
49 |
49 |
opt_handlers_teardown(); |
opt_handlers_teardown(); |
50 |
50 |
} |
} |
51 |
51 |
|
|
|
52 |
|
TEST(normal_command_can_run_whitespace_commands) |
|
53 |
|
{ |
|
54 |
|
assert_true(curr_view == &lwin); |
|
55 |
|
|
|
56 |
|
assert_success(cmds_dispatch("normal 1 ", &lwin, CIT_COMMAND)); |
|
57 |
|
assert_true(curr_view == &rwin); |
|
58 |
|
|
|
59 |
|
assert_success(cmds_dispatch("normal 1 ", &lwin, CIT_COMMAND)); |
|
60 |
|
assert_true(curr_view == &lwin); |
|
61 |
|
} |
|
62 |
|
|
52 |
63 |
TEST(normal_command_exits_cmdline_mode) |
TEST(normal_command_exits_cmdline_mode) |
53 |
64 |
{ |
{ |
54 |
65 |
assert_true(vle_mode_is(NORMAL_MODE)); |
assert_true(vle_mode_is(NORMAL_MODE)); |