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

Block comments #1687

Closed
novakwh opened this issue Feb 5, 2024 · 6 comments · Fixed by #1690
Closed

Block comments #1687

novakwh opened this issue Feb 5, 2024 · 6 comments · Fixed by #1690
Labels
duplicate Invalid: This issue or pull request already exists enhancement Request: New feature or improvement next release Note: Features planned for next release

Comments

@novakwh
Copy link

novakwh commented Feb 5, 2024

I searched and don't think I found this anywhere, if I overlooked it, my apologies.

Is there a way to comment out multiple paragraphs at once without needing to put a single % symbol at the beginning of each paragraph? In Obsidian, for example, I can turn multiple paragraphs into a comment block by putting %% at the beginning and then again at the end; or you can do the same with HTML comments, of course, and those would also work in standard Markdown (although I actually prefer the simplicity of %%). In novelWriter, it seems I can only comment out one paragraph at a time (and the "toggle comment" command, if used with multiple paragraphs selected, will only comment out the first paragraph.)

The reason I ask is that sometimes I write quite a bit of copy in a scene that I may or may not want to use, but I want to keep it there inside the scene, where it was natural for me to write it and where it would likely go if I decided later to use it. The easiest way to do this, that I can think of, would be to comment out the block, but not if I have to add (and then later remove) a % sign at the beginning of each commented paragraph.

For one example, I might write an exchange between two people and decide to slip a bit of description or memory of backstory in the middle, where it makes sense for me to write it, but I am not sure if I want to actually include it or not. The only other alternative that I can find would be to copy everything to a different note, but I'd rather not have to do this if possible.

Thanks for your time and consideration!

@novakwh novakwh added the enhancement Request: New feature or improvement label Feb 5, 2024
@vkbo
Copy link
Owner

vkbo commented Feb 5, 2024

Yes, there is already this request: #1042, which would cover what you're asking for.

You can comment/uncomment a paragraph with Ctrl + / on Linux and Windows, and whatever is the equivalent on Mac, which makes it a little faster than using the menu (not sure if that's what you meant). You don't have to type the %, or remove it, manually.

@vkbo vkbo added the duplicate Invalid: This issue or pull request already exists label Feb 5, 2024
@vkbo
Copy link
Owner

vkbo commented Feb 5, 2024

The feature in #1042 is scheduled for the next release by the way, and I think I will be able to include it.

@novakwh
Copy link
Author

novakwh commented Feb 5, 2024

Yes, the Ctrl / "toggle comment" command is easier than typing and removing %, but you still have to do it one paragraph at a time, which is what I hope to be able to avoid if you add block commenting in the future. Thanks very much! I really do love this software.

@vkbo
Copy link
Owner

vkbo commented Feb 5, 2024

There will not be block commenting, like you describe it, any time soon. The format parser in novelWriter treats the text one line at a time. However, being able to toggle comment mode on all selected text, including multiple paragraphs, should make this much simpler.

@vkbo vkbo added this to the Release 2.3 Beta 1 milestone Feb 10, 2024
@vkbo vkbo added the next release Note: Features planned for next release label Feb 10, 2024
@vkbo vkbo linked a pull request Feb 10, 2024 that will close this issue
6 tasks
@vkbo
Copy link
Owner

vkbo commented Feb 10, 2024

PR #1690 adds a new "ignored text format" which is just a %~ instead of % in front of the paragraph. This modified version will always exclude the text from manuscript builds even if you include comments. It's just an optional feature, and something I want for my own writing.

In any case, in the context of adding that, I made the comment, ignore text, and reset format commands apply to multiple paragraphs, Since the first two are toggle commands, they will make the decision based on the first of the selected paragraphs, and apply it to the remaining in the selection.

I hope this is good solution to this request.

@vkbo vkbo closed this as completed Feb 10, 2024
@novakwh
Copy link
Author

novakwh commented Feb 10, 2024

This sounds great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Invalid: This issue or pull request already exists enhancement Request: New feature or improvement next release Note: Features planned for next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants