Commit Graph

678 Commits

Author SHA1 Message Date
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
Mikhail S. Pobolovets
546b30008a Simple statusbar mode for editor.
Full mode:
    TODO [----] 2 L:[ 1+ 0 1/333] *(2 /11838b)= 102 0x066 cp:Other_8_bit

Simple mode:
    TODO [----] 2 1/333 (2 /11838b) 102 0x066 Other_8_bit

    modified:
        * edit/edit.h
        * edit/editdraw.c
        * src/setup.c

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-05-28 10:40:54 +03:00
Slava Zanko
abcd23406d remove ChangeLog files from mc tree
Description by Sergei Trofimovich:

GNU ChangeLog? files are result of CVS stupidpity about changeset tracking.
Currently constantly updated ChangeLogs? diverge in different branches and cause collisions(!)
when 'git merge' (almost ANY SINGLE MERGE!).

Major changes can be described in NEWS file, minor changes can be autogenerated via 'git log'/'git shortlog'
and friends (if needed at all).
2009-05-27 14:53:23 +03:00
Slava Zanko
17343149d6 Remove 'All charsets' checkbox from all search dialogs when specified '--disable-charsets' configure option 2009-05-27 12:20:21 +03:00
Slava Zanko
89bdeb7e34 edit/editcmd.c: fix backward search by one symbol. 2009-05-27 11:49:36 +03:00
Slava Zanko
8841747560 edit/syntax.c: fixed path to Syntax file 2009-05-22 10:53:02 +03:00
Slava Zanko
0c17219b2a Move global config files from pkg_datadir to sysconfdir
* Also fixed 'make dist' command
 * changed contrib/dist/redhat/mc.spec.in for builds with new dir
2009-05-21 01:01:10 +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
Ilia Maslakov
e9fe86f149 fix hotkey menu entry "Toggle li&ne state" now highlighted "n" 2009-05-13 09:00:49 +00:00
Slava Zanko
dd27f52286 Merge branch '352_add_XZ_compression_support'
* 352_add_XZ_compression_support:
  Added XZ compression support. Signed-off-by: xgizzmo <xgizzmo@slackbuilds.org>
2009-05-13 11:35:54 +03: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
c1413bb370 add call CK_Toggle_Line_State to edit menu 2009-05-13 07:34:32 +00: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
427ecef234 fix mark tab and spaces 2009-05-12 14:14:27 +00:00
Ilia Maslakov
7fbff4fa86 fix highlight tab and spaces in mark procces. 2009-05-12 10:06:37 +00:00
Ilia Maslakov
25d5ed8c6a Merge branch '344_optional_shift_block'
* 344_optional_shift_block:
  add check option persistent_selection if persistent_selection = 0 Tab shift block
2009-05-11 17:59:57 +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
Mikhail S. Pobolovets
3784f7253e Warning fix: 'implicit declaration of function'
edit.c:2645:
    implicit declaration of function ‘edit_move_block_to_right’
edit.c:2805:
    implicit declaration of function ‘edit_move_block_to_left’

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-05-08 13:15:50 +03:00
Ilia Maslakov
20090e0567 fix: error call edit_delete, add needed param. 2009-05-07 10:23:32 +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
Slava Zanko
09bc5434f6 Project builds with option --disable-charsets 2009-05-07 12:20:34 +03:00
Ilia Maslakov
079d83c779 fix building without --enable-charset 2009-05-07 07:21:04 +00:00
Slava Zanko
087ef15b1f Total replacement to mc_search stuff in all places 2009-05-06 19:12:32 +03:00
Slava Zanko
293310f727 refactoring: rename edit/editcmd_dialog.c:editcmd_dialog__get_search_types_list to
to src/search/lib.c:mc_search_get_types_strings_array
2009-05-06 10:50:12 +03:00
Slava Zanko
2276e9b513 Search engine: now used regexp external engines:
* glib
 * pcre
 * POSIX regex

External engine selected automatically, if present.
2009-05-05 16:19:32 +03:00
Slava Zanko
301435b374 edit/editcmd_dialogs.c: fixed state of search type between dialog window calls 2009-05-05 11:31:57 +03:00
Andrew Borodin
3c477cbdfd Fixed editor menu reloading.
edit/edit.h: moved N_menus 5 macro to editmenu.c. Renamed edit_init_menu()
to edit_create_menu().

edit/editmenu.c: added static variable EditMenuBar to store editor menus.
Reimplemented menu creation. Added new edit_create_menu() function.

edit/editwidget.c (edit_file): used edit_create_menu() instead of
edit_init_menu().
2009-05-01 21:10:52 +04:00
Slava Zanko
e12b9e50db edit/editcmd.c, edit/editcmd_dialigs.c: added 'search in all charsets' feature
src/search/search.c: fixed error with multicharset search
2009-04-30 16:58:28 +03:00
Slava Zanko
15b2d19428 Search engine: fix errors with backward regex-search 2009-04-30 14:21:39 +03:00
Slava Zanko
5e08dbbe76 edit/editcmd_dialogs.c: types of search now show as radiobuttons 2009-04-30 13:46:33 +03:00
Slava Zanko
3e2c3ebb5e Move replace confirm dialog into editcmd_dialogs.c 2009-04-30 12:45:02 +03:00
Slava Zanko
602f3c5796 Search engine: backward search now works 2009-04-30 12:35:24 +03:00
Slava Zanko
def581b24d Search engine:
* add function for prepare replacement string

edit/editcmd.c:
 * changes for correct replace

WARNING! replace don't fully works!
2009-04-29 18:45:21 +03:00
Slava Zanko
74c8c748b3 internal editor: change search/replace dialogs:
replace dialog:
 * removed 'replace order' field
 * removed 'scanf' and 'regex' chackboxes
 * added selectbox element for choise type of search
 * confirm replace and 'replace all' now radiobuttons

search dialog:
 * removed 'replace order' field
 * removed 'scanf' and 'regex' chackboxes
 * added selectbox element for choise type of search
2009-04-29 16:13:12 +03:00
Slava Zanko
d2e62a5c87 src/wtools: add callback functions for buttons to QuickWidget structure 2009-04-29 14:07:09 +03: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
b2442d1b1e Reorganize source structure: move search engine files into src/search subdir 2009-04-25 10:25:13 +03: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
1d18f3227e edit/editcmd.c:
* Fix encoding in replace confirm dialog
 * Correct handle error codes from search engine
2009-04-23 17:46:38 +03:00
Slava Zanko
ea2740059b edit/editcmd.c: Replace now worked with new search engine (just simple mode search) 2009-04-23 17:28:07 +03:00
Slava Zanko
9db1cf46a4 Continue develop of search engine: simple search now worked 2009-04-23 15:46:06 +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
Andrew Borodin
4e64ee3b8d edit/editcmd.c (edit_search_cmd): removed redundant code. 2009-04-22 06:19:20 +04: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
990838a226 fix: draw in core editor 8-bit locale and UTF-8 source 2009-04-21 21:27:42 +00:00
Slava Zanko
76bbeb60b2 Fixed search with different display and source charsets 2009-04-21 14:19:42 +03:00
Slava Zanko
356b501bdc revert commit No. e19de53a06 "change addch to addstr" 2009-04-21 11:51:24 +03:00
Ilia Maslakov
e19de53a06 change addch to addstr 2009-04-20 20:18:12 +00:00
Ilia Maslakov
83c10b2f6e fix: build without charsets 2009-04-20 19:10:33 +00:00
Ilia Maslakov
202ec6d78f fix: incorrect show and input capitalize chars in UTF-8 locale and 8-bit source 2009-04-20 14:46:22 +00:00
Ilia Maslakov
cc54a2083b change check S-LANG for use addch() 2009-04-20 10:56:31 +00:00
Ilia Maslakov
571ed66b76 fix: utf-8 output in editor with use ncurses 2009-04-20 10:26:14 +00:00
Slava Zanko
dd07d30c0b Fix coredump with jumps to function definition/declaration 2009-04-20 13:35:09 +03:00
Ilia Maslakov
78b7678845 Merge branch 'm-utf-8' of ssh://angel_il@midnight-commander.org:2222/git/mc into m-utf-8 2009-04-20 09:03:04 +00:00
Ilia Maslakov
4725fe329c fix: edit in 8-bit locale UTF-8 source 2009-04-20 09:01:47 +00:00
Slava Zanko
303cec8cb6 Supress compiler warnings. Now able to compile project with
make CFLAGS=-Werror
2009-04-20 11:10:06 +03: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
a4b354f99c fix: incorret draw files in 8-bit codeset after recode 2009-04-19 20:28:00 +00:00
Ilia Maslakov
b87edfdc26 fix: input in 8-bit locales 2009-04-19 12:18:18 +00:00
Ilia Maslakov
d8175b3e6b fix: incorrect input 2009-04-18 14:50:05 +00:00
Slava Zanko
6568cad9df Fixies for search stuff in editor.
src/charsets.c:
 * fix error with recoding string for display
edit/editcmd.c:
 * fix core dump if search dialog calls some multiple times
 * fix memory leak
2009-04-17 18:08:51 +03:00
Slava Zanko
95e2fb90ef Fix search with 8-bit system codepage in utf-8 text codepage 2009-04-17 17:05:19 +03:00
Slava Zanko
ea30fa7d88 Merge branch 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc into m-utf-8
* 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc:
  fix: incorrect convert_from_utf_to_current_c, convert_from_utf_to_current
2009-04-17 15:02:41 +03:00
Slava Zanko
3802929f94 edit/editcmd.c: Fixed search and replace with scanf-search 2009-04-17 15:01:25 +03:00
Ilia Maslakov
137e3e7259 fix: incorrect convert_from_utf_to_current_c, convert_from_utf_to_current 2009-04-17 10:27:59 +00:00
Slava Zanko
0730efa2fc Merge branch 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc into m-utf-8
* 'm-utf-8' of ssh://www.midnight-commander.org:2222/git/mc:
  fix by andrew_b uninitialised tool->compose.
  fix incorrect draw utf-8 text in 8-bit locale
  fix some warnings
  add convert_from_utf_to_current_c, fix little warnings
  add utf8_display global variable, if display bits select utf-8 utf8_display = 1
  add more convertion before draw text
  change charbuf to char from unsigned char
  add: convert input in utf locale to needle
  fix incorrect convertion from utf to display CP
  fix: width utf buffer
  add in core viewer codepage selection from list
  fix: editor status bar
  fix: edit_get_prev_utf segfault, add compare str with start of buf

Conflicts:
	edit/edit.h
2009-04-17 11:52:20 +03:00
Slava Zanko
1e5a201abd Temporary commit. Half-fix searching.
Not fixed search by regexp.
2009-04-17 11:46:06 +03:00
Ilia Maslakov
8767909493 fix incorrect draw utf-8 text in 8-bit locale 2009-04-17 06:17:37 +00:00
Ilia Maslakov
42eba5c18c fix some warnings 2009-04-16 21:28:02 +00:00
Ilia Maslakov
d4148989ed add more convertion before draw text 2009-04-16 21:17:58 +00:00
Ilia Maslakov
c03c4de5cc change charbuf to char from unsigned char 2009-04-16 21:14:48 +00:00
Ilia Maslakov
9cb41f7b43 Merge branch 'm-utf-8' of ssh://angel_il@midnight-commander.org:2222/git/mc into m-utf-8 2009-04-16 16:38:05 +00:00
Ilia Maslakov
2ce1042665 add: convert input in utf locale to needle 2009-04-16 15:12:33 +00:00
Ilia Maslakov
0934b0643a fix: width utf buffer 2009-04-16 15:09:19 +00:00
Slava Zanko
ac8ae55181 Fix conflicts after rebasing 2009-04-16 13:24:47 +03:00
Ilia Maslakov
7658246c35 fix: editor status bar 2009-04-16 13:14:30 +03:00
Ilia Maslakov
7bcb0b1930 fix: edit_get_prev_utf segfault, add compare str with start of buf 2009-04-16 13:14:29 +03:00
Ilia Maslakov
2fdb3689e2 fix: with status_string on utf-8 char 2009-04-16 13:14:29 +03:00
Andrew Borodin
dd6e11fa9c Unification of widgets API.
widget.h: chaged paremeters order of listbox_new()
and groupbox_new() functions.

widget.c: likewise.

src/achown.c: sync with modified API of WListbox and WGroupbox widgets.
src/boxes.c: likewise.
src/chown.c: likewise.
src/complete.c: likewise.
src/find.c: likewise.
src/hotlist.c: likewise.
src/layout.c: likewise.
src/listmode.c: likewise.
src/option.c: likewise.
src/panelize.c: likewise.
src/wtools.c: likewise.
edit/editcmd.c: likewise.
2009-04-16 13:14:29 +03:00
Ilia Maslakov
83b2c8406f fix move backward and backspace. 2009-04-16 13:14:29 +03:00
Slava Zanko
8e6a6e48b6 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-16 13:14:28 +03: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
38c7e229d5 fix: editor status bar 2009-04-15 20:08:44 +00: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
a71e58bcdb Merge branch 'm-utf-8' of ssh://angel_il@midnight-commander.org:2222/git/mc into m-utf-8 2009-04-15 18:17:26 +00:00
Ilia Maslakov
13986ea0af fix: with status_string on utf-8 char 2009-04-15 18:14:17 +00:00
Andrew Borodin
004bc0077e Unification of widgets API.
widget.h: chaged paremeters order of listbox_new()
and groupbox_new() functions.

widget.c: likewise.

src/achown.c: sync with modified API of WListbox and WGroupbox widgets.
src/boxes.c: likewise.
src/chown.c: likewise.
src/complete.c: likewise.
src/find.c: likewise.
src/hotlist.c: likewise.
src/layout.c: likewise.
src/listmode.c: likewise.
src/option.c: likewise.
src/panelize.c: likewise.
src/wtools.c: likewise.
edit/editcmd.c: likewise.
2009-04-15 20:22:26 +04:00
Ilia Maslakov
960b1ef89d fix move backward and backspace. 2009-04-15 13:56:19 +00:00
Ilia Maslakov
3236fe285c fix: segfault in 'edit_save_confirm_cmd', g_free non allocated memory 2009-04-14 20:41:41 +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