* view.c (view_labels): Simplified the code that decides whether

the user can switch to hexedit mode.
This commit is contained in:
Roland Illig 2005-05-21 10:34:16 +00:00
parent 0659621de4
commit 9eadb2ada4
2 changed files with 9 additions and 9 deletions

View File

@ -7,6 +7,8 @@
only apply to text mode. Renamed dpy_text_start_col to
dpy_text_column. Renamed edit_cursor to hex_cursor, as it is
used in hexview mode, too.
* view.c (view_labels): Simplified the code that decides whether
the user can switch to hexedit mode.
2005-05-20 Pavel Roskin <proski@gnu.org>

View File

@ -2230,16 +2230,14 @@ view_labels (WView *view)
my_define (h, 6, view->hex_mode ? _("Save") : _("RxSrch"),
regexp_search_cmd, view);
if (view->hex_mode)
if (view->hexedit_mode)
if (view->hex_mode) {
if (view->hexedit_mode) {
my_define (h, 2, _("View"), toggle_hexedit_mode, view);
else {
/* FIXME: add new function view_datasource_is_editable() */
/* FIXME: why is editing in panel mode disabled? */
if (view->growbuf_in_use || view_is_in_panel (view))
my_define (h, 2, "", NULL, view);
else
my_define (h, 2, _("Edit"), toggle_hexedit_mode, view);
} else if (view->datasource == DS_FILE) {
my_define (h, 2, _("Edit"), toggle_hexedit_mode, view);
} else {
my_define (h, 2, "", NULL, view);
}
} else
my_define (h, 2, view->text_wrap_mode ? _("UnWrap") : _("Wrap"),
toggle_wrap_mode, view);