Modific icon indicating copy to clipboard operation
Modific copied to clipboard

Does not revert indentation correctly

Open eproxus opened this issue 9 years ago • 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.

eproxus avatar Feb 05 '16 08:02 eproxus

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

gornostal avatar Feb 05 '16 08:02 gornostal

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

eproxus avatar Feb 05 '16 10:02 eproxus

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.

gornostal avatar Feb 09 '16 18:02 gornostal

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?

eproxus avatar Feb 10 '16 09:02 eproxus

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.

gornostal avatar Feb 10 '16 09:02 gornostal

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

eproxus avatar Feb 10 '16 09:02 eproxus

URL redirects to "Page Not Found".

gornostal avatar Feb 10 '16 09:02 gornostal

UserEcho is incredibly broken. Maybe these work?

  • https://sublimetext.userecho.com/topic/1142727
  • https://sublimetext.userecho.com/topic/1142727-edit_view-changes-indentation-of-inserted-text/

eproxus avatar Feb 10 '16 09:02 eproxus

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

gornostal avatar Feb 10 '16 10:02 gornostal

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

eproxus avatar Feb 10 '16 10:02 eproxus

Ah.. OK.

gornostal avatar Feb 10 '16 10:02 gornostal

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

eproxus avatar Feb 10 '16 10:02 eproxus