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 8731e0744cb5501162aaa9824069623c74988447

Error on trying to use raw mode in %q view
Just to give a user feedback on why nothing happens.
Author: xaizek
Author date (UTC): 2025-08-21 20:57
Committer name: xaizek
Committer date (UTC): 2025-08-21 20:57
Parent(s): b91e8b1c8025d1bc819af799f10b7dbec5907c73
Signing key: 99DC5E4DB05F6BE2
Tree: ecddc62500021997e4ffd93388da5a95a5da51af
File Lines added Lines deleted
ChangeLog 2 0
src/modes/view.c 4 0
tests/misc/view_mode.c 23 0
File ChangeLog changed (mode: 100644) (index 05801b06e..bf179fb51)
61 61
62 62 Allowed descriptions for commands of `:fileviewer`. Allowed descriptions for commands of `:fileviewer`.
63 63
64 Display an error on trying to switch from external preview to raw mode.
65
64 66 Fixed 'trashdir' with "%r" on BSD-like systems (those with getmntinfo() Fixed 'trashdir' with "%r" on BSD-like systems (those with getmntinfo()
65 67 instead of getmntent() API). The regression was apparently introduced in instead of getmntent() API). The regression was apparently introduced in
66 68 v0.9.1-beta. Thanks to sublimal. v0.9.1-beta. Thanks to sublimal.
File src/modes/view.c changed (mode: 100644) (index b5327b16f..4c5a1051c)
... ... cmd_i(key_info_t key_info, keys_info_t *keys_info)
1319 1319 vi->raw = !vi->raw; vi->raw = !vi->raw;
1320 1320 reload_view(vi, NOSILENT); reload_view(vi, NOSILENT);
1321 1321 } }
1322 else
1323 {
1324 display_error("No raw mode for an external viewer.");
1325 }
1322 1326 } }
1323 1327
1324 1328 static void static void
File tests/misc/view_mode.c changed (mode: 100644) (index a116b8628..7d6b62f08)
11 11 #include "../../src/modes/view.h" #include "../../src/modes/view.h"
12 12 #include "../../src/modes/wk.h" #include "../../src/modes/wk.h"
13 13 #include "../../src/ui/quickview.h" #include "../../src/ui/quickview.h"
14 #include "../../src/ui/statusline.h"
14 15 #include "../../src/ui/ui.h" #include "../../src/ui/ui.h"
15 16 #include "../../src/utils/str.h" #include "../../src/utils/str.h"
16 17 #include "../../src/utils/string_array.h" #include "../../src/utils/string_array.h"
 
... ... TEST(toggling_raw_mode)
89 90 assert_false(modview_is_raw(lwin.vi)); assert_false(modview_is_raw(lwin.vi));
90 91 } }
91 92
93 TEST(no_raw_mode_for_external_viewer)
94 {
95 opt_handlers_setup();
96 curr_stats.number_of_windows = 2;
97 make_abs_path(lwin.curr_dir, sizeof(lwin.curr_dir), TEST_DATA_PATH, "read",
98 NULL);
99 populate_dir_list(&lwin, 0);
100
101 int save_msg;
102 rn_ext(&lwin, "echo 1", "title", MF_PREVIEW_OUTPUT | MF_NO_CACHE, /*pause=*/0,
103 /*bg=*/0, &save_msg);
104 (void)vle_keys_exec_timed_out(WK_C_w WK_w);
105 assert_true(vle_mode_is(VIEW_MODE));
106
107 ui_sb_msg("");
108 (void)vle_keys_exec_timed_out(WK_i);
109 assert_string_equal("No raw mode for an external viewer.", ui_sb_last());
110
111 qv_hide();
112 opt_handlers_teardown();
113 }
114
92 115 TEST(switching_between_viewers) TEST(switching_between_viewers)
93 116 { {
94 117 assert_true(start_view_mode("*", "echo 1, echo 2, echo 3", TEST_DATA_PATH, assert_true(start_view_mode("*", "echo 1, echo 2, echo 3", TEST_DATA_PATH,
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