Commit Graph

3510 Commits

Author SHA1 Message Date
Vladimir Brednikov
3c4221bc40 Ticket #1994: Sort files by version (like strverscmp(3) does)
Suppose we have 3 files with version in their names:
 * file-2.1.tgz
 * file-2.2.tgz
 * file-2.10.tgz

It is impossible to see them in natural order using standard facilities,
they will be sorted in alphabet order:
 * file-2.1.tgz
 * file-2.10.tgz
 * file-2.2.tgz

There was some attempts to fix this. I've picked up the patch by Roland Illig <roland illig gmx de>
(http://mail.gnome.org/archives/mc-devel/2004-July/msg00016.html) and adopted it for today's git snapshot.
It adds "version" option to the sort menu, which uses copy of strverscmp function from glibc.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-22 11:08:37 +02:00
Sergei Trofimovich
5a714baeaf panel search crash due to strescape.h include missing from screen.c (ticket #2044)
> In current git, mc crashes (at least on 64-bit) in Ctrl-S search due to missing
> strutils_escape prototype. To reproduce, pressing Ctrl-S and a few keys is enough.
> Adding #include "lib/strescape.h" to screen.c fixes the issue.

Reported by jmak

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2010-02-21 20:51:26 +02:00
Andrew Borodin
b52e70637e show help for quick search.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-20 11:25:30 +00:00
Ilia Maslakov
be05d210c3 cleanup of screen.c: do_search() function (indentation and trailing whitespace)
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-20 11:25:29 +00:00
Ilia Maslakov
dde06f0503 do_search(): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>

    fix trouble with unescaped ',|\\[]{}'

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-20 11:25:29 +00:00
Slava Zanko
7e8975e022 quicksearch: stop appending of chars if no file found
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-20 11:25:29 +00:00
Ilia Maslakov
38008d6580 Ticket #2022 (new quick search)
changed quick search engine, now search with wildcards.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-20 11:25:28 +00:00
Ilia Maslakov
b0236c3e10 Ticket #1998 (EditColumnMark can't go up through newline)
fixed trouble with vertical selection

more detail description:

In block selection mode (shift-F3) it's impossible to go beyond empty line with
up or left arrow (i.e. in top direction).
In general: it's impossible to pass any line shorter than finishing column,
until left arrow is pressed at column 0 (which won't work on empty line), e.g.

xxxCxxx
yyyyy
zzzzzDz

- put cursor in C position,
- press shift-F3,
- go to D position,
- press up arrow twice,
- press left arrow - you're unlocked now and free to go up.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-19 12:59:10 +03:00
Andrew Borodin
163b07d23f Ticket #2008: reimplemented pty_buffer as static buffer.
Reimplemented pty_buffer as static buffer to avoid
MC crashes at exit due to race conditions of destroing
subshell and file manager.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-19 11:30:29 +00:00
Slava Zanko
0ebd30cd50 Merge branch '1917_viewer_search_again'
* 1917_viewer_search_again:
  Ticket #1917: again search in viewer
2010-02-15 17:19:38 +02:00
Slava Zanko
9e2768be46 Ticket #1917: again search in viewer
Added new confirm box for repeat search from begining of file

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-15 17:17:27 +02:00
Martin Petricek
7c3196b60e Ticket #1767: Custom/locale-based date format
Fixed showing of datetime format in various locales (such as Polish locale)

Added new options in config file:

[Misc]
    ...
    timeformat_recent=%d.%m.%y %H:%M
    timeformat_old=%d.%m.%y %H:%M
    ...

where
    timeformat_recent - for files with mtime between now
                         and "6 moths old" (like "Nov 2 00:56")
    timeformat_old    - for other files (like "Jun 23 2007")

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-15 12:31:47 +02:00
Slava Zanko
f9b956b483 Ticket #1996: ViewContinueSearch segfault on empty search
Steps to reproduce:
1. F7,
2. set empty search string,
3. enter
4. n
5. enter
6. n

Fix issue: set view->last_search_string to NULL after call g_free()

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-12 13:02:26 +02:00
Leonid Myravjev
56d955152c Ticket #1838: source_codepage autodetect with enca program.
Added support of autodetect codepages via 'enca' program.

New parameter in user configuration file (~/.mc/ini):

[Misc]
autodetect_codeset=(one of `enca --list languages | cut -d : -f1`)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>

Little code cleanup.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

Type accuracy. Added missing includes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-08 15:56:48 +02:00
Andrew Borodin
36b2136391 Fixed listbox scrolling after item deletion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
361f95a976 Minor optimization of listbox_key() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
081723c4e7 Removed double check of panel history before show it.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
9bc2066b1f Added history cleanup capability.
New shortcuts of WListbox widget:
d or Del: remove current item of history;
D or Shift-Del: clean the history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
2a8817b9be Changed i18n stuff of Confirmation dialog window.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
ad60c3fd8d Preparation to history cleanup confirmation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
43ca270f99 Scroll list if last item have been deleted.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
9a9e003243 History items can be deleted now using DEL key.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
5718372338 Reimplemented usage of history list in history dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
1947d842a5 Added deletable member to WListbox structure.
Added deletable member to WListbox structure to enable
delete some list entries.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
1695465594 Added listbox_set_list() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
1d16fd3a88 Small refactoring of history engine.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
32c580ee87 Reimplemented WListbox to use GList.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:43 +00:00
Andrew Borodin
aac16c693d Ticket #1445: remove history items.
Initial step: optimizatiom of listbox_remove_current() function.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:43 +00:00
Slava Zanko
2b653ecf33 Ticket #1991: toggle panels view
Added keybinding for switch panels view (horizontally/vertically).

Default value for keybind is
[main]
CmdTogglePanelsView = alt-comma

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-04 11:29:16 +02:00
Andrew Borodin
7bf935ad83 Fixed warning: ISO C90 forbids mixed declarations and code.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-02 21:55:37 +03:00
Andrew Borodin
7f50de4670 Added missed includes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-02 21:45:11 +03:00
Andrew Borodin
0bd03e07f5 Ticket #1990: code cleanup before 4.7.0.2 release.
Fixed warings: local variable shadows a global declaration.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-02 21:45:05 +03:00
Andrew Borodin
0d12e0def8 Ticket #1702: changed colors of alvays visible inactive menu bar.
If menu bar is always visible, default colors are used in menu.
If menu bar is visible when it is active, skin colors are used.

In this commit, only skin colors are applied to menu. Thanks to
Rashid N. Achilov for idea.
(see http://mail.gnome.org/archives/mc/2010-January/msg00087.html).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-01 15:58:01 +00:00
Slava Zanko
5975418163 edit.c: Some code refactoring&cleanup
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-29 18:05:03 +02:00
Slava Zanko
cd9e93b2d1 Ticket #1982: Segfault while opening gzip archive
1. touch /tmp/IzV-Útěk_do_bezpečí.gz
2. open mc
3. move cursor at /tmp/IzV-Útěk_do_bezpečí.gz
4. press F4
5. you will see an error message, press Dismiss
6. segfault

Fix issue: length of command line string for pipeing  now calculated
automatically (via g_strdup_printf()) rathen than calculating via
str_term_width1() function.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-29 18:05:03 +02:00
Ilia Maslakov
519e2a30cb Ticket #1956 (mcedit: moving cursor to the empty last line problem)
fixed cursor movement in empty last line.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-29 15:07:34 +03:00
Andrew Borodin
70a41e4fed Ticket #1935: Incorrect lock files check when hostname contains wide characters.
Bug: in lock_extract_info() number of unicode characters
is used as number of bytes in string.

Now strlen() is used instead of str_term_width() to calculate
string length. String length is calculated only one time.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-26 13:18:21 +00:00
Slava Zanko
9104ad78e1 src/viewer/display.c: added forgotten #include "src/charsets.h"
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:26 +02:00
Slava Zanko
8172b511bb Removed src/pipethrough.* files.
Glib have fully-functional replacement:
http://library.gnome.org/devel/glib/stable/glib-Spawning-Processes.html

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:26 +02:00
Slava Zanko
862652bd1b Move src/cons.saver into src/consaver/* subdir
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:26 +02:00
Slava Zanko
2fa4d9b952 Move logging.[ch] into library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:26 +02:00
Slava Zanko
e07ba16b3b Moved strecape.[ch] into library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko
108666b192 Added include of "fileloc.h" into subshell.c file
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko
25155c311a Move all interface includes from subdirs lib/*/*.h into lib/*.h
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko
7815c9c7a8 Reorganization of usage external libs
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko
cd4dbf3a09 Changes for build after moving strutil into lib
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko
7fa24fbc9b Moved strutil-related stuff from src into lib/strutil/*
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko
c764f3b84c Changes for build after moving util.[ch]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko
99abd3ab9a Moved src/util.[ch] into lib, also moved unixcompat.h and utilunix.c.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00
Slava Zanko
dbaff2b6f6 Reorganization of sources. Part 2
* moved src/fileloc.h into lib/fileloc.h
 * moved src/timefmt.h into lib/timefmt.h
 * removed unneedded includes into src/util.c

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00