Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Ignore Line Returns When Searching in Sublime

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #201338
    heavymark
    Participant

    I run into this issue all the time. I’m debugging css in chrome web inspector. I copy the css rule from chrome and cmd+f in sublime stylesheet to find the relevant css to make the necessary change.

    Most often it finds 0 results, which of course is impossible since I just copied it from the actual code. Note, this is regular css, not a pre-processor. I quickly realized it’s because of in the style sheets each rule may be on it’s online for instance.

    Is there a setting for Sublime so it will find the string regardless of line returns or extra spaces between code?

    #201516
    Alen
    Participant

    #201517
    Alen
    Participant

    but you can’t enter it in the search box.

    You can:

    • CTRL + F, to search
    • type “a” then press CTRL + ENTER then type “word”

    NO need for copy/paste.

    #201519
    heavymark
    Participant

    Thanks for everyone’s comments. So far none help my particular situation but some of the comments may help others with one of needs in regards to searches.

    For a one off time, could certainly manually add line returns etc, but in my situation I do the copy and pasting countless times per day so adding returns would end up being more time rather than less.

    Seems like there should be a setting or plugin that performs formatting before searching.

    For instance, a site’s code could have extra spaces between certain css code, or have line returns or be minified and in Chrome while view source will always show the users original styling the web inspect which is what I use, always shows the css formatted in the same way without line returns or any spacing. That is the code I copy and paste in Sublime to search the css file. I could find a code formatter plugin that formats the code to match chrome/safari styling but would be nice if I didn’t have to and search simply calculated that in knowing that the css is the same no matter the users particular styling such as a rule on each line or all one one line or tabs or indents, etc.

    Since it seems Sublime doesn’t natively support this will search for a plugin to help. Thanks ladies and gents!

    #201523
    heavymark
    Participant

    Thanks though I’m already familiar with sublime’s support for regular expressions. While not helpful for my situation they sooner are applicable in a lot of cases.

    The point for the above is about speed where I simply click control c to copy control tab to switch to sublime control f to find and control p to paste and then enter. Which I’m able to do in under to seconds. Where is having to manual edit each thing I’m pasting by adding multiple regex depending on where line returns may or may not be would complicate the problem more. Currently can simply copy only part of the css that I know won’t have a line return which is very fast but the problem being it may match multiple instances of code since it’s not as specific.

    But got my answer here that it doesn’t seem to support this issue natively so looking for a plugin to help do searches based on if the code was formatted even though it’s not.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Other’ is closed to new topics and replies.