sync_to_file


Description:

public async void sync_to_file () throws Error

Sync buffer contents to file on disk.

Gets the current buffer contents and writes them to the file. Used when buffer contents have been modified via GTK operations (user typing, etc.) and need to be saved to disk.

Process

  1. Get buffer content from GTK TextBuffer

    2. Write to file (creates backup, writes, updates metadata)

    3. Mark buffer as not modified

    4. Update last_read_timestamp to match file modification time

This method is only supported for GTK buffers. For dummy buffers, use write() instead.