Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

calling glue_marked_undo_groups marks the file as dirty #126

Closed
weslly opened this Issue · 30 comments

2 participants

@weslly

How to reproduce

Set trim_trailing_white_space_on_save as true.

  1. Open a file
  2. Enter in insert mode
  3. Add a space to the end of any line
  4. Save the file
    • (Sublime will remove the trailing white space)
  5. Go to another tab
  6. Come back to the previous tab
@guillermooo guillermooo was assigned
@guillermooo
Owner

I don't see anything out the ordinary? The first file remains untouched for me. Could other plugins be misbehaving here?

@weslly

I tried it again with all plugins disabled (except Vintageous and VintageousEx) but it is still happening :confused:

@guillermooo
Owner

What do you see after 6 switching back to the previous tab?

@guillermooo
Owner

Understood. Luckily, it's nothing to do with unwanted edits to the file, it's just the x coord is off, since the buffer has changed beneath Vintageous' feet. It's a condition that manifests in other cases too.

Thanks!

@weslly

I'm still having the same problem but now the caret goes to the last character of the line (as expected).

@guillermooo
Owner

Can you confirm this happens to you only in the last line of the buffer? I can reproduce this too, but not in any other non-empty line.

@weslly
@guillermooo
Owner

That's weird. I cannot reproduce it any more.

It's a blind guess, but you may try this in the console:

view.settings().erase('vintage')

...and then restart SublimeText.

@weslly

Didn't work, but i noticed that this is happening at any place of the line:

http://cl.ly/4202461i3s0u

@guillermooo
Owner

Unless I'm missing something, what I see in the clip is normal behavior.

As a test, repeatedly pressing the sequence i, esc should make the caret walk backward. That's what Vim does too.

@weslly

Thats correct, but the file is also being marked as modified.

@guillermooo
Owner

Damn, I've been missing this all along. I get it now. It's especially weird if you consider that pressing i, esc after esc has "modified" the file before doesn't have the same effect.

@guillermooo guillermooo reopened this
@guillermooo
Owner

hg diff shows that the file hasn't actually changed, though.

@guillermooo
Owner

All right, this seems to be Sublime Text's behavior (I don't know whether intentional or not). It's calling the command "glue_marked_undo_groups" what's making the buffer appear as dirty if there actually are any undo groups marked. That's at least what I've been able to infer.

@guillermooo
Owner

Good catch, btw! :)

@guillermooo
Owner

Seems to have been fixed in S3 3020 dev build. @weslly, could you please confirm?

@weslly

Still no luck. :(

Btw, this seems to happen only when I save the file in insert mode (cmd+s). If I switch to command mode before saving it works fine.

@guillermooo
Owner

Now I'm pretty sure I can't repro this any more. Have you disabled atomic saves in S3?

@weslly

I disabled atomic_save but it didn't solve the issue.

Here's how i'm reproducing it:

  1. Put the caret anywhere and enter in insert mode
  2. Type something
  3. Delete what you typed using backspace
  4. Save the file without leaving insert mode (ctrl+s or cmd+s)
  5. Open a new tab with ctrl+n
  6. Close the new tab with ctrl+w
  7. The file is dirty
@guillermooo
Owner

Still can't reproduce, and I don't think I've modified the behavior regarding this particular issue. Let's revisit the issue when I've uploaded a new version of Vintageous.

@guillermooo
Owner

Well, now I can reproduce it again.

@guillermooo
Owner

This has been acknowledged as a potential issue, but I don't know about its priority. I will remove this one from the milestone today or tomorrow and tag the tip as 0.5 after that.

@guillermooo
Owner

(BTW, this might not happen any more after the latest changes, but I'm not entirely sure the latest changes are correct regarding gluing/ungluing undo groups.)

@guillermooo
Owner

Related to #170.

@guillermooo
Owner

This issue seems to be unavoidable.

@weslly

I'm not sure if this is related to this issue but sometimes the file stays marked as dirty even after saving with :w.

http://monosnap.com/file/3eW8HL16tN30ugz1wzU5rJSgsg1p7W

@guillermooo
Owner

@weslly Hope this improves things.

Note that the trim_trailing... shenanigans seem to be an issue with Sublime Text, not Vintageous. I think I could fix it on my end, but let's see if there's a better solution.

@weslly

It seems to be fixed now. This bug was awfully annoying, thanks a lot for the fix! :D

@guillermooo
Owner

It was annoying indeed. Note, however, that the issue with trailing white space remains for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.