Skip to content

Commit

Permalink
compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
shuzijun committed Jan 16, 2023
1 parent b48527c commit 776ea53
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Markdown Editor Changelog

## 2.0.3
## 2.0.4

### Added
- Open file wait for animation
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginGroup = com.shuzijun.markdown
pluginName = markdown-editor
pluginVersion = 2.0.3
pluginVersion = 2.0.4

pluginSinceBuild = 221.0
pluginUntilBuild =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import java.awt.event.ComponentEvent;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -318,7 +320,21 @@ public void browserFind(String txt, boolean forward) {
getCefBrowser().stopFinding(true);
return;
}
getCefBrowser().find(1, txt, forward, false, true);
CefBrowser cefBrowser = getCefBrowser();

try {
Method findMethod = CefBrowser.class.getMethod("find",String.class,boolean.class,boolean.class,boolean.class);
findMethod.invoke(cefBrowser,txt, forward, false, true);
} catch (NoSuchMethodException e) {
try {
Method findMethod = CefBrowser.class.getMethod("find",int.class,String.class,boolean.class,boolean.class,boolean.class);
findMethod.invoke(cefBrowser,1, txt, forward, false, true);
} catch (Exception ex) {
LOG.error(ex);
}
} catch (Exception e) {
LOG.error(e);
}
}

private static boolean offScreenRendering(boolean isFileEditor) {
Expand Down

0 comments on commit 776ea53

Please sign in to comment.