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

Make the editor actually Plain Text #1521

Merged
merged 5 commits into from
Sep 6, 2023
Merged

Make the editor actually Plain Text #1521

merged 5 commits into from
Sep 6, 2023

Conversation

vkbo
Copy link
Owner

@vkbo vkbo commented Sep 6, 2023

Summary:

This PR makes the text editor in novelWriter actually plain text. So far, it's been a rich text editor with rich text editing disabled. At some point, there was a reason for this. There are still some drawbacks, but the benefits outweigh them.

Pros

  • It loads a lot faster since it doesn't have to take into account special text content like lists, images and tables. Which we don't support anyway.
  • The syntax highlighter works a lot more smoothly since it is designed and optimised for the plain text view.
  • Re-running the highlighter is no longer a performance bottleneck, so we can now rerun it for spell checking purposes even for large documents.
  • Scrolling past the end of the document is supported out of the box.
  • Centring the cursor when skipping to a specific line is natively supported.
  • There is no longer a need for the big doc limit setting, and no need to cap the max size of a text document. Performance when loading will suffer when a document reaches the 10MB range, but the editor still works, and works smoothly once the document is loaded.

Cons

  • The document now scrolls a single line at a time, so there is no smooth scrolling anymore.
  • The feature to keep the current line fixed is not as smooth anymore due to the above reason, but it does still work.

Related Issue(s):

Reviewer's Checklist:

  • The header of all files contain a reference to the repository license
  • The overall test coverage is increased or remains the same as before
  • All tests are passing
  • All flake8 checks are passing and the style guide is followed
  • Documentation (as docstrings) is complete and understandable
  • Only files that have been actively changed are committed

@vkbo vkbo added this to the Release 2.2 Beta 1 milestone Sep 6, 2023
@vkbo vkbo changed the title Make the editor actual Plain Text Make the editor actually Plain Text Sep 6, 2023
@vkbo vkbo merged commit e08790e into dev Sep 6, 2023
9 checks passed
@vkbo vkbo deleted the plaintext branch September 6, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant