vkbo / novelWriter

novelWriter is an open source plain text editor designed for writing novels. It supports a minimal markdown-like syntax for formatting text. It is written with Python 3 (3.9+) and Qt 5 (5.15) for cross-platform support.
https://novelwriter.io
GNU General Public License v3.0
2.05k stars 105 forks source link

Option to disable editing while writing #1721

Open xahodo opened 7 months ago

xahodo commented 7 months ago

The basic idea is to have a menu entry or option somewhere which, when enabled, disables all navigation (except from enter) and deletion keys, and puts the cursor automatically at the end of the current text. It would also be useful to disable selection using the mouse while this feature is active. This is to prevents writers from editing the text they've already typed. Of course those keys would only be disabled in the text editor where the actual chapters/scenes are written, not throughout the entire application. It could be called "Disable editing".

Such a tool is really helpful to prevent writers from editing what was entered while they're writing (I suffer from this). This option would be particularly useful in a first draft situation.

Further options building on this feature could be to include options such as automatically turning this off when the user switches to another chapter/scene which already contains text (thought being: the user now wants to edit) and a clock which, once set, would prevent this option from being turned off until the clock reaches zero. It could be a countdown or a clock which is active between certain times.

I tried searching, but could not find a feature request for this.

vkbo commented 7 months ago

Yes, I've seen this referred to as both "Typewriter Mode" and "Hemingway Mode". I've thought about adding this already, but you're right that there is no feature request for it.

There could be both a timer option and a word count option to the feature as well.

vkbo commented 7 months ago

I was thinking where to add this feature on the GUI. I'm planning to add collapsible panels below the Project Tree, like in VSCode. There are a few features I want to put in there. This may be a good place for this too.

A panel could include a progress bar with a word or time goal, with the option to keep "write only" mode on for the duration. There have been other requests for a writing session progress bar, and I may as well combine them into one.

The writing and editing mode toggle can be located on the editor footer for manual toggle and to display which mode the editor is currently in.

vkbo commented 6 months ago

Implementation note: The mode can be implemented by cancelling keystrokes where the cursor is not at the end of the document. This will allow the usage of the backspace key, but not editing anywhere inside the text already written.

Optionally, when the user types, the cursor could also skip to the end. This may be useful if the document ends in line breaks and someone is trying to continue the last paragraph. In which case, nothing would happen as it's not technically the end.