Hi all.

I have a bunch of little questions, some of them are not even related to
Geany. Here they are:

1. There is a little issue with "Automatically continue block comments"
turned on. It inserts comment symbols even if a block comment, which
includes the beginning of the prev. line, is already closed. An
example:

class A {
  virtual void a() = 0;
};
class B {
  /* override */ void a() = {}
   * <<< comment symbol was inserted here

The attached patch checks whether the comment is still active before
automatically continuing it. It seems to work fine for me.


2. There is a strange issue with deleting spaces from the beginning of
a line. Suppose you have a file with indentation set to 2 spaces and
two lines:

  if foo:
    bar()

If you move cursor after the first space of the second line and press
Backspace, you get

  if foo:
  bar

with the cursor just before "bar", not in the beginning of the line.
That is weird. Is this a "feature" of Scintilla or Geany? If the
latter, which source file I need to fix? :-)


3. [unrelated] How do I reply to my own message in a mailing-list? (I
tried to google it without success)

Best regards,
Eugene.
diff --git a/src/editor.c b/src/editor.c
index 9a9479d..62a22a3 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -3211,8 +3211,12 @@ static void auto_multiline(GeanyEditor *editor, gint cur_line)
 	/* Use the start of the line enter was pressed on, to avoid any doc keyword styles */
 	indent_pos = sci_get_line_indent_position(sci, cur_line - 1);
 	style = sci_get_style_at(sci, indent_pos);
+	if (!in_block_comment(lexer, style))
+		return;
 
-	if (in_block_comment(lexer, style))
+	/* Check whether the comment block continues on this line */
+	indent_pos = sci_get_line_indent_position(sci, cur_line);
+	if (sci_get_style_at(sci, indent_pos) == style)
 	{
 		gchar *previous_line = sci_get_line(sci, cur_line - 1);
 		/* the type of comment, '*' (C/C++/Java), '+' and the others (D) */
@@ -4979,5 +4983,3 @@ void editor_indent(GeanyEditor *editor, gboolean increase)
 		sci_set_current_line(sci, lstart);
 	}
 }
-
-
_______________________________________________
Geany-devel mailing list
[email protected]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to