SublimeText / ElasticTabstops

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

Redoing paste-format discards redo history #16

Open nyanpasu64 opened 8 years ago

nyanpasu64 commented 8 years ago

ST3 32-bit on Windows.

When I redo a "paste" operation, Elastic reformats the pasted text, throwing away all subsequent redo steps. This leads to code loss when stepping through undo history.

EDIT: This may only happen when the initial paste occurred before the plugin finished loading.

adzenith commented 8 years ago

I can't reproduce this - on my end, redoing a paste works like it should. I don't have a Windows machine to test with, but I don't see why it would be any different. Do you have any other plugins installed? Does it do this every time?

nyanpasu64 commented 8 years ago

I discovered a way to reproduce:

Paste in text before the plugin is loaded. Redoing this paste will trigger elastic formatting and discard all future history.

adzenith commented 6 years ago

Hm... I'm not really sure if there's a way around that. Maybe the plugin could detect an edit to the buffer that doesn't have a subsequent formatting action?