Andrew Borodin
6718b3ec26
Indentation using GNU indent-2.2.13.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-06-02 12:49:13 +03:00
Andrew Borodin
fe42478b97
Update copyright years.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-01-01 09:46:17 +03:00
Andrew Borodin
2d86b8889f
Use g_string_new_take().
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-12-31 19:28:44 +03:00
Andrew Borodin
d4e59aa022
Refactoring: avoid create an empty strings.
...
* (name_quote): return NULL instead of an empty string.
* (fake_name_quote): likewise.
* (expand_format): likewise.
* Related changes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-11-06 21:06:14 +03:00
Andrew Borodin
44b5accbf7
(expand_format): remove intermediate variable.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-11-06 21:06:14 +03:00
Andrew Borodin
daaea80895
(strip_ext): refactor loop.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-11-06 21:06:14 +03:00
Andrew Borodin
044c035900
Use bit-field members of file_entry_t as integers explicitly.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-08-04 21:04:54 +03:00
Andrew Borodin
f29118dcec
WPanel: rename 'selected' to 'current' and related changes.
...
Renames:
WPanel::selected -> WPanel::current
selection (macro) -> panel_current_entry()
panel_selected_at_half() -> panel_current_at_half()
move_selection() -> panel_move_current()
do_select() -> panel_set_current()
try_to_select() -> panel_set_current_by_name()
mark_if_marking(): argument and intermal variables
file attributes:
SELECTED -> CURRENT
MARKED_SELECTED -> MARKED_CURRENT
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-08-04 21:04:54 +03:00
Andrew Borodin
35b5d8e2f2
WListbox: renames:
...
WListbox::pos -> WListbox::current
listbox_select_entry() -> listbox_set_current()
listbox_get_nth_item() -> listbox_get_nth_entry()
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-08-04 21:04:54 +03:00
Andrew Borodin
c157b048e5
Listbox window: rename functions.
...
create_listbox_window -> listbox_window_new
create_listbox_window_centered -> listbox_window_new_centered
run_listbox -> listbox_run
run_listbox_with_data -> listbox_run_with_data
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
d2b9454f4b
Add EDIT and CONST_EDIT macros.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
683122482b
usermenu: clarify compilation w/o internal editor.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
7257f794d2
Update template for .c files.
...
Add section for forward declarations of local functions. This section is
located before file scope variables because functions can be used in
strucutres (see find.c for example):
/*** forward declarations (file scope functions) *************************************************/
/* button callbacks */
static int start_stop (WButton * button, int action);
static int find_do_view_file (WButton * button, int action);
static int find_do_edit_file (WButton * button, int action);
/*** file scope variables ************************************************************************/
static struct
{
...
bcback_fn callback;
} fbuts[] =
{
...
{ B_STOP, NORMAL_BUTTON, N_("S&uspend"), 0, 0, NULL, start_stop },
...
{ B_VIEW, NORMAL_BUTTON, N_("&View - F3"), 0, 0, NULL, find_do_view_file },
{ B_VIEW, NORMAL_BUTTON, N_("&Edit - F4"), 0, 0, NULL, find_do_edit_file }
};
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-03-19 20:34:24 +03:00
Andrew Borodin
57c61b7681
Update copyright years.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2023-01-28 21:38:05 +03:00
Andrew Borodin
2c205c5928
Update copyright years.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-03-13 13:17:26 +03:00
Andrew Borodin
f1e2f0e93d
Ticket #4150 : support file/dir macros for standalone mcviewer.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-10-31 09:49:45 +03:00
Andrew Borodin
f657d92e52
(execute_menu_command): fix memory leak.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-06-20 15:14:56 +03:00
Andrew Borodin
0cb6e97230
(execute_menu_command): get rid of code duplication.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-23 10:49:10 +03:00
Lukasz Krotowski
72d2fb981a
Ticket #4242 : %view fails to execute on no-exec tmp filesystem.
...
(execute_menu_command): use indirect execution of %view.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-05-23 10:49:10 +03:00
Andrew Borodin
6f859e52d0
(file_entry_t): use GString instead of fname & fnamelen.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:52:39 +03:00
Andrew Borodin
536fb676d8
(vfs_path_free): add 2nd parameter...
...
...to free or not to free the string representation
of vfs_path_t object.
It allows to get rid of string duplication in following cases:
vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = g_strdup (vfs_path_as_str (vpath));
vfs_path_free (vpath);
Now we can write:
vfs_path_t *vpath;
char *path;
...
vpath = vfs_path_from_str (...);
path = vfs_path_free (vpath, FALSE);
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:52:39 +03:00
Andrew Borodin
9ee52e77c3
Ticket #4179 : code clean up before 4.8.27 release.
...
Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-03-14 19:30:42 +03:00
Sebastian Gniazdowski
8177cdd0f1
Ticket #4171 : fix usermenu and macro system() calls disrupting terminal.
...
(execute_menu_command): prepare terminal to run system() and restore
after.
(user_menu_cmd): fix comment.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2021-01-26 13:52:13 +03:00
Andrew Borodin
41a35b9b8a
Rename files:
...
src/filemanager/midnight.[ch] -> src/filemanager/filemanager.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-31 16:26:46 +03:00
Andrew Borodin
81b1f47e01
Rename macros with editor-related file locations.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-05-17 18:48:19 +03:00
Andrew Borodin
31b37a1f79
Ticket #4050 : code cleanup before 4.8.25 release.
...
Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-02-29 19:10:17 +03:00
Andrew Borodin
1dd8a47987
Ticket #3955 : code cleanup before 4.8.23 release.
...
Update copyright years.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2019-02-03 12:44:40 +03:00
Andrew Borodin
8f7d44ef7f
Ticket #3914 : %view not piping command output to internal viewer in user menu.
...
Revert "(execute_menu_command): fix mcview_viewer() call."
This reverts commit 2043ef74a9
.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-05-07 09:07:37 +03:00
Andrew Borodin
e151b0756f
src/usermenu.c: cosmetics.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
2043ef74a9
(execute_menu_command): fix mcview_viewer() call.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:23 +03:00
Andrew Borodin
ddd645526a
Update copyright years.
2018-02-04 11:30:22 +03:00
Andrew Borodin
074008025b
mcviewer: refactor mode flags.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Andrew Borodin
73979369d1
Support __attribute__((fallthrough)) if possible.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2018-02-04 11:30:22 +03:00
Sergey Naumov
fc68bd7aa3
Ticket #3867 : mceditor: add %c (cursor offset from BOF) support for macros.
...
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-10-28 18:56:32 +03:00
Andrew Borodin
b11c84dbb7
Document the %f macro related to mcedit.
2017-10-28 18:46:14 +03:00
Andrew Borodin
f89fff139c
Fix %f macto in mcedit user menu.
...
In mcedit user menu the %f macro should match the file name opened in
mcedit not the file name is selected in the panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-10-28 18:46:14 +03:00
Andrew Borodin
680678ef72
Ticket #3861 : fix %f macro in mcedit user menu.
...
Initial step: move usermenu.[ch] files from src/filemanager/ directory
to src/ one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-10-28 18:46:08 +03:00