chemoish / atom-valign

MIT License
5 stars 1 forks source link

Text is aligned from the first ':', event if it is in a string #9

Open romgrk opened 9 years ago

romgrk commented 9 years ago

From:

        'open:snippets': -> ws.open('/home/romgrk/.atom/snippets.cson')
        'open:commands': -> ws.open('/home/romgrk/.atom/node_modules/commands.coffee')
        'open:functions': -> ws.open('/home/romgrk/.atom/node_modules/functions.coffee')
        'open:init':     -> ws.open('/home/romgrk/.atom/init.coffee')
        'open:keymap':   -> ws.open('/home/romgrk/.atom/keymap.cson')
        'open:config':   -> ws.open('/home/romgrk/.atom/config.cson')
        'open:style':    -> ws.open('/home/romgrk/.atom/styles.less')
        'open:scribble':  -> ws.open('/home/romgrk/tmp/scribble.coffee')

To

        'open: snippets': -> ws.open('/home/romgrk/.atom/snippets.cson')
        'open: commands': -> ws.open('/home/romgrk/.atom/node_modules/commands.coffee')
        'open: functions': -> ws.open('/home/romgrk/.atom/node_modules/functions.coffee')
        'open: init':     -> ws.open('/home/romgrk/.atom/init.coffee')
        'open: keymap':   -> ws.open('/home/romgrk/.atom/keymap.cson')
        'open: config':   -> ws.open('/home/romgrk/.atom/config.cson')
        'open: style':    -> ws.open('/home/romgrk/.atom/styles.less')
        'open: scribble':  -> ws.open('/home/romgrk/tmp/scribble.coffee')

As you see, the first ':' is considered, instead of the second.

chemoish commented 9 years ago

@romgrk, thanks for the issue. I was waiting for someone to create an issue for this. :+1:

This edge case happens for any string as I did not include file grammar into the operator identification. I will take another look at that to try and include it.

chemoish commented 9 years ago

Without resorting to grammar checks per language. Will probably have to do reverse regex look ahead thingy.

Feel free to make a PR.