...instead of direct access to panels in VGS GC.
Inlcudes clean up.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
* moved from lib/vfs/mc-vfs to lib/vfs;
* split by directories for VFS-plugins and moved to src/vfs;
* lib/vfs/vfs-impl.h was merged into lib/vfs/vfs.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Now default key bindings are hardcoded as strings like values in keymap
file. Such presentation of key bindings allows simplify keymaps merge
when new bindings are added, replaced or removed old ones during MC
initialization.
Previously, to rebind some keys, used must redefine the entire section
where that bindings are in. New merge algorithm doesn't require the
redefinition of entire section in user's keymap file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
default_main_map and default_main_x_map renamed to
default_main_keymap and default_main_x_keymap respectively to unified
variable names.
Editor: setup keymaps only once for all editors.
Viewer: share single keymap array for all viewers.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Most of keybind names are changed to unify that names.
Details see in doc/keybind-migration.txt file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Added doc/keybind-migration.txt file to describe new keybinding names
used in mc.keymap.* files in 4.8.x series.
Cosmetics: reordering of keymap section declarations to provide identical
order totally in the source tree.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Fixed user menu behaviour. MC hangs if menu entry contains the 'read' command or something like that.
bug introduced in the Ticket #323 (changeset: 0cfbe19d96).
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
if the external script contain #interactive then do show prompt.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Now "EditPipeBlock (X)" action tries execute the
~/.local/share/mc/mcedit/macros.d/macro.X.sh script.
To bind action EditPipeBlock (X) to the any hotkey you need add this binding
into ~/.local/share/mc/mc.macros file like following:
[editor]
ctrl-Q=EditWordLeft:-1;EditWordRightHighlight:-1;EditPipeBlock:3;
ctrl-W=EditPipeBlock:1;
This means that "ctrl-W" hotkey initiates the EditPipeBlock (1) action,
editor handler translates this into execution of
~/.local/share/mc/mcedit/macros.d/macro.1.sh shell script.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
some fixes
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
and one more fix
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
For example: "ctrl-w=action:code;action:code;action:code;"
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
The problem:
viewing binary files contain char 0x9A leads to massive screen corruption and Search
dialog pops up with 1;2c search string (multiple times depending on actual screen contents).
So it looks like the file 'presses' F7 or / and shift-right_arrow for every specified
character combination occurrence. In case of bigger files it's impossible to exit from
such viewer, as search dialog keeps popping up after closing.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
added action CK_Mark_Word to the mark current word
changed double-click the mouse handler of the editor
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
now the cursor jump more intuitive after actions "word left"/"word right".
It will be stop before BOL, BOF
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
fixed incorrect restore selection after UNDO
test case:
1. mcedit new_empty_file
2. type in 0123456789
3. F3 5*left F3 - digit '4' is not marked at this point
4. backspace, ctrl-u - digit '4' is marked now
5. left, 2*del, 2*ctrl-u - digits '4' and '5' are not marked
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
fixed segfault after getting the previous char in utf8, if previous char's
are: 0xB1, 0xB3, 0xB6, 0xBF, 0xBC.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
"Show mini info" checkbox was moved from the "Layout" dialog window
to the "Panel options" one. Documentation was updated.
The show_mini_info global variable was transformed to the member
of panels_options_t structure.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Drop backward compatibility for global panels options. These options
are read form [Panels] section, if this section exists. If this section
is abscent, default values are used.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Instead of hardcoded (via MC_USERCONF_DIR) path mc mc now used
dynamic directories specified by environment variables:
* XDG_CONFIG_HOME - dir for config files . By default is ~/.config/mc
* XDG_DATA_HOME - dir for some data, such as user defuned Syntax file, menu etc By default is ~/.local/share/mc
* XDG_CACHE_HOME - dir for temp files, such as cooledit.clip etc. By default is ~/.cache/mc
This is mainstream standard already adopted by many projects.
Old settings will be migrated at first time from ~/.mc to these dirs.
See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html for more info.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(paint_panel): removed. Sending of WIDGET_DRAW message is used instead.
(update_dirty_panels): moved from panel.c to midnight.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
(restore_into_right_dir_panel): made static.
(panel_update_cols): moved from panel.[ch] to layout.[ch].
(set_display_type): minor cleanup and type accuracy.
(panel_display_t): type accuracy
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
New "Simple panels swap" checkbox in "Panel options" configuration
dialog window. Unchecked by default.
Documentation update.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Initial step: refactoring: create new panel_sort_info_t structure
to store sort options of panel.
Type accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
I suggest changing default text in filtered view (alt-!) command input line
instead current filename in panel to contents of cmdline.
It's easier to edit command line with commands like alt-tab,
alt-enter, etc., and then view the result in mcview.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
little optimization, renamed:
* variables stack* to undo_stack*
* pop_action to edit_pop_undo_action
* edit_push_action to edit_push_undo_action
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Forget the old limit of 8 background and 16 foreground colors.
From now on Midnight Commander can use all the 256 colors,
as your favorite terminal emulator supports them - or not,
in which case it's not going to stay your favorite terminal for long.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
(check_is_cd): fix of cd command check.
Type accuracy: check_is_cd() now returns gboolean instead of int.
Initialize start and end variables.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
steps to reproduce:
mcview_remember_file_position=1
test file: file1.ext
123
456
123
qwe
123
123
qwe
123
qwe
456
1) open file1.ext in mcedit search text 'qwe'
2) close file1.ext
3) open file1.ext in mcview
4) close file1.ext
5) reopen file1.ext in mcedit and search again text 'qwe'
search position is reset but should not be reset.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
In mcedit, when the selected text is copied to the clipboard, the selection disappears.
This behavior contradicts to the traditional behavior of all modern text editors and is highly annoying.
Now selection don't reset after the text is copied into the clipboard.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Viewer Goto dialog doesn't allow go to the specified offset. The value
of input line is rounded to the next line start. Such bevaviour
is useless in hex mode of viewer. In hex mode we must heve a
capability to go to the specified address as is without any round.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
New keybinding "PanelSmartJumpUp" for the jump to the parent directory if command line is empty. Not defined by default.
This binding maybe used for bind 'Backspace' as hotkey for 'cd ..' (only if command line is empty).
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
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>