Commit Graph

202 Commits

Author SHA1 Message Date
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
Ilia Maslakov
854f214563 show line number in left part of screen (hotkey alt-n)
add option editor_line_status to ini (src/setup.c)
    add action CK_Toggle_Line_State (edt/editcmddef.h)
    change "print_to_widget()" to show line state, if option_line_state = 1 show line num (edit/editdraw.c)
    change "edit_draw_this_line()", (set line state: line num, etc)
    add const LINE_STATE_WIDTH, add options: option_line_state, option_line_state_width (edit/edit.h)
    add switch on/off show line number (edit/edit.c)
    add CK_Toggle_Line_State to translation table command_names (bindings name is Toggle-Line-State).
    add const LINE_STATE_COLOR for draw left area bar line state
    add color pair "editlinestate" for set in ini
    add help for keyword "editlinestate" on "mc --help-color" (src/main.c)
2009-05-13 07:09:47 +00:00
Ilia Maslakov
6a5dab64fe add check option persistent_selection if persistent_selection = 0 Tab shift block 2009-05-11 11:34:22 +00:00
Slava Zanko
2ebdf91079 Merge branch 'm-utf-8'
* m-utf-8: (223 commits)
  Fix wildcard pattern in file select and file find dialogs
  Project builds with option --disable-charsets
  Deleted build-glib1.sh because glib1 don't work with utf-8
  fix building without --enable-charset
  Total replacement to mc_search stuff in all places
  Search engine: if found_len parameter NULL, then mc_search_run don't try to fill them
  src/view.c: Reworked search stuff to usage src/search
  refactoring: rename edit/editcmd_dialog.c:editcmd_dialog__get_search_types_list to
  Search engine: development of hex search complete
  Search engine: remove forgotten debug string and reindent file
  Search engine:
  configure.ac: if present glib-2.14 and higher, libpcre don't linked
  Search engine: now used regexp external engines:
  src/find.c: Fixed core dump if content search pattern no present
  edit/editcmd_dialogs.c: fixed state of search type between dialog window calls
  Find files: checkbox 'Regular expression' for content search now default unchecked
  Find files: changes for usage of new search engine:
  Fix copy of current/opposite path to command line: remove charset info from path
  src/Makefile.am: add some header files to Make-tracking
  Fixed editor menu reloading.
2009-05-07 13:01:01 +03:00
Ilia Maslakov
079d83c779 fix building without --enable-charset 2009-05-07 07:21:04 +00:00
Ilia Maslakov
5e5df48951 fix: vertical insetrion UNDO on UTF-8 text. 2009-04-29 07:35:00 +00:00
Ilia Maslakov
3020c5573d fix UNDO:
revert void edit_cursor_move to original.
    add void edit_right_char_move_cmd (WEdit * edit)
    add void edit_left_char_move_cmd  (WEdit * edit)
    replace edit_cursor_move call to edit_left_char_move_cmd/edit_right_char_move_cmd in edit_execute_cmd (on key press LEFT/RIGHT)
2009-04-29 07:06:27 +00:00
Ilia Maslakov
2a52039fae fix: edit UNDO after delete, backspace on UTF-8 chars 2009-04-28 18:58:57 +00:00
Ilia Maslakov
a023d66b86 fix: incorrect UNDO in core editor on UTF-8 files. 2009-04-28 12:47:23 +00:00
Ilia Maslakov
52a2f5379e fix: draw cursor on non-utf-8 console if a character is typically rendered in a double-width cell. 2009-04-27 12:16:53 +00:00
Ilia Maslakov
093d4c7e7a fix: incorrect draw cursor if a character is typically rendered in a double-width cell.
(East Asian utf-8 chars)
2009-04-27 12:08:36 +00:00
Slava Zanko
10b7bdb361 Project now build with:
make CFLAGS="-ansi -pedantic -Wall -Wextra -Werror"

WARNING! Builds wuthout samba.
2009-04-24 01:47:22 +03:00
Slava Zanko
8fb216e732 Continue develop of mc_search module.
* Fix init of global variables cp_source and cp_display
 * add property (mc_search_t*) search to WEdit srtucture
 * start of reorganize edit/editcmd.c for new search engine
2009-04-23 14:30:14 +03:00
Ilia Maslakov
945d2183ac fix: incorrect delete selected block if is utf-8 text
add param byte_delete to edit_delete, if byte_delete = 1 then one byte only delete,
but not multibyte char.
2009-04-21 22:32:30 +00:00
Ilia Maslakov
83c10b2f6e fix: build without charsets 2009-04-20 19:10:33 +00:00
Ilia Maslakov
4725fe329c fix: edit in 8-bit locale UTF-8 source 2009-04-20 09:01:47 +00:00
Ilia Maslakov
7494db39ed clear some build warnings 2009-04-20 07:30:32 +00:00
Ilia Maslakov
9d855b3253 fix: build without HAVE_CHARSET 2009-04-20 05:51:32 +00:00
Ilia Maslakov
42eba5c18c fix some warnings 2009-04-16 21:28:02 +00:00
Mikhail S. Pobolovets
1959b42fdc Merge branch '252_doxygen_desc_src'
Conflicts:

	src/file.h

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-04-16 08:26:52 +03:00
Ilia Maslakov
4374fd4ea5 fix: edit_get_prev_utf segfault, add compare str with start of buf 2009-04-15 19:07:46 +00:00
Ilia Maslakov
13986ea0af fix: with status_string on utf-8 char 2009-04-15 18:14:17 +00:00
Ilia Maslakov
960b1ef89d fix move backward and backspace. 2009-04-15 13:56:19 +00:00
Slava Zanko
ca7427cd35 edit/{editcmd.c,edit.h,edit.c}: remove catstrs() and freestrs() functions
These functions fully replaced with g_strconcat ()

WARNING! This just stupid replace. Some parts of code need to usage
concat_dir_and_file() function instread of g_strconcat ()
2009-04-14 15:12:36 +03:00
Ilia Maslakov
21c88729a4 fix edit_delete, edit_backspace now work with utf-8 2009-04-14 06:07:35 +00:00
Ilia Maslakov
4411af46bb fix incorrect move cursor after left/right key pressed 2009-04-14 05:56:02 +00:00