Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Prevent escaped character from incurring an extra quotation mark - #201

Closed
andyfriesen wants to merge 2 commits into
atom:masterfrom
andyfriesen:master
Closed

andyfriesen wants to merge 2 commits into
atom:masterfrom
andyfriesen:master

Conversation

@andyfriesen

Copy link
Copy Markdown
Contributor

This change should cause the bracket matcher to do what we want when strings end in escape sequences.

Particularly, sequences like "\\" and '\'' should now insert the trailing quote when necessary. Also, the terminating quote should be properly overwritten.

@lee-dohm

lee-dohm commented Mar 3, 2016

Copy link
Copy Markdown
Contributor

There are a couple places where this falls down. In the examples below, the pipe character | represents the position of the cursor.

Parens inside quotes

  1. Enter the sequence "(

Expected: Contents of the editor to be "(|)"
Actual: Contents of the editor were "("

Escaped quotes

  1. Enter the sequence "</kbd>""

Expected: Contents of the editor to be "\""|
Actual: Contents of the editor were "\""|"

I haven't done a bunch of testing. This is just what I was able to find so far.

@andyfriesen

Copy link
Copy Markdown
Contributor Author

That's odd. Both of those cases work for me.

Is there perhaps an interaction between the syntax highlighting mode and bracket-matcher that I'm not aware of?

quotes

@lee-dohm

lee-dohm commented Mar 3, 2016

Copy link
Copy Markdown
Contributor

Perhaps ... what language were you using in your tests? To my recollection, I was using the null grammar.

@andyfriesen

Copy link
Copy Markdown
Contributor Author

I'm not sure what's going on. This case is working in every grammar I try.

For whatever it's worth, I've tested it on OSX and Windows.

@lee-dohm lee-dohm changed the title Fix https://github.com/atom/bracket-matcher/issues/80 Prevent escaped character from incurring an extra quotation mark Mar 4, 2016
@lee-dohm

lee-dohm commented Mar 4, 2016

Copy link
Copy Markdown
Contributor

I'll see if I get time to dig into this again.

@prurph

prurph commented Jun 21, 2016

Copy link
Copy Markdown

Would really like to see this merged. This issue is a source of daily frustration.

@Stanzilla

Copy link
Copy Markdown

Indeed

@ghost

ghost commented Sep 29, 2016

Copy link
Copy Markdown

Has this been fixed?

@Stanzilla

Copy link
Copy Markdown

nope

@ghost

ghost commented Sep 29, 2016

Copy link
Copy Markdown

I cloned andyfriesen's repo into my atom/packages directory, but I'm receiving an error:

Failed to activate the bracket-matcher package
Cannot find module 'underscore-plus'

Locally installed core Atom package bracket-matcher is out of date: 0.80.1 installed locally; 0.82.1 included with the version of Atom you're running. Removing the locally installed version may fix this issue.

How do I fix this? I've tried disabling Atom's bracket-matcher package, but it didn't work.

@winstliu

Copy link
Copy Markdown
Contributor

apm install

@winstliu

winstliu commented Oct 8, 2016

Copy link
Copy Markdown
Contributor

Looking to see if I can reproduce what @lee-dohm saw. Stay tuned.

@winstliu

winstliu commented Oct 9, 2016

Copy link
Copy Markdown
Contributor

This seems to work for me on 1.12.0-dev-e83b3cd, Windows 10 x64.

@winstliu

winstliu commented Oct 9, 2016

Copy link
Copy Markdown
Contributor

Some broken behavior I'm seeing regarding multiple backslashes:
Insert '\\\
Expected: '\\\''
Actual: '\\\'
This holds for any number of odd backslashes > 1.

@ghost

ghost commented Oct 9, 2016

Copy link
Copy Markdown

Thank you for the input!

@Stanzilla

Copy link
Copy Markdown

@andyfriesen are you still working on this?

@andyfriesen

Copy link
Copy Markdown
Contributor Author

To my knowledge, my branch solves the worst offending cases as-written. I've been happily using it for the last two years. :)

@winstliu winstliu self-assigned this Feb 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants