<p>We consider a file unmodified if it hasn't had modifications since the last saved state: you can see this as matching the last "checkpoint" in the undo history.  As <a href="https://github.com/elextr" class="user-mention">@elextr</a> said, modifications that just so happen to result in the same state are not considered the same, but if you undo your changes until the last checkpoint is reached it'll be considered unmodified (you can tell in several places in Geany's UI).</p>
<p>Yes, we <em>could</em> check the differences between the current state and the last known saved state, and if it's the same not bother.  However:</p>
<ul>
<li>it has to be done and is harder than what we currently have</li>
<li>losing undo history might be a problem, so current situation mitigates this</li>
<li>I don't think it's worth the hassle of implementing it (esp. for a behavior that might not please everyone)</li>
<li>AFAIK all other apps I know behave the same, which at least means we're not the odd kid in the playground</li>
</ul>
<hr>
<p>BTW, one could probably write a plugin that somewhat does that by adding a save point (<code>SCI_SETSAVEPOINT</code>) when the buffer matches the last one again.  I'm not 100% sure it'd be enough, but it someone really wants this it might be worth trying it out through a plugin.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1710#issuecomment-349465842">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ1zIfYaTwbdAfOG9UHLIkJcBy034ks5s9cZ4gaJpZM4Q2zRb">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ34oVI6vpYQNwYuKbBqBdIeWFfEgks5s9cZ4gaJpZM4Q2zRb.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1710#issuecomment-349465842"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@b4n in #1710: We consider a file unmodified if it hasn't had modifications since the last saved state: you can see this as matching the last \"checkpoint\" in the undo history.  As @elextr said, modifications that just so happen to result in the same state are not considered the same, but if you undo your changes until the last checkpoint is reached it'll be considered unmodified (you can tell in several places in Geany's UI).\r\n\r\nYes, we *could* check the differences between the current state and the last known saved state, and if it's the same not bother.  However:\r\n* it has to be done and is harder than what we currently have\r\n* losing undo history might be a problem, so current situation mitigates this\r\n* I don't think it's worth the hassle of implementing it (esp. for a behavior that might not please everyone)\r\n* AFAIK all other apps I know behave the same, which at least means we're not the odd kid in the playground\r\n\r\n---\r\nBTW, one could probably write a plugin that somewhat does that by adding a save point (`SCI_SETSAVEPOINT`) when the buffer matches the last one again.  I'm not 100% sure it'd be enough, but it someone really wants this it might be worth trying it out through a plugin."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1710#issuecomment-349465842"}}}</script>