READ ONLY state for buffers
Build project / build (push) Successful in 36s

This commit is contained in:
2026-05-23 15:42:17 +02:00
parent 310498d582
commit c4d772e465
8 changed files with 58 additions and 11 deletions
+4 -2
View File
@@ -77,8 +77,10 @@ void bufferRowInsertBytes(struct buffer_t *buffer, row_t *row, int at,
* \param at Index of the char to delete
* \param row Row on operation is made */
void bufferRowDelByte(struct buffer_t *buffer, row_t *row, int at, int n) {
if (at < 0 || at >= row->size)
return;
if (buffer->state == READ_ONLY)
return;
if (at < 0 || at >= row->size)
return;
memmove(row->chars + at, row->chars + at + n, row->size - at - n);
row->size -= n;
row->chars[row->size] = '\0';