Issue #551Opened November 21, 2017by duskhacker1 reactions

Document dirty indicator

Question

I'd like to indicate that the document is not saved. What would be the best way to know if the document data has changed from the last load/save?

Thanks!

Answers (3)

duskhackerNovember 21, 20171 reactions

Perfect! Thank you so much for the quick reply ... and also this project. Very nice!

artfNovember 21, 20170 reactions

There is an internal counter which you can use like this

editor.on('change:changesCount', () => {
     const editorModel = editor.getModel();
     const changes = editorModel.get('changesCount');
     if (changes) {
          // dirty
     }
});
// same as
editor.on('change:changesCount', (editorModel, changes) => { ... });
lock[bot]September 18, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.