Commit Graph

2666 Commits

Author SHA1 Message Date
Pavel Tsekov
b0ced33741 * edit/editcmd.c: Do not set the field histname' of QuickWidget' unless
the widget is of type `quick_input'.
* src/boxes.c: Likewise.
* src/filegui.c: Likewise.
* src/hotlist.c: Likewise.
2006-01-30 09:22:33 +00:00
Roland Illig
3f581584d5 * view.c (view_display_hex): Bug fix: The list iterator from the
bytes that have been changed in the hex editor must be advanced
	even if the cursor is currently on a changed byte.
2006-01-30 03:50:51 +00:00
Pavel Tsekov
04000dcf84 * doc/mc.1.in: Update the documentation to reflect the fact that
confirmation may be requested when deleting directory hotlist entries
based on a user configurable setting.
* src/file.h (safe_delete): Move declaration of `safe_delete'
* src/main.h: ... here.
(confirm_directory_hotlist_delete): Declare new global variable.
* src/file.c (safe_delete): Move definition of `safe_delete'
* src/main.c: ... here.
(confirm_directory_hotlist_delete): Define new global variable.
* src/hotlist.c (remove_from_hotlist): Based on a user configurable
setting, request confirmation when removing directory hotlist
entries. The confirmation dialog honours the `Safe delete'
setting.
Reorder the buttons in the hotlist group removal confirmation
dialog so that it becomes consistent with other confirmation
boxes.
* src/setup.c (int_options): Add support for user configurable
confirmation of directory hotlist entries removal.
* src/boxes.c (conf_widgets): Likewise.
(confirm_box): Likewise.
(my_directory_hotlist_delete): New module variable.
2006-01-29 20:26:05 +00:00
Pavel Tsekov
d05ad82ea6 * dir.c (do_sort): Do not try to reorder the entries so that ".." becomes
the first entry.
(do_load_dir): When filling the list of directory entriesmake sure that
".." occupies the first element.
(do_reload_dir): Likewise.
2006-01-29 11:23:36 +00:00
Pavel Tsekov
b3fa1f0a3e * src/cmd.c: When invoking external viewer, probe VIEWER environment
variable first, then PAGER, then fall back to "view".
* lib/mc.hint: Mention VIEWER environment variable.
* doc/mc.1.in: Document support for VIEWER environment variable.
2006-01-29 10:41:47 +00:00
Roland Illig
28f0a4ab24 Patch provided in #10557. Fixes #10557. 2006-01-28 09:27:11 +00:00
Roland Illig
cbf2c616ff * cmd.c (toggle_listing_cmd): Included the brief listing mode in
the list of listing modes that can be switched through using
	Alt-t.
2006-01-28 09:21:55 +00:00
Roland Illig
8f683b9789 Oops, we're already in the year 2006. 2006-01-28 00:24:57 +00:00
Roland Illig
282371e33b Rewrote the code so that it does what I intended it to do. 2006-01-28 00:23:55 +00:00
Roland Illig
e3fb94363e * Makefile.am, logging.h, logging.c: Added a new logging module
to allow easy tracing of function calls and other events. It is
	only intended for debugging.
2006-01-27 23:48:49 +00:00
Roland Illig
015ebfc2fe * Makefile.am: cons.saver is installed in $(pkglibexecdir), not
in $(pkglibdir), to conform to the usual directory hierarchy
	standards. Fixes #2796.
2006-01-27 21:53:50 +00:00
Pavel Tsekov
78535f6b60 * file.c (copy_file_file): In 'Reget' mode take into account
the partially retrieved data when drawing the progress bar.
From Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
2006-01-24 14:07:07 +00:00
Andrew V. Samoilov
ee404fbebe * subshell.c: restart write() calls interrupted by sigchld which lead
to some bytes being swallowed from the subshell's output.
2006-01-23 18:55:36 +00:00
Roland Illig
adc2d181c7 * view.c: Replaced calls to printw() with tty_printf() to get
rid of the str_unconst() function.
2006-01-07 18:17:27 +00:00
Roland Illig
58337baa8d White-space and indentation fixes. Rewrote the expressions for the
*_PRESSED constants to emphasize they are in fact bit masks.
2006-01-07 12:49:08 +00:00
Roland Illig
63a504ffed It was not Redhat who changed the SLang API of SLsmg_write_char, but
actually Debian. Redhat only copied that code.
2006-01-07 12:17:07 +00:00
Pavel Roskin
dd8b442df5 * global.h [!ENABLE_NLS]: Provide replacement for ngettext.
* screen.c (display_mini_info): Cast panel->total to unsigned
long before passing it to ngettext() to avoid warnings.
2005-11-11 03:32:39 +00:00
Pavel Roskin
7b3b03f9db * glibcompat.c: Move Q_ back ...
* util.c: ... here.  Q_ is not defined by just including glib.h.
The glib implementation doesn't strip prefix from translations,
so it's not suitable for us.  Finally, it makes man2hlp depend
on libintl.
Reported by Leonard den Ottolander <leonard@den.ottolander.nl>
2005-11-03 02:18:38 +00:00
Leonard den Ottolander
894b343f90 * main.c (directory_history_add): Fix invalid directory preselection on cd. 2005-11-02 11:50:51 +00:00
Pavel Roskin
da6ee30252 * man2hlp.c (main): Fix using 0 instead of NULL. 2005-10-08 04:55:06 +00:00
Pavel Roskin
528e392458 * widget.c (listbox_fwd): Eliminate forward inline declaration. 2005-10-08 04:52:42 +00:00
Leonard den Ottolander
79567ed4a1 view.c (search): Fix backward regex search off by one. 2005-10-04 21:07:20 +00:00
Pavel Roskin
01f571f1d2 * util.c (gettext_ui): Rename to Q_() for glib compatibility,
move ...
* glibcompat.c: ... here.  Adjust all callers.
2005-10-04 15:20:10 +00:00
Pavel Roskin
0f46bb2632 * screen.c (display_mini_info): Use ngettext(). 2005-10-03 23:37:51 +00:00
Leonard den Ottolander
9ac5ed8d4e * key.c (xmouse_get_event): Catch GPM_DRAG event.
* mouse.c (enable_mouse, disable_mouse): Update printed escape sequence.
2005-09-28 17:21:53 +00:00
Leonard den Ottolander
a621fb9b67 * execute.c (do_execute): Flush stdout after printing the command to be
executed.
2005-09-17 12:08:19 +00:00
Leonard den Ottolander
13d8512c37 * util.c: Indentation cleanup (function result types on different lines
then function names).
2005-09-17 12:01:04 +00:00
Leonard den Ottolander
2319ac0f7b * file.c (make_symlink): Fix off by one in symlink creation. 2005-09-17 11:45:13 +00:00
Leonard den Ottolander
b2952be541 * util.c (diff_two_paths): Abort when second symlink can't be resolved
(fixes segfault).
2005-09-17 11:40:31 +00:00
Roland Illig
06f4ef50e6 option_backup_ext is only available when the internal editor is enabled. 2005-09-07 10:08:25 +00:00
Roland Illig
cd8cf54cbb * setup.c: Replaced the editor_option_backup_ext_int hack with a
string configuration variable, which allows the backup extension
	to have more than just four characters. Added generic support
	for string options.
2005-09-07 08:55:31 +00:00
Roland Illig
4df8fde197 * util.h: Added get_config_string() and set_config_string(),
which are analogous to get_int() and set_int().
	* util.c: Likewise.
2005-09-07 08:47:22 +00:00
Roland Illig
fa0d732112 * setup.c: Renamed options[] to int_options[]. 2005-09-07 07:55:15 +00:00
Roland Illig
689ee9f8ae * main.c (midnight_callback): Ctrl-space calculates the size of
the currently selected directory entry. This is mostly useful for
	directories.
2005-09-06 11:38:45 +00:00
Roland Illig
0e218318da * cmd.c: Added single_dirsize_cmd(), which computes the size of
the currently selected panel entry and moves down. Suggested by
	ForestCreature on mc-devel.
	* cmd.h: Likewise.
	* main.c (midnight_callback): When the space key is pressed and
	the command line is empty, single_dirsize_cmd() is called.
2005-09-06 06:41:35 +00:00
Roland Illig
2d64b1c884 Replaced const_cast with str_unconst. Removed unused mvaddstr. 2005-09-05 03:22:04 +00:00
Roland Illig
4486c5eec2 Replaced const_cast with str_unconst. 2005-09-05 03:20:53 +00:00
Roland Illig
500136d789 Removed unnecessary const_cast. 2005-09-05 03:20:27 +00:00
Roland Illig
16bb1e8eaa * tty.c: Don't use SLsmg_write_char, because Redhat provides a
different API to that function when the preprocessor symbol UTF8
	is defined.
2005-09-05 03:05:39 +00:00
Roland Illig
ad9acbde44 Moved printwstr() from src/slint.c to edit/editdraw.c. 2005-09-05 02:14:29 +00:00
Roland Illig
03759c8f34 * main.h: Added const qualifier to the global prompt variable.
* main.c: Likewise.
2005-09-05 02:10:48 +00:00
Roland Illig
1a0fad0d01 * main.h: Added const qualifier to the global prompt variable.
* main.c: Likewise.
2005-09-05 02:10:47 +00:00
Roland Illig
fed479813e Added const qualifier. 2005-09-05 02:04:23 +00:00
Roland Illig
14e619d39e Switched from printw() to tty_printf() to avoid gcc
warnings. st_ctime is not the creation time, but the status
	change time.
2005-09-05 01:36:58 +00:00
Roland Illig
1c1f2f5210 Switched from printw() to tty_printf() to avoid gcc
warnings. st_ctime is not the creation time, but the status
	change time.
2005-09-05 01:36:57 +00:00
Roland Illig
bb2feb9e7f * info.c: Switched from printw() to tty_printf() to avoid gcc
warnings. st_ctime is not the creation time, but the status
	change time.
2005-09-05 01:34:25 +00:00
Roland Illig
1efcbd27a7 * widget.c: Reduced the number of gcc warnings by using
tty_printf() instead of printw().
2005-09-04 22:04:32 +00:00
Roland Illig
612f1555eb * tty.h: Added tty_printf().
* tty.c: Likewise.
2005-09-04 22:02:25 +00:00
Roland Illig
6bbcb8ef76 Added a comment to ecs_strbox concerning characters with other width
than 1.
2005-09-04 16:34:36 +00:00
Roland Illig
e7917badfa * main.h: Removed unused variables acs_hline and acs_vline. 2005-09-04 16:32:09 +00:00
Roland Illig
26ffecfc09 * treestore.c (str_common): Don't require the arguments to be
different.
2005-09-01 20:56:10 +00:00
Roland Illig
49448bfa43 * view.c (view_fix_cursor_position): Renamed to
view_scroll_to_cursor.
2005-09-01 20:49:17 +00:00
Roland Illig
9fe9ad92a1 Reformatted the comments. 2005-09-01 17:06:38 +00:00
Roland Illig
7b95eee94a Added a comment that the user is responsible for not overflowing the
screen.
2005-09-01 17:04:05 +00:00
Roland Illig
f901a3549c Added line breaks before the function names. 2005-09-01 17:01:12 +00:00
Roland Illig
c3ba638d43 * myslang.h: Partly switched to the new tty functions. 2005-08-29 10:02:35 +00:00
Roland Illig
f85a7d8275 Removed unused variable. 2005-08-29 09:40:58 +00:00
Roland Illig
af781d96f8 Added tty.c. 2005-08-29 09:36:32 +00:00
Roland Illig
ab3005ff93 Added a type conversion to view_growbuf_read_until to suppress a gcc
warning. Instead of treating various expressions as booleans, compare
them with a 0 of appropriate type.
2005-08-29 09:34:43 +00:00
Roland Illig
0c4c461433 The got_interrupt function from tty.c is defined for ncurses, too. 2005-08-29 09:30:45 +00:00
Roland Illig
132ee7a361 Fixed indentation. 2005-08-29 09:05:24 +00:00
Roland Illig
e223667dc3 Removed trailing white-space. 2005-08-29 09:04:39 +00:00
Roland Illig
a1bf93f138 Changed the prototypes of tty_print_hline and tty_print_vline. 2005-08-29 09:03:10 +00:00
Roland Illig
2a0f1a1cd0 * view.c: Converted to use the new tty functions. 2005-08-29 08:53:28 +00:00
Roland Illig
66332a4fb1 * slint.c: The handling of user interrupts has been moved to ...
* tty.c: ... this newly created file, which contains a simple,
	not yet complete interface to the terminal library. It should be
	used instead of depending directly on ncurses or SLang features.
	* tty.h: Added the new function prototypes from tty.c and some
	legacy definitions.
2005-08-29 08:45:28 +00:00
Roland Illig
f1452c9580 * view.c (view_new): Separated the mode toggling functions from
updating the display. The non-updating functions are called on
	initialization.
2005-08-28 20:38:53 +00:00
Roland Illig
1d7b05f8f2 * view.c (view_hexedit_save_changes): Added an assertion that
view->filename be not NULL.
	* view.c (view_toggle_magic_mode): Check if filename != NULL
	before dereferencing the pointer.
	* view.c (view_change_nroff_mode_cmd): Renamed to
	view_toggle_nroff_mode_cmd.
	* view.c (view_new): Don't initialize the various view->mode
	variables by now. This needs to be done correctly.
2005-08-28 19:10:00 +00:00
Leonard den Ottolander
1d1af1d099 view.c (view_normal_search_cmd): Initialize exp to avoid freeing of
uninitialized pointer on cancel.
2005-08-27 11:35:03 +00:00
Leonard den Ottolander
81d7ee4f51 * key.c (xmouse_get_event): Disable double-click tracking for mouse wheel
events.
2005-08-25 20:36:40 +00:00
Roland Illig
55da46b128 * view.c (view_moveto_top): Simplified the code. 2005-08-22 19:19:51 +00:00
Roland Illig
de058c5488 * view.c (view_display_status): In normal display mode (that is:
not search progress), calculate the percentage based on dpy_end
	instead of dpy_start. This avoids a sudden break to 100 % when
	approaching the end of file.
2005-08-22 18:36:51 +00:00
Roland Illig
21640f491d * view.c (struct WView): Renamed dpy_topleft to dpy_start, as it
does not always represent the top-left corner of the screen.
	Replaced dpy_complete with dpy_end, the offset of the first byte
	after the displayed region.
2005-08-22 18:31:51 +00:00
Roland Illig
c0f14a906d * view.c: The search string is managed by the WView, not as
static variable in some functions.
2005-08-21 12:33:21 +00:00
Roland Illig
7abfd54b97 * view.c (free_change_list): Renamed to
view_hexedit_free_change_list.
2005-08-21 12:04:20 +00:00
Roland Illig
135ce37fef * view.c (view_done): Reordered the statements in the
destructor and added paragraph comments.
2005-08-21 11:57:45 +00:00
Roland Illig
2081f5f9fa * fileloc.h: Newly added this file, which provides a place where
all names of user specific configuration files are listed.
2005-08-21 04:00:43 +00:00
Roland Illig
03bdc998ca * view.h: Rewrote it. All functions are preceded by a describing
comment and the "extern" keyword.
2005-08-21 03:32:17 +00:00
Roland Illig
0d4be87ff8 * view.c: Added section headers. The functions are still
somewhat unordered. Renamed some functions to fit into the
	view_*_cmd naming convention.
2005-08-19 19:32:02 +00:00
Roland Illig
6baf73cfd9 Removed the rant from my commit message to make Pavel Tsekov happy. 2005-08-19 13:42:59 +00:00
Roland Illig
99f3df1591 * screen.c (string_file_name): Increased the buffer size to
MC_MAXPATHLEN + 1 bytes to avoid filename truncation.
2005-08-18 04:40:45 +00:00
Roland Illig
541c12241f * view.c (struct WView): Renamed found_len to search_length. 2005-08-18 04:11:52 +00:00
Roland Illig
0601d83324 * view.c (view_display_text): Removed the (almost) unused
variable boldflag.
2005-08-18 03:50:29 +00:00
Roland Illig
b7cba56d21 * view.c (view_display_hex): Completely rewritten. Now the code
distinguishes several phases (state selection, color selection,
	printing) and does not mix them wildly, as the previous code
	did.
2005-08-18 03:33:33 +00:00
Roland Illig
ba8ba542f0 * view.c (view_move_up): Don't scroll up if it is not necessary.
This fixes an inconsistency noted by Andrej Zebrowski on
	mc-devel.
	* view.c (view_move_down): Do nothing if we're already at the
	end of the file. This makes the cursor movement more consistent
	with the behavior of the <End> key.
	* view.c (regexp_search_cmd): Moved the code to save the changes
	of the hex editor out of this function. Whoever wrote that
	should be blamed for it, but the code has been there since the
	beginning.
2005-08-18 02:26:39 +00:00
Roland Illig
01432587b8 Changed the return type of view_toggle_ruler() to void. 2005-08-16 09:04:29 +00:00
Roland Illig
ad29def0c4 * view.c (view_init_growbuf): Mark the first page full instead
of empty. This saves one condition in view_growbuf_read_until().
2005-08-16 08:59:14 +00:00
Roland Illig
03d2e06c41 Layout change for better readability. 2005-08-16 08:51:55 +00:00
Roland Illig
0deeec756e Added some white-space for better readability. The coordinates of the
status line are computed like the other ones (was implicit before).
2005-08-16 08:47:15 +00:00
Roland Illig
9758c34a82 Added some white-space for better readability. 2005-08-16 08:37:05 +00:00
Roland Illig
c2564e99f6 * view.c (view_place_cursor): Made the call to widget_move()
look like the other calls.
2005-08-16 08:22:07 +00:00
Roland Illig
7b35eaa34d * view.c (view_percent): Fixed coordinate computation. 2005-08-16 08:16:12 +00:00
Roland Illig
d76dc9218b Fixed a typo in a comment. 2005-08-16 08:00:15 +00:00
Roland Illig
ae3c8a324d Don't mix enums with ints. 2005-08-15 22:59:20 +00:00
Roland Illig
08a40c8d17 * screen.c (use_display_format): Removed unused variable. 2005-08-15 22:40:58 +00:00
Roland Illig
5c7a219b36 Don't mix enums with ints. 2005-08-15 22:36:53 +00:00
Roland Illig
4e3e810973 * complete.c: Don't mix enums with ints. 2005-08-15 22:33:20 +00:00
Roland Illig
a94e34c698 * complete.c (fetch_hosts): Removed unused variable. 2005-08-15 22:30:36 +00:00
Roland Illig
b973c398dc * view.c (view_toggle_ruler): Don't mix enums with ints. 2005-08-15 21:59:08 +00:00
Roland Illig
d36a6c6cdb Replaced 0 with LISTBOX_APPEND_AT_END. 2005-08-15 21:46:34 +00:00
Roland Illig
66d059bcdf Replaced 0 with LISTBOX_APPEND_AT_END. 2005-08-15 21:46:34 +00:00
Roland Illig
7152139ad6 * wtools.h: Replaced 0 with LISTBOX_APPEND_AT_END. 2005-08-15 21:44:41 +00:00
Roland Illig
32f6020a0f * dialog.h (struct Dlg_head): Changed the bit fields of length one
from signed int to unsigned int.
2005-08-15 20:30:55 +00:00
Roland Illig
ae815922de view_init: Made the initialization order the same as the order in which the
fields appear in struct WView. Explicitly initialize view->marks[], as they
are used without other initialization.
2005-08-15 18:58:18 +00:00
Roland Illig
6e0a3be319 * view.c (view_ccache_lookup): Rewrote the calculation of the
cache entry. Also don't put entries in the cache when the
	current byte is '\r'.
	* view.c (view_ccache_dump): Extended the output by the offset
	of the next line.
2005-08-15 11:49:30 +00:00
Roland Illig
69e4d3f825 * view.c (toggle_hex_mode): Now the hex cursor is always visible
after switching to hex mode.
2005-08-15 10:22:18 +00:00
Roland Illig
3dd9ec536b * view.c (view_growbuf_read_until): When using mc_read, recover
from interrupted system calls.
2005-08-15 10:04:49 +00:00
Roland Illig
c4da4aecf2 Made the search function interruptible. 2005-08-15 09:55:19 +00:00
Roland Illig
6b874e13aa * view.c (view_growbuf_read_until): On short reads, try to read
one more byte to check whether we're already at the end of file.
	This makes the ">=" disappear earlier.
2005-08-06 18:19:14 +00:00
Roland Illig
725c9f7b34 * textconf.c: Include ecs_char in the list of type
characteristics that are printed.
2005-08-06 16:33:54 +00:00
Roland Illig
070b0dccf2 Use hline() instead of addch() to clear the menubar widget area. 2005-08-05 12:01:47 +00:00
Roland Illig
922043282d * view.h: Renamed view to mc_internal_viewer. This avoids
hundreds of shadowed names in view.c.
2005-07-31 20:29:35 +00:00
Roland Illig
ca0d773797 * view.c: Removed global variable have_fast_cpu. It is not used
anymore.
2005-07-31 20:16:12 +00:00
Roland Illig
1b18865579 * user.c (execute_menu_command): Allow execution on no-exec
filesystems. This fixes Savannah Bug #13832.
2005-07-31 19:29:04 +00:00
Roland Illig
ae2ec0ec2e Added missing #include. 2005-07-31 19:08:18 +00:00
Roland Illig
7bb3bea344 Removed redundant comment. 2005-07-31 18:57:20 +00:00
Roland Illig
16b7d7b60a Added standard file header. 2005-07-31 18:47:12 +00:00
Roland Illig
35a8f2b2a2 * Makefile.am: Added support for extended character sets.
* ecs.h: Support for extended character sets.
	* ecs.c: Likewise.
	* ecs-test.c: Testsuite for ecs.c.
2005-07-31 18:30:43 +00:00
Leonard den Ottolander
772c2600b9 * utilunix.c (mc_tmpdir): Check that tmpdir is correctly initialized. 2005-07-27 15:03:24 +00:00
Leonard den Ottolander
ed1899d211 * src/ChangeLog, edit/ChangeLog: Fix wrong dates on latest entries. 2005-07-24 13:42:28 +00:00
Leonard den Ottolander
f21564b9e6 * edit/choosesyntax.c: Create file. Menu option to override syntax
highlighting.
* edit/Makefile.am: Add choosesyntax.c.
* edit/edit.c (edit_init): Set option_auto_syntax to 1 on every invokation
of the editor.
* edit/edit.h: Pass char*** to edit_load_syntax(). Add parameters for
syntax dialog and override.
* edit/editmenu.c (menu_options): Add menu option to override syntax
hightlighting.
* edit/editoptions.c (edit_options_dialog): Pass option_syntax_type to
edit_load_syntax().
* edit/syntax.c (edit_read_syntax_file): Dynamically allocate and fill
syntax list pnames.
* edit/syntax.c (edit_load_syntax): Use char*** for syntax list.
* src/wtools.h: #include "widget.h" and remove redundant declarations
of Dlg_head and WListbox.
2005-07-24 13:37:58 +00:00
Roland Illig
be3ab1a3e0 * view.c: When saving and loading the file position, use the
full pathname instead of the one passed as argument.
2005-07-23 08:20:58 +00:00
Roland Illig
2bf2f0c38d * util.c (save_file_position): Only save the position if not
at the beginning of the file (1;0).
2005-07-23 08:20:03 +00:00
Roland Illig
df1477f1ec Fixed wrong comparison of the result of iconv(). 2005-07-22 23:21:45 +00:00
Roland Illig
c22e826761 Updated German translation. 2005-07-22 21:16:50 +00:00
Roland Illig
6e318ab041 * help.c: Fixed shadowing warnings from gcc. 2005-07-22 09:29:50 +00:00
Roland Illig
7b0f17ad6a fixed a bug that had been introduced by
me, when replacing Dlg_head * with void *.
2005-07-22 09:01:04 +00:00
Roland Illig
390f69bc30 * help.c: Fixed an invalid memory access, which has been noted
by Vitja Makarov.
2005-07-22 08:41:45 +00:00
Roland Illig
37ffcf9ae7 * ext.c: Fixed a typo which has been noted by Arpad Biro. 2005-07-22 07:27:01 +00:00
Roland Illig
1c8c676c76 * key.c: When the command line option -x is given, enable
additional key sequences that are typical for xterms.
	* main.c: First parse command line arguments, then initialize
	key sequences.
2005-07-20 20:29:08 +00:00
Roland Illig
3abff48000 * util.c: Added gettext_ui(), which translates a string and
strips everything before the first '|' character. This function
	is used to translate special elements of the user interface,
	like ButtonBar labels.
	* util.h: Likewise.
	* view.c: Using the new gettext_ui() function.
2005-07-20 15:39:47 +00:00
Roland Illig
77b5978cf1 Removed unused macros mc_mmap and mc_munmap. 2005-07-18 13:21:50 +00:00
Roland Illig
6d3226c4e7 * util.c: Added ascii_alpha_to_cntrl(), which converts 'x' to
^X. Useful for entering control characters literally.
	* util.h: Likewise.
	* widget.c: Use that function after C-q.
2005-07-18 09:31:37 +00:00
Roland Illig
ace71736b8 * view.c: The viewer can remember the last file position and
restore it, like the editor. This fixes Savannah bug #13734.
	* view.h: Likewise.
	* setup.c: Likewise.
2005-07-18 08:47:45 +00:00
Roland Illig
ecfbe13fa3 AC_CHECK_TYPES([mode_t off_t pid_t socklen_t uid_t nlink_t],,, 2005-07-14 06:31:29 +00:00
Roland Illig
de5d9b1d40 * view.c: Always call display() before close_error_pipe() to make
sure the screen looks nice.
	http://mail.gnome.org/archives/mc-devel/2005-July/msg00194.html
2005-07-13 21:30:28 +00:00
Roland Illig
fae0cabfc6 * view.c (view_hexedit_save_changes): Use the VFS file functions
instead of the native ones. This makes it possible to edit
	remote files using the hex editor.
2005-07-12 07:22:49 +00:00
Roland Illig
c61ea2f1c4 Removed leading underscores from variable names. 2005-07-12 07:01:47 +00:00
Roland Illig
8d475c4c35 * view.c: Added some paragraph comments. Changed some literal
expressions (e.g. 0 => '\0', 0 => NULL). Fixed indentation.
2005-07-12 06:04:38 +00:00
Roland Illig
9f62ed703a Changed three one-line comments to one multi-line comment. 2005-07-11 08:17:38 +00:00
Roland Illig
5d5afede78 (view_display_ruler): Reduced code size by declaring a string literal as
"static". (view_display_hex): Added a FIXME concerning screen overflow.
2005-07-11 08:14:44 +00:00
Roland Illig
8bbf0d25fe * view.c (view_update_bytes_per_line): Use a local variable to
do the computation. Update view->bytes_per_line only once, after
	all computations have finished.
2005-07-11 07:39:04 +00:00
Roland Illig
35b218fc69 (view_move_down): Brought to cursor-normal-form. 2005-07-11 07:26:31 +00:00
Leonard den Ottolander
1bf69bc163 info.c (info_show_info): Properly calculate the length of the line drawn
by hline().
2005-07-10 08:46:54 +00:00
Roland Illig
b8969ae3df * view.c (view_ccache_find): Replaced the linear search with a
binary search. This speeds up the viewer by a factor of 25 for
	large files (> 100 MB).
2005-07-07 22:34:31 +00:00
Roland Illig
ca15b965d6 Added to result-equivalent functions for view_ccache_find_linear_down().
All three work, but view_ccache_find_binary() is the fastest of all. So
the other ones will be removed in the next revision. This revision is
mainly for the records.
2005-07-07 22:30:56 +00:00
Roland Illig
0072aeb2e5 Provided multiple versions of view_ccache_find(), which can be selected by
defining C preprocessor symbols.
2005-07-07 21:46:01 +00:00
Roland Illig
bc446f0cee * dialog.h: Replaced object-like macros with implicit references
to an identifier ``h'' with function-like macros. Adjusted all
	users.
	* dialog.c: Likewise.
	* find.c: Likewise.
	* tree.c: Likewise.
	* widget.c: Likewise.
	* widget.c (widget_selectcolor): New function that selects a
	color among DLG_{HOT_,}{FOCUS,NORMAL}C.
2005-07-07 19:34:55 +00:00
Roland Illig
0c2b595997 * view.c (view_display_text): Fixed handling of tabulators. 2005-07-07 18:38:12 +00:00
Roland Illig
4fc6e727e7 Fixed the special handling of nroff character sequences at the beginning of
the screen. Removed the wrong comment. Only advance behind the backspace
character and display the rest of the nroff sequence.
2005-07-07 18:06:57 +00:00
Roland Illig
4d7a3f6779 * view.c (view_compute_areas, view_percent, view_display_status,
view_display_ruler): Fixed screen overflow bugs.
2005-07-07 17:49:01 +00:00
Roland Illig
bcf9978ee8 * view.c (view_update_bytes_per_line): Fixed integer overflow
bug.
2005-07-07 17:09:59 +00:00
Roland Illig
00fcae9141 * view.c: view_display_status() is called inside display(). 2005-07-07 17:03:25 +00:00
Roland Illig
c4d669162a * view.c (view_status): Renamed to view_display_status(). 2005-07-07 16:59:31 +00:00
Roland Illig
cecafaab0b * view.c (view_compute_areas): Fixed a bug noted by Pavel
Tsekov. The coordinates are now relative to the Widget, as they
	should be.
2005-07-07 16:48:55 +00:00
Roland Illig
338c32c400 Added an assertion to offset_rounddown to make sure that b != 0. 2005-07-06 22:35:17 +00:00
Roland Illig
e3176f640e Use the correct coodinates for displaying the percentage in the status line. 2005-07-06 19:36:59 +00:00
Roland Illig
0785232a60 * view.c: Changed some variables from int to screen_dimen.
Instead of relying on each of the view_display_* functions to
	compute the correct coordinates they are managed using the new
	function view_compute_areas(). In the view_display_* functions,
	all calculations are done 0-based; before, the calculation had
	involved the relative position of the area. Removed "static"
	variables from view_status(). Simplified view_display_clean().
2005-07-06 19:12:25 +00:00
Roland Illig
4150000223 Removed the #include directive for "ecs.h", as this file is not yet in HEAD. 2005-07-06 15:38:43 +00:00
Leonard den Ottolander
674dac483d complete.c: Fix autocompletion for single possible path when "complete
show all" is set.
2005-07-06 11:16:08 +00:00
Roland Illig
148f56adcd * textconf.c: mc --version prints the size of commonly used data
types.
2005-07-05 20:57:38 +00:00
Roland Illig
db1e5ef53c Added an "inline" specifier to str_unconst_inlined. 2005-07-05 20:50:02 +00:00
Roland Illig
a041ed48a9 Removed unused local variable. 2005-07-05 20:31:18 +00:00
Roland Illig
a1db50305e * chmod.c: Changed all references to umode_t into mode_t. 2005-07-05 20:14:15 +00:00
Roland Illig
9f55376746 * view.c (view_load): Don't try to use fcntl() with VFS file
handles. That cannot work.
2005-07-05 19:19:17 +00:00
Roland Illig
e3b7168498 * achown.c: Changed all references to umode_t into mode_t.
* file.c: Likewise.
2005-07-05 18:18:36 +00:00
Roland Illig
96223eace4 Replaced 8 space characters with one tab for indentation. 2005-07-03 15:31:55 +00:00
Roland Illig
aac7b35bfc The value of b is unused in view_set_byte(). 2005-07-03 14:01:25 +00:00
Roland Illig
c3f40d150f * textconf.c: mc --version prints the number of bits of off_t. 2005-07-03 11:37:28 +00:00
Roland Illig
1ee7a7c31f * view.c (view_fix_cursor_position): Fixed a division-by-zero
bug, which had been reported by Dirk Jagdmann and Pavel Tsekov.
	Pavel also tracked down the bug.
2005-07-01 20:48:29 +00:00
Roland Illig
1440266805 Fixed a typo: DS_VFS_FILE => DS_FILE. 2005-06-30 23:16:14 +00:00
Roland Illig
6e5508ef14 * global.h: Don't use MC_ENABLE_DEBUGGING_CODE to decide whether
to enable or disable assertions. Just use the default value.
2005-06-30 23:12:08 +00:00
Roland Illig
7f25b3154b Added some more assertions to check whether bytes_per_line is really != 0. 2005-06-30 22:58:52 +00:00
Roland Illig
1918157719 * view.c (view_growbuf_load_until): Check the datasource in the
right place. (get_byte_growing_buffer): Removed an unnecessary
	assertion. (view_file_load_data): Make sure the right datasource
	is selected. (view_set_byte): This function is only expected to
	be called when datasource == DS_FILE. Removed unused code.
2005-06-30 22:50:30 +00:00
Roland Illig
b27499f6da * ext.c (get_file_type_local): Redirect error messages from
file(1) to /dev/null.
2005-06-28 13:55:33 +00:00
Roland Illig
dfbc2522aa * view.c (display): Splitted up into view_display_hex() and
view_display_text().
2005-06-28 13:21:42 +00:00
Roland Illig
868c55faa6 * view.c (display): Changed return type to void. 2005-06-28 13:02:09 +00:00
Roland Illig
a095bce5ee (do_regexp_search): Removed unnecessary type cast.
(do_normal_search): Likewise.
2005-06-28 12:28:35 +00:00
Roland Illig
6fdbaf90a0 * view.c (normal_search): Replaced with normal_search_cmd(). 2005-06-28 12:25:34 +00:00
Roland Illig
bb8946d3e2 Removed misleading comment for view_load_command_output(). 2005-06-28 12:16:17 +00:00
Roland Illig
9c27d4c71f Removed unused variable. 2005-06-28 12:15:05 +00:00
Roland Illig
48b81cf616 * view.c: Simplified error handling when loading files. 2005-06-28 12:13:37 +00:00
Roland Illig
cf9ca5b46b * view.c: Eliminated the need for function pointer casts. 2005-06-27 23:19:32 +00:00
Roland Illig
00261c30de * view.c: Renamed view_quit to want_to_quit and changed its type
to gboolean.
2005-06-27 22:38:03 +00:00
Roland Illig
fe50acadd4 Some more inline functions ... 2005-06-27 22:36:00 +00:00
Roland Illig
bb142400e1 * view.c: Massive speed-ups by reordering statements and declaring
functions as inline.
2005-06-27 22:11:55 +00:00
Roland Illig
d991a41c9f (coord_cache_entry_less): Another speed-up by declaring the
function as inline.
2005-06-27 21:37:51 +00:00
Roland Illig
1300633147 * view.c (is_nroff_sequence): Reordered the statements to gain
a speed-off of 30 percent on a 10 MB file.
2005-06-27 21:34:36 +00:00
Leonard den Ottolander
f10fe35005 * main.[ch], user.c: Fixed a double free in mc_maybe_editor_or_viewer().
Restructured setup_dummy_mc() and expand_format() accordingly.
2005-06-22 21:38:52 +00:00
Pavel Roskin
d093a4024c * view.c (view_percent): Remove unused variable. 2005-06-21 19:44:28 +00:00
Roland Illig
62d358bdc1 Took my "opinion" out of the ChangeLog message from Jun 14. 2005-06-16 21:19:37 +00:00
Roland Illig
9711666a53 * view.c (view_get_filesize_with_exact): Removed. I didn't like
the name. Replaced with a new function view_may_still_grow().
2005-06-14 14:13:11 +00:00
Roland Illig
c534a510c7 * view.c: Fixed an integer wraparound bug. 2005-06-14 13:34:41 +00:00
Roland Illig
0979ed9626 Changed the name of the multiple-inclusion guard. 2005-06-14 13:14:49 +00:00
Roland Illig
3bac3bdf53 Removed misleading comment. 2005-06-14 13:07:12 +00:00
Roland Illig
6bf747eccf * widget.h (struct WButtonBar): Moved into widget.c.
* widget.c (struct WButtonBar): Moved from widget.h.
	* boxes.c: Don't dereference WButtonBar.
	* help.c: Likewise.
	* layout.c: Likewise.
	* view.c: Likewise.
2005-06-14 13:02:30 +00:00
Roland Illig
468ab7a3cd * widget.c: Added code to handle multiple types of functions for
commands.
	* widget.h: Likewise.
2005-06-14 12:11:38 +00:00
Roland Illig
27ef4ba453 * help.c: Use buttonbar_clear_label().
* tree.c: Likewise.
2005-06-14 11:34:28 +00:00
Roland Illig
160686b6a8 void
buttonbar_clear_label (Dlg_head *h, int idx)
{
    WButtonBar *bb = find_buttonbar (h);

    if (!bb)
	return;

    set_label_text (bb, idx, "");
    bb->labels[idx - 1].tag = BBFUNC_NONE;
}
2005-06-14 11:30:26 +00:00
Roland Illig
9d8e5504e2 * achown.c (advanced_chown_callback): Swapped the arguments of a
recursive function call -- the types didn't match.
2005-06-14 10:26:06 +00:00
Roland Illig
c4c1c12432 * util.h (free_after): Moved to vfs/smbfs.c, as this is the only
place where it is used. This is necessary because the SunPro
	compiler creates external references even for functions that are
	only referred to in unused inline functions.
2005-06-08 00:23:44 +00:00
Leonard den Ottolander
f5dabea2a6 main.c: Also match tabs as empty command. 2005-06-07 20:55:13 +00:00
Roland Illig
6edc2743db * command.c (command_callback): Fixed gcc warning about
incompatible pointer types.
2005-06-07 14:16:19 +00:00
Andrew V. Samoilov
7a0f4c45ef * subshell.c (exit_subshell): Do not blindly perform cleanup. 2005-06-07 09:05:09 +00:00
Roland Illig
b2b0d33105 * view.c (view_move_up): In text wrap mode, don't display parts
of lines that only consist of the (invisible) newline character.
	* view.c (view_move_down): Likewise.
2005-06-07 07:37:00 +00:00
Roland Illig
69879eab1e * view.c (view_ccache_lookup): Replaced the min_nroff_column
variable with a state chart, which makes the code clearer and
	fixes a bug in translating line/column pairs into offsets.
2005-06-07 07:06:48 +00:00
Roland Illig
bb23db86a7 Removed trailing whitespace. 2005-06-05 23:43:49 +00:00
David Martin
5c6b8862ba Localize label. 2005-05-31 09:13:41 +00:00
Leonard den Ottolander
2bba061bf0 * src/boxes.c, vfs/ftpfs.[ch]: Add checkbox to allow passive FTP
over proxy to VFS dialog.
2005-05-29 12:10:08 +00:00
Leonard den Ottolander
3be17f6657 main.c: Fix blocking of panel cd-ing when there are only spaces on the
command line.
2005-05-29 11:54:22 +00:00
Pavel Roskin
1f60f44145 Update postal address of Free Software Foundation. 2005-05-27 03:35:10 +00:00
Roland Illig
ade85a1817 Moved the hexedit functions behind the display management. 2005-05-26 10:40:10 +00:00
Roland Illig
7ee9c2b956 Moved the data source constructors and the descructor into the data
sources section. Created a new section for the growing buffer.
2005-05-26 10:17:38 +00:00
Roland Illig
f4618b1731 Provided an introducing comment to the data sources section. 2005-05-26 10:04:26 +00:00
Roland Illig
745e81ab5f Moved the view_growbuf_filesize(), view_get_filesize_with_exact() and
view_get_filesize() functions into the data sources section.
2005-05-26 09:51:03 +00:00
Roland Illig
a5abbdf9d6 Moved the prototypes of the data source functions into the data source
section. Same for the get_byte_indexed() function.
2005-05-26 09:46:48 +00:00
Roland Illig
01c1faa0f5 Moved view_growbuf_read_until() into the data source section. 2005-05-26 09:34:44 +00:00
Roland Illig
2c68774812 * view.c: Removed unnecessary prototype declarations for the cursor
movement functions.
2005-05-26 09:22:51 +00:00
Roland Illig
608e7b4970 * view.c: Completely rewrote the cursor movement code. Now all
cursor movement functions are based on two functions that
	translate file offsets into line/column pairs and vice versa.
	This change made it possible that the line/column is displayed
	in the status line. The beginning-of-line and end-of-line
	functions now work in text mode, too. Switching from non-wrap to
	wrap mode does not cause the whole file to be loaded.
2005-05-26 09:08:54 +00:00
Roland Illig
d558ddd362 * python.syntax: Added chunk from Savannah bug #7872. This
changes the color for """long strings""" from brown to green and
	adds embedded highlighting for escape sequences.
	* Syntax: Added a comment introducing the file format, based on
	the current implementation in edit/syntax.c. Changed the
	first-line regular expressions of sh, perl, python and ruby to
	also match @SH@, @PERL@, @PYTHON@ and @RUBY@.
	* Syntax: Extended the patterns for #! interpreters to match
	almost everything that looks like the interpreter.
2005-05-26 09:08:54 +00:00
Roland Illig
45355775fe Moved the view_hexview_move_to_eol() function some lines down to make the next patch apply more cleanly. 2005-05-26 09:07:40 +00:00
Roland Illig
0fea1df332 * widget.h: Fixed prototype of input_callback(). 2005-05-24 11:50:12 +00:00
Roland Illig
87759863e3 * widget.c: Fixed all but one casts on function pointers. 2005-05-24 11:48:23 +00:00
Roland Illig
603d2f3dc5 * tree.c: Removed function casts and provided wrappers where
necessary.
2005-05-23 17:07:21 +00:00
Roland Illig
b4dd15e808 * screen.c: Removed function casts. 2005-05-23 16:44:24 +00:00
Roland Illig
a3e822b6ba * menu.c: Removed function casts. 2005-05-23 16:39:52 +00:00
Roland Illig
2a21804cc2 * main.h: Changed the type of quiet_quit_cmd() from int to void.
* main.c: Likewise. Removed function cast.
2005-05-23 16:37:01 +00:00
Roland Illig
c1a5413eef * info.c: Removed function casts. 2005-05-23 16:30:44 +00:00
Roland Illig
512aa8120d * help.c: Removed function casts. 2005-05-23 16:27:33 +00:00
Roland Illig
cbcdeeefbf * fileopctx.c: Removed unnecessary function casts. 2005-05-23 11:30:07 +00:00
Roland Illig
b8438197e1 * filegui.c: Removed unnecessary function casts. 2005-05-23 11:29:03 +00:00
Roland Illig
12641d520f * find.c: Removed a function cast by using the wrapper function
cstrstr().
2005-05-23 11:28:10 +00:00
Roland Illig
caaf0730b6 * util.h: Added const-preserving version of strstr().
* util.c: Likewise.
2005-05-23 11:21:26 +00:00
Roland Illig
de1e263746 * command.c: Removed casts on function pointer types. 2005-05-23 11:17:25 +00:00
Roland Illig
d223460184 * help.c: Fixed the use of check_movement_keys(). This had been
really ugly code, involving casts on incompatible functions.
2005-05-23 10:15:45 +00:00
Pavel Roskin
6b494ddd63 * view.c: Better fix for the gcc 4.0.0 warnings. Fix callees
rather than callers.
2005-05-23 02:03:29 +00:00
Roland Illig
166e1d20de * win.h: Removed a const qualifier from the type movefn, as these
functions typically modify their object.
	* win.c: Likewise.
2005-05-21 10:51:15 +00:00
Roland Illig
9eadb2ada4 * view.c (view_labels): Simplified the code that decides whether
the user can switch to hexedit mode.
2005-05-21 10:34:16 +00:00
Roland Illig
0659621de4 Renamed edit_cursor to hex_cursor, as it is
used in hexview mode, too.
2005-05-21 10:23:57 +00:00
Roland Illig
48fd4667fd Changed some comments. 2005-05-21 10:21:35 +00:00
Roland Illig
4138e2d88b * view.c: Renamed dpy_text_start to dpy_topleft, as it does not
only apply to text mode. Renamed dpy_text_start_col to
	dpy_text_column.
2005-05-21 10:17:35 +00:00
Roland Illig
8aadbba7d3 * view.c: Fixed comment above toggle_hexedit_mode(). 2005-05-21 10:04:03 +00:00
Roland Illig
75691621a6 * view.c: Made the F2 key action much simpler---now it just
toggles between hexview and hexedit mode. Switching between text
	and hex mode can be done with <tab>, as before.
2005-05-21 10:02:09 +00:00
Pavel Roskin
9d44b75ad5 * find.c: Fix warnings reported by gcc 4.0.0.
* mountlist.c: Likewise.
* screen.c: Likewise.
* view.c: Likewise.
2005-05-21 03:26:36 +00:00
Pavel Roskin
9260860bbf * dialog.c (dlg_select_widget): Remove first argument, it's
redundant.  Adjust all callers.
(dlg_replace_widget): Likewise.
2005-05-20 20:22:06 +00:00
Roland Illig
10c2c57663 * charsets.c (translate_character): Fixed checking of the return
value of iconv().
2005-05-11 21:50:36 +00:00
Pavel Roskin
c90d263d2c * .c: Sanitize all calls to functions from ctype.h. Fix gcc 4.0
warnings.
2005-05-11 01:16:58 +00:00
Pavel Roskin
446c06ea0c * file.c: Remove unneeded WANT_WIDGETS.
* layout.c: Likewise.
* setup.c: Likewise.
* view.c: Likewise.
2005-05-10 21:38:40 +00:00
Roland Illig
3bcac235f5 * find.c (find_parameters): Moved around and reordered dialog
items to make their meaning clearer.
2005-05-10 19:30:22 +00:00
Pavel Roskin
a6dd81352b * screen.c (try_to_select): Don't call display_mini_info(), it
will be called later because select_item sets panel->dirty.
This fixes the mini status appearing first after Ctrl-O.
2005-05-03 15:16:57 +00:00
Roland Illig
70f77a1945 * view.c: Changed use of view->text_wrap_mode to reflect its
type, being gboolean. That is, only use boolean operators and
	TRUE/FALSE for assignment. Bug reported by Jindrich Makovicka.
2005-04-27 18:39:21 +00:00
Roland Illig
413ed3236e * global.h: Define NDEBUG (used by assert() depending on
MC_ENABLE_DEBUGGING_CODE).
2005-04-26 19:42:37 +00:00
Roland Illig
2404c633d0 struct view_coord coord;
coord.vc_line = line;
    view_ccache_complete (view, &coord, CCACHE_OFFSET);
    return coord.offset;
2005-04-26 15:06:38 +00:00
Roland Illig
ebbcf8d28a * view.c: Removed inconsistent whitespace. 2005-04-25 08:50:59 +00:00
Roland Illig
b46af7bac6 * view.c (struct WView): Replaced view->last with
view->dpy_complete. The former variable's name didn't match its
	value.
2005-04-25 08:47:22 +00:00
Roland Illig
a34e4b5dde * view.c (offset_type): Adjusted the PRI[dX] constants to be
like the ISO C99 PRI* constants.
2005-04-25 00:26:46 +00:00
Roland Illig
eaa04d2269 * view.c (init_growing_view): Renamed to
view_load_command_output(). Removed dead code. Removed unused
	parameter.
2005-04-24 23:47:27 +00:00
Roland Illig
fa7945759b * view.c (view_move_forward2): Fixed a bug related to the return
value, which had made the down and page-down keys no-ops.
2005-04-24 23:21:05 +00:00
Roland Illig
bbdebd492c * view.c (display): Fixed operator precedence with ?: in hex
display.
2005-04-22 15:26:25 +00:00
Roland Illig
94a7ad1a56 * view.c (view_move_forward2): Added more assertions. Rewrote
condition for breaking out of the loop when upto == 0.
2005-04-22 15:18:14 +00:00
Roland Illig
5b7339a2db * view.c (view_move_forward2): Fixed a bug discovered by
Jindrich Makovicka. The return value did not take into account
	the value of the `upto' parameter.
2005-04-22 15:01:11 +00:00
Roland Illig
92526f4b57 * view.c (display): Extracted the code for drawing the ruler into
its own function, view_display_ruler(). Rewrote it.
2005-04-19 22:33:21 +00:00
Roland Illig
2312d2ce97 * view.c: Replaced const_cast with str_unconst. 2005-04-19 22:16:25 +00:00
Roland Illig
2842c33f11 * view.c (view_move_forward2): Early return if get_byte() returns
-1.
2005-04-19 21:27:03 +00:00
Roland Illig
1c367fbab4 * view.c (view_free_growing_buffer): Renamed to
view_growbuf_free(). Simplified the code.
2005-04-19 20:54:53 +00:00
Roland Illig
f6e6c6e80d * view.c (struct WView): Renamed nib_shift to hexedit_lownibble.
Replaced 0 literals with FALSE.
2005-04-19 20:33:51 +00:00
Roland Illig
008c9ef797 * view.c (view_file_load_data): Removed the requirement for
ds_file_datasize to be a power of two.
2005-04-19 18:36:23 +00:00
Roland Illig
0972491418 * view.c: Small formatting changes. 2005-04-18 21:02:55 +00:00
Roland Illig
25cf80294b * view.c: Fixed a typo. 2005-04-18 20:18:12 +00:00
Roland Illig
26c2f7fc50 * view.c (save_edit_changes): Renamed to
view_hexedit_save_changes().
2005-04-18 20:12:18 +00:00
Roland Illig
f6f90ed34f * view.c (struct WView): Moved the growing buffer variables
between the data source and the display section.
2005-04-18 20:06:16 +00:00
Roland Illig
aae5612581 * view.c (view_set_datasource_string): Removed call to
view_close_datasource() for consistency with the other
	view_set_datasource_*() functions. Adjusted the callers.
2005-04-17 11:40:26 +00:00
Roland Illig
18325716b1 * view.c (display): Renamed frame_shift to left or top, whatever
is more appropriate.
2005-04-17 11:35:31 +00:00
Roland Illig
0dc31ebb6c * view.c (display): Renamed width and height to right and bottom.
The values of the variables aren't really the width and height
	of anything.
2005-04-17 11:21:54 +00:00
Roland Illig
56ea657694 * view.c (display): Simplified the ruler drawing code. 2005-04-17 11:05:42 +00:00
Roland Illig
093f7a679a * ChangeLog: Added the rest of the log message. 2005-04-17 10:15:32 +00:00
Roland Illig
054e617e9b * view.c: Added four functions view_get_top(), view_get_left(),
view_get_bottom(), view_get_right() to mark the bounds of the
	rectangle that can be used for displaying data. Expressed
	view_get_datalines() and view_get_datacolumns() in terms of
	these four functions.
2005-04-17 10:14:18 +00:00
Roland Illig
46a8f2bdc5 * view.c: Corrected some typos and indentation. 2005-04-17 10:02:58 +00:00
Roland Illig
76c3ff06a5 * view.c: Eliminated some ?: operators. 2005-04-17 09:50:38 +00:00
Roland Illig
98240f77bd * view.c (view_load): Changed return type to gboolean. Adjusted
returned values.
	* view.c (view): Rewrote the code a little bit.
	* view.h (view): Rewrote the comment.
2005-04-17 09:35:41 +00:00
Roland Illig
74318e44bb * view.c (save_edit_changes): Changed return type to gboolean.
* view.c (view_ok_to_quit): Changed return type to gboolean.
	Adjusted returned values.
2005-04-17 09:17:58 +00:00
Roland Illig
3c872a532c * view.c (save_edit_changes): Completely rewritten to be robust
on errors. All changed bytes that could not be saved are kept
	in the change list, so that the user can try to save them later.
	* view.c (view_set_byte): Added for save_edit_changes().
	* view.c (display): view_place_cursor() is called after displaying
	in hex mode.
2005-04-17 09:05:42 +00:00
Roland Illig
3cdf8bf168 * view.c (free_change_list): Don't use view->change_list as
scratch variable.
2005-04-16 22:06:53 +00:00
Roland Illig
7456a7c035 * view.c (enqueue_change): Rewrote the function once more, this
time eliminating the redundant variable `curr'. Introduced
	another variable, as it was inappropriate to reuse the `head'
	variable as a list iterator.
2005-04-16 22:01:48 +00:00
Roland Illig
9e5c41008d * view.c (enqueue_change): Combined the while loop with the break.
Fixed an off-by-one-error.
2005-04-16 21:49:48 +00:00
Roland Illig
d2f7ec86c4 * view.c (enqueue_change): Made the algorithm independent of the
memory layout (especially the order) of the fields in struct
	hexedit_change_node.
2005-04-16 21:47:26 +00:00
Roland Illig
0453262b4b * view.c (enqueue_change): Made the algorithm independent of the
memory layout (especially the order) of the fields in struct
	hexedit_change_node.
2005-04-16 21:45:36 +00:00
Roland Illig
2d8721c745 * view.c (display): Removed the call to the empty macros
view_freeze() and view_thaw(). Deleted these macros, as they
	are otherwise unused.
2005-04-16 18:56:58 +00:00
Roland Illig
021e1cb48e * view.c (view_get_datacolumns): Added. Replaced equivalent
expressions to call this function.
	* view.c (display): Fixed a bug introduced with the last change.
2005-04-16 18:53:51 +00:00
Roland Illig
d51fac0d75 * view.c (vwidth, vheight): Replaced these two macros with their
expansion. They looked like variables, which was irritating.
2005-04-16 18:32:09 +00:00
Roland Illig
0384ebe60c * view.c: Added the `byte' type as an alias for unsigned char.
Converted some datasources to using byte as the base type.
	Removed the superfluous type conversions.
2005-04-16 15:13:20 +00:00
Roland Illig
8ce21c781b * view.c (struct WView): Renamed start_display to dpy_text_start.
Fixed one invalid use of bit arithmetics (line 1819).
2005-04-16 14:52:36 +00:00
Roland Illig
dc97c493c5 * view.c (struct WView): Removed start_col. Added
dpy_text_start_col, which has a similar function like start_col,
	but does not have negative values. Added bounds checking for
	dpy_text_start_col. Code cleanup, as usual.
2005-04-16 14:25:52 +00:00
Roland Illig
e4635efd2d * view.c (struct WView): Renamed have_frame to dpy_frame_size.
* view.c (view_is_in_panel): Added.
	* view.c (view_percent): Removed the last parameter, as it has
	always the same value.
	* view.c: Code cleanup.
2005-04-16 13:45:16 +00:00
Roland Illig
e7b7360f79 * view.c (struct WView): Aligned all datasource fields so that they
look more related than before.
2005-04-16 12:56:50 +00:00
Roland Illig
081dd56e8c * layout.c: Followed the renaming of view_init() to view_load().
* view.h: Likewise.
2005-04-14 18:24:02 +00:00
Roland Illig
14a8919772 * util.h (str_unconst): Added a conditional INLINE_STR_UNCONST
that makes str_unconst() an inline function.
2005-04-14 18:16:04 +00:00
Roland Illig
3db06a9dd2 * view.c (struct WView): Renamed ds_file_size to ds_file_filesize,
to avoid confusion with ds_file_datasize.
2005-04-14 11:31:05 +00:00
Roland Illig
b3913aa39f * view.c (struct WView): Renamed growing_buffer to growbuf_in_use,
blocks to growbuf_blocks, block_ptr to growbuf_blockptr.
2005-04-14 11:27:13 +00:00
Roland Illig
a44dbeab65 * view.c (struct WView): Renamed wrap_mode to text_wrap_mode, as
it only applies to the text viewer.
2005-04-14 11:14:42 +00:00
Roland Illig
c2c7cfe647 * view.c (struct WView): Renamed viewer_magic_flag to magic_mode. 2005-04-14 11:12:01 +00:00
Roland Illig
fe6cf255d2 * view.c (struct WView): Moved hexedit_mode into the "Editor
modes" section.
2005-04-14 11:08:25 +00:00
Roland Illig
4dcd4b8da2 * view.c (struct WView): Renamed viewer_nroff_flag to
text_nroff_mode.
2005-04-14 11:06:12 +00:00
Roland Illig
2b41552c06 * view.c (struct WView): Changed the type of hex_mode to gboolean.
Fixed one non-boolean operation in toggle_wrap_mode().
2005-04-14 11:02:21 +00:00
Roland Illig
f468578ff7 * view.c (struct WView): Renamed hexedit_text to hexview_in_text. 2005-04-14 10:59:02 +00:00
Roland Illig
c1860072d7 * view.c (struct WView): Removed the "first" field, as it was
always 0.
2005-04-14 09:18:28 +00:00
Roland Illig
366dc2ce75 * view.c: Removed the "file monitor" feature (tail -f). It has
not been working since at least mc-4.6.0.
2005-04-14 09:09:34 +00:00
Roland Illig
bea9efb0f2 * view.c (view_new): Don't use view_init_growbuf, as this function
also activates it. Rather set view->growing_buffer = FALSE.
2005-04-14 08:35:56 +00:00
Roland Illig
d994002e5f * view.c (struct WView): Removed the view_active field. It was
practically equivalent to view->datasource != DS_NONE.
	* view.c (do_view_init): Renamed to view_load().
	* view.c (view_new): Every field of the WView is initialized
	explicitly.
2005-04-14 08:00:14 +00:00
Roland Illig
502309b4fa * view.c (view_get_datalines): Using the STATUS_LINE constant.
* view.c (display): Using the OFFSETTYPE_PRIX constant to print
	an offset_type in uppercase hex letters.
2005-04-14 00:59:33 +00:00
Roland Illig
d3bf9a489f * view.c (display): Fixed a bug that I introduced some hours ago.
* view.c (view_move_forward2): Rewrote the hexmode algorithm to
	get rid of the ?: operators. Introduced some variables with names
	that better fit their actual use. Fixed a bug that appeared when
	scrolling down by single lines in framed (panel) mode.
2005-04-14 00:43:34 +00:00
Roland Illig
9eff3cef04 * view.c (view_move_forward2): Backed out my last changes. The old
code worked better. :)
2005-04-14 00:18:35 +00:00
Roland Illig
ac03019408 * view.c (view_move_forward2): Added missing declaration. 2005-04-13 22:21:13 +00:00
Roland Illig
e65531ce4e * view.c: Reformatted the header comment. 2005-04-13 22:19:52 +00:00
Roland Illig
0b2f50aad4 * view.c (view_move_forward2): Simplified the code.
* view.c (get_byte_growing_buffer): Added bounds checking.
2005-04-13 22:18:04 +00:00
Roland Illig
ca1fc0467d * view.c (view_handle_editkey): Simplified the code. 2005-04-13 21:34:57 +00:00
Roland Illig
1a26500862 * view.c (struct WView): Removed the last_byte field, because it
got too complex maintaining it together with the new datasource
	framework. The function view_get_filesize() now takes its place.
	Corrected the type of the growing buffer to unsigned char. Added
	a field growbuf_finished to indicate when all data has been read.
	* view.c (view_move_cursor_to_eol): Renamed to
	view_hexview_move_to_eol().
	* view.c (view_get_filesize): Added.
	* view.c (view_get_filesize_with_exact): Added.
	* view.c (get_byte_indexed): get_byte with bounds checking.
	* view.c (view_growbuf_read_until): Closes the datasource after
	reading has finished.
	* view.c (view_percent): The percentage is only shown when its
	exact value can be computed.
	* view.c (view_status): The [grow] field has been removed from
	the status line. Instead, the filesize is reported as ">= n"
	bytes.
	* view.c (count_backspaces): Added a bounds check.
	* view.c (display): Using get_byte_indexed instead of get_byte.
	* view.c (move_forward2): Renamed to view_move_forward2 because
	of the equally-named function in src/help.c. Replaced the
	algorithm for the hexview mode by a much simpler version. Now
	we have 5 ?: operators less than before.
	* view.c (get_bottom_first): Added bounds checking.
	* view.c (move_right): Simplified the code.
	* view.c (goto_addr): Fixed an off-by-one error.
	* view.c (view_close_datasource): For the growing buffer cases,
	check if the datasource has already been closed before.
2005-04-13 21:09:00 +00:00
Roland Illig
a3a1e26210 * util.h (str_unconst): Provide a replacement for the const_cast
macro from global.h.
	* util.c (str_unconst): Likewise.
2005-04-13 18:47:12 +00:00
Roland Illig
293d35daf0 * view.c: Removed mmap(2) support. Now regular files are
accessed using mc_read(). Added a framework for datasources.
	Introduced assertions. Removed some variables (e.g. view->data)
	that were used for many things simultaneously.
2005-04-07 11:23:53 +00:00
Roland Illig
5185abce21 * dialog.h: Removed a comma at the end of an enumeration, because
ANSI does not permit it.
2005-04-07 07:39:09 +00:00
Roland Illig
e64958776a * x11conn.c (x_io_error_handler): Close the X11 connection when
a protocol error occurs. Otherwise the X11 connection is held
	open, which may keep ssh from closing the connection.
2005-04-06 18:04:43 +00:00
Andrew V. Samoilov
28c940b71e Typo fix. 2005-03-29 15:22:33 +00:00
Pavel Roskin
417ca2ab1f * screen.c (chdir_other_panel): When used on a file entry, move
selection on the inactive panel to select the entry for the
current directory on the active panel.
2005-03-29 04:47:16 +00:00
Andrew V. Samoilov
1bee4012b1 * keyxdef.c: Constify struct qnx_key_define_s typedef.
* key.c (get_modifier): Fixed dynamic loading of the Photon library for
        shift keys, only current version of libph used now.
        (qansi_key_defines): Swapped Gray '-' and '+' codes definitions, due to
        fixed bugs in the QNX6's console driver.
2005-03-25 09:38:24 +00:00
Andrew V. Samoilov
a75d81b3c2 * util.c (load_file_position): Fix mcedit position save bug. Read a
number after ';'.
2005-03-23 05:29:06 +00:00
Pavel Roskin
504faf19d4 * key.c (init_key): Load xterm_key_defines for terminals with
names starting with "rxvt".
2005-03-21 20:27:55 +00:00
Pavel Roskin
21cc7b340f * slint.c: Don't use private S-Lang functions if they are
unavailable.
2005-03-19 19:31:23 +00:00
Pavel Roskin
0074c885f2 * acinclude.m4 (MC_WITH_SLANG): Define HAVE_SYSTEM_SLANG after
all fallbacks so it shows whether we are using system S-Lang.
* configure.ac: Remove USE_INCLUDED_SLANG, since it's now fully
dependent on HAVE_SLANG and HAVE_SYSTEM_SLANG.
* src/myslang.h: Likewise.
2005-03-19 17:27:36 +00:00
Pavel Roskin
9bdae2ff7c * screen.c (chdir_other_panel): Prevent changing current
directory.  Remove incorrect comment.
2005-03-17 22:40:11 +00:00
Pavel Roskin
bf653ed2a1 * achown.c (update_permissions): Partly revert recent changes
because they cause infinite recusion.
2005-03-17 22:03:31 +00:00
Roland Illig
13a63f21c9 * x11conn.c: Separated X11 connection handling from key.c. Added
error handling for X11 errors and connection errors.
	* x11conn.h: The interface for x11conn.h.
	* key.c: Now using the x11conn code.
	* Makefile.am: Added x11conn.{h,c}.
2005-03-10 09:44:36 +00:00
Miguel de Icaza
6b14153361 2005-02-26 Miguel de Icaza <miguel@novell.com>
* screen.c (chdir_other_panel): Restored original functionality.

	(sync_other_panel): This is now bound to the key Alt-i, and is the
	functionality that was lost.
2005-02-26 16:39:31 +00:00
Roland Illig
f0f4721309 * unixcompat.h: Only include <sys/sysmacros.h> if we're on AIX,
as Solaris defines the macros twice---once in <sys/mkdev.h>,
	and once in <sys/sysmacros.h>.
2005-02-23 23:49:30 +00:00
Roland Illig
a89e9cce8b * tty.h: Moved the function printwstr to slint.c, because the
SunPro compiler does not eliminate unused inline functions.
	* slint.c: printwstr has been moved to here.
2005-02-23 19:55:06 +00:00
Roland Illig
476927920b * screen.c: Changed the return type of ilog10 to unsigned int
and adjusted some variables in format_device_number.
2005-02-23 19:37:43 +00:00
Roland Illig
da66509191 * unixcompat.h: Added missing parenthesis to the minor() macro. 2005-02-22 03:47:01 +00:00
Roland Illig
ffc41c1faa * treestore.c (str_common): Added a comment that str_common shall
not be called with two equal strings.
2005-02-15 22:16:18 +00:00
Roland Illig
42d2ab10be * info.c (info_show_info): Casted st_mode to unsigned to avoid
compiler warning on Solaris 9 (st_mode is unsigned long there).
2005-02-12 22:28:09 +00:00
Roland Illig
7d1b02caad * unixcompat.h: Typo (show => shown). 2005-02-12 22:16:25 +00:00
Roland Illig
5d55e9b92f * vfs.c (vfs_translate_url): Add support for smb://, sh://,
ssh:// and mc:// filesystem requests. Introduced separate table
	for vfs aliases.
	* util.c (strip_password): Modifications to take the aliases into
	account while eliminating passwords.

	The original patch was extended by Roland Illig.
2005-02-12 14:30:48 +00:00
Roland Illig
0a545794da * screen.c: Reverted my changes from 2005-02-08 (except the
maybe_cd calls) to not confuse the upcoming UTF-8 patches.
2005-02-12 05:14:54 +00:00
Andrew V. Samoilov
663792b91a * glibcompat.c: Add g_strlcat() declaration for glib 1.2.x 2005-02-11 23:38:26 +00:00
Roland Illig
256cce9bb5 * screen.c (string_file_name): Fixed the displaying of long file
names. The bug had been introduced by me on 2005-02-08.
	* screen.c (string_file_nlinks): Likewise.
2005-02-11 19:43:30 +00:00
Roland Illig
6407873f69 * cons.handler.c: Marked unused parameters.
* dir.c: Likewise.
	* find.c: Likewise.
	* help.c: Likewise.
	* layout.c: Likewise.
	* mountlist.c: Likewise.
	* popt.c: Likewise.
	* poptconfig.c: Likewise.
	* popthelp.c: Likewise.
	* regex.c: Likewise.
	* subshell.c: Likewise.
	* tree.c: Likewise.
	* util.c: Likewise.
	* utilunix.c: Likewise.
	* widget.c: Likewise.
	* wtools.c: Likewise.
2005-02-08 22:33:52 +00:00
Roland Illig
f8a7930a1a * screen.c: Marked unused parameters. Updated use of maybe_cd. 2005-02-08 20:12:30 +00:00
Roland Illig
5356ac60d5 * main.c (maybe_cd): Removed unused parameter.
* main.h: Likewise.
2005-02-08 20:09:36 +00:00
Roland Illig
f9d9f92370 * Removed my own experiments. 2005-02-08 19:59:45 +00:00
Roland Illig
d2ee0985fc * dialog.c: Marked unused parameters. Now dlg_broadcast_msg_to
does what the comment above it says.
2005-02-08 18:25:31 +00:00
Roland Illig
c6a72952ac * screen.c (string_file_*): Don't use static buffers.
* screen.c (format_file): Provide a buffer for the string_file_*
	functions.
2005-02-08 12:28:17 +00:00
Roland Illig
f629c91ded * util.h: Added macro str_cmp to allow syntactically nice string
comparison.
2005-02-08 10:46:01 +00:00
Roland Illig
a580664255 * Removed transition support macros. 2005-02-08 09:58:40 +00:00