Skip to content

Commit b5c6a74

Browse files
committed
Merge branch 'stable'
# Conflicts: # code/mindmap-model/pom.xml # code/mindmap-panel/pom.xml # code/mindolph-base/pom.xml # code/mindolph-core/pom.xml # code/mindolph-csv/pom.xml # code/mindolph-desktop/pom.xml # code/mindolph-fx/pom.xml # code/mindolph-fx/src/main/resources/dialog/about_dialog.fxml # code/mindolph-genai/pom.xml # code/mindolph-markdown/pom.xml # code/mindolph-mindmap/pom.xml # code/mindolph-plantuml/pom.xml # code/pom.xml
2 parents 617ec5a + 9faef32 commit b5c6a74

File tree

8 files changed

+37
-5
lines changed

8 files changed

+37
-5
lines changed

code/mindolph-base/src/main/java/com/mindolph/base/control/ExtCodeArea.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public void refresh() {
9191
// DO NOTHING
9292
}
9393

94+
public void refreshAsync() {
95+
// DO NOTHING
96+
}
97+
9498
public void doHistory() {
9599
historySource.push(null);
96100
}

code/mindolph-base/src/main/java/com/mindolph/base/control/HighlightCodeArea.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,18 @@ public abstract class HighlightCodeArea extends SearchableCodeArea {
3030

3131
public HighlightCodeArea() {
3232
refreshEvent.reduceSuccessions((v1, v2) -> v2, Duration.ofMillis(250)).subscribe(v -> {
33-
StyleSpans<Collection<String>> styleSpans = computeHighlighting(this.getText());
34-
this.setStyleSpans(0, styleSpans);
33+
this.refresh();
3534
});
3635
}
3736

3837
@Override
3938
public void refresh() {
39+
StyleSpans<Collection<String>> styleSpans = computeHighlighting(this.getText());
40+
this.setStyleSpans(0, styleSpans);
41+
}
42+
43+
@Override
44+
public void refreshAsync() {
4045
refreshEvent.push(null);
4146
}
4247

code/mindolph-base/src/main/java/com/mindolph/base/editor/BaseCodeAreaEditor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void loadFile() throws IOException {
135135
if (!Strings.CS.equals(oldValue, newText)) {
136136
this.codeArea.doHistory();
137137
if (log.isTraceEnabled()) log.trace("Refresh editor since text are changed.");
138-
refresh(newText);
138+
refreshAsync(newText);
139139
isChanged = true;
140140
fileChangedEventHandler.onFileChanged(editorContext.getFileData());
141141
this.outline();
@@ -170,6 +170,8 @@ public void loadFile() throws IOException {
170170
*/
171171
protected abstract void refresh(String text);
172172

173+
protected abstract void refreshAsync(String text);
174+
173175
protected abstract String getOutlinePattern();
174176

175177
protected abstract String getHeadingLevelTag();

code/mindolph-base/src/main/java/com/mindolph/base/editor/PlainTextEditor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ public void applyStyles() {
5858

5959
@Override
6060
protected void refresh(String text) {
61-
this.refresh();
61+
super.refresh();
62+
}
63+
64+
@Override
65+
protected void refreshAsync(String text) {
66+
// DO NOTHING
6267
}
6368

6469
@Override

code/mindolph-core/src/main/java/com/mindolph/core/constant/GenAiConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static Collection<ModelMeta> getFilteredPreDefinedModels(String providerName, in
6464
put(GenAiModelProvider.OPEN_AI.name(), new ModelMeta("gpt-5-mini", 128000));
6565
put(GenAiModelProvider.OPEN_AI.name(), new ModelMeta("gpt-5-nano", 128000));
6666
put(GenAiModelProvider.OPEN_AI.name(), new ModelMeta("gpt-5-chat-latest", 16384));
67+
put(GenAiModelProvider.OPEN_AI.name(), new ModelMeta("gpt-5-pro", 272000));
6768
put(GenAiModelProvider.OPEN_AI.name(), new ModelMeta("gpt-4.1", 32768));
6869
put(GenAiModelProvider.OPEN_AI.name(), new ModelMeta("gpt-4.1-mini", 32768));
6970
put(GenAiModelProvider.OPEN_AI.name(), new ModelMeta("gpt-4.1-nano", 32768));
@@ -139,6 +140,7 @@ static Collection<ModelMeta> getFilteredPreDefinedModels(String providerName, in
139140

140141

141142
// ChatGLM https://www.bigmodel.cn/console/modelcenter/square
143+
put(GenAiModelProvider.CHAT_GLM.name(), new ModelMeta("glm-4.6", 131072));
142144
put(GenAiModelProvider.CHAT_GLM.name(), new ModelMeta("glm-4.5-airx", 98304));
143145
put(GenAiModelProvider.CHAT_GLM.name(), new ModelMeta("glm-4.5-air", 98304));
144146
put(GenAiModelProvider.CHAT_GLM.name(), new ModelMeta("glm-4.5-x", 98304));

code/mindolph-markdown/src/main/java/com/mindolph/markdown/MarkdownEditor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,13 @@ protected void refresh(String text) {
374374
this.refresh();
375375
}
376376

377+
@Override
378+
protected void refreshAsync(String text) {
379+
codeArea.refreshAsync();
380+
super.refresh(text);
381+
this.refresh();
382+
}
383+
377384
@Override
378385
public void refreshPreview(String text, Callback<Object, Void> callback) {
379386
if (codeArea.getLength() == 0) {

code/mindolph-mindmap/src/main/java/com/mindolph/mindmap/dialog/NoteDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public NoteDialog(TopicNode topic, String title, NoteEditorData noteEditorData)
237237
if (!Strings.CS.equals(oldValue, newValue)) {
238238
this.textArea.doHistory();
239239
}
240-
textArea.refresh();
240+
textArea.refreshAsync();
241241
}
242242
);
243243
textArea.undoAvailableProperty().addListener((observableValue, aBoolean, newValue) -> btnUndo.setDisable(!newValue));

code/mindolph-plantuml/src/main/java/com/mindolph/plantuml/PlantUmlEditor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,13 @@ protected void refresh(String text) {
340340
this.refresh();
341341
}
342342

343+
@Override
344+
protected void refreshAsync(String text) {
345+
codeArea.refreshAsync();
346+
super.refresh(text);
347+
this.refresh();
348+
}
349+
343350
@Override
344351
public void refreshPreview(String text, Callback<Object, Void> previewConsumer) {
345352
indicator.reset();

0 commit comments

Comments
 (0)