SublimeText / ElasticTabstops

Tab characters automatically adjust to keep adjacent lines aligned.
https://github.com/SublimeText/ElasticTabstops
67 stars 6 forks source link

maybe provides better undo behaviour. #2

Closed titoBouzout closed 12 years ago

titoBouzout commented 12 years ago

It needs testing from someone with better knowledge of how ElasticTabsStops works.

adzenith commented 12 years ago

Awesome! I'll take a look at it this weekend. Thanks!

titoBouzout commented 12 years ago

Ok, thank you!

To clarify I fixed the issue:

I wanted too, to remove the "edit mark" that the plugin does when working ( when a buffer is modified ) but I was unable to implement it. I'm not sure if this is possible.

adzenith commented 12 years ago

So the change is that an edit is only begun if the plugin actually edits something? That looks good. And it looks like you're only "maybe-gluing" if the plugin edits something. But that means that the first edit won't correctly glue with the indentation changes following it, right? I'm playing around with it and it looks like the gluing isn't quite doing the right thing. I don't think there's any way around the single-character undo with the current API, but I'm more than willing to be proven wrong :)

titoBouzout commented 12 years ago

True, that's, exactly describes the changes. Thank you.

I don't know how to improve the situation with the API for undo, since I don't understand it.

To summarize: This request improves the undo behaviour allowing the application to have "undo working normally" when the plugin is not used. But it makes a little worse the situation when the plugin is used ( needs two undos for each character altering the indentation ) In theory, this request is not altering the plugin function, but I don't use tabstops frequently.

adzenith commented 12 years ago

You're right, it does work better if you're not using the plugin. Hm. Let me play around and see if I can come up with a way to have both. If not, I'll just merge this change because it's more convenient.

titoBouzout commented 12 years ago

This pull request cannot be automatically merged.

adzenith commented 12 years ago

Sorry! Should have merged this four months ago. I rebased and pushed it separately.