Restore right margin word wrap as in 7.8.5



  • Hi,
    I’ve been “suffering” without this for some time, but finally thought I’d ask if it could be restored as an option.

    In version 7.8.5 and prior, Ctrl-I (capital “i”) word wraps a long line at the right margin no matter how big the window is. After that version, the word wrap option changed to always wrap at the window width.

    I find this very inconvenient. I often have files that have a combination of long lines and lines that I want to be only 80 characters. I make the window wider to see the full lines, but want to
    wrap certain lines without having to very carefully resize the window every single time. If you don’t resize it just right, it can wrap at 81 or 82.

    The prior method was brilliant. Can it be restored as an option in the Preferences/Editing section? Window wrap or margin wrap?

    Thanks,
    RD



  • @rd4gh ,

    In version 7.8.6, the developers added the “multi-margin” feature, which made it possible to have multiple margin lines. Probably something about the way that was implemented made the wrap-at-margin not work as it did in v7.8.5 and earlier.

    As a workaround, it doesn’t seem to me to be too hard to get the application width set properly to line up with the margin at character 80 (or whatever your preference) – just shrink go until only the final 1 wraps:

    123456789x123456789x123456789x123456789x123456789x123456789x123456789x123456789x1
    

    8e2916f2-017d-4b06-a195-aaebc9cffd78-image.png

    … however, I do understand that being able to set the line-wrap to go at one of the margins rather than at the full screen width might be useful.

    This forum is good for discussing problems, and finding workarounds, but isn’t the right place for a feature request – the process is discussed in a FAQ entry. If you do create an issue, please paste a link to that issue in this discussion

    If I were to give some advice for requesting the feature: I would suggest some implementation alternatives, like:

    1. Add a checkbox to toggle at the last (rightmost column) margin in the entry
    2. Add a checkbox to toggle at the first (leftmost column) margin in the entry
    3. Both 1 and 2
    4. Add a single checkbox to toggle at the nth margin, where nth, where the nth is a numeric entry, similar to the recent-files-entry or tab-stop entry
    5. Add a syntax where something like 5 (80) 120 or 5 w80 120 would give three

    However, just writing those descriptions out, I am not sure it’s ever overly useful to wrap at anything but the rightmost margin (#1), because otherwise, why draw those other margins? (Maybe if someone frequently toggled the line-wrap on and off, they might want the indicator at 120 to be there when line-wrap is off, but wrap at 80 when line-wrap is on).

    In the mean time, since such a feature might take a while to be implemented, or maybe never be implemented, hopefully the workaround of using an 81-character line with no space, along with the margin setting, to help you to find the right width for you window (if not, you could in theory just continue using v7.8.5… you don’t have to upgrade, after all.)



  • @rd4gh said in Restore right margin word wrap as in 7.8.5:

    In version 7.8.5 and prior, Ctrl-I (capital “i”) word wraps a long line at the right margin no matter how big the window is

    I think there are some good ideas expressed here, but I was initially somewhat confused due to nomenclature problems.

    “In 7.8.5 and prior, Ctrl+i word wraps a long line at the right margin”
    —should be stated as—>
    In 7.8.5 and prior, Ctrl+i splits a long line at the Vertical Edge column

    Splitting (Ctrl+i) is different from word-wrapping (View menu > Word wrap) because the former inserts a line-ending in the middle of a longish line, whereas the latter is merely a visual thing on-screen (text content is not changed).

    Also, (right-hand side) margins in N++ don’t really exist – unless I suppose if we are talking about printing. When @PeterJones speaks that way, he is really meaning the “rightmost vertical edge” and not the “rightmost margin”.

    Also @PeterJones speaks of “line-wrap” but what is really meant here is the aforementioned View menu > Word wrap feature. (For myself, I’ve always found “word wrap” confusing as it really means “line wrap” – but I’ll bow to what N++ actually calls it).

    BTW: I’m not trying to be the “N++ terminology police” here. :-)





  • Thank you for your replies.

    @Alan-Kilborn thanks for the clarification in terminology, it’s appreciated. Yes, I mean “split line at vertical edge”, not “word wrap at margin”.

    Also, thanks for the link to the related thread. Per that thread, you can simulate split line with a regex. But that’s a workaround, and not nearly as convenient, and not a solution to my mind.

    As suggested, I will propose it as a restored (not new) feature request, though it may not be compatible with the multi-margin feature. In the meantime I will probably roll back to 7.8.5. I use the split line function a lot and it’s just not convenient with the current way Ctrl-I works.

    Thanks,
    Ross



  • @rd4gh said in Restore right margin word wrap as in 7.8.5:

    As suggested, I will propose it as a restored (not new) feature request,

    The other discussion linked shows that they already created an issue… So you don’t need to create one; just add your support to that one.



  • @PeterJones Thank you. Will do.



  • @rd4gh said in Restore right margin word wrap as in 7.8.5:

    …thanks for the link to the related thread. Per that thread, you can simulate split line with a regex. But that’s a workaround…

    Yes, I didn’t necessarily mean it as a solution for you.
    Just trying to gather discussions that have happened previously to new discussions.

    When creating a formal issue, it is best to cite multiple references to a defect: If one user complains, devs might think he’s an “oddball”, if TWO users complain, it’s “okay, maybe we have a real problem here”.
    These citations can certainly be in the form of hyperlinks to two (or more) Community forum threads.



  • @rd4gh said in Restore right margin word wrap as in 7.8.5:

    I will probably roll back to 7.8.5

    Not necessary, you should try my workaround using NppExec script plugin given in the other thread.



  • @rd4gh said:

    I’ve been “suffering” without this for some time, but finally thought I’d ask if it could be restored as an option.

    lines that I want to be only 80 characters

    So here’s a method that requires nothing special – so I won’t call it a workaround – except for a change to a Notepad++ setting:

    Tick the Background mode box:

    c760f992-ef18-45bd-84e3-8052eff154d9-image.png

    After doing that, you’ll notice that Ctrl+i again works to split lines at your set column value; 80 in my screenshot.

    You may dislike the coloring used for the text background at column 80+, however it is a simple matter to adjust the coloring to a really light grey (assumes default white text background color/theme selected) so that the intrusion is minimal.

    End the “suffering”. :-)



  • Hello, @rd4gh, @alan-kilborn and All,

    You do not need, at all, to stay with the Background mode set !!

    The best method for using the Ctrl + I functionality and splitting text at column N, is :

    • Run Preferences... > Margins/Border/Edge > Vertical Edge Settings

    • Wipe out all the existing column markers, if any

    • Type in the column marker N, ONLY ( generally the 80 value )

    • Tick the Background mode option

    • Immediately un-tick the Background mode option ( Important )

    • Re-enter all your previous column markers

    • Click on the Close button

    =>

    • Even though you can see all your column markers, again, Notepad++ remembers that the position to split text, with the Ctrl + I option, is column N

    • This behavior is kept, even if you use the Ctrl + I option on new opened files, on closed and re-opened files and after switching tabs !

    • The only way to reset this splitting behavior, on column N, is to close the current N++ session and restart N++ ;-))

    Best Regards,

    guy038



  • @guy038 said in Restore right margin word wrap as in 7.8.5:

    The only way to reset this splitting behavior, on column N, is to close the current N++ session and restart N++ ;-))

    With the statement I’ve quoted, are you saying that restarting N++ will prevent Split Lines from working, after setting it up as you describe in the workaround?

    If so, that’s hardly viable, as nobody would want to do that setup after every restart, just to use the split-lines feature.



  • Hello @rd4gh, @alan-kilborn and All,

    Unfortunately…yes :-((

    Once you re-start Notepad++, you’ll see the possible vertical edges, previously defined, but, again, the Ctrl + I operation will simply split all lines of current file to the right margin of the present editor window, this is the default behavior !


    However, an easy other work-around is to zoom in, with Ctrl + Nummpad +, in order that the column 80 is closed to the right side of the editor window. For instance, using the Consolas monospaced font, after six hits on Ctrl + Nummpad +, the column 82 is near the right of the N++ window !

    Best Regards,

    guy038



  • @guy038 said in Restore right margin word wrap as in 7.8.5:

    an easy other work-around is to zoom in

    Yes, that works, but it is probably not satisfying to the OP. :-)



  • Hello, @rd4gh, @alan-kilborn and All,

    A third solution could be to install, in addition to the latest release, a portable N++ v.7.8.5 version, once and for all, and set the vertical edge to column 80

    The OP could even download the Mini-portable (7z) archive of N++ v7.8.5 !

    Cheers,

    guy038



  • @guy038 said in Restore right margin word wrap as in 7.8.5:

    A third solution could be to install, in addition to the latest release, a portable N++ v.7.8.5 version, once and for all, and set the vertical edge to column 80

    Using an old version that makes you happy is always a choice! :-)



  • I noticed a difference in the behavior of the Split Lines (Ctrl+i) behavior – when using the vertical edge’s background mode, of course – depending upon whether or not the Use DirectWrite preference is enabled/disabled.

    Before invoking Ctrl+i things appear like this:

    Imgur

    After invoking:

    • First trial, here is a (more-desired) result when Use DirectWrite is unticked/disabled:
      Imgur

    • Second trial, a (less-desired) result when Use DirectWrite is ticked/enabled:
      Imgur

    Note that in the “first” case, the word under does not get moved to the following line, but in the “second” case, it does.
    Correct behavior would be to keep “under” with line 8.
    [Also: Purists might feel that the the following “under” should also be kept with line 8.]

    Conditions: Single selection on line 8 when invoking Ctrl+i to split the line, (single) vertical edge specified to be 60, file: license.txt from N++ distro.

    The moral of the story: DirectWrite impacts the splitting of lines, and there are probably still more areas where DirectWrite (in general a good thing) adversely impacts N++ features.



  • @Alan-Kilborn

    Yes, I have seen this effect, too. It seems like character spacing is slightly smaller when DirectWrite rendering is activated. I tested some minutes ago with Npp v7.9.1 and saw that with DirectWrite the Scintilla window showed 85 characters and with standard rendering it showed 83 characters. In pixels the difference was 17 px.

    Here are screen shots from my test, captured with a screen magnifier:

    ca999e07-59f7-4bbe-a633-d6f651f7dfea-grafik.png

    561a4be7-53af-4fd8-b457-1b661f0b2804-grafik.png

    Unfortunately this issue causes the Horizontal Ruler plugin to draw an inaccurate ruler - Scintilla’s edge line is drawn at the correct position (after column 80) but the plugin’s ruler shows column number 88 at this postion:

    bf029625-d4bf-46a9-ac17-0b7af81c3344-grafik.png


Log in to reply