mozilla / fireplay-sublime

A fantastic plugin connecting your favorite editor with your favorite web debugger
47 stars 9 forks source link

Use multiline string where appropriate #24

Open sole opened 10 years ago

sole commented 10 years ago

Declaring the function code for FIREPLAY_CSS should be better done using a multiline string so the code is not in a one very long line. See here for an example.

nicola commented 10 years ago

The issue with that is that Firefox console will accept that only if it is given in that form. So, I am basically pre-processing it. Not sure how I should be doing that.

This will have low priority for a bit.

nicola commented 10 years ago

Unless by multiline string you mean.. literally have the same thing in multi-line.

sole commented 10 years ago

Oh I hadn't realised the console limitation, which makes sense. What about having the multiline string and split it by "\n" and join it with spaces before sending to the console? :)

fwenzel commented 10 years ago

You can also do a tuple like this:

'\n'.join((
    'hello',
    'is it me',
    "you're looking for?"))
nicola commented 10 years ago

That is ugly writing down some javascript code. What I am going to do is probably put that in a different file and load it and replace('\n', '\\n')

fwenzel commented 10 years ago

Good idea actually.

In [1]: open('blah.js').read()
Out[1]: "ohai\nis it me\nyou're looking for"
nicola commented 10 years ago

Oh yes, correct. I won't be on this soon, there is async to fix now.