summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-05-11 12:11:44 -0400
committerpommicket <pommicket@gmail.com>2023-05-11 12:11:54 -0400
commit8f23762128bebda1e8e07058f905363954ac9c61 (patch)
treed1e78fa4020de61b34cf4600bebcf40dc0cc7322 /ted.h
parentba8d08d0eef98e1950f8c96c12fe8de3f0f059ae (diff)
:matching-bracket, fix matching bracket highlighting in some cases
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/ted.h b/ted.h
index de00472..bed54fe 100644
--- a/ted.h
+++ b/ted.h
@@ -917,20 +917,22 @@ void buffer_create(TextBuffer *buffer, Ted *ted);
void line_buffer_create(TextBuffer *buffer, Ted *ted);
/// does this buffer have unsaved changes?
bool buffer_unsaved_changes(TextBuffer *buffer);
-/// returns the character at position pos, or 0 if pos is invalid
+/// returns the character after position pos, or 0 if pos is invalid
char32_t buffer_char_at_pos(TextBuffer *buffer, BufferPos pos);
+/// returns the character after the cursor
+char32_t buffer_char_at_cursor(TextBuffer *buffer);
/// returns the character before position pos, or 0 if pos is invalid or at the start of a line
char32_t buffer_char_before_pos(TextBuffer *buffer, BufferPos pos);
-/// returns the character after position pos, or 0 if pos is invalid or at the end of a line
-char32_t buffer_char_after_pos(TextBuffer *buffer, BufferPos pos);
/// returns the character to the left of the cursor, or 0 if the cursor at the start of the line.
char32_t buffer_char_before_cursor(TextBuffer *buffer);
-/// returns the character to the right of the cursor, 0 if cursor is at end of line
-char32_t buffer_char_after_cursor(TextBuffer *buffer);
/// buffer position of start of file
BufferPos buffer_pos_start_of_file(TextBuffer *buffer);
/// buffer position of end of file
BufferPos buffer_pos_end_of_file(TextBuffer *buffer);
+/// move position to matching bracket. returns true if there was a bracket at the position, otherwise returns false and does nothing.
+bool buffer_pos_move_to_matching_bracket(TextBuffer *buffer, BufferPos *pos);
+/// move cursor to matching bracket. returns true if cursor was to the right of a bracket.
+bool buffer_cursor_move_to_matching_bracket(TextBuffer *buffer);
/// ensures that `p` refers to a valid position, moving it if needed.
void buffer_pos_validate(TextBuffer *buffer, BufferPos *p);
/// is this a valid buffer position?