Kaydet (Commit) 4321eeae authored tarafından Nick Treleaven's avatar Nick Treleaven

Add workaround for PHP/TCL closing brace de-indenting.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1539 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst c074639d
......@@ -2,6 +2,8 @@
* src/highlighting.c:
Fix bug when loading custom filetypes.common styles.
* src/sci_cb.c:
Add workaround for PHP/TCL closing brace de-indenting.
2007-05-15 Nick Treleaven <nick.treleaven@btinternet.com>
......
......@@ -543,6 +543,7 @@ static gint brace_match(ScintillaObject *sci, gint pos)
}
/* Called after typing '}', if pref_editor_indention_mode is INDENT_ADVANCED. */
void sci_cb_close_block(gint idx, gint pos)
{
gint x = 0, cnt = 0;
......@@ -588,6 +589,19 @@ void sci_cb_close_block(gint idx, gint pos)
SSM(sci, SCI_REPLACESEL, 0, (sptr_t) text);
g_free(text);
}
else
if (sci_get_lexer(sci) == SCLEX_HTML || sci_get_lexer(sci) == SCLEX_TCL)
{ /* For TCL & PHP brace_match doesn't work here (maybe lexer bugs?),
* so this is a simple workaround. */
gint indent = sci_get_line_indentation(sci, line);
gint last_indent = sci_get_line_indentation(sci, line - 1);
if (indent < last_indent)
return;
indent -= app->pref_editor_tab_width;
indent = MAX(0, indent);
sci_set_line_indentation(sci, line, indent);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment