Comments (24)
@markusgritsch, can you create a gist with a file (or a part of it), where you see the issue?
Also, please provide your git version.
Thanks.
from modific.
I already mentioned that I use Git for Windows 2.5. However, I also had the same behaviour with previous versions of Git.
I think the crucial thing to reproduce the bug is to have a file which is in the repository with Unix (LF) line endings which gets checked out on Windows with Windows (CR LF) line endigs. For example this file
https://github.com/nodemcu/nodemcu-firmware/blob/master/Makefile
has LF line endings in the repo (https://github.com/nodemcu/nodemcu-firmware/raw/master/Makefile) but my local clone of this file has CR LF line endings.
So here is an example with exactly that file:
the spurious CR appears.
Thanks for looking into this.
from modific.
Hehe, I was wondering what is Window 2.5.
I think I know how to fix it. I'll create a fix, then you verify it, because I don't have access to Windows machine right now.
from modific.
Great, looking forward to it.
from modific.
I just pushed commit to master.
from modific.
No, this does not change anything. Note, even if I change join_lines() to return "", a spurious CR appears (of course without any text from the original line):
from modific.
Made another fix. Hope that helps.
from modific.
Unfortunately, still the same.
from modific.
I just made another fix. And I'm pretty sure it will work.
from modific.
Still no change. If it helps, when doing
git diff Makefile > tmp.diff
the file tmp.diff has Unix (LF) line endings.
from modific.
OK. I'll get back to this when I get access to a Windows machine.
from modific.
All right.
from modific.
Hi gornostal, any chance you will take another look into this issue?
from modific.
Sorry for the delay.
I'll try to find time for this today or tomorrow.
Thanks for the reminder!
from modific.
Could not reproduce the bug today.
Here is what I did:
- downloaded and installed Git-2.6.3-64.bit.exe on Windows 7
- downloaded and installed ST 3
git config --global core.autocrlf true
git checkout https://github.com/nodemcu/nodemcu-firmware
- modified a few lines in Makefile
- pressed
Ctrl+Alt+R
- Modific reverted lines just fine, no CR symbols in the end of the line
from modific.
Did you delete some lines in the Makefile so that they were added back when pressing Ctrl+Alt+R?
Reverting works fine with modified lines and added lines. The problem appears only when deleting lines from the original file.
from modific.
Oh.. I missed that in your description. Will try again today.
from modific.
Have you been able to reproduce it?
from modific.
Not yet. Got distracted at work that day.
Downloading virtual box...
from modific.
I reproduced it and here is what I found out:
CR appears only if I use \r\n
to join the lines.
When I change it to \n
, it joins them just fine.
Can you find the line with "\r\n"
in Modific.py and change that to \n, then let me know if it works for you?
If it does I will simply add a new config option to manually change line endings, because as it turns out, we cannot use windows line endings on windows in some cases like yours.
from modific.
Checked in changes to issue-96
branch.
Will merge when @markusgritsch confirms it's working.
from modific.
Yes, this seems to solve the issue, thanks!
But why add a "line_ending" configuration option? Who would need to set this to something else than \n?
from modific.
It's good to hear it works.
I thought I could break the functionality for someone who needs \r\n, but maybe you are right. I'll use \n.
P.S. Thanks for being insistent :)
from modific.
You are welcome ;) I like Modific a lot, and this was the only outstanding issue I had with it. Great that it's fixed now.
Concerning the config option: I think, it is unnecessary. Mind you: The problem with the stray \r characters appeard on a file, which had Windows (\r\n) line endings, and even there the config option has to be set to \n.
Besides: If it would be different from file to file, it would not be practicat to have to change the config option every time.
from modific.
Related Issues (20)
- Modific hides SublimeLint mark HOT 1
- Does not revert indentation correctly HOT 12
- Problems with SublimeLinter HOT 3
- Not working with OSX HOT 9
- [Question] still useful since sublime text adds git support? HOT 2
- SublimeText 4 support HOT 3
- Lockup with Win8.1 HOT 4
- Syntax error HOT 2
- RuntimeError: Must call on main thread... HOT 2
- Issue when setting fallback_encoding to UTF-8 in user settings HOT 3
- Windows/ Sublime Text problems with leftalt/ rightalt and overall ctrl+alt shortcut HOT 1
- Highlight changes on demand
- Feature request: Display removed lines by hotkey HOT 2
- Git show diff not opening new tab HOT 4
- Sometimes no gutter update HOT 2
- if set console_encoding , cause exception. HOT 5
- Seeks git in /usr/bin/git which triggers an error on my OSX installation HOT 4
- SVN HOT 8
- Incompatiblity with SublimeLinter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modific.