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 7ef9d0288c8f447c1fc0577c799f8d9b9a911b66

Fix printing the value of 'previewoptions'
* remove trailing comma
* fix "maxtreedepth:" and "graphicsdelay:" being mutually exclusive
Author: xaizek
Author date (UTC): 2026-08-06 07:06
Committer name: xaizek
Committer date (UTC): 2026-08-06 07:06
Parent(s): 7e8ab9fc795e7e2459484dfdffa1c7a887991293
Signing key: 99DC5E4DB05F6BE2
Tree: 20b907dd943b5217514222d9be52f4ac5b69bf91
File Lines added Lines deleted
ChangeLog 3 0
src/opt_handlers.c 8 0
tests/misc/options.c 8 0
File ChangeLog changed (mode: 100644) (index 6c30ee582..d6a76a1a3)
291 291 'previewoptions' lists non-default values for builtin directory preview. 'previewoptions' lists non-default values for builtin directory preview.
292 292 Thanks to Chris at Vifm Q2A site. Thanks to Chris at Vifm Q2A site.
293 293
294 Fixed printing the value of 'previewoptions': remove trailing comma and
295 fix "maxtreedepth:" and "graphicsdelay:" being mutually exclusive.
296
294 297 0.14-beta to 0.14 (2025-02-08) 0.14-beta to 0.14 (2025-02-08)
295 298
296 299 Improved documentation on zh/zl menu keys a bit. Improved documentation on zh/zl menu keys a bit.
File src/opt_handlers.c changed (mode: 100644) (index 76cefebaa..65afbf505)
... ... init_previewoptions(optval_t *val)
1306 1306 { {
1307 1307 snprintf(buf + len, sizeof(buf) - len, "maxtreedepth:%d,", snprintf(buf + len, sizeof(buf) - len, "maxtreedepth:%d,",
1308 1308 cfg.max_tree_depth); cfg.max_tree_depth);
1309 len += strlen(buf + len);
1309 1310 } }
1310 1311 if(cfg.graphics_delay != 0) if(cfg.graphics_delay != 0)
1311 1312 { {
1312 1313 snprintf(buf + len, sizeof(buf) - len, "graphicsdelay:%d,", snprintf(buf + len, sizeof(buf) - len, "graphicsdelay:%d,",
1313 1314 cfg.graphics_delay); cfg.graphics_delay);
1315 len += strlen(buf + len);
1316 }
1317
1318 /* Remove trailing comma. */
1319 if(len > 0)
1320 {
1321 buf[len - 1] = '\0';
1314 1322 } }
1315 1323
1316 1324 val->str_val = buf; val->str_val = buf;
File tests/misc/options.c changed (mode: 100644) (index f4929d007..9bb084c2b)
... ... TEST(previewoptions)
595 595 assert_false(cfg.hard_graphics_clear); assert_false(cfg.hard_graphics_clear);
596 596 assert_int_equal(0, cfg.max_tree_depth); assert_int_equal(0, cfg.max_tree_depth);
597 597 assert_false(cfg.top_tree_stats); assert_false(cfg.top_tree_stats);
598
599 /* Verify that all possible values are printed back correctly. */
600 assert_success(cmds_dispatch("set previewoptions=hardgraphicsclear,"
601 "toptreestats,maxtreedepth:2,graphicsdelay:20", &lwin, CIT_COMMAND));
602 ui_sb_msg("");
603 assert_failure(cmds_dispatch("set previewoptions", &lwin, CIT_COMMAND));
604 assert_string_equal(" previewoptions=hardgraphicsclear,toptreestats,"
605 "maxtreedepth:2,graphicsdelay:20", ui_sb_last());
598 606 } }
599 607
600 608 TEST(autocd) TEST(autocd)
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