Commit Graph

319 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
a041ed48a9 Removed unused local variable. 2005-07-05 20:31:18 +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
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
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
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
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