summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-02-25 17:03:52 -0500
committerpommicket <pommicket@gmail.com>2023-02-25 17:03:52 -0500
commit1dbe868e22fe9762d5e32d73167d09a2c5b72821 (patch)
treec0fbd40610090ca633a81dca1de5a416e8cd1a07 /ted.h
parent8393d8439f3f522d5388da87294ccdfa7c77c671 (diff)
better handlign of backspace/delete with `indent-with-spaces = on`
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ted.h b/ted.h
index 76058af..1faf439 100644
--- a/ted.h
+++ b/ted.h
@@ -651,6 +651,10 @@ bool buffer_clip_rect(TextBuffer *buffer, Rect *r);
LSP *buffer_lsp(TextBuffer *buffer);
// Get the settings used for this buffer.
Settings *buffer_settings(TextBuffer *buffer);
+// Get tab width for this buffer
+u8 buffer_tab_width(TextBuffer *buffer);
+// Get whether or not to indent with spaces for this buffer.
+bool buffer_indent_with_spaces(TextBuffer *buffer);
// NOTE: this string will be invalidated when the line is edited!!!
// only use it briefly!!
String32 buffer_get_line(TextBuffer *buffer, u32 line_number);
@@ -678,6 +682,9 @@ void buffer_check_valid(TextBuffer *buffer);
void buffer_free(TextBuffer *buffer);
// clear buffer contents
void buffer_clear(TextBuffer *buffer);
+// returns the length of the `line_number`th line (0-indexed),
+// or 0 if `line_number` is out of range.
+u32 buffer_line_len(TextBuffer *buffer, u32 line_number);
// returns the number of lines of text in the buffer into *lines (if not NULL),
// and the number of columns of text, i.e. the number of columns in the longest line displayed, into *cols (if not NULL)
void buffer_text_dimensions(TextBuffer *buffer, u32 *lines, u32 *columns);