Fixed (hopefully) wrong indentation in some cases when inserting '}'.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@969 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2006-11-05 21:20:22 +00:00
parent dd47b2bf62
commit c037341315
2 changed files with 18 additions and 9 deletions

View File

@ -1,9 +1,15 @@
2006-11-05 Enrico Tröger <enrico.troeger@uvena.de>
* src/sci_cb.c: Fixed (hopefully) wrong indentation in some cases when
inserting '}'.
2006-11-04 Enrico Tröger <enrico.troeger@uvena.de>
* src/highlighting.c, src/highlighting.h:
Applied patch from Bob Doan to do not set keywords for XML
documents(thanks).
Made styleset_markup() static.
Made styleset_markup() static.
2006-11-04 Nick Treleaven <nick.treleaven@btinternet.com>
@ -15,7 +21,7 @@
* src/filetypes.c, data/filetype_extensions.conf:
Recognise *.xsl, *.xslt filenames for XML filetype.
Recognise 'GNUmakefile' filename for Make filetype.
2006-11-03 Nick Treleaven <nick.treleaven@btinternet.com>

View File

@ -316,7 +316,7 @@ static void on_new_line_added(ScintillaObject *sci, gint idx)
/// TODO add something like insert_tabs() which inserts a tab or tab_width times a space
sci_add_text(sci, "\t");
}
}
// " * " auto completion in multiline C/C++ comments
sci_cb_auto_multiline(sci, pos);
@ -452,15 +452,18 @@ void sci_cb_close_block(gint idx, gint pos)
//geany_debug("line_len: %d eol: %d cnt: %d", line_len, eol_char_len, cnt);
if ((line_len - eol_char_len - 1) != cnt) return;
if (start_brace >= 0) sci_cb_get_indent(sci, start_brace, TRUE);
/* geany_debug("pos: %d, start: %d char: %c start_line: %d", pos, start_brace,
sci_get_char_at(sci, pos), sci_get_line_from_position(sci, start_brace));
*/
text = g_strconcat(indent, "}", NULL);
sci_set_anchor(sci, line_start);
SSM(sci, SCI_REPLACESEL, 0, (sptr_t) text);
g_free(text);
if (start_brace >= 0)
{
sci_cb_get_indent(sci, start_brace, TRUE);
text = g_strconcat(indent, "}", NULL);
sci_set_anchor(sci, line_start);
SSM(sci, SCI_REPLACESEL, 0, (sptr_t) text);
g_free(text);
}
}
@ -474,7 +477,7 @@ void sci_cb_find_current_word(ScintillaObject *sci, gint pos, gchar *word, size_
if (pos == -1)
pos = sci_get_current_position(sci);
line = sci_get_line_from_position(sci, pos);
line_start = sci_get_position_from_line(sci, line);
startword = pos - line_start;