After implementation of keybinding engine and reimplenetation
of menu engine, MC starts very slow due to multiple trivial
(totally non optimized) search of many values in many arrays.
This patch performes the some speedup of MC startup process.
Statistics:
- startup time without the patch: 0m0.413s
- startup time with the patch: 0m0.073s
Great thanks to 0xe2.0x9a.0x9b for the original patch.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
1. Open empty file (<Shift-F4>)
2. Fill with data:
1234
5678
9abc
3. Mark contents (or any multiline text in, for example, firefox) with mouse (<Shift+MouseDown???>)
4. Insert somewhere below third line (<Shift+Insert>)
5. Newlines are eaten (xterm)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
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>
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>
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>
Viewer: fixed command handling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
add: binding for "esc", "escape"
Signed-off-by: Ilia Maslakov <il.smind@google.com>
fixed completion in command line
add: EditToggleTabTWS,EditFindDefinition, EditLoadPrevFile, EditLoadNextFile actions into bindings list
add string bindings for f21..f24
Signed-off-by: Ilia Maslakov <il.smind@google.com>
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>
...or not-so-large but nevertheless
contain more than one function call,
or contain loops, or contain if's and at least one
function call, or contain largish objects on stack.
In my experience, in those cases the code size
growth is big enough to not inline stuff.
I guess some of the really big functions
are defined inline because they have, or had in the past,
just one callsite.
But for a few years gcc already does it automatically,
no need to do it by hand and risk code size explosion
when later during code evolution another callsite
is created. This optimization by hand is simply
no longer needed.
Anyway, here is the code size difference:
text data bss dec hex filename
572337 17944 177820 768101 bb865 mc.t5/.obj/src/mc
567697 17944 177820 763461 ba645 mc.t6/.obj/src/mc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
src/tty/key.c (get_modifier): comparison between pointer and integer
src/tty/win.c: missed #include <stdlib.h>
src/dialog.c (add_widget): control reaches end of non-void function
src/widget.c: missed #include "layout.h"
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If you run without mouse support (mc -d), mc doesn't detect resizes.
You need to press a key for mc to resize itself to new window after
window is maximized or resized (press up/down arrow, Ctrl-O, almost
anything will work).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Code clean up.
Modification of tty_refresh for NCurses: call doupdate() after refresh()
every time.
tty_draw_box_slow() is not private function of TTY now.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
getch have been renamed to tty_lowlevel_getch.
mi_getch have been renamed to tty_getch.
get_event have been renamed to tty_get_event.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
tty_touch_screen() is used instead of touchwin() function or macro.
tty_set_normal_attrs() is used instead of standend() function or macro.
tty_set_alt_charset() is used instead of acs() and noacs()
functions or macros.
tty_baudrate() is used instead of baudrate() function or macro.
tty_keypad() is used instead of keypad() function or macro.
tty_nodelay() is used instead of nodelay() function or macro.
tty_reset_prog_mode() is used instead of reset_prog_mode() function or macro.
tty_reset_shell_mode() is used instead of reset_shell_mode()
function or macro.
tty_beep() is used instead of beep() function or macro.
src/tty/key.h: cleanup. Changed returned type of is_abort_char()
function from int to gboolean.
src/tty/key.c: moved is_abort_char() function here...
src/tty/win.h: ...from here.
src/dialog.c (dialog_handle_key): is_abort_char() function is used.
Changed order of dialog key handling. Formatting.
Created some TTY functions instead of MC core global variables.
Moved init_layer() function from MC core to TTY layer.
Renamed slang_init() to init_slang().
Added required #include's in TTY layer.
Moved S-Lang color and attribute definitions from src/tty/tty-slang.h
to colors-slang.h.