1
1

Simple statusbar mode for editor.

Full mode:
    TODO [----] 2 L:[ 1+ 0 1/333] *(2 /11838b)= 102 0x066 cp:Other_8_bit

Simple mode:
    TODO [----] 2 1/333 (2 /11838b) 102 0x066 Other_8_bit

    modified:
        * edit/edit.h
        * edit/editdraw.c
        * src/setup.c

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
Этот коммит содержится в:
Mikhail S. Pobolovets 2009-05-28 10:40:54 +03:00
родитель f0182a6969
Коммит 546b30008a
3 изменённых файлов: 44 добавлений и 17 удалений

Просмотреть файл

@ -327,6 +327,8 @@ extern int column_highlighting;
extern int visible_tabs;
extern int visible_tws;
extern int simple_statusbar;
/* File names */
#define EDIT_DIR ".mc" PATH_SEP_STR "cedit"
#define SYNTAX_FILE EDIT_DIR PATH_SEP_STR "Syntax"

Просмотреть файл

@ -68,6 +68,8 @@
#define FONT_PIX_PER_LINE 1
#define FONT_MEAN_WIDTH 1
/* Toggles statusbar draw style */
int simple_statusbar = 0;
static void status_string (WEdit * edit, char *s, int w)
{
@ -107,30 +109,52 @@ static void status_string (WEdit * edit, char *s, int w)
}
/* The field lengths just prevent the status line from shortening too much */
g_snprintf (s, w,
"[%c%c%c%c] %2ld L:[%3ld+%2ld %3ld/%3ld] *(%-4ld/%4ldb)= %s %s",
edit->mark1 != edit->mark2 ? ( column_highlighting ? 'C' : 'B') : '-',
edit->modified ? 'M' : '-',
edit->macro_i < 0 ? '-' : 'R',
edit->overwrite == 0 ? '-' : 'O',
edit->curs_col,
if (simple_statusbar)
g_snprintf (s, w,
"[%c%c%c%c] %2ld %3ld/%3ld (%-4ld/%4ldb)= %s cp:%s",
edit->mark1 != edit->mark2 ? ( column_highlighting ? 'C' : 'B') : '-',
edit->modified ? 'M' : '-',
edit->macro_i < 0 ? '-' : 'R',
edit->overwrite == 0 ? '-' : 'O',
edit->curs_col,
edit->start_line + 1,
edit->curs_row,
edit->curs_line + 1,
edit->total_lines + 1,
edit->curs_line + 1,
edit->total_lines + 1,
edit->curs1,
edit->last_byte,
byte_str,
edit->curs1,
edit->last_byte,
byte_str,
#ifdef HAVE_CHARSET
get_codepage_id ( source_codepage )
get_codepage_id ( source_codepage )
#else
""
""
#endif
);
);
else
g_snprintf (s, w,
"[%c%c%c%c] %2ld L:[%3ld+%2ld %3ld/%3ld] *(%-4ld/%4ldb)= %s %s",
edit->mark1 != edit->mark2 ? ( column_highlighting ? 'C' : 'B') : '-',
edit->modified ? 'M' : '-',
edit->macro_i < 0 ? '-' : 'R',
edit->overwrite == 0 ? '-' : 'O',
edit->curs_col,
edit->start_line + 1,
edit->curs_row,
edit->curs_line + 1,
edit->total_lines + 1,
edit->curs1,
edit->last_byte,
byte_str,
#ifdef HAVE_CHARSET
get_codepage_id ( source_codepage )
#else
""
#endif
);
}
static inline void

Просмотреть файл

@ -227,6 +227,7 @@ static const struct {
{ "editor_visible_tabs", &visible_tabs },
{ "editor_visible_spaces", &visible_tws },
{ "editor_line_state", &option_line_state },
{ "editor_simple_statusbar", &simple_statusbar },
#endif /* USE_INTERNAL_EDIT */
{ "nice_rotating_dash", &nice_rotating_dash },