Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No connections are drawn when opening a Yarn file #78

Closed
swakdaddy opened this issue Aug 24, 2018 · 11 comments
Closed

No connections are drawn when opening a Yarn file #78

swakdaddy opened this issue Aug 24, 2018 · 11 comments

Comments

@swakdaddy
Copy link

image

OS: Windows 10.

Repro steps:

  • Open Yarn version 0.2.1 for Windows.
  • File -> Open -> Sally.yarn.txt
  • Observe Yarn load the nodes, but draw no connections between nodes.

Including a file I know isn't working.

Thanks!

Sally.yarn.txt

@julsam
Copy link
Contributor

julsam commented Aug 25, 2018

Thank you for your reporting this bug 👍

It seems like the issue comes from the line ending. When using the yarn.txt save format, Yarn is expecting only Unix type line ending and doesn't interpret correctly CR that Windows add. By default Yarn saves using LF only, but I guess the text editor you used changed it to CRLF.

Should be easy to fix, but in the meantime you can convert your files from the Windows format to the Unix one and the connections should be back 😉
Here's your file converted: Sally.yarn.txt

Another quickfix would be to save it as a json file.

julsam added a commit to julsam/Yarn that referenced this issue Aug 25, 2018
When loading a yarn.txt file, Yarn was expecting lines to end only with
\n and didn't handle properly lines ending with \r\n.
Yarn saves files using only \n, even on Windows, but if the user modify
the file manually, some editors on Windows will convert \n to \r\n, so
it must be taken into account.
@swakdaddy
Copy link
Author

Thanks for the great info and the source of the problem.
I'm not sure what editor added CR. I only used Notepad++ and Visual Studio 2017.
I just tested editing/saving with whitespace visible and neither added CR.
I'll be sure to keep an eye out in the future.

Thank you! :-)

@blurymind
Copy link
Collaborator

blurymind commented Nov 24, 2018

ok I fixed this bug in my pull here:
#80
1cc7e50

@blurymind
Copy link
Collaborator

this is actually fixed in #79 , so I reverted my fix in #80

desplesda added a commit that referenced this issue Jan 21, 2019
Fix for issue #78 loading yarn.txt with \r\n lines
@desplesda
Copy link
Collaborator

Fixed in c50b77c.

@swakdaddy
Copy link
Author

So I noticed that this fix doesn't seem to be included in Yarn-master somehow when you download the ZIP from Git. I opened up data.js and added the fix manually, but it doesn't seem to work.
Dumb question, but do I need to compile something to get it to work?

@blurymind
Copy link
Collaborator

blurymind commented Apr 12, 2019 via email

@swakdaddy
Copy link
Author

swakdaddy commented Apr 14, 2019

The example file is already attached in the original post. See Sally.yarn.txt above.
It has the Windows-style line endings.
But, the problem is that this fix isn't in the git repo it seems. At least, not when I download it like this:

image

If you are talking about data.js, I simply changed the line in this change list to match what is supposed to be in git. It does not work locally by changing that file and then running Yarn by dragging Yarn-master folder into nw.exe. It's the only way I've found to run latest version of Yarn.

@blurymind
Copy link
Collaborator

@swakdaddy this was fixed on the electron branch. You need to use that instead of master
https://github.com/blurymind/Yarn/releases/tag/0.3.6

@swakdaddy
Copy link
Author

@blurymind - Ah thanks. I'll grab the electron branch then since it seems you guys have been working more on it!

@blurymind
Copy link
Collaborator

blurymind commented Apr 18, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants