<p>I tried just hacking it, and it works. The below is my <code>git diff</code>.</p>
<p>I don't know what <em>buf_len</em> should be set to, so I just set it to 0 and didn't cause any problems.</p>
<p>All of the changes below would be surrounded by some if statement for the setting. Also, instead of setting <code>allow_empty_lines = TRUE;</code> directly, that would be passed in as an arg.</p>
<p>The last step would be to add it is a preference to <em>Edit=>Preferences=>Editor=>Features</em> as a checkbox. I have no idea how to do that though, and will also have to create PO files (which is a lot of work).</p>
<pre><code>diff --git a/src/editor.c b/src/editor.c
index 620248c4..8663ad90 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -3031,11 +3031,11 @@ gint editor_do_uncomment(GeanyEditor *editor, gint line, gboolean toggle)
 
                buf_len = MIN((gint)sizeof(sel) - 1, line_len);
                if (buf_len <= 0)
-                       continue;
+                       buf_len = 0;
                sci_get_text_range(editor->sci, line_start, line_start + buf_len, sel);
                sel[buf_len] = '\0';
 
-               while (isspace(sel[x])) x++;
+               //while (isspace(sel[x])) x++;
 
                /* to skip blank lines */
                if (x < line_len && sel[x] != '\0')
@@ -3140,8 +3140,8 @@ void editor_do_comment_toggle(GeanyEditor *editor)
                return;
 
        co_len = strlen(co);
-       if (co_len == 0)
-               return;
+       //if (co_len == 0)
+       //      return;
 
        sci_start_undo_action(editor->sci);
 
@@ -3155,11 +3155,11 @@ void editor_do_comment_toggle(GeanyEditor *editor)
 
                buf_len = MIN((gint)sizeof(sel) - 1, line_len);
                if (buf_len < 0)
-                       continue;
+                       buf_len = 0;
                sci_get_text_range(editor->sci, line_start, line_start + buf_len, sel);
                sel[buf_len] = '\0';
 
-               while (isspace(sel[x])) x++;
+               //while (isspace(sel[x])) x++;
 
                /* use single line comment */
                if (EMPTY(cc))
@@ -3310,9 +3310,9 @@ gint editor_do_comment(GeanyEditor *editor, gint line, gboolean allow_empty_line
        if (! filetype_get_comment_open_close(ft, single_comment, &co, &cc))
                return 0;
 
-       co_len = strlen(co);
-       if (co_len == 0)
-               return 0;
+       //co_len = strlen(co);
+       //if (co_len == 0)
+       //      return 0;
 
        sci_start_undo_action(editor->sci);
 
@@ -3326,11 +3326,12 @@ gint editor_do_comment(GeanyEditor *editor, gint line, gboolean allow_empty_line
 
                buf_len = MIN((gint)sizeof(sel) - 1, line_len);
                if (buf_len < 0)
-                       continue;
+                       buf_len = 0;
                sci_get_text_range(editor->sci, line_start, line_start + buf_len, sel);
                sel[buf_len] = '\0';
 
-               while (isspace(sel[x])) x++;
+               //while (isspace(sel[x])) x++;
+               allow_empty_lines = TRUE;
 
                /* to skip blank lines */
                if (allow_empty_lines || (x < line_len && sel[x] != '\0'))
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/2239?email_source=notifications&email_token=AAIOWJ5JZ7TCTWWAHO7MM23QCWOADA5CNFSM4II4A3UKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3PQGJA#issuecomment-517931812">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ2PR3WHRR7PASSD6NTQCWOADANCNFSM4II4A3UA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAIOWJ67TDVOOSBQ34UQS4DQCWOADA5CNFSM4II4A3UKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3PQGJA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/2239?email_source=notifications\u0026email_token=AAIOWJ5JZ7TCTWWAHO7MM23QCWOADA5CNFSM4II4A3UKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3PQGJA#issuecomment-517931812",
"url": "https://github.com/geany/geany/issues/2239?email_source=notifications\u0026email_token=AAIOWJ5JZ7TCTWWAHO7MM23QCWOADA5CNFSM4II4A3UKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3PQGJA#issuecomment-517931812",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>