diff options
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -3834,7 +3834,7 @@ void buffer_dedent_cursor_line(TextBuffer *buffer) { void buffer_comment_lines(TextBuffer *buffer, u32 first_line, u32 last_line) { const Settings *settings = buffer_settings(buffer); - const char *start = settings->comment_start, *end = settings->comment_end; + const char *start = rc_str(settings->comment_start, ""), *end = rc_str(settings->comment_end, ""); if (!start[0] && !end[0]) return; String32 start32 = str32_from_utf8(start), end32 = str32_from_utf8(end); @@ -3889,7 +3889,7 @@ static bool buffer_line_ends_with_ascii(TextBuffer *buffer, u32 line_idx, const void buffer_uncomment_lines(TextBuffer *buffer, u32 first_line, u32 last_line) { const Settings *settings = buffer_settings(buffer); - const char *start = settings->comment_start, *end = settings->comment_end; + const char *start = rc_str(settings->comment_start, ""), *end = rc_str(settings->comment_end, ""); if (!start[0] && !end[0]) return; u32 start_len = (u32)strlen(start), end_len = (u32)strlen(end); @@ -3913,7 +3913,7 @@ void buffer_uncomment_lines(TextBuffer *buffer, u32 first_line, u32 last_line) { void buffer_toggle_comment_lines(TextBuffer *buffer, u32 first_line, u32 last_line) { const Settings *settings = buffer_settings(buffer); - const char *start = settings->comment_start, *end = settings->comment_end; + const char *start = rc_str(settings->comment_start, ""), *end = rc_str(settings->comment_end, ""); if (!start[0] && !end[0]) return; // if first line is a comment, uncomment lines, otherwise, comment lines |