-
Notifications
You must be signed in to change notification settings - Fork 40
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
Word Wrap option would be nice #87
Comments
This sounds like a nice feature to me. Hints and pull requests are welcome if anyone knows how to do this! |
I've never made a NB plugin but I guess it has to do with adding a file to the Editors structure. In the following example they use Editors > FontColors. |
The good news: I did some research and found out how to hook into the formatting options panel. I also created a proof-of-concept implementation. See the feature-line-wrap-nb8 branch. The bad news: This feature requires the Possible options to proceed include the following:
|
See |
Thanks for the hint! |
@jerry1970 The "Toggle line wrap" plugin by markiewb provides a more general solution for this issue. Would this be sufficient for you or is a separate option in the Markdown plugin itself important to you? Note that you can install it from within NetBeans if you want to try it. I thought it might be a good idea to get your opinion on this before I actually start to implement this. |
@markiewb 's suggestions sounds wonderful. It's a per mimetype setting so with Markdown being text/x-markdown, this should do the trick. A MD plugin setting would have been easier to find, but as long as it works, I don't care. I couldn't find a compiled version to test it. I only ever downloaded the install packages (from within NB and pointing NB to a downloaded package) but never built a package from within NB. When I load the project, NB knows how to build it and has enough runtime engines to do it? |
You don't have to compile the plugin. Open the "Plugins" window from the "Options" menu and search for "Toggle line wrap" in the "Available plugins" tab. Once you have installed the plugin open a Markdown file and click on the "Wrap: *" section in the status bar to toggle between "off", "any" and "words". |
Thanks. Weird that when I did a search on 'wrap' nothing came up and now with 'toggle line wrap' it does. Anyway, I installed it and it looks good, this is enough for me. That plugin does have a curious way of moving the cursor in a wrapped line. When I press End, the cursor moves past the line-wrap and ends up at the start of the next line. So I can keep pressing End to move the cursor to the end of the paragraph. More consistent would be placing the cursor right before the line-wrap, as you would expect with a line-break. But, this is good enough for me now. Maybe I didn't notice it before (or I have a different NB installation here than on my other computer), but the Options > Formatting > Language select box contains All languages, HTML, JSON, JavaScript, PHP, and text/x-java. I never noticed that text/x-java option there. @stengerh, do I understand correctly that it is hard to add an option text/markdown here? I didn't understand all of your explanation above, sorry... ;) |
The behaviour of the End key is determined by the NetBeans text editor. The "Toggle line wrap" plugin just changes the line wrap mode of this editor. It just provides a UI for this option. The Formatting tab in the Editor options provides another UI for the same option. I don't know why the combo box would should text/x-java instead of Java for you. It is actually not that difficult to add Markdown to the formatting options. However, the required API of the NetBeans IDE is not public so we cannot use it. As I wrote there is a workaround but this would break automatic updates and would probably cost us the validation for the update center. Without this validation users would not be able to download and install the plugin from within NetBeans. They would have to download the NBM file manually again. |
If NB would put your plugin on the friend list that would be great, but until then just mentioning the line wrapper plugin would be better than not being in the repository. |
Hi,
I have the system wide NetBeans setting for word wrap off, because in most code I don't like it.
But in markdown files, this would be very nice.
Now in NetBeans' Options > Editor > Formatting where I can set word wrap, I cannot select Markdown files only.
Is it possible to add Markdown files to the Language select box on the Formatting page?
The text was updated successfully, but these errors were encountered: