Commit Graph

167 Commits

Author SHA1 Message Date
Andrew Borodin
d55c30eb7d Changed type of WEdit::extmod from integer to gboolean.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-08-26 10:30:53 +04:00
Andrew Borodin
d86acaa51d Extended shortcuts like 'ctrl-x x' are unavailable in editor.
Extended shortcuts like 'ctrl-x ctrl-x' or 'ctrl-x alt-x' are available
in editor, but 'ctrl-x x' are not.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-08-26 10:30:53 +04:00
Andrew Borodin
29d675c567 Allow create WEdit window with any sizes and in any location.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-08-24 09:51:54 +04:00
Andrew Borodin
340dc69013 Draw status line at the top of screen not at the top of editor widget.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-08-24 09:51:54 +04:00
Andrew Borodin
5ae3697e58 Ticket #2591: mouse clicks ignored on the bottom line of editor.
Initial step: fixups of WEdit resizing.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-08-24 09:51:54 +04:00
Ilia Maslakov
54cf8c3ffa Do not mark the text after opening the file.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-07-11 20:23:44 +03:00
Slava Zanko
1beaecdf12 Added function mc_build_filename() for processing URL-paths as well
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:02 +03:00
Slava Zanko
405cc98cea VFS: Make functions vfs_canon_and_translate() and vfs_canon() as static in lib/vfs/path.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
8ea49095c3 Changed functions vfs_file_is_local() and vfs_file_class_flags() for handle vfs_path_t type
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
093128c532 VFS: Current directory handler now have type vfs_path_t
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Andrew Borodin
321f5b2555 WEdit::num_widget_lines and WEdit::num_widget_columns are removed.
Widget sizes are used instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin
c81486c202 WEdit::screen_modified is unused. Removed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin
ae07d3a9d4 Ticket #2511: fix of column mark with alt-alrrow keys in mcedit.
This bug was introduces in 1374340aa2 commit.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-31 10:32:27 +04:00
Andrew Borodin
a225419f1a (editcmd_dialog_raw_key_query): fix of result value.
ctrl-g is handled in common way (SIGINT), ctrl-c can be used as macro
shortcut.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-30 16:17:16 +04:00
Slava Zanko
5f8a5e4290 Use events for calling help window
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
62207c8d4d Use events for operate with clipboard (copy/paste to external clipboard, save/load to file)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
c2dfb82f61 Use events for update panels
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
c58365fa64 Move check_for_default() function from lib/util.c to src/util.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
6016620f42 Remove backlinks from lib to src - move global variables(used in lib) to mc_global structure (see lib/global.c)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:50 +02:00
Slava Zanko
6c5f5bf768 VFS structure changes:
* 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>
2011-03-21 11:48:26 +02:00
Andrew Borodin
35b429f625 Prepare to merge default and user-defined keymaps.
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>
2011-03-20 19:26:08 +03:00
Andrew Borodin
722121a575 Define keybind numbers using enum.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
1374340aa2 Fixup of shift-arrow mark in editor.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
50de02cfe4 Unification of keybinding names.
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>
2011-03-20 19:26:08 +03:00
Ilia Maslakov
ecd8ca2292 mark inserted from file
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-17 08:50:52 +00:00
Ilia Maslakov
dc6bd875c4 Ticket #2504 (Verical block is unmarked after copy/move)
Now mark of vertical block is not reset after copy/move. This make easy many copies/movements.
    Do nothing if cursor is in first line of selection.
2011-03-17 08:50:52 +00:00
Ilia Maslakov
b58e7e64fc Fix cursor position after execution of external script.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-03-03 20:48:30 +00:00
Ilia Maslakov
d31116328a Changed engine of external macros execution
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>
2011-03-03 20:48:30 +00:00
Ilia Maslakov
83177cfc16 added a new action "Record and Repeat commands", added menu entry (Record/Repeat actions) for this.
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>
2011-03-03 20:45:07 +00:00
Ilia Maslakov
6066713f77 Removed unneeded menu entries.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-03-02 11:16:55 +00:00
Ilia Maslakov
8e22a16430 Added lookup_key_by_code, now parameter is string.
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>
2011-03-02 11:16:54 +00:00
Ilia Maslakov
8509b74f73 Ticket #323 (reimplimented editor macros)
Reimplemented editor macro engine:

    * added string binding "InsertChar" for action - "CK_Insert_Char"
    * added keybind_lookup_actionname - found action name by numeric constant
    * replaced struct macro to struct macro_action_t
    * added struct macros_t for describe editor scripts
    * rewritten edit_load_macro_cmd, edit_execute_macro
    * renamed edit_save_macro_cmd into edit_store_macro_cmd (WEdit * edit);
    * dropped Wedit properties: macro_i, macro_depth, macro[MAX_MACRO_LENGTH]
    * added GArray *macros_list to the store macroses of mcedit
    * added edit_get_macro

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-02 11:16:44 +00:00
Ilia Maslakov
4e97991714 code indentation
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-02-17 21:46:20 +00:00
Ilia Maslakov
afed48a44a Ticket #2499 (action to the mark current word)
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>
2011-02-17 21:38:06 +00:00
Ilia Maslakov
cfad4d685b Ticket #2500 (incorrect the word boundary detection)
fixed detection of the word boundary (added '{', '}' as end of the word).

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-02-16 22:17:15 +00:00
Ilia Maslakov
7651b5dd30 Ticket #2483 (editor: improvement word left/right)
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>
2011-02-13 08:30:19 +00:00
Andrew Borodin
1ceb2494e4 Fixup compile with --disable-charset.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-05 16:54:55 +02:00
Ilia Maslakov
afb498de3a Ticket #2456 (Incorrect restore selection after UNDO)
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>
2011-02-04 18:32:13 +03:00
Ilia Maslakov
9b5de3c96b direct commit: utf8 fixup
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-02-03 17:14:48 +03:00
Ilia Maslakov
f42e10ab1d Ticket #2484 (segfault after getting previous char)
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>
2011-02-03 09:50:15 +03:00
Slava Zanko
f31863a80a Renamed variables mc_home to mc_sysconfig_dir and mc_home_alt to mc_share_data_dir for more sence
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-20 17:38:27 +02:00
Slava Zanko
acbe048486 Ticket #1851: Home config directory [xdg-user-dirs]
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>
2011-01-20 17:38:27 +02:00
Ilia Maslakov
7bd3a17db7 do not set modify flag when user menu cancelled.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-01-06 16:01:52 +00:00
Ilia Maslakov
bf7675246f Ticket #2463 (do not reset selection after execute user menu)
do not reset selection after execute user menu

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-01-06 16:01:51 +00:00
Ilia Maslakov
ab46ad0749 Modified editor general options gialog
...added "Group undo" option.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-01-01 21:17:27 +00:00
Ilia Maslakov
b39033812b Ticket #27 (group undo)
added option editor_group_undo unset by default
    added group undo mechanism

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-01-01 21:17:19 +00:00
Ilia Maslakov
6832b8e7e9 binded EditRedo on alt-r
added entry Redo into editor menu

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-12-30 21:23:43 +00:00
Ilia Maslakov
03363eac71 added action EditRedo.
added functions:
        * edit_push_redo_action
        * edit_pop_redo_action
        * edit_do_redo

    removed not supported (not actual) code

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-12-30 21:23:42 +00:00
Ilia Maslakov
b5fc178027 Ticket #25 (mcedit: REDO)
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>
2010-12-30 21:23:42 +00:00
Egmont Koblinger
e593572bb9 Ticket #2169: Add support for 256 colors terminals
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>
2010-12-29 11:58:10 +02:00