Closed ehaughee closed 11 years ago
I have the same issue occured. :(
@rekky I ended up switching to Auto-Pairs. It is not as smart, but it doesn't have the same issues.
@ehaughee Thank you! Now I'm using it too.
This seems to be fixed. I can't reproduce the issues anymore.
Sorry for the horrible title. I was trying to find a good way to state the issue.
Basically, I have the following block:
When I hit
}
while the cursor is at the position denoted in the above code block, I am sent to the position marked with<--- HERE
instead of the second brace being inserted.After more testing, here is one case with the appropriate behavior and some without. All of the following lines of code are inside a block like the
function test()
block described above.Single quotes nested inside of double quotes
$test = "a string {<cursor here>"
->$test = "a string {<cursor here>}"
. After hitting the first{
the matching}
is automatically inserted properly. Notice the lack of semicolon or nested single quoted string.$test = "a string '{<cursor here>'"
-> Does not autocomplete the match and no matching brace inserted, when}
is pressed, instead of inserting the brace, my cursor is moved to the closing brace on the function block (or, presumably, whatever the surrounding block is). Notice the nested single quotes but no semicolon.$test = "a string {<cursor here>";
-> Does not autocomplete the match and no matching brace inserted, when}
is pressed, instead of inserting the brace, my cursor is moved to the closing brace on the function block (or, presumably, whatever the surrounding block is). Notice the semicolon but no nested single quotes.Double quoted string nested inside of single quotes
$test = 'a string {<cursor here>'
->$test = 'a string {<cursor here>'}
Autocompletes the match properly. Notice the lack of semicolon and nested double quoted strings.$test = 'a string {<cursor here>';
-> Does not autocomplete the match, but when}
is pressed, the cursor is not repositioned and the}
character is inserted where it should be. Notice the presence of a semicolon and the lack of nested double quoted string$test = 'a string "{<cursor here>'"
-> Does not autocomplete the match, but when}
is pressed, the cursor is not repositioned and the}
character is inserted where it should be. Notice the presence of a nested double quoted string. This scenario reacts the same whether a semicolon is placed at the end of the string or not.Note: The above is true of
[
and(
as well as{
but'
and"
seem to autocomplete fine in all of the above cases. In fact, they seem to work too well and will sometimes not balance with a trailing quote. But that is not a big deal to me.It seems like if the left item of a match is typed inside of a string, and before the closing match of that string, everything works. However, if the left item of a match is typed, and the following character is not the closing match of the parent string, autocomplete goes a little haywire and, in the case of double quotes, balancing goes haywire as well.
Sorry for the rambling issue; I got interrupted a few times while writing it and stopped to do some additional testing. Let me know if you need any clarification. I will submit my delimitTest output if requested, but it should be identical to my output in my previous issue submission: https://github.com/Raimondi/delimitMate/issues/100