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 ed6d989dc5270ebf0defcfb510692e0e3880cf47

Inline filetype.c:assoc_viewers()
No need to have this code in a separate function.
Author: xaizek
Author date (UTC): 2025-07-10 14:01
Committer name: xaizek
Committer date (UTC): 2025-07-10 14:01
Parent(s): c4379066a54f0812c331243959dbb4b6610f90a8
Signing key: 99DC5E4DB05F6BE2
Tree: 2986dcfc047ede3cfe779f24486abb5ef441ec83
File Lines added Lines deleted
src/filetype.c 2 9
File src/filetype.c changed (mode: 100644) (index fda3eb77f..fb00685bf)
... ... static void register_assoc(assoc_t assoc, int for_x, int in_x);
44 44 static assoc_records_t clone_all_matching_records(const char file[], static assoc_records_t clone_all_matching_records(const char file[],
45 45 const assoc_list_t *record_list); const assoc_list_t *record_list);
46 46 static int add_assoc(assoc_list_t *assoc_list, assoc_t assoc); static int add_assoc(assoc_list_t *assoc_list, assoc_t assoc);
47 static void assoc_viewers(matchers_t *matchers, const assoc_records_t *viewers);
48 47 static assoc_records_t clone_assoc_records(const assoc_records_t *records, static assoc_records_t clone_assoc_records(const assoc_records_t *records,
49 48 const char pattern[], const assoc_list_t *dst); const char pattern[], const assoc_list_t *dst);
50 49 static void reset_all_lists(void); static void reset_all_lists(void);
 
... ... void
300 299 ft_set_viewers(matchers_t *matchers, const char viewers[]) ft_set_viewers(matchers_t *matchers, const char viewers[])
301 300 { {
302 301 assoc_records_t view_records = parse_command_list(viewers, 0); assoc_records_t view_records = parse_command_list(viewers, 0);
303 assoc_viewers(matchers, &view_records);
304 ft_assoc_records_free(&view_records);
305 }
306 302
307 /* Associates pattern with the list of viewers. */
308 static void
309 assoc_viewers(matchers_t *matchers, const assoc_records_t *viewers)
310 {
311 303 const assoc_t assoc = { const assoc_t assoc = {
312 304 .matchers = matchers, .matchers = matchers,
313 .records = clone_assoc_records(viewers, matchers_get_expr(matchers),
305 .records = clone_assoc_records(&view_records, matchers_get_expr(matchers),
314 306 &fileviewers), &fileviewers),
315 307 }; };
308 ft_assoc_records_free(&view_records);
316 309
317 310 (void)add_assoc(&fileviewers, assoc); (void)add_assoc(&fileviewers, assoc);
318 311 } }
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