Commit Graph

2898 Commits

Author SHA1 Message Date
Slava Zanko
09bb0c5a6d Merge branch '415_trivial_optimization'
* 415_trivial_optimization:
  Ticket #415 (trivial optimization in src/file.c::panel_operate())
2009-06-18 15:53:43 +03:00
Ilia Maslakov
3ce5fb127b Ticket #412 (Exit from mcedit by sequence Esc-Esc-Esc)
fix: Exit from mcedit by sequence Esc-Esc-Esc, now revert to double Esc
2009-06-18 12:09:13 +00:00
Slava Zanko
df256dbaf6 Ticket #415 (trivial optimization in src/file.c::panel_operate())
This patch contains the following trivial optimizations:

 * merged two identical "dest_dir_ = g_strdup (dest_dir)" ops.
 * simplified check for trailing '/' (no need to strcmp 1-char string).
 * since g_free (NULL) is safe, merged two separate "if empty string then bail out" code paths.
 * fixed wording in a comment.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-18 14:51:05 +03:00
Sergei Trofimovich
f4611f3651 Ticket #409: search: build failure on glib <2.14
During constant renaming #ifdef'ed path was broken.

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-06-17 15:52:21 +03:00
Sergei Trofimovich
6ee0ed5750 Ticket #409: search: build failure on glib <2.14
During constant renaming #ifdef'ed path was broken.

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-06-17 15:14:47 +03:00
Slava Zanko
a44141e7a0 Fixed regex search by mask '.*' in multibyte strings (utf-8)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-17 11:39:27 +03:00
Slava Zanko
9dbdac0ad3 Ticket #305 (Extra character on renaming)
Fixed renaming/copying utf-8 filenames and directoryes.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-17 11:39:26 +03:00
Ilia Maslakov
a0508934ab Merge branch 'master' of ssh://angel_il@midnight-commander.org:2222/git/mc 2009-06-16 19:07:16 +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
Ilia Maslakov
dc6cf0b6fa Ticket #305 (dont work rename/copy on some chars)
fix: incorrect work rename/copy
2009-06-15 20:48:42 +00:00
Andrew Borodin
205fa24e7d Fixed codepage selection (#402).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-06-15 20:27:17 +04:00
Slava Zanko
8bc27c83e8 Merge branch '340_forgotten_include'
* 340_forgotten_include:
  Added forgotten #include "../src/strescape.h" for avoid warnings
2009-06-15 10:10:15 +03:00
Ilia Maslakov
2dffac596d Merge branch '327_simple_editor_status'
* 327_simple_editor_status:
  Simple statusbar mode for editor.
2009-06-14 18:25:27 +00:00
Slava Zanko
80ad54decb Added forgotten #include "../src/strescape.h" for avoid warnings
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-13 00:27:23 +03: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
Slava Zanko
86e3d2123c Fixed work with copying/moving files by mask into subdirs
For example, we need to move files:
some_test.ext
this_is_file.ext

into subdirs, named as first char of filenames:
./s/
./d/

Select needed files and press F5(F6)
Source mask: ?*
to: \1/\1\2

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 17:10:38 +03: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
0791b5b200 Revert ""Exit" menu entry have been moved from "File" submenu to "Command" one."
This reverts commit 00497702b78138b888a55eff49fd90d99cb034b4.
2009-06-12 16:12:10 +04:00
Andrew Borodin
4a748afdc0 "Exit" menu entry have been moved from "File" submenu to "Command" one.
Changed hotkey of "Exteranl panelize" menu entry.
2009-06-12 16:12:10 +04:00
Andrew Borodin
5241c7a5d4 src/main.c: don't display "Encoding..." menu entry if charsets support is
disabled.

edit/editmenu.c: edded "Encoding..." menu entry to the "Command" submenu.
Display it if charsets support is enabled.
2009-06-12 16:12:10 +04:00
Andrew Borodin
0c01337e81 src/cmd.c: fixed double definition of quick_chdir_cmd(). 2009-06-12 16:12:10 +04: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
823d92e69f Fixed bug with copying files/dirs into directory with 'wild' name (such as ${}, \1, etc.)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:32:01 +03:00
Slava Zanko
bbb800530c Fixed patterns escaping of wild filenames (such as \1, ${1}, \U, etc).
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:32:01 +03:00
Slava Zanko
a58a14c357 Removed unused debug code from src/filegui.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:32:01 +03:00
Slava Zanko
6e04cf1250 Refactoring: renamed variable 'loop' into 'curr_index'
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:32:00 +03:00
Slava Zanko
db71fba72f Changed defined constants to static const char[] declarations.
Also, fixed escape of '\' char in glob-like string.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:32:00 +03:00
Slava Zanko
04b34832ef Fixed declarations of functions. May be, need to split with previous commmit...
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:32:00 +03:00
Slava Zanko
be27cd1a2e Reworked functions strutils_shell_escape and strutils_shell_unescape
also added function:
 * strutils_glob_escape
 * strutils_glob_unescape
 * strutils_regex_escape
 * strutils_regex_unescape

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:32:00 +03:00
Slava Zanko
f018970577 Renamed functions shell_escape (to strutils_shell_escape) and shell_unescape (to strutils_shell_unescape)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:32:00 +03:00
Slava Zanko
75fe3bf3a8 Just identation of some source files
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
786174fac8 Renamed function shell_is_char_escaped to strutils_is_char_escaped; removed function mc_search_is_char_escaped
* All calls of function mc_search_is_char_escaped replaced to strutils_is_char_escaped

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
5f810602e0 Moved 'escape' and 'unescape' strings functions from src/util.[ch] into src/strescape.[ch]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
5834a9ed84 Fixed crash if replace group ${N} used into replace string
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
1b08532f5f Some cosmetic optimisation for less code :)
This not important fix - just removing some unsense code (part of older logic?)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
1d4f7fd44d Fixed searched token in source file mask.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
facb94dc48 Fixed NULL acertion if replacement don't correct
Also fixed multiple usage of replacement pointers (such as \1\1).

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:58 +03:00
Slava Zanko
2e9a16487a Handle new search replace behaviour into src/file.c. Also fixed filemask into src/filegui.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:58 +03:00
Slava Zanko
a0d56381e0 Search Replace now handled \U,\u,\L,\l and \E modificators.
Also function mc_search__regex_is_char_escaped() renamed to mc_search_is_char_escaped() and moved into global visibility scope.
2009-06-12 10:31:58 +03:00
Slava Zanko
5e6c14a928 Just identation of regex.c and search.h
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:58 +03:00
Slava Zanko
2d4ee6f616 search engine: Added new syntax for replace tokenks.
Now \<digit> handle just first 0-9 search groups.
If you need to access to more search groups, need to use
${digits} syntax.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:58 +03:00
Andrew Borodin
dd319ef92e Fixed file find.
Fixed segfault in file find if MC complied with --disabled-charset.
Fixed wrong search results because of incorrect mc_search_run() argument.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-06-10 23:21:44 +04:00
Slava Zanko
3708dd28b5 Added new checkbox 'Using shell patterns' into select/unselect dialogs
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-10 14:20:27 +03:00
Slava Zanko
74abbb482f Refactoring: making from anonymous enum new type
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-10 14:20:27 +03:00
Slava Zanko
dbb953bfbe Fixed Select/Unselect file mask. now mask applied to entire filename, not to part of filename
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-10 14:20:27 +03:00
Andrew Borodin
b2a680b768 src/cmd.c (select_unselect_cmd): set dialog sizes using constants
instead of defines.
2009-06-10 14:20:26 +03:00
Andrew Borodin
edc9264a27 Advanced "Select/Unselect Group" dialogs.
src/search/glob.c (mc_search__glob_translate_to_regex): added '^'
and '$' symbols to the begin and end of regex respectively to
properly handle shell-style wildcards.

src/cmd: new select/unselect engine.
(reverse_selection_cmd): invert selection for dirs as for files.

(select_unselect_cmd): new dialog. Added "Case sensitive" and "Files
only" checkboxes.
2009-06-10 14:20:26 +03:00
Slava Zanko
8a3e1a8f5b Fixed broken history of input elements (history wasn't save into ~/.mc/history file)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-10 09:41:28 +03:00
Slava Zanko
f606e64861 Version of project now formed automatically from current git-describe output
* File version.h will be created (or changed) automatically
 * Fixed versions for rpm packages - all '-' changed to '.' in RPM_VERSION variable
 * when version.h is changed (or deleted) ./configure script will be invoked

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-07 00:56:07 +03:00