Commit Graph

1079 Commits

Author SHA1 Message Date
Andrew Borodin
09f1818bed Ticket #3018: broken directory completion.
In the command line, the subdirectory completion in current directory
isn't performed if stub isn't starting with './'.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 21:23:43 +04:00
Andrew Borodin
c7b7a299e3 Ticket #3084: (dlg_init): fix order of messages sent to widgets during dialog initialization.
If checkbox is the first focusable widget in a dialog, it taken the MSG_DRAW
message after MSG_FOCUS one and therefore wasn't highlighted.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:59:26 +04:00
Andrew Borodin
5a61ac80d0 Refactoring of WInput history.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:53:53 +04:00
Andrew Borodin
de94164cb5 Remove WInput::field_width. Use Widget::cols instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:53:53 +04:00
Andrew Borodin
e16e33a186 (input_update): don't do anything if widget is unowned or is in inactive dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:53:53 +04:00
Andrew Borodin
d8bb31c665 Ticket #3076: copy/move doesn't work if num_history_items_recorded=0.
How to reproduce:
1. Set num_history_items_recorded=0 in my $HOME/.config/mc/ini
2. Run mc.
3. Press F5 to copy and then enter.
Result: nothing happens.

Solution: refactoring of initial text usage in input line.
Use def_text to fill WInput:buffer when WInput is created.
Then overwrite WInput::buffer content from history if history usage
is enabled.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-07 15:53:53 +04:00
Andrew Borodin
5a04c1ede2 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:27:24 +04:00
Andrew Borodin
6a05f30ecf Clarify usage of SA_RESTART.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:09 +04:00
Andrew Borodin
c058e92586 Remove input_set_origin(). Use widget_set_size() instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
b0a793c420 (input_destroy): don't call input_free_completions() twice.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
61dc030772 More tests for canonicalize_pathname().
(custom_canonicalize_pathname): fix wrong condition. Remove redundant
break.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
e78b1fdf66 Remove redundant checks for g_strdup().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
034e973fbf (vfs_translate_path): return const char *.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
a6b3cc8f24 Typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
200cb115ab (widget_init): init pos_flags member to WPOS_KEEP_DEFAULT.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:07 +04:00
Andrew Borodin
0a784f4d2e (mc_search_regex__process_append_str): minor optimization and cosmetics.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:12:08 +04:00
Andrew Borodin
fbdf3adfbf (mc_search__cond_struct_new_regex_accum_append): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:12:08 +04:00
Andrew Borodin
d119439a1c (mc_search__conditions_free): use g_ptr_array_foreach().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:12:08 +04:00
Andrew Borodin
00f6272364 (mc_search__cond_struct_new_regex_hex_add): refactoring to get rid of extra memory allocation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:05 +04:00
Andrew Borodin
bb2f5d35f3 (mc_search__run_regex): optimization
...for case where there is no MC_SEARCH_CB_INVALID or MC_SEARCH_CB_SKIP
return codes (for search from file manager), so we can copy line
at regex buffer all at once.

Thanks Sergey Naumov <sknaumov@gmail.com> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:05 +04:00
Andrew Borodin
bb142bf47f (lookup_key): minor refactoring: replace while() by for().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Andrew Borodin
546e89f611 (vfs_path_tokens_get): minor refactoring: replace while() by for().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Andrew Borodin
f3bdcb186b (mc_skin_colors_old_configure_one): cosmetics.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Andrew Borodin
26fbddf6f4 (vfs_path_tokens_count): refactoring: get rid of extra memory allocation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Egmont Koblinger
930f683019 Handle newline and tab with shift/ctrl modifiers correctly.
MC already has its own half-ready trick: when pasting with Shift-Insert,
using the X11 extension, the newline ("Enter" as mc calls it) with the
Shift modifier pressed gets converted to a "Return", and in the editor
the Return character inserts a non-indenting newline. This makes pasting
better in terminals not supporting bracketed paste, however, it has some
problems that this commit addresses:

  * Shift+newline gets this special treatment, but Ctrl+newline gets
    dropped. Hence e.g. when pasting in Gnome-terminal with Ctrl+Shift+V
    all the newlines will be missing. This commit adds the same
    non-indenting newline behavior to Ctrl+Newline and Ctrl+Shift+Newline.

  * The code forgets about Tab that also needs special treatment:

    - Most terminals send \e[Z on Shift+Tab, this is not handled by MC
      at all, moreover it causes a hang for about a second. This commit
      teaches this sequence to MC. This is especially useful when no X11
      is available, because there Ctrl+Tab is identical to Tab, so the
      backwards tab feature is not available. With this commit Shift+Tab
      becomes a backwards tab too on all terminals that emit \e[Z.

    - When pasting to the editor, Shift+Tab, Ctrl+Tab and Ctrl+Shift+Tab
      should all insert a tab for the same reason mentioned at the newline.

    - It would look inconsistent in the keymap files to have logical code
      such as "backtab" instead of "shift-tab" and friends, hence get rid
      of KEY_BTAB and use KEY_M_SHIFT | '\t' instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 11:41:58 +04:00
Egmont Koblinger
8f35c90b94 Ticket #2661: support enable bracketed paste of xterm.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 11:41:58 +04:00
Slava Zanko
0b0f7e3975 Refactoring: use define DEFAULT_CHARSET for "ASCII" charset.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-09-21 13:35:59 +04:00
Andrew Borodin
941a1eac1d Search: better support of --disable-charset
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-21 13:35:56 +04:00
Andrew Borodin
66da276200 Ticket 3069: fix of case-sensitive search
...if file encoding and locale are different.

Example: locale is KOI8-R, file encoding is UTF-8. Note: those encodings
are not same.

File content is following (in Russian):

йцукен
Йцукен

The difference is in first line char only: Й (lowercase letter) and й
(uppercase letter).  The search of Ê gives the result Й independently of
case sensitivity. й isn't found.
If switch "All charsets" on, nothing is found.

The main idea of fix is modification of search API to allow set of search
pattern charset and use if within search engine.
Old API:
mc_search_new (pattern, pattern_len);
New API:
mc_search_new (pattern, pattern_len, pattern_charset);

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-21 13:35:31 +04:00
Slava Zanko
8a28d3bac4 Rename type file_entry to the file_entry_t.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-09-19 16:22:30 +04:00
Andrew Borodin
511850e52b (hline_callback): fix of MSG_INIT and MSG_RESIZE messages handling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-02 21:58:45 +04:00
Andrew Borodin
b451e8d13d (menubar_new): add 3rd 'visible' argument.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-08-02 21:58:45 +04:00
Andrew Borodin
f9eed1fcef Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:15:29 +04:00
Veres Lajos
dfbb2c9430 Typo fixes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:15:24 +04:00
Slava Zanko
857fe38e87 Fix panel recoding
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-07-23 14:15:24 +04:00
Andrew Borodin
9e5d51df95 Ticket #3043: broken NCurses detection.
HAVE_NCURSESW_CURSES_H included the wrong header.

Partially revert 80c8d58003
for lib/tty/tty-ncurses.h.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:15:24 +04:00
Andrew Borodin
ab3f53fbbe Add DIR_IS_DOT and DIR_IS_DOTDOT macros
...to detect "." and ".." directories, respectively.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:15:24 +04:00
Andrew Borodin
17aef88637 lib/strutil/strutilutf8.c: cosmetics and minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:01:05 +04:00
Andrew Borodin
7ee58f73ff lib/strutil/strutil8bit.c: cosmetics and minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:01:05 +04:00
Andrew Borodin
9e4d279885 lib/strutil/strutilascii.c: cosmetics and minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:01:05 +04:00
Andrew Borodin
5b91108b3c lib/strutil/strutil.c: cosmetics and minor refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:01:05 +04:00
Slava Zanko
0013adeeba Ticket #2992: mc fails to link when system lib does not contain strverscmp
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-07-09 13:44:51 +03:00
Amadeusz Sławiński
33c47b5734 Ticket #3025: race condition when creating temporary directory.
When there's no mc-tmpdir and a user tries to start two mc sessions
simultaneously, sometimes (in one out of ten attempts on my machine) one
mc session emits the following error message:

Cannot create temporary directory /tmp/mc-lars: File exists (17)
Temporary files will be created in /tmp
Press any key to continue...

Steps to reproduce:

# rm /tmp/mc-$(whoami) -rf
# uxterm -e mc & uxterm -e mc

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-05 20:58:41 +04:00
Andrew Borodin
ccf82ada12 Add functions to transform string to unsigned integer:
* (xstrtoumax): from gnulib.
 * (parse_integer): from coreutils (dd.c).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-05 09:09:03 +04:00
Andrew Borodin
de2a934b37 lib/search/search.c: cosmetics.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 13:20:08 +04:00
Andrew Borodin
4f16d7e8f0 Ticket #3026: Find File: "All charsets" options don't work.
(mc_search_prepare): use cp_display not cp_source to convert text to all
available charsets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 13:20:08 +04:00
Andrew Borodin
48abe8735f Rename functions:
init_widget -> widget_init
create_dlg -> dlg_create
init_dlg -> dlg_init
run_dlg -> dlg_run
destroy_dlg -> dlg_destroy

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin
0adf569b54 (dlg_overlap): rename to widget_overlapped()
...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin
c7da120588 (dlg_replace_widget): rename to widget_replace()
...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00
Andrew Borodin
1672fa44dd (dlg_widget_active): rename to widget_is_active()
...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:17 +04:00