summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-03-02 10:44:11 -0500
committerpommicket <pommicket@gmail.com>2023-03-02 10:44:11 -0500
commiteddcc7e8c6c02970ac658024b3a8c6b5f416c8a5 (patch)
tree542e3eb5536cf4abb9592a88ff779fc0d2763103 /buffer.c
parent595cc50b7985ec67c49c6e2ffc649cb04692a318 (diff)
comment-start and comment-end settings
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/buffer.c b/buffer.c
index 5852c68..8371c7c 100644
--- a/buffer.c
+++ b/buffer.c
@@ -3023,8 +3023,8 @@ void buffer_dedent_cursor_line(TextBuffer *buffer) {
void buffer_comment_lines(TextBuffer *buffer, u32 first_line, u32 last_line) {
- Language lang = buffer_language(buffer);
- const char *start = language_comment_start(lang), *end = language_comment_end(lang);
+ Settings *settings = buffer_settings(buffer);
+ const char *start = settings->comment_start, *end = settings->comment_end;
if (!start[0] && !end[0])
return;
String32 start32 = str32_from_utf8(start), end32 = str32_from_utf8(end);
@@ -3078,8 +3078,8 @@ 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) {
- Language lang = buffer_language(buffer);
- const char *start = language_comment_start(lang), *end = language_comment_end(lang);
+ Settings *settings = buffer_settings(buffer);
+ const char *start = settings->comment_start, *end = settings->comment_end;
if (!start[0] && !end[0])
return;
u32 start_len = (u32)strlen(start), end_len = (u32)strlen(end);
@@ -3102,8 +3102,8 @@ 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) {
- Language lang = buffer_language(buffer);
- const char *start = language_comment_start(lang), *end = language_comment_end(lang);
+ Settings *settings = buffer_settings(buffer);
+ const char *start = settings->comment_start, *end = settings->comment_end;
if (!start[0] && !end[0])
return;
// if first line is a comment, uncomment lines, otherwise, comment lines