Add xml_indent_tags filetype setting for documents using the
HTML/XML lexers (patch by Eugene Arshinov, thanks). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5392 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
1355795908
commit
eba0571fb6
@ -7,6 +7,10 @@
|
||||
* src/document.c:
|
||||
Fix not reporting an error message when saving a document fails.
|
||||
Check result of fclose().
|
||||
* src/filetypesprivate.h, src/filetypes.c, src/editor.c,
|
||||
data/filetypes.xml, data/filetypes.html:
|
||||
Add xml_indent_tags filetype setting for documents using the
|
||||
HTML/XML lexers (patch by Eugene Arshinov, thanks).
|
||||
|
||||
|
||||
2010-11-09 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
@ -32,6 +32,10 @@ comment_use_indent=true
|
||||
# context action command (please see Geany's main documentation for details)
|
||||
context_action_cmd=
|
||||
|
||||
# If this setting is set to true, a new line after a line ending with an
|
||||
# unclosed tag will be automatically indented
|
||||
xml_indent_tags=true
|
||||
|
||||
[build_settings]
|
||||
# %f will be replaced by the complete filename
|
||||
# %e will be replaced by the filename without extension
|
||||
|
@ -103,3 +103,6 @@ comment_use_indent=true
|
||||
# context action command (please see Geany's main documentation for details)
|
||||
context_action_cmd=
|
||||
|
||||
# If this setting is set to true, a new line after a line ending with an
|
||||
# unclosed tag will be automatically indented
|
||||
xml_indent_tags=true
|
@ -55,6 +55,7 @@
|
||||
#include "document.h"
|
||||
#include "documentprivate.h"
|
||||
#include "filetypes.h"
|
||||
#include "filetypesprivate.h"
|
||||
#include "sciwrappers.h"
|
||||
#include "ui_utils.h"
|
||||
#include "utils.h"
|
||||
@ -1356,8 +1357,9 @@ static gint get_indent_size_after_line(GeanyEditor *editor, gint line)
|
||||
* recommend us to insert additional indent, we are probably not in PHP/JavaScript chunk and
|
||||
* should make the XML-related check */
|
||||
if (additional_indent == 0 && !editor_prefs.auto_close_xml_tags &&
|
||||
(editor->document->file_type->id == GEANY_FILETYPES_HTML ||
|
||||
editor->document->file_type->id == GEANY_FILETYPES_XML))
|
||||
(sci_get_lexer(sci) == SCLEX_HTML ||
|
||||
sci_get_lexer(sci) == SCLEX_XML) &&
|
||||
editor->document->file_type->priv->xml_indent_tags)
|
||||
{
|
||||
size += iprefs->width * get_xml_indent(sci, line);
|
||||
}
|
||||
|
@ -1139,6 +1139,8 @@ static void load_settings(gint ft_id, GKeyFile *config, GKeyFile *configh)
|
||||
|
||||
ft->priv->symbol_list_sort_mode = utils_get_setting(integer, configh, config, "settings",
|
||||
"symbol_list_sort_mode", SYMBOLS_SORT_BY_NAME);
|
||||
ft->priv->xml_indent_tags = utils_get_setting(boolean, configh, config, "settings",
|
||||
"xml_indent_tags", FALSE);
|
||||
|
||||
/* read build settings */
|
||||
build_load_menu(config, GEANY_BCS_FT, (gpointer)ft);
|
||||
|
@ -43,6 +43,7 @@ typedef struct GeanyFiletypePrivate
|
||||
gchar *last_string; /* last one compiled */
|
||||
gboolean custom;
|
||||
gint symbol_list_sort_mode;
|
||||
gboolean xml_indent_tags; /* XML tag autoindentation, for HTML and XML filetypes */
|
||||
}
|
||||
GeanyFiletypePrivate;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user