Commit Graph

227 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Ilia Maslakov
4eba917c0c Added field lb (kind of line break) into WEdit struct
Some cosmetic changes.
Fixed compiling warnings.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-31 13:20:49 +04:00
Andrew Borodin
f023ce440f Ticket #1571: enhancement of mcedit 'Save as' action.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-08-31 13:20:49 +04:00
Denys Vlasenko
e064bd60df De-inline a few functions which are large
...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>
2009-08-31 07:12:59 +03:00
Ilia Maslakov
68a6495c96 fix: incorrect move/delete block if 'Cursor beyond end of line' swiched on
fix: Enter behavior if 'Cursor beyond end of line' swiched on

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-21 13:42:30 +00:00
Ilia Maslakov
cdd28feca8 fix: mouse selection if line state swiched on.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-21 13:42:29 +00:00
Daniel Borca
ea219adec3 Ticket #1412 (vertical selection issue)
fix: vertical selection issue then line state is switch on

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-18 06:13:01 +00:00
Ilia Maslakov
4afee14f94 Ticket #1529 (remove search converter overhead)
* add: void tty_print_anychar (int c)
    * remove superfluous search converter in convert_from_utf_to_current_c,
      convert_from_8bit_to_utf_c add converter to WEdit struct
    * fix: init defaulf codesets
    * fix: segfault on replace if LANG=C

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-08-18 05:52:40 +00:00
Ilia Maslakov
b536c3e487 add option "Cursor beyond end of line" into "Options\General..." dialog (editor_beyond_eol in ini)
Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-17 18:11:20 +00:00
Ilia Maslakov
f4fc6ad79d Ticket #1534 (cool cooledit)
first commit for support drag cursor after end of line

    * change mouse movement, allow place cursor after EOL
    * change vertical select
    * fix: right scroll

Signed-off-by: Ilia Maslakov <il.smind@google.com>
2009-08-17 18:11:20 +00:00
Ilia Maslakov
00200124dd Ticket #1411 (issue insertion in overwite mode)
fix: issue insertion in overwite mode
2009-08-06 10:18:08 +00:00
Patrick Winnertz
bada6849cd Remove unneeded vars in edit/edit.c to avoid compiler warnings
Signed-off-by: Patrick Winnertz <winnie@debian.org>

edit: cleanup: moved variable declaration to begin of block
edit: have_charset: added explicit variable declarations

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>

fix not initialized variable 'cw'
fix variables 'cw', 'utf_ch', make more safety algorithm.
2009-07-17 12:00:01 +03:00
Ilia Maslakov
348ab7303f Ticket #1384 (Whitespace highlighting should be optional)
Add Denis Vlasenko patch for draw options in dialog
    Add hotkey M-S-<minus> as swicher for show tabs and tws
2009-07-07 05:53:52 +00:00
Enrico Weigelt, metux IT service
c7d04dd47a fixed several missing #include's 2009-06-18 21:02:29 +04:00
Ilia Maslakov
5c28d2bda4 Ticket #321 (Trouble with mc's clipboard paste)
add: paste as vertical block if clipfile contain magic sequence
add: vertical paste from file
add: symbolic definition MAGIC_VERTICAL for "\1\1\1\1\n" magic sequence
2009-06-17 13:12:03 +00:00
Andrew Borodin
fd09abaeb2 Hide private API of editor (#361).
All editor private API stuff is located now in edit/edit-impl.h.
Public API is located in edit/edit.h.
Added functions to read some fields of WEdit struct.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-06-16 15:36:45 +04:00
Andrew Borodin
6e86e9f383 Fixed type of variables that store result of get_codepage_id(). 2009-06-15 23:35:20 +04:00
Andrew Borodin
205fa24e7d Fixed codepage selection (#402).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-06-15 20:27:17 +04:00
Sergei Trofimovich
f5dce266fe Merge commit 'origin/340_inrorrect_handling_of_wildcards'
* commit 'origin/340_inrorrect_handling_of_wildcards': (21 commits)
  Fixed work with copying/moving files by mask into subdirs
  Fixed bug with copying files/dirs into directory with 'wild' name (such as ${}, \1, etc.)
  Fixed patterns escaping of wild filenames (such as \1, ${1}, \U, etc).
  Removed unused debug code from src/filegui.c
  Refactoring: renamed variable 'loop' into 'curr_index'
  Changed defined constants to static const char[] declarations.
  Fixed declarations of functions. May be, need to split with previous commmit...
  Reworked functions strutils_shell_escape and strutils_shell_unescape
  Renamed functions shell_escape (to strutils_shell_escape) and shell_unescape (to strutils_shell_unescape)
  Just identation of some source files
  Renamed function shell_is_char_escaped to strutils_is_char_escaped; removed function mc_search_is_char_escaped
  Moved 'escape' and 'unescape' strings functions from src/util.[ch] into src/strescape.[ch]
  Fixed crash if replace group ${N} used into replace string
  Some cosmetic optimisation for less code :)
  Fixed searched token in source file mask.
  Fixed NULL acertion if replacement don't correct
  Handle new search replace behaviour into src/file.c. Also fixed filemask into src/filegui.c
  Search Replace now handled \U,\u,\L,\l and \E modificators.
  Just identation of regex.c and search.h
  search engine: Added new syntax for replace tokenks.
  ...
2009-06-12 23:02:44 +03:00
Ilia Maslakov
b955d8c2ff Merge branch '318_alt_arrows_select_block'
* 318_alt_arrows_select_block:
  Add esc sequencies to src/key.c for xterm
2009-06-12 14:53:04 +00:00
Ilia Maslakov
f4844e5b21 Add esc sequencies to src/key.c for xterm
Add CK_*_Alt_Highlight commands in edit/editcmddef.h
Add processing for CK_*_Alt_Highlight commands in edit/edit.c
2009-06-12 12:54:52 +00:00
Andrew Borodin
fb48d4a295 Small reorganization of MC and Editor menus.
The 'User Menu' entry is moved from 'File' submenu to 'Command' one.
The 'Edit editor menu file' and 'Edit syntax file' entries are moved
from main MC menu ('Command' submenu) to editor main menu ('Options'
submenu) and renamed.

src/cmd.c (check_for_default): moved to util.c and maken global.
(menu_edit_cmd): rewritten to handle MC menu files only and renamed
to edit_mc_menu_cmd.
Editor relevant routines are moved to editor code.

src/cmd.h: cleanup.

src/main.c: main menu reorganization.

src/user.h: moved editor macros to edit/edit.h.

src/util.c, src/util.h: check_for_default function from src/cmd.h.
Rewritten to use exist_file() function.

edit/editcmddef.h: added new commands:
CK_Load_Syntax_File and CK_Load_Menu_File.

edit/edit.h: editor file macros from src/user.h.
New type for file which is currently being edited.
Modified edit_load_cmd function to be more advanced.

edit/edit.c (edit_execute_cmd): handle new commands:
CK_Load_Syntax_File and CK_Load_Menu_File.

edit/editmenu.c: menu reorganization: moved two entries here from main
MC menu. Added requireq handle functions. Small optimization: removed
extra layer in menu entry handlers.

edit/editcmd.c: menu and syntax files edit is implemented.
Modified edit_load_cmd function to be more advanced.
2009-06-12 16:12:10 +04:00
Slava Zanko
cf13c588d7 Fix encoding of newly created files in editor
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:57 +03:00
Slava Zanko
e9a644219a Fix encoding of newly created files in editor
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-11 12:59:46 +03:00
Ilia Maslakov
f8a487de01 Merge branch '351_show_number_line'
* 351_show_number_line:
  fix hotkey menu entry "Toggle li&ne state" now highlighted "n"
  add call CK_Toggle_Line_State to edit menu
  show line number in left part of screen (hotkey alt-n)
2009-05-14 07:57:51 +00:00
xgizzmo
24ca27fe30 Added XZ compression support. Signed-off-by: xgizzmo <xgizzmo@slackbuilds.org>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-05-13 11:35:22 +03:00