Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Conversation

@SiriusXT
Copy link
Member

@SiriusXT SiriusXT commented May 14, 2025

In read-only code, the selected text can be directly obtained through getSelection

@github-actions
Copy link

github-actions bot commented May 14, 2025

Folder/File Previous size New size Difference
/upload/TriliumNextNotes-Server-1933-merge-linux-x64.tar.xz 69.44MB +69.44MB (+100.00%)
TOTAL +69.44MB

const codeEditor = await this.noteContext.getCodeEditor();
selectedText = codeEditor.getSelectedText();
}
if (this.note?.type === "code" && this.noteContext && !isReadOnly) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have getCodeEditor for read-only code notes as well (not sure why it wasn't the case in upstream Trilium), so I guess we could remove the read-only check entirely.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it and it really works. It seems that you have fixed the issue. , I remembered that the codeEditor would not be fetched inside the read-only code before so that's why the check was there.

@eliandoran eliandoran marked this pull request as draft May 14, 2025 05:47
@SiriusXT SiriusXT marked this pull request as ready for review May 14, 2025 06:51
@eliandoran eliandoran added this to the v0.94.0 milestone May 14, 2025
@eliandoran eliandoran merged commit 5c8d3f9 into develop May 14, 2025
11 checks passed
@eliandoran eliandoran deleted the codemirror_find branch May 14, 2025 09:56
eliandoran added a commit that referenced this pull request May 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants