Skip to content
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

Fix script editor caret position #1301

Merged
merged 4 commits into from
Aug 24, 2023
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This is a work-in-progress for the next QuPath release.
* 'Run for project' does not recognize when previous images have been deleted (https://github.com/qupath/qupath/issues/1291)
* ProjectCommands.promptToImportImages always returns an empty list (https://github.com/qupath/qupath/issues/1251)
* PathIO doesn't restore backup if writing ImageData fails (https://github.com/qupath/qupath/issues/1252)
* Scripts open with the caret at the bottom of the text rather than the top (https://github.com/qupath/qupath/issues/1258)

### Dependency updates
* Bio-Formats 7.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ protected void readFile(final File file) throws IOException {
logger.info("Loading file {} to Script Editor", file.getAbsolutePath());
String content = GeneralTools.readFileAsString(file);
editor.setText(content);
editor.positionCaret(0); // Reposition caret to the beginning of the file
name = file.getName();
this.file = file;
lastModified = file.lastModified();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public Region getRegion() {
if (splitPaneGrid == null) {
// Create a reasonably-sized viewer
QuPathViewerPlus defaultViewer = createViewer();
this.viewers.add(defaultViewer);
// this.viewers.add(defaultViewer);
if (defaultViewer != null)
defaultViewer.addViewerListener(this);
setActiveViewer(defaultViewer);
Expand Down
Loading