The %j modifier used to show file size produces segmentation fault
on some platforms. PRIuMAX macro cannot be used within i18b'd strings.
Solution: use %llu modifier with typecasting to unsigned long long.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Use PRIuMAX and PRIXMAX instead of ju and jX modifiers respectively
for formatted output of uintmax_t variables.
If PRIXMAX is not defined (i.e. in Solaris9), use PRIxMAX instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Don't mix GLib and GModule compiler and linker options.
Use gmodule-no-export if present to avoid use -Wl,--export-dynamic
option with some linkers. If gmodule-no-export is not available,
use generic gmodule.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Panel state is saved in ~/.mc/panels.ini:
1) when "Save setup" command is invoked;
or
2) when MC is quited and "Auto save panels setup" option is set.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Check values of verbose and dialog type outside of
file_progress_show_count() and file_progress_show_total()
to avoid double checks of those options and extra function calls.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...to provide symmetrical usage of init/deinit functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
All file panels related stuff was moved to midnight.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
menubar_set_visible(): new function to get rid of menubar_visible global variable
in widgtes library.
menu_set_name(): new function to avoid total recreation of main menu
after change panel layout.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dview_status): use str_term_trim() instaed of trim() to trim file name.
(dview_get_title): reimplemented using GString because str_term_trim()
returnes a pointer to internal static buffer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Refactoring: reimplement find_ignore_dirs as sorted array of strings.
Handling value of ignore_dirs like "/foo::/bar/:".
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
no more put removed text into clipboard. when doing CK_InputKillWord, CK_InputBackwardKillWord
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
* WInput routines: get rid of one-line functions.
* added CK_InputClearLine handler. Now CK_InputClearLine - clear command line,
CK_InputKillLine - clear command line from cursor to the EOL.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Previous solutions have broken one of the viewer features (http://www.midnight-commander.org/ticket/1778)
What suggest is fixing PgDn in a way, that it switches to one-line mode after EOF and add a check to ensure,
that at least one last line stays visible (4.7.1 behaviour of end/pgdn was irritating indeed).
With this patch, PageDown at the last page scrolls file line by line instead of entire page.
This is feature, not a bug. :)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Typing 'u' in "User defined mode" input line, the "User defined"
radio-button is checked instead of putting the 'u' letter
into the input line.
Bug was introduced in 80d34ca625.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Miscellaneous changes:
* Create search handlers before search session and destroy afterwards.
* Get rid of goto operator in do_search() functon.
* Fixed handling of DLG_VALIDATE message.
* Type accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Made "Find recursively" and "Search for content" appear the
first, as they are completely logically independent and influence the
way the strings entered in the corresponding fields are used.
"Using shell patterns" and "Regular expression" come next, as
they set a similar property of the fields. Same goes for the "Case
sensitive" and "All charsets" group.
"Skip hidden" and the rest close the show up.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If "Search for content" checkbox is enabled, then content_pattern is
initialized as usual. Otherwise, it's forcibly set to NULL.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This checkbox allows to define whether the "Content" field should be
taken into account or not when performing file search. The checkbox
remembers its state across sessions.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
In case sensitive sort, the order of files and directories is following:
hidden dirs
dirs
hidden files
files
In case insensitive mode, directories are mixed and files are mixed too:
dirs (hidden and not are mixed)
files (hidden and not are mixed).
This commit defines the sort order independently of case sensitivity:
hidden dirs
dirs
hidden files
files
Files in UTF-8 locale require special handling: leading dot must not be
processed in g_utf8_casefold() funcion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Added capability to load codepage list from /usr/share/mc/mc.charsets
and /etc/mc/mc.charsets and merge them then.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(tree_store_rescan): use g_list_foreach() to free content of list.
(process_special_dirs): get rid of extra memory allocation.
(should_skip_directory): type accuracy and variable intializations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
RPMLint shows the following warnings:
mc.i586: W: conffile-without-noreplace-flag /etc/mc/Syntax
mc.i586: W: conffile-without-noreplace-flag /etc/mc/mc.lib
mc.i586: W: conffile-without-noreplace-flag /etc/mc/mc.charsets
First step: install Syntax into /usr/share/mc instead of /etc/mc.
This also fixes the impossibility of editing of system-wide Syntax file
in mcedit under root (menu Options->Syntax file->System Wide).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Start mc, and make sure that at least one of the two displayed
directiories contains so many files that they cannot all be displayed
at once.
Click in this panel and hold the mouse button pressed, and then move
your mouse downwards. As you pass beyond the bottom of this list, it
should start scrolling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Midnight Commander's color/skin engine often reuses the same color definition for multiple elements on the UI.
This unnecessarily limits the possibilities when playing with colors.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>