diff options
| author | Albert Cervin <albert@acervin.com> | 2023-01-29 22:22:54 +0100 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2023-01-29 22:22:54 +0100 |
| commit | f90d5e1f07fdc9dea7c24b11107049b613a5be7a (patch) | |
| tree | d4e3ba84f198738fd68f225b2d03f34b2653acb1 /src/text.c | |
| parent | 94278ec39b08b4085fa920f870261eb7639baa6b (diff) | |
| download | dged-f90d5e1f07fdc9dea7c24b11107049b613a5be7a.tar.gz dged-f90d5e1f07fdc9dea7c24b11107049b613a5be7a.tar.xz dged-f90d5e1f07fdc9dea7c24b11107049b613a5be7a.zip | |
More tests and documentation
Also improve find file and switch buffer a bit.
Implement word backward/forward.
Diffstat (limited to 'src/text.c')
| -rw-r--r-- | src/text.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -80,6 +80,11 @@ uint32_t byteidx_to_charidx(struct line *line, uint32_t byte_idx) { return utf8_nchars(line->data, byte_idx); } +uint32_t text_byteindex_to_col(struct text *text, uint32_t line, + uint32_t byteindex) { + return byteidx_to_charidx(&text->lines[line], byteindex); +} + void insert_at_col(struct line *line, uint32_t col, uint8_t *text, uint32_t len, uint32_t nchars) { |
