Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f2b1a75

Browse files
authored
change the place of the lock decorator (#23)
1 parent a44d3db commit f2b1a75

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

‎src/commands/show.ts‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,22 @@ async function showProblemInternal(channel: vscode.OutputChannel, id: string): P
7979
async function parseProblemsToPicks(p: Promise<list.IProblem[]>): Promise<Array<IQuickItemEx<string>>> {
8080
return new Promise(async (resolve: (res: Array<IQuickItemEx<string>>) => void): Promise<void> => {
8181
const picks: Array<IQuickItemEx<string>> = (await p).map((problem: list.IProblem) => Object.assign({}, {
82-
label: `${parseProblemDecorator(problem.state)}${problem.id}.${problem.name}`,
82+
label: `${parseProblemDecorator(problem.state,problem.locked)}${problem.id}.${problem.name}`,
8383
description: "",
84-
detail: `${parseLockDecorator(problem.locked)}AC rate: ${problem.passRate}, Difficulty: ${problem.difficulty}`,
84+
detail: `AC rate: ${problem.passRate}, Difficulty: ${problem.difficulty}`,
8585
value: problem.id,
8686
}));
8787
resolve(picks);
8888
});
8989
}
9090

91-
function parseProblemDecorator(state: ProblemState): string {
91+
function parseProblemDecorator(state: ProblemState,locked: boolean): string {
9292
switch (state) {
9393
case ProblemState.AC:
9494
return "$(check) ";
9595
case ProblemState.NotAC:
9696
return "$(x) ";
9797
default:
98-
return "";
98+
return locked ? "$(lock) " : "";
9999
}
100100
}
101-
102-
function parseLockDecorator(locked: boolean): string {
103-
return locked ? "$(lock) " : "";
104-
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /