Commit Graph

344 Commits

Author SHA1 Message Date
Roland Illig
132ee7a361 Fixed indentation. 2005-08-29 09:05:24 +00:00
Roland Illig
2a0f1a1cd0 * view.c: Converted to use the new tty functions. 2005-08-29 08:53: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
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
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
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
b973c398dc * view.c (view_toggle_ruler): Don't mix enums with ints. 2005-08-15 21:59:08 +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
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