+
Skip to content

userdiff: add userdiff patterns for ts files (TypeScript) #859

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions userdiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ PATTERNS("bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
"[={}\"]|[^={}\" \t]+"),
PATTERNS("tex", "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$",
"\\\\[a-zA-Z@]+|\\\\.|[a-zA-Z0-9\x80-\xff]+"),
PATTERNS("ts", "^[\t ]*(constructor|public|private|protected).*$",
"^[\t ]*(const|let|var)[^()]*=[\t ]*\\([^()]*\\)[\t ]*=>*$"),

Choose a reason for hiding this comment

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

Seems like you intended >.* because otherwise this is saying: "accept any number of > characters"

If you accept this suggestion it will say: "accept rest of line", which will pull in the EOL-context for the hunk-header.

Suggested change
"^[\t ]*(const|let|var)[^()]*=[\t ]*\\([^()]*\\)[\t ]*=>*$"),
"^[\t ]*(const|let|var)[^()]*=[\t ]*\\([^()]*\\)[\t ]*=>.*$"),

PATTERNS("cpp",
/* Jump targets or access declarations */
"!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:[[:space:]]*($|/[/*])\n"
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载