Ticket #1754: show current syntax in 'Choose syntax highlighting' dialog.
Now current syntax scheme is highlighted in 'Choose syntax highlighting' dialog. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
dffe717c56
Коммит
469d119e12
@ -42,7 +42,7 @@ pstrcmp(const void *p1, const void *p2)
|
||||
}
|
||||
|
||||
static int
|
||||
exec_edit_syntax_dialog (const char **names) {
|
||||
exec_edit_syntax_dialog (const char **names, const char *current_syntax) {
|
||||
int i;
|
||||
|
||||
Listbox *syntaxlist = create_listbox_window (LIST_LINES, MAX_ENTRY_LEN,
|
||||
@ -52,8 +52,7 @@ exec_edit_syntax_dialog (const char **names) {
|
||||
|
||||
for (i = 0; names[i]; i++) {
|
||||
LISTBOX_APPEND_TEXT (syntaxlist, 0, names[i], NULL);
|
||||
if (! option_auto_syntax && option_syntax_type
|
||||
&& (strcmp (names[i], option_syntax_type) == 0))
|
||||
if ((current_syntax != NULL) && (strcmp (names[i], current_syntax) == 0))
|
||||
listbox_select_entry (syntaxlist->list, i + N_DFLT_ENTRIES);
|
||||
}
|
||||
|
||||
@ -61,7 +60,7 @@ exec_edit_syntax_dialog (const char **names) {
|
||||
}
|
||||
|
||||
void
|
||||
edit_syntax_dialog (void) {
|
||||
edit_syntax_dialog (const char *current_syntax) {
|
||||
char *old_syntax_type;
|
||||
int old_auto_syntax, syntax;
|
||||
char **names;
|
||||
@ -78,7 +77,8 @@ edit_syntax_dialog (void) {
|
||||
while (names[count++] != NULL);
|
||||
qsort(names, count - 1, sizeof(char*), pstrcmp);
|
||||
|
||||
if ((syntax = exec_edit_syntax_dialog ((const char**) names)) < 0) {
|
||||
syntax = exec_edit_syntax_dialog ((const char**) names, current_syntax);
|
||||
if (syntax < 0) {
|
||||
for (i = 0; names[i]; i++) {
|
||||
g_free (names[i]);
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ int line_is_blank (WEdit *edit, long line);
|
||||
int edit_indent_width (WEdit *edit, long p);
|
||||
void edit_insert_indent (WEdit *edit, int indent);
|
||||
void edit_options_dialog (void);
|
||||
void edit_syntax_dialog (void);
|
||||
void edit_syntax_dialog (const char *current_syntax);
|
||||
void edit_mail_dialog (WEdit *edit);
|
||||
void format_paragraph (WEdit *edit, int force);
|
||||
|
||||
|
@ -3457,7 +3457,7 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
|
||||
edit_load_cmd (edit, EDIT_FILE_SYNTAX);
|
||||
break;
|
||||
case CK_Choose_Syntax:
|
||||
edit_syntax_dialog ();
|
||||
edit_syntax_dialog (edit->syntax_type);
|
||||
break;
|
||||
|
||||
case CK_Load_Menu_File:
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user