Only remove extra space indent after a multiline comment if the

indent contains one too many spaces.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1099 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2006-12-15 11:57:48 +00:00
parent 1ed6338a14
commit 665eec08f1
2 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2006-12-15 Nick Treleaven <nick.treleaven@btinternet.com>
* src/sci_cb.c:
Only remove extra space indent after a multiline comment if the
indent contains one too many spaces.
2006-12-14 Frank Lanitz <frank@frank.uvena.de>
* about.c: Fixed a typo.

View File

@ -1748,7 +1748,14 @@ static void auto_multiline(ScintillaObject *sci, gint pos)
while (i >= 0 && isspace(previous_line[i])) i--;
if (i >= 1 && is_doc_comment_char(previous_line[i - 1], lexer) && previous_line[i] == '/')
{
SSM(sci, SCI_DELETEBACK, 0, 0); // remove whitespace indent
gint cur_line = sci_get_current_line(sci, -1);
gint indent_pos = sci_get_line_indent_position(sci, cur_line);
gint indent_len = sci_get_col_from_position(sci, indent_pos);
/* if there is one too many spaces, delete the last space,
* to return to the indent used before the multiline comment was started. */
if (indent_len % app->pref_editor_tab_width == 1)
SSM(sci, SCI_DELETEBACKNOTLINE, 0, 0); // remove whitespace indent
g_free(previous_line);
return;
}