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 ff304fc52873b110e18278ff8a5f0ac034dc124b

Move filelist:set_view_path() to vifm.c
It's really startup-related code which is easier to keep in vifm.c.
Author: xaizek
Author date (UTC): 2026-06-13 13:41
Committer name: xaizek
Committer date (UTC): 2026-06-13 13:41
Parent(s): 88b0ec46eded1af0818601646dfde2f7b5202687
Signing key: 99DC5E4DB05F6BE2
Tree: 077325be44cdaff26d0baf749fcf8549dc022e5e
File Lines added Lines deleted
src/filelist.c 0 10
src/filelist.h 0 2
src/vifm.c 12 0
File src/filelist.c changed (mode: 100644) (index 2b7c28c06..ae3a9111d)
... ... view_needs_cd(const view_t *view, const char path[])
3494 3494 return 1; return 1;
3495 3495 } }
3496 3496
3497 void
3498 set_view_path(view_t *view, const char path[])
3499 {
3500 if(view_needs_cd(view, path))
3501 {
3502 copy_str(view->curr_dir, sizeof(view->curr_dir), path);
3503 exclude_file_name(view->curr_dir);
3504 }
3505 }
3506
3507 3497 uint64_t uint64_t
3508 3498 fentry_get_size(const view_t *view, const dir_entry_t *entry) fentry_get_size(const view_t *view, const dir_entry_t *entry)
3509 3499 { {
File src/filelist.h changed (mode: 100644) (index b19b1a04b..2ef071cdc)
... ... int is_dir_list_loaded(view_t *view);
188 188 /* Checks whether view can and should be navigated to the path (no need to do /* Checks whether view can and should be navigated to the path (no need to do
189 189 * anything if already there). Returns non-zero if path should be changed. */ * anything if already there). Returns non-zero if path should be changed. */
190 190 int view_needs_cd(const view_t *view, const char path[]); int view_needs_cd(const view_t *view, const char path[]);
191 /* Sets view's current directory from path value. */
192 void set_view_path(view_t *view, const char path[]);
193 191 /* Retrieves size of the entry, possibly using cached or calculated value. /* Retrieves size of the entry, possibly using cached or calculated value.
194 192 * Returns the size. */ * Returns the size. */
195 193 uint64_t fentry_get_size(const view_t *view, const dir_entry_t *entry); uint64_t fentry_get_size(const view_t *view, const dir_entry_t *entry);
File src/vifm.c changed (mode: 100644) (index 40f193151..5f1cd8074)
97 97
98 98 static int vifm_main(int argc, char *argv[]); static int vifm_main(int argc, char *argv[]);
99 99 static int get_start_cwd(char buf[], size_t buf_len); static int get_start_cwd(char buf[], size_t buf_len);
100 static void set_view_path(view_t *view, const char path[]);
100 101 static OpsResult undo_perform_func(OPS op, void *data, const char src[], static OpsResult undo_perform_func(OPS op, void *data, const char src[],
101 102 const char dst[]); const char dst[]);
102 103 static void parse_received_arguments(char *args[]); static void parse_received_arguments(char *args[]);
 
... ... get_start_cwd(char buf[], size_t buf_len)
398 399 return 0; return 0;
399 400 } }
400 401
402 /* Sets view's current directory from path value. */
403 static void
404 set_view_path(view_t *view, const char path[])
405 {
406 if(view_needs_cd(view, path))
407 {
408 copy_str(view->curr_dir, sizeof(view->curr_dir), path);
409 exclude_file_name(view->curr_dir);
410 }
411 }
412
401 413 /* perform_operation() interface adaptor for the undo unit. */ /* perform_operation() interface adaptor for the undo unit. */
402 414 static OpsResult static OpsResult
403 415 undo_perform_func(OPS op, void *data, const char src[], const char dst[]) undo_perform_func(OPS op, void *data, const char src[], const char dst[])
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