Skip to content

fix config failure #548

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
Aug 6, 2022
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Icon patchIcon(Icon baseIcon, VirtualFile file, int flags, @Nullable Proj
}
try {
Config config = PersistentConfig.getInstance().getInitConfig();
if (config == null || !config.isQuestionEditor() || !config.isShowQuestionEditorSign()) {
if (config == null || !config.isShowQuestionEditor() || !config.isShowQuestionEditorSign()) {
return baseIcon;
}
LeetcodeEditor leetcodeEditor = ProjectConfig.getInstance(project).getEditor(file.getPath(), config.getUrl());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public QuestionEditorProvider() {
public boolean accept(@NotNull Project project, @NotNull VirtualFile file) {
try {
Config config = PersistentConfig.getInstance().getInitConfig();
if (config == null || !config.isQuestionEditor()) {
if (config == null || !config.isShowQuestionEditor()) {
return false;
}
LeetcodeEditor leetcodeEditor = ProjectConfig.getInstance(project).getEditor(file.getPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class QuestionEditorTabTitleProvider implements EditorTabTitleProvider {
public @NlsContexts.TabTitle @Nullable String getEditorTabTitle(@NotNull Project project, @NotNull VirtualFile file) {
try {
Config config = PersistentConfig.getInstance().getInitConfig();
if (config == null || !config.isQuestionEditor() || !config.isShowQuestionEditorSign()) {
if (config == null || !config.isShowQuestionEditor() || !config.isShowQuestionEditorSign()) {
return null;
}
LeetcodeEditor leetcodeEditor = ProjectConfig.getInstance(project).getEditor(file.getPath(), config.getUrl());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void openCode(String titleSlug, Project project) {
return;
}

if (config.isQuestionEditor()) {
if (config.isShowQuestionEditor()) {
openContent(titleSlug, project, false);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/shuzijun/leetcode/plugin/model/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,13 @@ public void setCookie(boolean cookie) {
}

@Transient
public Boolean isQuestionEditor() {
public Boolean isShowQuestionEditor() {
return !"Disable".equals(questionEditor) && !"false".equals(questionEditor);
}

@Transient
public Boolean isLeftQuestionEditor() {
return "Left".equals(questionEditor) || "true".equals(questionEditor) || !isQuestionEditor();
return "Left".equals(questionEditor) || "true".equals(questionEditor) || !isShowQuestionEditor();
}

public String getQuestionEditor() {
Expand Down