Commit Graph

781 Commits

Author SHA1 Message Date
Slava Zanko
7dc3b43a20 Merged code of two functions edit_move_up() and edit_move_down()
into one function with additional parameter.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-10 09:28:31 +03:00
Ilia Maslakov
6ed3909280 Ticket #1628 (fix for drawing CJK chars)
fixed: drawing CJK character as '...'.
    Sometimes the CJK character gets replaced by three inverse dots.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-12-10 09:26:58 +03:00
Ilia Maslakov
dd5b7c8651 Ticket #1839 (troubles with vertical selection: delete, move, etc.)
fixed: 'eval_marks' for correct vertical block delete.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

    fixed edit_block_delete, edit_delete_column_of_text for correct delete vertical block
    fixed cursor position after delete block

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-12-09 14:58:02 +03:00
Ilia Maslakov
595eb7e3f0 Ticket #1809 (incorrect calculanion char width in 8-bit locales)
fixed: cursor placement and movements in non-ascii (cyrillic) UTF-8 files
    in 8-bit (KOI8-R) locales
    fixed incorrect width calculation in 7-bit codeset

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

    Minor optimization of edit_move_forward3() function.
    Also fixed build with --disable-charset option.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-09 14:42:51 +03:00
Ilia Maslakov
2ae5412fb7 refresh screen any way
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-12-06 10:20:35 +03:00
Andrew Borodin
8eb860eb48 Ticket #1844: refactoring of goto in editor user_menu() function.
Refactoring of uneeded goto in user_menu() function in editor.
Thanks to Vit Rosin for originl patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-06 10:20:35 +03:00
Ilia Maslakov
99f0e50aba Ticket #1809 (editor: incorrect cursor positioning)
fixed: cursor positioning after non-printeble char (in 8-bit encoding)
    added: char convertion for correct cursor movement

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-12-02 18:28:22 +00:00
Ilia Maslakov
cfc90ab23f fixed eval_marks for correct calculation of the sizes of the selected block
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-11-24 20:35:09 +00:00
Ilia Maslakov
dc9029f599 Ticket #1839
fixed vertical selection behavior.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-11-24 20:33:15 +00:00
Ilia Maslakov
380504c8d9 Ticket #1837 (incorrect block selection)
fixed strange behavior of selection in editor.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-11-20 15:34:42 +03:00
Andrew Borodin
a193e2e56f Ticket #1831: fixed compilation warings of --disable-nls and --disable-charset options.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-20 14:39:51 +03:00
Ilia Maslakov
51e7de4bb5 Ticket #1809 (invalid length of nonprintable chars)
fixed calculation of the cursor position in 'edit_move_forward3'.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-11-19 17:41:26 +03:00
Andrew Borodin
ed2e33574a Fixed generation of shortcut string for menu items.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:52 +03:00
Andrew Borodin
366067d0c3 Fixed CK_Menu command handling in editor.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:52 +03:00
Andrew Borodin
1ed7892f8e Modified ButtonBar engine to allow bind keys to unused buttons.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
c2693b7212 Implemented keybindings engine for ButtonBar (F1-F10 keys).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
b7f367542a Modified menu command handling using DLG_ACTION message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
11d21f1437 Modified dialog callback function.
Added two parameters:
  * Widget *sender -- to recognize the wiget that have sent message;
  * void *data -- to pass any user-defined data to the dialog.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
5592a472f6 Optimization of command handling. 2009-11-19 10:07:51 +03:00
Andrew Borodin
8224a26cf4 ButtonBar optimizations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
da33e767e9 Type accuracy and code clean up.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
9b82c05fca Changed widget order in editor and viewer dialogs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
71c9e4c668 Ticket #212: implemented keybindings for ButtonBar.
First step: renamed type of dialog command execution function.
Made execution function more flexible: added parameters for
sender and receiver widgets and user data.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Ilia Maslakov
64bc6aa1c7 Ticket #1792 (incorrect mouse movement)
Fixed incorrect mouse movement when text scrolled to the right.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-11-18 21:53:08 +00:00
Andrew Borodin
354b184463 Ticket #1810: fixed CK_Edit_Save_Mode command handling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-11 13:55:52 +03:00
Andrew Borodin
d870705e0b Ticket #1759: fixed date & time insertion in editor.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-03 13:51:05 +03:00
Ilia Maslakov
be65c2979c Ticket #1768 (incorrect calculation utf-8 width)
fixed miscalculating of width some utf-8 characters

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-11-01 16:54:00 +00:00
Slava Zanko
51f10b3038 Cleanup of code for compile with new warnings options for compilator
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:48 +02:00
Ilia Maslakov
7ce5e1eacb Ticket #1628 (editor CJK fix)
fix: incorrect drawing CJK character. Sometimes the CJK character gets replaced by three inverse dots.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-30 11:51:40 +00:00
Ilia Maslakov
359c9406d1 Ticket #1489 (indent block)
added bindings for shift block 'EditShiftBlockLeft', 'EditShiftBlockRight'
    EditShiftBlockLeft, EditShiftBlockRight - force move block without option_persistent_selections checking

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-29 07:58:30 +00:00
Slava Zanko
e7c6d59e63 Code cleanup for compile with new CFLAGS value.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 13:37:40 +02:00
Ilia Maslakov
467d833ac3 Ticket #46 (mcedit: check POSIX newline at end of file)
* added warning dialog (showed before save/save as)
    * added option "editor_check_new_line"
    * changed dialog 'Edit Save Mode' (added check box 'Check POSIX new line')

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

    * Redesing of 'Edit Save Mode' dialog.
    * Added hotkeys in 'Edit Save Mode' dialog.
    * Modified warning message, minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-27 12:08:45 +00:00
Ilia Maslakov
6d311fd852 Ticket #408
menu Command split to Command and Format

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-26 15:23:25 +00:00
Andrew Borodin
7e33c12685 Show actual shortcuts in editor menu.
Key emulation in editor was removed. Default key emulation
is stored in misc/mc.keymap.default file. Emacs key emulation
is stored in misc/mc.keymap.emacs.
Editor options dialog was redesigned.
Shortcut parser was fixed.
Fixes after rebase to recent master.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:32 +03:00
Andrew Borodin
729d4f08a9 Implemented default actual shortcuts for main menu.
Some functions and commands are renamed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
41989bd0c6 Implemented display of actual shortcuts in main menu.
Many shortcuts are not defined in keymap file and therefore
not displayed in menu.

Editor menu is not reimplemented yet.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Ilia Maslakov
82b7c4fdee Add support for multi-hotkeys in editor (like a ctrl-x,t).
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-26 16:15:31 +03:00
Andrew Borodin
b4b30941f5 Some refactoring.
Renamed name_key_map_t to name_keymap_t.
Renamed global_key_map_t to global_keymap_t.
Use more '#ifdef USE_INTERNAL_EDIT' preprocessor directives
Removed unused variables and structure members.
Aplly const modificator to keybind argument of keybind_cmd_bind().
Aplly const modificator to keyname argument of lookup_action().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Ilia Maslakov
de56559df5 Reimplemented keybindings parser.
New parser allows get the string representation of menu shortcuts.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-26 16:15:31 +03:00
Andrew Borodin
4a02baa202 Fixed key translation in editor.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
b3b332083c Use commands instead of callbacks to execute menu items.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
c47d2d20d7 New menu engine: use GList instead of GPtrArray.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Andrew Borodin
7f7bc452e3 Ticket #1563: Modified menu engine to create and modify menu dynamically.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-26 16:15:31 +03:00
Ilia Maslakov
cb5836c2e0 Ticket #1667: Hardcoded colours
Problem:
BOOK_MARK_COLOR and BOOK_MARK_FOUND_COLOR are hardcoded
in edit/edit-widget.h and so cannot be changed via skin.

Solution:
Now these colors will configure via skin-file. Like:

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-24 16:42:04 +03:00
Andrew Borodin
562ad3e84b More usage of gettext context.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-23 18:50:13 +04:00
Ilia Maslakov
dc8c80c334 Ticket #1553
fixed wrong rectangular selection when selected from right to left
    and/or bottom to top

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-23 11:47:38 +00:00
Ilia Maslakov
310e2a25c1 Ticket #395
* add scrolled percentage in status bar (like in viewer)
    * make "simple statusbar" more simple

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-21 20:12:42 +00:00
Ilia Maslakov
6717960d5b Ticket #1492
fixed: indentation block when selecting with F3

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-21 18:03:45 +00:00
Andrew Borodin
47c4744347 Ticket #1451: fixed placement of choose encoding dialog window.
The "Choose codepage" dialog (for file panel) is centered
over the according panel.

Renamed create_listbox_window_delta() function to
create_listbox_window_centered(). Now this function takes in
coordinates of dialog center.
Changed argumets order to unified dialogs API.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-15 11:40:30 +04:00
Slava Zanko
14be06d050 Reorganize work with files. Fixed permissions of files in mc home dir. All file names now accumulated into src/fileloc.h
* Added common functions for work with backups of main config files.
 * Fixed permissions of ~/.mc/ini;
 * Fixed permissions of ~/.mc/filepos
 * Fixed permissions of ~/.mc/hotlist
 * Fixed permissions of ~/.mc/Tree
 * Fixed ownership for ~/.mc/hotlist file
 * Changed definitions of config files. Now used constants from src/fileloc.h

Also, added ability for change mc user home dir. Just type:
{{{
make CFLAGS='-DMC_USERCONF_DIR=\".mc2\"'
}}}

And you will have different config files (very usefull for testing or development).

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-07 12:01:05 +03:00