Sync current buffer contents to file (GTK buffers only).
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.
2. Create backup if needed
3. Write to file on disk
4. Mark buffer as not modified
5. Update file metadata
Usage:
// For GTK buffers only
if (file.buffer is GtkSourceFileBuffer) {
yield file.buffer.sync_to_file();
}
| Error |
if file cannot be written or method is not supported |