gornostal / Modific

Highlight lines changed since the last commit (supports Git, SVN, Bazaar, Mercurial and TFS) / ST2(3) plugin
614 stars 44 forks source link

Does not revert indentation correctly #101

Open eproxus opened 8 years ago

eproxus commented 8 years ago

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.

gornostal commented 8 years ago

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

eproxus commented 8 years ago

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

gornostal commented 8 years ago

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.

eproxus commented 8 years ago

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?

gornostal commented 8 years ago

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.

eproxus commented 8 years ago

Done: https://sublimetext.userecho.com/topic/1142727-/

gornostal commented 8 years ago

URL redirects to "Page Not Found".

eproxus commented 8 years ago

UserEcho is incredibly broken. Maybe these work?

gornostal commented 8 years ago

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

eproxus commented 8 years ago

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

gornostal commented 8 years ago

Ah.. OK.

eproxus commented 8 years ago

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