Commit Graph

1108 Commits

Author SHA1 Message Date
Egmont Koblinger
976c18557e Ticket #3178: fix update of command line colors on skin change.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-27 16:41:02 +04:00
Egmont Koblinger
5b243eb9ea (dlg_set_size): clarify comment and hangling of DLG_TRYUP flag.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-24 16:20:41 +04:00
Andrew Borodin
be6b3889af Ticket #3173: fix location of popup windows upon screen resize.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-24 16:20:40 +04:00
Egmont Koblinger
a9d02894a1 Ticket #3180: remove DFF_FOLDER_COLOR. It's unused.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-16 17:14:54 +04:00
Egmont Koblinger
5943929956 Ticket #3183: diffviewer line drawing fix.
The "topmiddle" and "bottommiddle" characters are defined incorrectly
in many skins. This is because the correct definition wouldn't work
with S-Lang build. The only place these characters are used is the
diffviewer if either the +/- signs or the line numbers are shown,
enabled by pressing S or L. The correct definition of these characters
currently show up as 'v' and 'w' characters.

The fix makes the diffviewer use tty_print_alt_char() as it is being used
in other parts of the code, and hence it fixes the bug.
It also fixes the skin definitions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-03-16 17:02:46 +04:00
Andrew Borodin
e5203cb023 Fix name of FSF in all *.c files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-28 13:33:17 +04:00
Andrew Borodin
43bf10b170 Ticket #3167: copyright issues.
lib/strutil/xstrtol.c: restore copyright line.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-28 13:33:16 +04:00
Gergely Szász
2b6e440597 Ticket #3172: WListbox: fix of add item to the empty list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-18 09:42:15 +04:00
Andrew Borodin
bf474e1241 Ticket #2165: basic version of the user-friendly skin selector.
Thanks Egmont Koblinger and Vitaliy Filippov for original patches.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-11 15:13:09 +04:00
Andrew Borodin
30ca8efd7c From ticket #3116: attempt to fix segfault while passing messages to widgets.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Eugene San (eugenesan)
198334ccc4 From ticket #3116: fix possible segfault when freeing a VFS.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin
5e7e9ddf32 Ticket #3151: lib/global.h: remove declaration of refresh_screen().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin
f0da49345a Collapse list of copyright years to ranges. Add 2014 year.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin
d8b58c84be Ticket #3134: fix some inconsistencies in "Learn keys" UI.
Reorder keys in "Learn key" window in accordance with the order
of keys on regular keyboards.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:26:18 +04:00
Andrew Borodin
094fd0cd89 Use symbolic names for standard file descriptors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:26:17 +04:00
Andrew Borodin
62e1606106 Fix segfault in directory hotlist.
(listbox_get_current): check parameter value before use it's member.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-01-22 13:59:54 +04:00
Andrew Borodin
7df67031a2 Refactoring of WListbox widget.
Use GQueue instead of GList to store listbox entries.

g_list_append() function is slow because it uses g_list_last()
internally to traverse from the beginning to the end of a list, so
forming a list of results has O(n*n) complexity instead of O(n).
GQueue contains pointers to head and tail of list and list length.
So in this case we don't need seach end of list every time when we
want append listbox entry to the listbox.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-01-14 14:13:38 +04:00
Egmont Koblinger
7866bf7342 Ticket #3093: keep symlinks in cwd at startup.
If you navigate in your shell to a directory containing symlinks and
then start mc, mc will show the canonical path instead. It would be nice
to make it show the directory with the symlinks.

Example: in your shell execute these:

user:~$ mkdir -p /tmp/a/b /tmp/x ; ln -s /tmp/a/b /tmp/x/y
user:~$ cd /tmp/x/y
user:/tmp/x/y$ mc

In mc you'll find yourself in /tmp/a/b, though it'd be nicer to see
/tmp/x/y at the top, and correspondingly navigating to the parent would
take you to /tmp/x.

If you start bash or zsh from /tmp/x/y, the new instance will start
displaying the working directory as such. They do this via the PWD env
variable. On one hand, they set and maintain PWD to point to the current
directory, using the path as specified by the user (possibly containing
symbolic links). On the other hand, they check its value at startup. If
$PWD points to the same physical directory as the actual working
directory then they use this value. If $PWD points somewhere else then
it's simply ignored (so it's a hint only as to which symlinks to use to
get to the working directory, but never alters the actual cwd).

Now mc also does the same at startup (with respect of "Cd follows
links" option). Relative directories specified in the command line  are
applied after possibly replacing the canonical cwd with $PWD. This way
for example

user:/tmp/x/y$ mc . ..

opens two panels in /tmp/x/y and /tmp/x instead of /tmp/a/b and /tmp/a
(whereas /tmp/x is actually a different directory than /tmp/a).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-12-27 19:07:58 +04:00
Andrew Borodin
d870aedad1 Ticket #3114: fix broken build with NCurses.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-12-04 15:14:07 +04:00
Andrew Borodin
14973bfe79 Use AC_HEADER_MAJOR.
Instead of checking for sys/mkdev.h headerfile, there is the
AC_HEADER_MAJOR helper for how to get major(), minor(), makedev().

Sinc with GLib efb1701bf3baf6f5b05fd1a7a5a4ff990a7dc460.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Andrew Borodin
bb65b46790 Fix use of uninitialized memory in sigaction structure.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Andrew Borodin
377807c5de Fix search in internal viewer in case of nroff mode.
(mc_search__run_regex): fix conditions.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Andrew Borodin
29f6dd2a84 Use g_list_free_full().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Andrew Borodin
90dc6fffac Use g_slist_free_full().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Slava Zanko
0ed4a91d7d Reduce cppcheck warnings (style) in lib subdirectory.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
0d489acd58 cppcheck: reduce variable scope.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
a3b8a2f005 Use UTF8_CHAR_LEN instead of a magic number
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
bd69b8dd31 Suppress cppcheck errors
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko
a57d45d590 Ticket #3098: vfs_path_from_str_flags() doesn't support VPF_STRIP_HOME
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-08 16:57:42 +03:00
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