Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a means of using a multi-character trigger. #230

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

GlennNZ
Copy link

@GlennNZ GlennNZ commented Apr 9, 2019

This PR is more for visibility purposes because my dev setup is not agreeing with gulp; I haven't run any formal tests. I'm hoping someone can take what I'm hinting at here and is able to provide a more robust solution. It's working for my particular use case after modifying the non ES6 javascript file.

This relates to issue #153

@@ -144,7 +144,7 @@ class TributeRange {
: '\xA0'
text += textSuffix
this.pasteHtml(text, info.mentionPosition,
info.mentionPosition + info.mentionText.length + !this.tribute.autocompleteMode)
info.mentionPosition + info.mentionText.length + info.mentionTriggerChar.length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this break autocompleteMode in tributejs

Copy link
Author

@GlennNZ GlennNZ Apr 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I think the idea of having a boolean be used as an integer for arithmetic purposes made me blitz it, but I didn't put back a proper solution.

It likely needs a

autocompleteOffet = this.tribute.autocompleteMode ? info.mentionTriggerChar.length : 0;

and then use that offset value.

peschuster added a commit to peschuster/tribute that referenced this pull request Oct 3, 2019
@peschuster
Copy link
Contributor

Hi,
I am also interested in this feature. Any chance of getting this PR merged? Or is there anything I can help with? I also think that the length of the trigger string needs to be added to line 135 of TributeRange.js with offset -1.

@GlennNZ
Copy link
Author

GlennNZ commented Oct 3, 2019 via email

peschuster added a commit to peschuster/tribute that referenced this pull request Oct 4, 2019
mrsweaters pushed a commit that referenced this pull request Oct 4, 2019
* Add support for multi-char triggers

Adopted changes from PR #230 (#230).

* Added tests for multi-char trigger

* Fix autocompleteMode with multi-char changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants