mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
added new parameter mcview_eof into ini-file
if mcview_eof defined show mcview_eof as EOF Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
parent
8e68c5614a
commit
1eeffc2803
@ -241,6 +241,7 @@ static const struct {
|
||||
#ifdef USE_INTERNAL_EDIT
|
||||
{ "editor_backup_extension", &option_backup_ext, "~" },
|
||||
#endif
|
||||
{ "mcview_eof", &mcview_show_eof, "" },
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -71,6 +71,8 @@ int mcview_max_dirt_limit = 10;
|
||||
/* Scrolling is done in pages or line increments */
|
||||
int mcview_mouse_move_pages = 1;
|
||||
|
||||
/* end of file will be showen from mcview_show_eof */
|
||||
char *mcview_show_eof = NULL;
|
||||
|
||||
/*** file scope macro definitions ****************************************************************/
|
||||
|
||||
|
@ -28,6 +28,7 @@ extern int mcview_remember_file_position;
|
||||
extern int mcview_max_dirt_limit;
|
||||
|
||||
extern int mcview_mouse_move_pages;
|
||||
extern char *mcview_show_eof;
|
||||
|
||||
/*** declarations of public functions **********************************/
|
||||
|
||||
|
@ -46,6 +46,7 @@
|
||||
#include "../src/main.h"
|
||||
#include "../src/charsets.h"
|
||||
#include "../src/util.h" /* is_printable() */
|
||||
#include "mcviewer.h" /* mcview_show_eof */
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
@ -74,6 +75,7 @@ mcview_display_text (mcview_t * view)
|
||||
off_t from;
|
||||
int cw = 1;
|
||||
int c, prev_ch = 0;
|
||||
gboolean last_row = TRUE;
|
||||
struct hexedit_change_node *curr = view->change_list;
|
||||
|
||||
mcview_display_clean (view);
|
||||
@ -102,6 +104,7 @@ mcview_display_text (mcview_t * view)
|
||||
if (!mcview_get_byte (view, from, &c))
|
||||
break;
|
||||
|
||||
last_row = FALSE;
|
||||
from++;
|
||||
if (cw > 1)
|
||||
from += cw - 1;
|
||||
@ -177,6 +180,15 @@ mcview_display_text (mcview_t * view)
|
||||
}
|
||||
|
||||
view->dpy_end = from;
|
||||
if (mcview_show_eof != NULL && mcview_show_eof[0] != '\0') {
|
||||
if (last_row && mcview_get_byte (view, from - 1, &c))
|
||||
if (c != '\n')
|
||||
row--;
|
||||
while (++row < height) {
|
||||
widget_move (view, top + row, left);
|
||||
tty_print_string (mcview_show_eof);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user