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

Feature Request - word wrap per tab #5232

Open
Clyfton opened this issue Jan 13, 2019 · 40 comments
Open

Feature Request - word wrap per tab #5232

Clyfton opened this issue Jan 13, 2019 · 40 comments
Labels
enhancement Proposed enhancements of existing features

Comments

@Clyfton
Copy link

Clyfton commented Jan 13, 2019

I usually have many documents open of many types with only one or two I want to have word wrap. It would be great to have word wrap as a tab-right-click option so that word wrap only applies to that tab and not any of the others. The global word-wrap option can still remain for those who want that.

@Clyfton
Copy link
Author

Clyfton commented Apr 20, 2019

A great way to implement this would be to add a section of 3 settings to the right-click menu of a tab:

USE GLOBAL SETTING
WORD WRAP OFF
WORD WRAP ON

The USE GLOBAL SETTING would be the default.
If the user wants a per-tab setting, then user can click one of the bottom two.

@sasumner
Copy link
Contributor

It's a feature that makes sense. Not sure of the disposition of Notepad++ developers to add it, but it is possible to write a script to implement the behavior. See these links for inspiration: https://notepad-plus-plus.org/community/topic/10985/file-specific-word-wrap-vs-global-enable
and https://notepad-plus-plus.org/community/topic/16941/feature-request-word-wrap-per-tab

@Clyfton
Copy link
Author

Clyfton commented Apr 21, 2019

Thanks. But I saw those links previously and they were over my head to implement :(
It was like ... use this code ... but no instructions on how to use the code.

@MetaChuh MetaChuh added enhancement Proposed enhancements of existing features known issue The issue was known, but won't be fixed or cannot be fixed labels Apr 21, 2019
@sasumner
Copy link
Contributor

@Clyfton There are a lot of Pythonscript installation instructions on that same forum; seems pointless to re-spoon-feed here. Maybe see https://notepad-plus-plus.org/community/topic/17256/guide-how-to-install-the-pythonscript-plugin-on-notepad-7-6-3-7-6-4-and-above and/or https://notepad-plus-plus.org/community/topic/16942/pythonscript-any-ready-pyscript-to-replace-one-huge-set-of-regex-phrases-with-others/

@Clyfton
Copy link
Author

Clyfton commented Apr 21, 2019

I followed the instructions. Then I created WordWrapPerTab.py file and pasted in the script. It now appears as a Python script, but when I click on it, I get:
An exception occurred due to plugin: PythonScript.dll
Exception reason: Access violation

@Stan-Dm
Copy link

Stan-Dm commented May 11, 2020

I strongly support this feature request. My previous favorite text editor, ConTEXT, had this feature built in. Surprised more people aren't calling for this - doesn't everyone work with numerous large files, some files requiring word wrapping and other files not?

@Clyfton
Copy link
Author

Clyfton commented May 11, 2020

Sad but true ... none of the programmers and plugin developers notice the missing feature, and the few instructions laying around the internet are outdated and incomplete.
All the other major players have the per-tab-word-wrap feature: editpad pro, ultraedit, lopeedit.

@jpkatlarge
Copy link

+1 for me too. It seems to be something that I thought was already there, but recent experience with a variety of files in use daily makes having to go back and forth annoying. In the meantime maybe an Autohotkey macro might do it.

@ArkadiuszMichalski
Copy link
Contributor

Similar to #3839.

@Elleby77
Copy link

Elleby77 commented Feb 18, 2022

+1 here as well. I do a lot of coding in Notepad++ and sometimes I don't want the text to wrap for a certain tab but to remain wrapped in all the other tabs.

@sharprs83
Copy link

I was just preparing to make a similar request, but I came across this one for per-tab wrapping. This would solve my issue with the relatively minor hassle of having to set it each time I opened a file. Here's what I would add.

I'd be delighted to have word-wrap per lanugage.

The reasoning is that most of the time I don't want word wrap; it makes code hard to read. However, certain types of files shouldn't use CR LF for display formatting. The example that's been bugging me lately is markdown. I'd really appreciate being able to set markdown to be wrapped, while leaving most others alone. I might consider plain text as well; usually that's for notes I'm taking and wrapping would be helpful there as well so I don't have to watch how close I am to the edge of the window. After all, the "edge of the window" moves sometimes.

@FoolishTech
Copy link

boggles the mind this hasn't been implemented yet. very annoying constantly switching the global setting when switching to certain tabs where it matters. probably cliché to say this, but this is one of those features that would make me donate lol.

@alankilborn
Copy link
Contributor

@FoolishTech

boggles the mind this hasn't been implemented yet

Sure.

very annoying constantly switching the global setting when switching to certain tabs where it matters

Also very true.


A WORKAROUND technique has been known for roughly 7 years and was referenced earlier in this thread. Recently I've "freshened" the workaround and those efforts may be found HERE.

At this juncture, there are two choices: use the workaround, or continue to suffer.

@ArkadiuszMichalski
Copy link
Contributor

@alankilborn
You forgot about the third choice: start learning C++ and write the appropriate patch. Looking at the age of some requests, this option seems the most reasonable.

@alankilborn
Copy link
Contributor

You forgot about the third choice: start learning C++ and write the appropriate patch

If THAT'S the suggested path, that solves maybe 90% of open issues. :-)
I'd hazard to guess that the changes needed to the source code are not small, and thus best left to real devs (because they won't reject their own work--well, hopefully not).
But really, posters contributing offhand comments here, e.g. "boggles the mind...", are very likely just normal users, not those that are going to take the leap into writing this type of code. They are just looking for solutions; I give them a workaround of a small number of script code lines, sometimes; whether or not they choose to go that route is up to them.

@Clyfton
Copy link
Author

Clyfton commented Dec 6, 2022

The suggested feature should have been part of Notepad++ from day one.
The original Microsoft Notepad didn't need a per-tab settings because tabs aren't allowed.
Once tabs are implemented, word-wrap should be isolated to a tab.
The problem is, the devs and most users are using Notepad++ as a programming tool instead of a notepad.
Programmers have no need for word wrap.
Notepad++ should have been named something else, like Devpad++.
Other major notepads (Editpad Pro, Ultraedit, Lopeedit) have the feature because it makes sense and it is essential when actually using the program as a tabbed notepad.

@mekelton
Copy link

Desperately need this. I wish I had a nickel for every time I turned word wrap on or off.

@alankilborn
Copy link
Contributor

Desperately need this

Use the script referenced here: #5232 (comment)

@mekelton
Copy link

Desperately need this

Use the script referenced here: #5232 (comment)

I got the script to work when I run it from the Plugins menu. But I can't get the command to show up in the right-click Context Menu. I edited ContextMenu.xml and added this:

I saved the .XML file and exited out of Notepad++, then restarted. Do not see the entry in the right-click Context menu.

What am I missing?

@alankilborn
Copy link
Contributor

@mekelton

What am I missing?

I don't know, I think you left something out of your post:

image

@mekelton
Copy link

Oh, sorry, I didn't realize what I pasted in didn't appear:
<Item PluginEntryName = "Python Script" PluginCommandItemName = "WordWrapToggleForActiveTab" ItemNameAs = "Toggle wrap on/off for this file Ctrl+Alt+w" />

@alankilborn
Copy link
Contributor

@mekelton Does the script appear exactly here, in the FIRST submenu of the PythonScript plugin?

image

If not then I think you missed this step in the setup: https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript#:~:text=Click%20the%20left%20Add%20to%20add%20the%20script%20to%20the%20Menu%20items%20table

@mekelton
Copy link

I did miss that part. It is working now. Thanks very much!

@donho donho removed the known issue The issue was known, but won't be fixed or cannot be fixed label Oct 23, 2023
@TheSQLGuru
Copy link

I didn't read anything above, but want to immediately add my PLUS 1 to this request!! I have had this in TextPad forever and it is SOOOO useful!!

Now I will read the posts, and see if I can provide an additional useful posting based on what I find.

@TheSQLGuru
Copy link

boggles the mind this hasn't been implemented yet. very annoying constantly switching the global setting when switching to certain tabs where it matters. probably cliché to say this, but this is one of those features that would make me donate lol.

THIS!!!

@TheSQLGuru
Copy link

@FoolishTech

boggles the mind this hasn't been implemented yet

Sure.

very annoying constantly switching the global setting when switching to certain tabs where it matters

Also very true.

A WORKAROUND technique has been known for roughly 7 years and was referenced earlier in this thread. Recently I've "freshened" the workaround and those efforts may be found HERE.

At this juncture, there are two choices: use the workaround, or continue to suffer.

A) Why would you mention something that was already recommended AND which the OP stated completely flumuxed him/her?!?

B) What you suggest is also only one step removed from telling a user of Microsoft Excel to stop whining, learn how to program, and then hack a patch to the application to get what you want.

C) Oh, did you get the part there about needing to learn how to program FIRST??

D) How about another angle: are you recommending that a user COPIES CODE OFF OF THE INTERNET and then just runs it on their computer?!?!? Even if the user was competent in the language, which is not the case here, they could still get screwed by doing this if they miss something in their review of said code.

Very misguided recommendation here, and poor taste too, IMHO.

@TheSQLGuru
Copy link

@alankilborn You forgot about the third choice: start learning C++ and write the appropriate patch. Looking at the age of some requests, this option seems the most reasonable.

Desperately need this. I wish I had a nickel for every time I turned word wrap on or off.

THIS ALSO!

@TheSQLGuru
Copy link

@alankilborn You forgot about the third choice: start learning C++ and write the appropriate patch. Looking at the age of some requests, this option seems the most reasonable.

I assume that you are not expressing sarcasm here, due to the lack of an emoji. If you were, good one! If not, I reference you to my prior post quoting a similar response . . . but yours is far worse.

@TheSQLGuru
Copy link

The suggested feature should have been part of Notepad++ from day one. The original Microsoft Notepad didn't need a per-tab settings because tabs aren't allowed. Once tabs are implemented, word-wrap should be isolated to a tab. The problem is, the devs and most users are using Notepad++ as a programming tool instead of a notepad. Programmers have no need for word wrap. Notepad++ should have been named something else, like Devpad++. Other major notepads (Editpad Pro, Ultraedit, Lopeedit) have the feature because it makes sense and it is essential when actually using the program as a tabbed notepad.

I don't see this as a problem. First off, NPP was NOT named DevPad++, it was named Notepad++. I don't know if NPP was originally written SPECIFICALLY as a developer tool, or if it was written as a more general text editor. Given the riff on Microsoft's product name, I strongly suspect the latter.

Regardless, NPP should strive to provide what anyone who decides to use it would absolutely expect from it - modern text creation/editing features (and a LOT of people are drawn to the product due to its wonderful reviews online). And wrapping-per-document is clearly one of those features.

@TheSQLGuru
Copy link

I posted my subsequent comments partly the hopes of helping some people be better at responding to GitHub Issue postings.

But the main issue was to hopefully get this feature to percolate up to the "let's add it now" que. As a final push for this, I note that this particular feature request has been on the books since at LEAST Jan 29, 2016: #1427. And that Issue Request was closed, improperly I think, simply because the poster wasn't using the latest NPP build. So we are talking at least EIGHT YEARS that this has been asked for.

@alankilborn
Copy link
Contributor

I would have to dig to find the reference (somewhere in some recent RTL-per-tab issue comments), but N++ author feels that word-wrap-per-tab would introduce some unacceptable performance penalties, so it won't be considered for implementation.

@nurbles
Copy link

nurbles commented Mar 15, 2024

Strange that NOT doing extra work (i.e. word wrapping) for EVERY tab causes a performance penalty. It must take a whole lot of work to NOT do something in N++!

I really, REALLY wish this existed in the base product. To me, the whole point of multiple tabs is that I can have multiple documents, almost always a mix of general text, source code and configuration files -- but only the general text benefits from word wrap. With 5GHz, 24 core CPUs these days, I think I can afford the performance penalty!

@Clyfton
Copy link
Author

Clyfton commented Mar 15, 2024

Strange that NOT doing extra work (i.e. word wrapping) for EVERY tab causes a performance penalty. It must take a whole lot of work to NOT do something in N++!

I really, REALLY wish this existed in the base product. To me, the whole point of multiple tabs is that I can have multiple documents, almost always a mix of general text, source code and configuration files -- but only the general text benefits from word wrap. With 5GHz, 24 core CPUs these days, I think I can afford the performance penalty!

Well said! I couldn't agree more. There have been 10,000 fixes to problems I've never had and no interest in the biggest omission.

@nathanm
Copy link

nathanm commented Aug 30, 2024

@alankilborn

A WORKAROUND technique has been known for roughly 7 years and was referenced earlier in this thread. Recently I've "freshened" the workaround and those efforts may be found HERE.

I added the PythonScript plugin and your WordWrapToggleForActiveTabWithPersistence script. It works great, and I really appreciate it. Any possibility the script could also toggle N++'s built-in word-wrap icon in the toolbar somehow? (I suppose I could install the Customize Toolbar plugin.)

P.S. Your suggested keyboard shortcut of Ctrl+Alt+W is similar to the pre-defined Ctrl+Shift+W keyboard shortcut for close all windows. I did that by accident the first time I tried it. Oops.

@Clyfton
Copy link
Author

Clyfton commented Aug 31, 2024

The workaround won't help me. I keep around 30 text files open all the time. I need a way to turn word wrap on for one or two of them (different ones each time), not all of them.

@alankilborn
Copy link
Contributor

@Clyfton

The workaround won't help me. I keep around 30 text files open all the time. I need a way to turn word wrap on for one or two of them (different ones each time), not all of them.

I think you're confused. The workaround script allows independent control.

@alankilborn
Copy link
Contributor

@nathanm

Any possibility the script could also toggle N++'s built-in word-wrap icon in the toolbar somehow?

Scripts don't have easy access to the toolbar icons. What I do if I am unsure of the wrap status for the active tab is to toggle it and then I see the status in the N++ status bar area. If it goes to the state I don't want by doing that, I simply toggle it again. (Note: not sure if the script you have is one that writes status to N++ status bar?)


I suppose I could install the Customize Toolbar plugin.

That plugin has known problems.


P.S. Your suggested keyboard shortcut of Ctrl+Alt+W is similar to the pre-defined Ctrl+Shift+W keyboard shortcut for close all windows. I did that by accident the first time I tried it. Oops.

I tried to suggest something unassigned, for simplicity. What I actually have for myself is Ctrl+w assigned to it (I unassign the default N++ Ctrl+w from close-tab).

@Clyfton
Copy link
Author

Clyfton commented Aug 31, 2024

@nathanm

@Clyfton

The workaround won't help me. I keep around 30 text files open all the time. I need a way to turn word wrap on for one or two of them (different ones each time), not all of them.

I think you're confused. The workaround script allows independent control.

You are probably right.
I may have confused "active" with "open" in the line below:
With each run of the script, the state of wrapping for the active file will be “toggled” – if wrap was “off” when the script was run, it will be turned “on”; if wrap was “on” at script running, it will be turned “off”.

@Clyfton
Copy link
Author

Clyfton commented Sep 1, 2024

@nathanm
Great job on the script. Thanks.
I followed the install instructions.
Unfortunately, the persistence is not working for me.
When I run the script, it word-wraps and says "word wrap is ON" at the bottom.
If I restart Notepad++, the file no longer wraps, yet the script remembers the state.
So, when I run the script again, it says "word wrap is OFF," so it remembered that word wrap should have been ON but it actually wasn't.

@alankilborn
Copy link
Contributor

@Clyfton

the persistence is not working for me.

It works for me.
Are you trying WordWrapToggleForActiveTabWithPersistence.py or WordWrapToggleForActiveTab.py ?
If you need further help with the script, posting HERE is a more appropriate place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposed enhancements of existing features
Projects
None yet
Development

No branches or pull requests