Giter VIP home page Giter VIP logo

surround's People

Contributors

mkleehammer avatar walheimat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

surround's Issues

Don't confuse open / close in strings

NOTE: I've not started working on this, so if this is a problem for you, please upvote this by adding a comment or an emoji.

The current algorithm for nested pairs (those where the open and close are different, like parens and braces) simply counts open and cloes as it finds them. But it could be smarter by paying attention to the syntax of each character (ppss).

For example:

(message "finding (, huh?")
                  ---------

If the cursor is anywhere past the paren inside the string, it will incorrectly identify the underlined portion as the pair instead of matching with the first paren before "message".

For this particular case, it would work if we use syntax-ppss and note that we started outside of a string, so we should ignore the paren inside the string. Would work for skipping over comments too.

On a similar note, we could figure out which direction to search for quotes. If we are on a closing quote in a comment and the next quote is not in a comment, we should try the other direction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.