Skip to content

Commit

Permalink
[stylus mode] Fix some weird indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Aug 15, 2024
1 parent ce9520c commit b25d8f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mode/stylus.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,11 +709,11 @@ export const stylus = {
/^\s*\/(\/|\*)/.test(textAfter) ||
/^\s*\/\*/.test(prevLineFirstWord) ||
/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(textAfter) ||
/^(\+|-)?[a-z][\w-]*\(/i.test(textAfter) ||
/^return/.test(textAfter) ||
wordIsBlock(lineFirstWord)) {
indent = lineIndent;
} else if (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ch) || wordIsTag(lineFirstWord)) {
/^(\+|-)?[a-z][\w-]*\(/i.test(textAfter) ||
/^return/.test(textAfter) ||
wordIsBlock(lineFirstWord)) {
indent = lineIndent;
} else if (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ch) || wordIsTag(lineFirstWord)) {
if (/\,\s*$/.test(prevLineFirstWord)) {
indent = prevLineIndent;
} else if (!state.sol() && (/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(prevLineFirstWord) || wordIsTag(prevLineFirstWord))) {
Expand Down

0 comments on commit b25d8f3

Please sign in to comment.