namespace {
-static unsigned int const LYXRC_FILEFORMAT = 9; // spitz: remove \\default_language
+static unsigned int const LYXRC_FILEFORMAT = 10; // tommaso: new prefs option: close_buffer_with_last_view
// when adding something to this array keep it sorted!
LexerKeyword lyxrcTags[] = {
{ "\\bind_file", LyXRC::RC_BINDFILE },
{ "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
{ "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
+ { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
{ "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
{ "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
{ "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
default_decimal_point = ".";
default_length_unit = Length::CM;
cursor_width = 1;
+ close_buffer_with_last_view = "yes";
}
case RC_VISUAL_CURSOR:
lexrc >> visual_cursor;
break;
+ case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
+ lexrc >> close_buffer_with_last_view;
+ break;
case RC_AUTO_NUMBER:
lexrc >> auto_number;
break;
}
if (tag != RC_LAST)
break;
+ case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
+ if (ignore_system_lyxrc ||
+ close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
+ os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
+ os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
+ }
+ if (tag != RC_LAST)
+ break;
case RC_LANGUAGE_CUSTOM_PACKAGE:
if (ignore_system_lyxrc ||
language_custom_package != system_lyxrc.language_custom_package) {
case LyXRC::RC_FULL_SCREEN_TOOLBARS:
case LyXRC::RC_FULL_SCREEN_WIDTH:
case LyXRC::RC_VISUAL_CURSOR:
+ case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
case LyXRC::RC_VIEWER:
case LyXRC::RC_VIEWER_ALTERNATIVES:
case LyXRC::RC_FORWARD_SEARCH_DVI:
str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
break;
+ case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
+ str = _("Specify whether, closing the last view of an open document, LyX should close the document (yes), hide it (no), or ask the user (ask).");
+ break;
+
case RC_SCREEN_DPI:
str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
break;