atom / toggle-quotes

An Atom package to toggle between single and double quotes
MIT License
77 stars 36 forks source link

Multi-line quoted scope is broken #5

Open alexrussell opened 10 years ago

alexrussell commented 10 years ago

If a quoted area goes over two lines the quote toggler does not calculate the correct area to toggle. My guess (from my delving into the code the other day) is that this isn't an issue with the plugin, but the underlying API to get the range associated to the scope from the cursor's position. Vague example: (| denotes cursor placement)

<?php
$array = array("some
multilin|e text", "next one");

is turned into

<?php
$array = array("some
"ultilin|e text\", "next one");

Similarly:

<?php
$array = array("som|e
multiline text", "next one");

is turned into

<?php
$array = array('som|'
multiline text", "next one");
nathansobo commented 10 years ago

Yes, our scope query doesn't currently span multiple lines. We can leave this open though.

alexrussell commented 10 years ago

Is that something that can be fixed by changing the way toggle-quotes uses the API or is it something in Atom's core that simply doesn't yet allow packages to retrieve a multi-line range from a given scope?