summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-03-23 16:18:38 -0400
committerpommicket <pommicket@gmail.com>2023-03-23 16:18:38 -0400
commitaf61b9be6a746421a0417d282134491213f2c03f (patch)
treeb81b5fe297cc2d4f029ec111b9ac6a9228b1c4f8 /ted.h
parent6643ff4c14cc27bf80189aadaf65c36ac2e7307f (diff)
handle various :increment-number edge cases and binary
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/ted.h b/ted.h
index 94660ff..b4f87ac 100644
--- a/ted.h
+++ b/ted.h
@@ -1043,7 +1043,12 @@ String32 buffer_word_at_cursor(TextBuffer *buffer);
/// Get a UTF-8 string consisting of the word at the cursor.
/// The return value should be freed.
char *buffer_word_at_cursor_utf8(TextBuffer *buffer);
-/// Used for CMD_INCREMENT_NUMBER/CMD_DECREMENT_NUMBER
+/// Used for \ref CMD_INCREMENT_NUMBER and \ref CMD_DECREMENT_NUMBER
+///
+/// Moves `*ppos` to the start of the (new) number.
+/// returns false if there was no number at `*ppos`.
+bool buffer_change_number_at_pos(TextBuffer *buffer, BufferPos *ppos, i64 by);
+/// Used for \ref CMD_INCREMENT_NUMBER and \ref CMD_DECREMENT_NUMBER
void buffer_change_number_at_cursor(TextBuffer *buffer, i64 argument);
/// Buffer position corresponding to the start of line `line` (0-indexed).
BufferPos buffer_pos_start_of_line(TextBuffer *buffer, u32 line);
@@ -1058,7 +1063,7 @@ void buffer_cursor_move_to_start_of_file(TextBuffer *buffer);
/// Move cursor to the end of the file, like Ctrl+End does.
void buffer_cursor_move_to_end_of_file(TextBuffer *buffer);
/// Get the LSPDocumentID corresponding to the file this buffer contains.
-/// The return value is only useful if buffer_lsp(buffer) != NULL.
+/// The return value is only useful if `buffer_lsp(buffer) != NULL`.
LSPDocumentID buffer_lsp_document_id(TextBuffer *buffer);
/// Get LSPPosition corresponding to position in buffer.
LSPPosition buffer_pos_to_lsp_position(TextBuffer *buffer, BufferPos pos);