-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Show and Hide Text Feature #399
Comments
It seems this is at least technically possible as QTextBlock has a setVisible method that, presumably, can be used to show/hide lines of text (should be easy enough to test). I would guess the feature is supported because this is a common feature of code editors, and Qt has multiple widgets clearly intended for such use. The other feature points are easy enough to implement too, and are sensible options to have. The remaining question is how to mark a line as one that can be hidden. Since the intention here seems to be to "comment out" text, this should be a sub class of comments, similar to how synopsis comments are tagged. This will also help to reduce complexity and slowing down of the text parsing by adding further top level branching (headers, keywords, comments and regular text are treated as separate code branches at the top level in both the highlighter and the tokenizer). One possible solution is to have a paragraph like this tagged with:
For simplicity, a keyboard shortcut could be added to quickly toggle this feature on and off for a line. |
I've been thinking about this a bit. What you essentially want is a way to strike a whole paragraph. Maybe a I want to keep the the syntax as consistent as possible to avoid the need to learn a lot of esoteric codes and keywords. |
Hiding an entire paragraph is one of the use cases I'm thinking about, indeed it is likely the most common use case. But I'm also thinking to hide entire sentences, and perhaps even a few words or phrases in the general case. I may want to |
I will have to experiment with this. The backslash is not ideal as it's used for escaping characters, so unsure how to make this happen within text lines (paragraphs). Hiding whole lines is, as I said, trivial as each line, by default is a QTextBblock, which has a visibility flag. |
Maybe something like |
I think I will close this issue now. I've implemented #1075, which allows a paragraph to be completely ignored in the document viewer and manuscript builds. It is not visually hidden in the editor though, but that's a trickier thing to achieve. It may also not be so desirable as it would otherwise be difficult to find the hidden text. I've tested hiding these paragraphs, but there is no visual indicator to show where they are. The ignored paragraph feature is a toggle feature, and can be used on multiple paragraphs. It will be a part of the upcoming 2.3 release, and can be tested in the 2.3 pre-releases. The syntax is similar to comments, but uses a |
Is your feature request related to a problem? Please describe.
When making an edit pass over a manuscript I sometimes come across a chunk of text that I want to remove. But it's text that I might want to put back or use again later on. How can this text be maintained available and yet not have it show up in the manuscript?
novelWriter already includes a comment feature so the writer can sprinkle the text with ideas and notes. But the text I want to hide is not a comment. It might be a description.
Describe the solution you'd like
I propose novelWriter include special markers, perhaps backtics: \hide this text. A user controlled switch will:
Describe alternatives you've considered
This sort of thing may be possible if novelWriter were to include Git integration. There is a feature request to add Git integration that might be pressed into service to accomplish the above. However the above seems so much more useful.
Additional context
None.
The text was updated successfully, but these errors were encountered: