Skip to content

[bugfix] Correct the content shown in status-bar #202

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

Merged
merged 2 commits into from
Mar 13, 2019
Merged

Conversation

jdneo
Copy link
Member

@jdneo jdneo commented Mar 12, 2019

Resolve #112

@jdneo jdneo added this to the 0.13.0 milestone Mar 12, 2019
@jdneo jdneo requested review from poppinlp and Vigilans March 12, 2019 12:23
private tryParseUserName(output: string): string {
const lines: string[] = output.trim().split(/\r?\n/);
if (lines.length === 3) {
const reg: RegExp = /^\s*.{1}\s*(.+)\s*https:\/\/leetcode/;
Copy link
Contributor

Choose a reason for hiding this comment

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

The regex executing on

'    ×      vigilans             https://leetcode-cn.com'

will return

'vigilans             '

Append ? to .+ to prevent greedy match could solve the problem.

Besides, is there any difference between .{1} and .?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

Copy link
Contributor

@Vigilans Vigilans left a comment

Choose a reason for hiding this comment

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

LGTM. I neglected the trim() in last review.

@jdneo jdneo merged commit be4f2d5 into master Mar 13, 2019
@jdneo jdneo deleted the cs/statusbar branch March 13, 2019 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants