Merge branch '3445_mcedit_status_filename'

* 3445_mcedit_status_filename:
  Ticket #3445: mcedit: choose filename format in the status line.
This commit is contained in:
Andrew Borodin 2015-05-03 19:00:13 +03:00
commit c23324013e
5 changed files with 17 additions and 0 deletions

View File

@ -604,6 +604,10 @@ Set of characters to stop paragraph formatting. If one of those characters
is found in the begin of line, that line and all following lines of paragraph
will be untouched. Default value is
"\fB-\fR\fB+\fR\fB*\fR\fB\\\fR\fB,\fR\fB.\fR\fB;\fR\fB:\fR\fB&\fR\fB>\fR".
.TP
.I editor_state_full_filename
Show full file name in the status line. If disabled (default), the only file
name is shown.
.SH MISCELLANEOUS
You can use scanf search and replace to search and replace a C format
string. First take a look at the

View File

@ -90,6 +90,7 @@ int option_cursor_beyond_eol = 0;
int option_line_state = 0;
int option_line_state_width = 0;
gboolean option_cursor_after_inserted_block = FALSE;
int option_state_full_filename = 0;
int option_edit_right_extreme = 0;
int option_edit_left_extreme = 0;

View File

@ -42,6 +42,7 @@ extern int option_persistent_selections;
extern int option_drop_selection_on_copy;
extern int option_cursor_beyond_eol;
extern gboolean option_cursor_after_inserted_block;
extern int option_state_full_filename;
extern int option_line_state;
extern int option_save_mode;
extern int option_save_position;

View File

@ -210,8 +210,13 @@ edit_status_fullscreen (WEdit * edit, int color)
status_len = (int) str_term_width1 (status);
if (edit->filename_vpath != NULL)
{
fname = vfs_path_get_last_path_str (edit->filename_vpath);
if (!option_state_full_filename)
fname = x_basename (fname);
}
fname_len = str_term_width1 (fname);
if (fname_len < preferred_fname_len)
fname_len = preferred_fname_len;
@ -263,7 +268,12 @@ edit_status_window (WEdit * edit)
const char *fname = N_("NoName");
if (edit->filename_vpath != NULL)
{
fname = vfs_path_get_last_path_str (edit->filename_vpath);
if (!option_state_full_filename)
fname = x_basename (fname);
}
#ifdef ENABLE_NLS
else
fname = _(fname);

View File

@ -357,6 +357,7 @@ static const struct
{ "editor_check_new_line", &option_check_nl_at_eof },
{ "editor_show_right_margin", &show_right_margin },
{ "editor_group_undo", &option_group_undo },
{ "editor_state_full_filename", &option_state_full_filename },
#endif /* USE_INTERNAL_EDIT */
{ "editor_ask_filename_before_edit", &editor_ask_filename_before_edit },
{ "nice_rotating_dash", &nice_rotating_dash },