Commit Graph

754 Commits

Author SHA1 Message Date
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
Ilia Maslakov
93f8b96b32 Ticket #1664 (Viewer: incorrect tabs alignment)
fix tabs alignment. Variable option_tab_spacing instead hardcoded '8' are used.

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-07 07:25:26 +00:00
Ilia Maslakov
e5abe33fc6 Ticket #1669 (autoindent not working)
* remove unused code;
    * autoindent fixed, mcedit distinguishes CK_Enter and CK_Return commands, but terminal not.

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-10-06 13:56:17 +00:00
Stan. S. Krupoderov
35ededec26 Ticket #1390: Key binding ctrl+t and marking files
mc.keymap: remap select charset to M-e, and C-t to mark file
    editmenu.c, main.c: change menu items to be consistent

Signed-off-by: Stan. S. Krupoderov <pashelper@gmail.com>
2009-10-05 16:02:04 +04:00
Ilia Maslakov
a910b45e57 Ticket #1649: Prepare for prerelease mc-4.7.0-pre3 (code cleanup)
* removed unused edit/editcmddef.h, edit/usermap.c, edit/usermap.h
 * some cleanup

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

 * Remove unneded constant definition from src/Makefile.am

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-01 16:14:32 +03:00
Slava Zanko
dd94068a62 Ticket #1649: Prepare for prerelease mc-4.7.0-pre3 (code cleanup)
Try to compile with
{{{
make CFLAGS="-Wall -Werror -Wno-long-long -Wwrite-strings"
}}}

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-30 16:42:11 +03:00
Ilia Maslakov
4c64340111 Ticket #1650
fix: UNDO behavior when cursor besides EOL

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-30 12:09:10 +00:00
Ilia Maslakov
87102cc7e8 fix: main.c keys handler
add more keys into mc.keymap
    fix: CK_SingleDirsizeCmd event
    add default keys (alt-'.', alt-'+') mc.keymap

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

    Added alt-shift-h hotkey
    Add some documentation about keymap file.
    Replace some symbols into names '.' to 'dot', '?' to question, etc.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-29 17:42:40 +00:00
Ilia Maslakov
dbdc3254c1 add more commands into mc.keymap
Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-29 17:42:35 +00:00
Ilia Maslakov
592ddbf39e refactoring editor keybindings
add more keys into mc.keymap
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-09-29 17:42:35 +00:00
Ilia Maslakov
5a397a6b9a * add new commands into cmddef.h
* add user keybind in widgets
    * add widget keybindings

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-29 17:42:34 +00:00
Ilia Maslakov
da303d73ac * removed edit/usermap.c edit/usermap.h
Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-29 17:42:33 +00:00
Ilia Maslakov
71b1a8bf99 Ticket #212 (User defined hotkeys)
created structs:
    struct name_key_map_t
    struct key_config_t
    global_key_map_t
    add lookup_action
    replace editor key map struct to global_key_map_t
    add main_map screen_map
    replace command CK_* to src/cmddef.h
    add mc.keymap
    fix misc/Makefile.am
    add x_keymap
    add more commands

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-29 17:42:32 +00:00
Andrew Borodin
a437ed5d52 Ticket #1560: fixed button locations in editor search dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-09-29 20:40:09 +04:00
Andrew Borodin
9c0a8e7d3f Fixed segfault in search in editor and viewer.
Modified API of search engine: return the number of search types.
This avoids the calculation of the search type count when need.
Sync editor search, editor replace and viewer searc dialogs with
new search API.
Fixed memory leak in editcmd_dialog_search_show().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-09-26 00:27:45 +03:00
Slava Zanko
a1e3999abf Editor: Autocomplete all words (not just English words)
Also fix charset conversation for autocompleted text.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-23 16:13:36 +03:00
Slava Zanko
d5381e862e Added option for switch beetween 'collect completions before cursor'
and 'collect completions in entire file'

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-23 16:13:36 +03:00
dborca
fdbd5b8a86 Ticket #1486: Editor completion is confusing
Editor completion became really confusing in 4.7.0-pre1:

1. The list is populated with words from the entire file. This is arguably
better than the old style, which scanned only up to the cursor. But the number
of suggestions are limited, and if you have a bigger file, some words won't
make it in the list. Besides, I somehow liked the old way.

2. Suggestions do not end on a word boundary. This may or may be not useful; but
it just increases the list of suggestions, which slows the user. In the end, it
beats the purpose of completions.

3. It completes the word I am currently editing. That's smart. :)

4. The suggestions are displayed in the order in which they were found from the
beginning of the file. This is my main gripe, because when using the editor for
coding, it is better to have suggestions based on the distance to the cursor.
Closer means higher. When writing a function, I am mainly interested in the
variable names I recently used.

5. Sometimes, it does not work at all, but I haven't investigated the bug. :(

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-23 16:13:36 +03:00
Ilia Maslakov
37383d65d5 Ticket #1598 (vertical selection: Meta+PgDn)
fix: vertical selection with Meta+PgDn

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-23 12:10:28 +00:00
Ilia Maslakov
559f161ebc Ticket #1599 (navigation with Ctrl+arrows besides EOL)
fix: navigation with Ctrl+arrows besides EOL
    fix: kill word left/right when cursor besides EOL

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-23 12:04:25 +00:00
Andrew Borodin
434ebd3780 Ticket #1556: full i18n support of editor 'Search' dialog.
Dialog width calcualtion is based on each dialog widget width.
Updated russian translation (for 'Find all' button).

Thanks a lot to David Martin.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-09-21 13:21:39 +04:00
Slava Zanko
2216332c0c continue develop of skins.
* Compile with option --with-screen=ncurses
 * Added default init of colors (if color description is null)
 * Renamed some color pairs. All static color pairs now cached.
 * Fix cursor show in panel over selected files in b&w color scheme.
 * Fix editor highlight
 * Handle old-style colors definitions.
 * Fix showing box lines in onebyte codepages.
 * Fix segfault with:
 * mc -C 'menu=blue,white:'
 * Fix reading of color backgrounds from old-style color definition strings.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>

 * Fixed typos.
 * Added ACS_PLUS char and related stuff.
 * Changed order of colors.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>

 * Fixed pseudo-graphics drawing for S-Lang library and 8-bit locale.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-09-18 11:54:20 +03:00
Slava Zanko
981fe001d1 Base support of skins.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-09-18 11:49:44 +03:00
Andrew Borodin
e983e9eedc fix: i18n label in the search dialog
Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-16 13:45:08 +00:00
Andrew Borodin
2ae441dde6 Some optimization of mouse handling in editor. 2009-09-14 15:11:59 +04:00
Andrew Borodin
c00900472e Fixed i18n of editor search dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-09-07 13:06:11 +00:00
Ilia Maslakov
9e5fb208a9 Ticket #1556 (editor search: button 'Find all')
* add new button 'Find all' into Search dialog. Bookmarks all founded entries.
    * fix: search dialog (buttons are positioned dynamically)
    * some optimisation of usability.

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-09-07 13:06:04 +00:00
Andrew Borodin
d6d713eb24 Fixed segfault in editor options dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-09-03 11:39:57 +04:00