Skip to content

Commit

Permalink
Small regex fix to make style completion work after [ or before ,
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikDoom committed Jan 26, 2024
1 parent a63ce64 commit afa1330
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion javascript/ext_styles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const STYLE_REGEX = /(\$(\d*)\(?)[^$|\]\s]*\)?/;
const STYLE_REGEX = /(\$(\d*)\(?)[^$|\[\],\s]*\)?/;
const STYLE_TRIGGER = () => TAC_CFG.useStyleVars && tagword.match(STYLE_REGEX);

var lastStyleVarIndex = "";
Expand Down
4 changes: 2 additions & 2 deletions javascript/tagAutocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ function isEnabled() {
const WEIGHT_REGEX = /[([]([^()[\]:|]+)(?::(?:\d+(?:\.\d+)?|\.\d+))?[)\]]/g;
const POINTY_REGEX = /<[^\s,<](?:[^\t\n\r,<>]*>|[^\t\n\r,> ]*)/g;
const COMPLETED_WILDCARD_REGEX = /__[^\s,_][^\t\n\r,_]*[^\s,_]__[^\s,_]*/g;
const STYLE_VAR_REGEX = /\$\(?[^$|\]\s]*\)?/g;
const NORMAL_TAG_REGEX = /[^\s,|<>\]:]+_\([^\s,|<>\]:]*\)?|[^\s,|<>():\]]+|</g;
const STYLE_VAR_REGEX = /\$\(?[^$|\[\],\s]*\)?/g;
const NORMAL_TAG_REGEX = /[^\s,|<>\[\]:]+_\([^\s,|<>\[\]:]*\)?|[^\s,|<>():\[\]]+|</g;
const RUBY_TAG_REGEX = /[\w\d<][\w\d' \-?!/$%]{2,}>?/g;
const TAG_REGEX = new RegExp(`${POINTY_REGEX.source}|${COMPLETED_WILDCARD_REGEX.source}|${STYLE_VAR_REGEX.source}|${NORMAL_TAG_REGEX.source}`, "g");

Expand Down

0 comments on commit afa1330

Please sign in to comment.