diff options
author | Pablo Barciela <[email protected]> | 2017-09-26 01:24:17 +0200 |
---|---|---|
committer | Pablo Barciela <[email protected]> | 2017-09-26 01:24:17 +0200 |
commit | 0b48af90e44f00bdaee636c287b80cf8773b906a (patch) | |
tree | 1e4c308eab6afc131f654d35a5e5bc6be7d11e87 | |
parent | a8cc3156edb422eada7d7fd31467424835c5c809 (diff) | |
download | pluma-0b48af90e44f00bdaee636c287b80cf8773b906a.tar.bz2 pluma-0b48af90e44f00bdaee636c287b80cf8773b906a.tar.xz |
don't request to save documents with no changes
Fixes https://github.com/mate-desktop/pluma/issues/230
-rw-r--r-- | pluma/pluma-tab.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pluma/pluma-tab.c b/pluma/pluma-tab.c index 22dad56a..84371e86 100644 --- a/pluma/pluma-tab.c +++ b/pluma/pluma-tab.c @@ -2624,19 +2624,20 @@ _pluma_tab_can_close (PlumaTab *tab) ts = pluma_tab_get_state (tab); + doc = pluma_tab_get_document (tab); + /* if we are loading or reverting, the tab can be closed */ - if ((ts == PLUMA_TAB_STATE_LOADING) || - (ts == PLUMA_TAB_STATE_LOADING_ERROR) || - (ts == PLUMA_TAB_STATE_REVERTING) || - (ts == PLUMA_TAB_STATE_REVERTING_ERROR)) /* CHECK: I'm not sure this is the right behavior for REVERTING ERROR */ + if ((ts == PLUMA_TAB_STATE_LOADING) || + (ts == PLUMA_TAB_STATE_LOADING_ERROR) || + (ts == PLUMA_TAB_STATE_REVERTING) || + (ts == PLUMA_TAB_STATE_REVERTING_ERROR) || /* CHECK: I'm not sure this is the right behavior for REVERTING ERROR */ + (!gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc)))) return TRUE; /* Do not close tab with saving errors */ if (ts == PLUMA_TAB_STATE_SAVING_ERROR) return FALSE; - doc = pluma_tab_get_document (tab); - /* TODO: we need to save the file also if it has been externally modified - Paolo (Oct 10, 2005) */ |