Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Allow space before “++” and “--” #3

Open
FranklinYu opened this issue Feb 10, 2019 · 3 comments
Open

Allow space before “++” and “--” #3

FranklinYu opened this issue Feb 10, 2019 · 3 comments

Comments

@FranklinYu
Copy link

This is a feature request.

In Gitter when we mention someone with @, the auto-completion would add a space after user’s name. To trigger this plugin, user need to manually remove the space before typing ++. It would be great if a space before ++/-- is allowed.

@notpeter
Copy link
Owner

I don't have Gitter to test with, but this shouldn't be tough, probably just modifying the -- regex and the ++ regex.

Just add \s? after the first closing parenthesis in each regex. So change these two lines:

robot.hear /@?(\S+[^+\s])\+\+(\s|$)/, (msg) ->
robot.hear /@?(\S+[^-\s])--(\s|$)/, (msg) ->

To be like so:

robot.hear /@?(\S+[^+\s])\s?\+\+(\s|$)/, (msg) ->
robot.hear /@?(\S+[^-\s])\s?--(\s|$)/, (msg) ->

Can you edit your local copy karma-classic.coffee, restart, test and report back?

@cbuto
Copy link

cbuto commented Apr 15, 2019

That regex worked for me

@jjshoe
Copy link

jjshoe commented Apr 15, 2019

Can verify the regex worked as well

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants