Search Unity

[SOLVED] Unable to open any scripts!!! :O

Discussion in 'Linux' started by FuzzyQuills, Dec 23, 2015.

  1. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Ok people, I'm seriously pulling my hair out with this one...

    Basically, I'm trying to open a script using gedit in unity. The arguments I gave to it was just "$(File)"

    But, every time I open a file, gedit doesn't actually open it, it instead makes a new blank file with the name!

    The only workaround I've found is to open the assets folder, and open the file manually from the file manager... Of which is seriously impractical to do every damn time. Anyone got ideas of what I could do? I think it might be Unity accidentally feeding gedit the '$' symbol in the arguments of which I think points it to the home folder, instead of my file. That's the only insight I can offer...

    I have also tried VS code, and got the exact same result

    Oh yea, and Monodevelop doesn't even launch... but I think that's a linux editor bug Unity's aware of.

    Information:
    Editor Version: 5.2.2
    OS: Ubuntu 15.10
    DWM: Plasma 5 desktop
     
  2. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Ok people, I found the solution! All I had to do was get rid of the quotations. For those having this issue also, instead of:
    Code (csharp):
    1. "$(File)"
    Put this:
    Code (csharp):
    1. $(File)
    in the editor args. For some reason, this opened my file correctly. Obviously, this might stuff up with files that have spaces, but file-names with spaces aren't advised for scripts anyway.

    EDIT: UT, if this is a bug... should I report it?
     
  3. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    394
    I don't think it's a bug, it just doesn't work with quotation marks. (I think it was always this way.)

    On a side note, (haven't tested with Gedit, but) this should allow you to open the file at a specific line (for example, double clicking in console): $(File):$(Line)
     
  4. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    ...Except that one time, the windows editor wouldn't do it without the quotations! :D

    Have yet to try the file:line thing. (I'm inside windows atm)
     
  5. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Anyone managed to make it work with Sublime Text 2? Using $(File):$(Line) only works as long as the project directory has no spaces in it and using "$(File)" opens empty documents.
     
    Last edited: Dec 23, 2015
  6. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    just use $(File) (without quotes) and it should work. I will laugh though if you come back and say it opened the file three times... :D

    Oh yea, and my solution also works with VS Code.