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

Revert produces CR at end of lines in Unix files #46

Closed XaapX closed 11 years ago

XaapX commented 11 years ago

HI,

As the title says, I work on unix EOL style files, and whenever I use the revert block feature of modific, the lines are appended with a CR byte.

This also breaks svn diff display, as svn is probably warning about abnormal specific EOL inside my file so every modific markup vanishes.

As soon as I delete the CR bytes (I can do it from ST3 :) ) the diff works again and shows the marks in the gutter.

gornostal commented 11 years ago

Hi,

Can you send me a file and tell how I can reproduce this issue? Do I need SVN for that, or git also shows you CR bytes? Thanks.

P.S. I also use unix EOL style files and have no problems with reverting changes. I use git though.

XaapX commented 11 years ago

I don't think sending a file is relevant here, but I can tell you my files have Unix EOL and are UTF-8. Also, I found that this only happens when you revert at least a block with 2 lines, then every line except the first one gets appended with the CR byte.

I cannot test using git right now, I only use SVN here.

I may test later at home with git but with a Linux build...

gornostal commented 11 years ago

I tried to investigate this issue and didn't notice anything like this. When file has Windows EOL, it indeed adds CR byte. But if file has Unix EOL, no CRs being added. Try to install this plugin (LineEndings) to make sure you have Unix EOL.

If you still think that Modific has a bug, please reopen this issue and provide a test case. Thanks.

XaapX commented 11 years ago

Hi,

Thank you for investigating on this.

Unfortunately, the issue is still there.

I installed LineEndings for st3 and my files are indeed in Unix EOL format. I also checked in vim from linux and I do not see the '^M' characters like I see them in every windows EOL style file I open from this editor.

This still happens when reverting, When reverting a multi-line block, every block but the last one will get a CR byte appended.

I can at least show you what I get after reverting 3 consecutive lines in an unix file: modific46

I'm not sure I can reopen an issue myself.