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 56558dd0239388ad8faf7daa82238feb686a3839

Add 'uioptions' option
It's only (for now) possible "iodetails" value results in displaying
progress dialog by default.

Thanks to Ralf Schmitt.
Author: xaizek
Author date (UTC): 2025-01-18 14:03
Committer name: xaizek
Committer date (UTC): 2025-01-18 14:03
Parent(s): da41efe973fa02fae4c2e7b8fd76fc1bc185f61b
Signing key: 99DC5E4DB05F6BE2
Tree: 8b3cef0cc755823ec5eeadb97bb37fcc8433bd6f
File Lines added Lines deleted
ChangeLog 3 0
THANKS 1 0
data/man/vifm.1 11 1
data/vim/doc/app/vifm-app.txt 11 1
data/vim/syntax/vifm.vim 4 4
src/cfg/config.c 2 0
src/cfg/config.h 3 0
src/cfg/info.c 2 0
src/fops_common.c 2 0
src/opt_handlers.c 26 0
src/tags.c 1 0
tests/misc/options.c 16 7
tests/test-data/syntax-highlight/syntax.vifm 2 0
File ChangeLog changed (mode: 100644) (index cadce3e9e..456d0a150)
104 104 Added a way to insert "}" inside of %{expr} macro of 'statusline'. Thanks Added a way to insert "}" inside of %{expr} macro of 'statusline'. Thanks
105 105 to vuenn. to vuenn.
106 106
107 Added 'uioptions' option with possible "iodetails" value to display
108 progress dialog by default. Thanks to Ralf Schmitt.
109
107 110 Don't draw right padding on a truncated rightmost column of a transposed Don't draw right padding on a truncated rightmost column of a transposed
108 111 ls-like view. ls-like view.
109 112
File THANKS changed (mode: 100644) (index 23b455587..d8ec8bb64)
... ... r0ck
261 261 r44083 r44083
262 262 rafasc rafasc
263 263 Rainer Suhm Rainer Suhm
264 Ralf Schmitt
264 265 randomizedthinking randomizedthinking
265 266 ratnamhof ratnamhof
266 267 rbong rbong
File data/man/vifm.1 changed (mode: 100644) (index 92b45a090..1dea2f1c9)
1 .TH VIFM 1 "11 January 2025" "vifm 0.13"
1 .TH VIFM 1 "18 January 2025" "vifm 0.13"
2 2 .\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
3 3 .SH NAME .SH NAME
4 4 .\" --------------------------------------------------------------------------- .\" ---------------------------------------------------------------------------
 
... ... l \- truncation is always on the left.
5445 5445 .br .br
5446 5446 r \- truncation is always on the right. r \- truncation is always on the right.
5447 5447 .TP .TP
5448 .BI 'uioptions'
5449 type: set
5450 .br
5451 default:
5452 .br
5453 Tweaks UI behaviour. The following values are available:
5454 \- iodetails \- show I/O progress details dialog automatically instead of
5455 displaying progress on statusbar until user presses "i" to see
5456 the dialog.
5457 .TP
5448 5458 .BI "'undolevels' 'ul'" .BI "'undolevels' 'ul'"
5449 5459 type: integer type: integer
5450 5460 .br .br
File data/vim/doc/app/vifm-app.txt changed (mode: 100644) (index ca05b2c34..d4b2342f3)
1 *vifm-app.txt* For Vifm version 0.13 Last change: 2025 January 11
1 *vifm-app.txt* For Vifm version 0.13 Last change: 2025 January 18
2 2
3 3 Email for bugs and suggestions: <xaizek@posteo.net> Email for bugs and suggestions: <xaizek@posteo.net>
4 4
 
... ... l - truncation is always on the left.
4587 4587 *vifm-to-r* *vifm-to-r*
4588 4588 r - truncation is always on the right. r - truncation is always on the right.
4589 4589
4590 *vifm-'uioptions'*
4591 uioptions
4592 type: set
4593 default:
4594
4595 Tweaks UI behaviour. The following values are available:
4596 - iodetails - show I/O progress details dialog automatically instead of
4597 displaying progress on statusbar until user presses "i" to see
4598 the dialog.
4599
4590 4600 *vifm-'undolevels'* *vifm-'ul'* *vifm-'undolevels'* *vifm-'ul'*
4591 4601 undolevels ul undolevels ul
4592 4602 type: integer type: integer
File data/vim/syntax/vifm.vim changed (mode: 100644) (index f6b667a7b..79fb9165a)
1 1 " vifm syntax file " vifm syntax file
2 2 " Maintainer: xaizek <xaizek@posteo.net> " Maintainer: xaizek <xaizek@posteo.net>
3 " Last Change: November 20, 2024
3 " Last Change: January 18, 2025
4 4 " Inspired By: Vim syntax file by Dr. Charles E. Campbell, Jr. " Inspired By: Vim syntax file by Dr. Charles E. Campbell, Jr.
5 5
6 6 if exists('b:current_syntax') if exists('b:current_syntax')
 
... ... syntax keyword vifmOption contained aproposprg autocd autochpos caseoptions
170 170 \ shell sh shellflagcmd shcf shortmess shm showtabline stal sizefmt slowfs \ shell sh shellflagcmd shcf shortmess shm showtabline stal sizefmt slowfs
171 171 \ smartcase scs statusline stl suggestoptions syncregs syscalls tablabel \ smartcase scs statusline stl suggestoptions syncregs syscalls tablabel
172 172 \ tabline tabprefix tabscope tabstop tabsuffix tal timefmt timeoutlen title \ tabline tabprefix tabscope tabstop tabsuffix tal timefmt timeoutlen title
173 \ tm trash trashdir ts tuioptions to undolevels ul vicmd viewcolumns
174 \ vifminfo vimhelp vixcmd wildinc wildmenu wmnu wildstyle wordchars wrap
175 \ wrapscan ws
173 \ tm trash trashdir ts tuioptions to uioptions undolevels ul vicmd
174 \ viewcolumns vifminfo vimhelp vixcmd wildinc wildmenu wmnu wildstyle
175 \ wordchars wrap wrapscan ws
176 176
177 177 " Disabled boolean options " Disabled boolean options
178 178 syntax keyword vifmOption contained noautocd noautochpos nocf nochaselinks syntax keyword vifmOption contained noautocd noautochpos nocf nochaselinks
File src/cfg/config.c changed (mode: 100644) (index a1b835a3a..545586f7e)
... ... cfg_init(void)
204 204
205 205 cfg.set_title = term_title_restorable(); cfg.set_title = term_title_restorable();
206 206
207 cfg.always_show_io_details = 0;
208
207 209 cfg.chase_links = 0; cfg.chase_links = 0;
208 210
209 211 cfg.graphics_delay = 50000; cfg.graphics_delay = 50000;
File src/cfg/config.h changed (mode: 100644) (index 6f6a44891..bd0dd0e71)
... ... typedef struct config_t
338 338 /* Whether terminal title should be updated or not. */ /* Whether terminal title should be updated or not. */
339 339 int set_title; int set_title;
340 340
341 /* Show I/O progress details dialog automatically. */
342 int always_show_io_details;
343
341 344 /* Whether directory path should always be resolved to real path (all symbolic /* Whether directory path should always be resolved to real path (all symbolic
342 345 * link expanded). */ * link expanded). */
343 346 int chase_links; int chase_links;
File src/cfg/info.c changed (mode: 100644) (index ffb6be4de..e63a04bad)
... ... store_global_options(JSON_Object *root)
2326 2326 append_dstr(options, format_str("%strash", cfg.use_trash ? "" : "no")); append_dstr(options, format_str("%strash", cfg.use_trash ? "" : "no"));
2327 2327 append_dstr(options, format_str("tuioptions=%s", append_dstr(options, format_str("tuioptions=%s",
2328 2328 escape_spaces(vle_opts_get("tuioptions", OPT_GLOBAL)))); escape_spaces(vle_opts_get("tuioptions", OPT_GLOBAL))));
2329 append_dstr(options, format_str("uioptions=%s",
2330 escape_spaces(vle_opts_get("uioptions", OPT_GLOBAL))));
2329 2331 append_dstr(options, format_str("undolevels=%d", cfg.undo_levels)); append_dstr(options, format_str("undolevels=%d", cfg.undo_levels));
2330 2332 append_dstr(options, format_str("vicmd=%s%s", escape_spaces(cfg.vi_command), append_dstr(options, format_str("vicmd=%s%s", escape_spaces(cfg.vi_command),
2331 2333 cfg.vi_cmd_bg ? " &" : "")); cfg.vi_cmd_bg ? " &" : ""));
File src/fops_common.c changed (mode: 100644) (index 87eb00feb..f8cf4d984)
... ... fops_get_ops(OPS main_op, const char descr[], const char base_dir[],
961 961 if(ops->use_system_calls) if(ops->use_system_calls)
962 962 { {
963 963 progress_data_t *const pdata = alloc_progress_data(ops->bg, ops); progress_data_t *const pdata = alloc_progress_data(ops->bg, ops);
964 pdata->dialog = cfg.always_show_io_details;
965
964 966 const io_cancellation_t cancellation = { .hook = &ui_cancellation_hook }; const io_cancellation_t cancellation = { .hook = &ui_cancellation_hook };
965 967 ops->estim = ioeta_alloc(pdata, cancellation); ops->estim = ioeta_alloc(pdata, cancellation);
966 968 } }
File src/opt_handlers.c changed (mode: 100644) (index 7684b7ef5..16950fe2b)
... ... static void init_relativenumber(optval_t *val);
108 108 static void init_sort(optval_t *val); static void init_sort(optval_t *val);
109 109 static void init_sortorder(optval_t *val); static void init_sortorder(optval_t *val);
110 110 static void init_tuioptions(optval_t *val); static void init_tuioptions(optval_t *val);
111 static void init_uioptions(optval_t *val);
111 112 static void init_wildinc(optval_t *val); static void init_wildinc(optval_t *val);
112 113 static void init_wordchars(optval_t *val); static void init_wordchars(optval_t *val);
113 114 static void load_options_defaults(void); static void load_options_defaults(void);
 
... ... static void title_handler(OPT_OP op, optval_t val);
239 240 static void trash_handler(OPT_OP op, optval_t val); static void trash_handler(OPT_OP op, optval_t val);
240 241 static void trashdir_handler(OPT_OP op, optval_t val); static void trashdir_handler(OPT_OP op, optval_t val);
241 242 static void tuioptions_handler(OPT_OP op, optval_t val); static void tuioptions_handler(OPT_OP op, optval_t val);
243 static void uioptions_handler(OPT_OP op, optval_t val);
242 244 static void undolevels_handler(OPT_OP op, optval_t val); static void undolevels_handler(OPT_OP op, optval_t val);
243 245 static void vicmd_handler(OPT_OP op, optval_t val); static void vicmd_handler(OPT_OP op, optval_t val);
244 246 static void vixcmd_handler(OPT_OP op, optval_t val); static void vixcmd_handler(OPT_OP op, optval_t val);
 
... ... static const char *tuioptions_vals[][2] = {
402 404 { "v", "vary width of middle border to equalize view sizes" }, { "v", "vary width of middle border to equalize view sizes" },
403 405 }; };
404 406
407 /* Possible flags of 'uioptions'. */
408 static const char *uioptions_vals[][2] = {
409 { "iodetails", "show I/O progress details dialog automatically" },
410 };
411
405 412 /* Possible values of 'dirsize' option. */ /* Possible values of 'dirsize' option. */
406 413 static const char *dirsize_enum[][2] = { static const char *dirsize_enum[][2] = {
407 414 { "size", "size of directory or its files" }, { "size", "size of directory or its files" },
 
... ... options[] = {
869 876 &tuioptions_handler, NULL, &tuioptions_handler, NULL,
870 877 { .init = &init_tuioptions }, { .init = &init_tuioptions },
871 878 }, },
879 { "uioptions", "", "tweaks of UI behaviour",
880 OPT_SET, ARRAY_LEN(uioptions_vals), uioptions_vals,
881 &uioptions_handler, NULL,
882 { .init = &init_uioptions },
883 },
872 884 { "undolevels", "ul", "number of file operations to remember", { "undolevels", "ul", "number of file operations to remember",
873 885 OPT_INT, 0, NULL, &undolevels_handler, NULL, OPT_INT, 0, NULL, &undolevels_handler, NULL,
874 886 { .ref.int_val = &cfg.undo_levels }, { .ref.int_val = &cfg.undo_levels },
 
... ... init_tuioptions(optval_t *val)
1371 1383 val->str_val = buf; val->str_val = buf;
1372 1384 } }
1373 1385
1386 /* Composes initial value of 'uioptions' from current configuration. */
1387 static void
1388 init_uioptions(optval_t *val)
1389 {
1390 val->set_items = (cfg.always_show_io_details != 0) << 0;
1391 }
1392
1374 1393 /* Composes initial value of 'wildinc' from current configuration. */ /* Composes initial value of 'wildinc' from current configuration. */
1375 1394 static void static void
1376 1395 init_wildinc(optval_t *val) init_wildinc(optval_t *val)
 
... ... tuioptions_handler(OPT_OP op, optval_t val)
3906 3925 stats_redraw_later(); stats_redraw_later();
3907 3926 } }
3908 3927
3928 /* Applies new value of 'uioptions' to configuration. */
3929 static void
3930 uioptions_handler(OPT_OP op, optval_t val)
3931 {
3932 cfg.always_show_io_details = ((val.set_items & 1) != 0);
3933 }
3934
3909 3935 static void static void
3910 3936 undolevels_handler(OPT_OP op, optval_t val) undolevels_handler(OPT_OP op, optval_t val)
3911 3937 { {
File src/tags.c changed (mode: 100644) (index 5da9ffee2..b39b1e2b9)
... ... const char *tags[] = {
147 147 "vifm-'trashdir'", "vifm-'trashdir'",
148 148 "vifm-'ts'", "vifm-'ts'",
149 149 "vifm-'tuioptions'", "vifm-'tuioptions'",
150 "vifm-'uioptions'",
150 151 "vifm-'ul'", "vifm-'ul'",
151 152 "vifm-'undolevels'", "vifm-'undolevels'",
152 153 "vifm-'vicmd'", "vifm-'vicmd'",
File tests/misc/options.c changed (mode: 100644) (index 64e36475d..1bf2af050)
... ... TEARDOWN()
62 62 columns_teardown(); columns_teardown();
63 63 } }
64 64
65 static void
66 print_func(const char buf[], int offset, AlignType align,
67 const char full_column[], const format_info_t *info)
68 {
69 ncols += (info->id != FILL_COLUMN_ID);
70 }
71
72 65 TEST(lsview_block_columns_update_on_sort_change) TEST(lsview_block_columns_update_on_sort_change)
73 66 { {
74 67 assert_success(cmds_dispatch("set viewcolumns=", curr_view, CIT_COMMAND)); assert_success(cmds_dispatch("set viewcolumns=", curr_view, CIT_COMMAND));
 
... ... TEST(wildinc)
801 794 assert_string_equal(" wildinc=*", ui_sb_last()); assert_string_equal(" wildinc=*", ui_sb_last());
802 795 } }
803 796
797 TEST(uioptions)
798 {
799 assert_success(cmds_dispatch("set uioptions=iodetails", &lwin, CIT_COMMAND));
800 assert_true(cfg.always_show_io_details);
801
802 assert_success(cmds_dispatch("set uioptions=", &lwin, CIT_COMMAND));
803 assert_false(cfg.always_show_io_details);
804 }
805
806 static void
807 print_func(const char buf[], int offset, AlignType align,
808 const char full_column[], const format_info_t *info)
809 {
810 ncols += (info->id != FILL_COLUMN_ID);
811 }
812
804 813 /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
805 814 /* vim: set cinoptions+=t0 filetype=c : */ /* vim: set cinoptions+=t0 filetype=c : */
File tests/test-data/syntax-highlight/syntax.vifm changed (mode: 100644) (index 660e3e376..1ee5aab6c)
... ... hi WildBox
610 610 " "tabline" and "tal" should be highlighted as 'option' " "tabline" and "tal" should be highlighted as 'option'
611 611 " "hloptions" should be highlighted as 'option' " "hloptions" should be highlighted as 'option'
612 612 " "wildinc" should be highlighted as 'option' " "wildinc" should be highlighted as 'option'
613 " "uioptions" should be highlighted as 'option'
613 614 set dotfiles nodotfiles invdotfiles dotfiles! set dotfiles nodotfiles invdotfiles dotfiles!
614 615 set caseoptions set caseoptions
615 616 set sizefmt set sizefmt
 
... ... set navoptions
635 636 set tabline tal set tabline tal
636 637 set hloptions set hloptions
637 638 set wildinc set wildinc
639 set uioptions
638 640
639 641 " "echo" and "call" should be highlighted as :command " "echo" and "call" should be highlighted as :command
640 642 " "chooseopt" should be highlighted as builtin function " "chooseopt" should be highlighted as builtin function
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