gornostal/Modific

Does not revert indentation correctly

eproxus opened this issue · 12 comments

I have a file with mixed tabs and spaces for indentation. When trying to revert the modified part, Modific restores the original line and the original indentation width, but not the actual indentation itself (tabs are replaced with spaces). This makes the part show up as modified anyway, and trying to revert it does nothing.

I have the following setting enabled in Sublime Text:

"translate_tabs_to_spaces": true,

But I would expect Modific to restore the original content no matter what.

I'm using Sublime Text 3 Dev Channel, Build 3100 and Modific 2015.12.05.20.31.07 installed via Package Control.

Could you provide steps to reproduce?
I don't see this issue.

The attached file contains a Zip archive of a Git repository with a single file file. It is modified on the last line, containing mixed tabs and spaces in the checked in version. For me, when I revert the part with Modific it sets the whole line indentation to spaces and marks the part as still modified.

test.zip

I did an investigation. Turns out Modific gives a correct string to replace but ST3 replaces tab with spaces and inserts a different string.
I'll keep this issue open, but I doubt there is anything I can do to fix it.

Maybe there's a more low level API to use?

If not, I suggest we open a bug report / feature request on Sublime Text instead. Do you know if that is possible?

Maybe there's a more low level API to use?

None that I know of.

ST bug tracker is here https://sublimetext.userecho.com/
Could you report the issue there please?

The issue is that 'edit_view' command doesn't insert mixed tabs and spaces, but converts indentation to default for the current file.

URL redirects to "Page Not Found".

Nope.
Are you sure it's visible to everyone? Maybe there is a visibility setting or something?

It's set to public, but it also says "Awaiting Moderation" so I guess it will be a while before it shows up. 😄

Ah.. OK.

UserEcho seems mostly dead and full of spam. I cross posted to the forums as well: https://forum.sublimetext.com/t/edit-view-changes-indentation-of-inserted-text/17389