[v.7.8.6] Vertical Edge Settings no longer works with Split Lines (Ctrl-I)



  • @Matthew-Au said in [v.7.8.6] Vertical Edge Settings no longer works with Split Lines (Ctrl-I):

    Can this issue be workaround via GUI?

    It seems choosing background mode is working, more or less, like you want.

    If this would be set to EDGE_LINE I assume it would cover previous and current feature set.



  • @Matthew-Au said in [v.7.8.6] Vertical Edge Settings no longer works with Split Lines (Ctrl-I):

    And shall I raise this as an issue in N++ Github?

    I would say YES to this.



  • @Matthew-Au said in [v.7.8.6] Vertical Edge Settings no longer works with Split Lines (Ctrl-I):

    And shall I raise this as an issue in N++ Github

    Yes please. And reference / link this discussion please.

    @Matthew-Au said in [v.7.8.6] Vertical Edge Settings no longer works with Split Lines (Ctrl-I):

    Can this issue be workaround via GUI?

    I didn’t notice this because I use NppExec to run a startup script (as soon as N++ launches) and among other things, it force sets Edge Line mode and column 80. I added it after this new release that changed the way vertical edge was done. I hadn’t noticed your issue since I was always forcing Edge Line mode.

    Cheers.



  • @Ekopalypse Thanks, the “background mode” does the job (for now).

    @Alan-Kilborn I’ve submitted a bug report here.



  • Hello, @matthew-au, @michael-Vincent, @ekopalypse and All,

    I fully understand the problem ! In order to get the Split Lines feature to work, here is my work-around :

    • Open the Settings > Preferences... > Editing > Vertical Edge Settings option

    • If the window contains several column numbers, delete all these numbers

    • Now, type in an unique column number where you want the lines to be splitted

    • Tick the Background mode option ( IMPORTANT )

    • If preferred, you can untick this option, immediately !

    • Now the Ctrl + I feature should be fucntional, as soon as a selection have been made, whatever the Background or Line mode is chosen ;-))

    • If you want, you may rewrite all your previous column numbers

    • But, beware that any subsequent Ctrl + I operation will refer to the unique number noticed while ticking the Background mode option !!

    Here is my debug info :

    Notepad++ v7.8.6   (32-bit)
    Build time : Apr 18 2020 - 22:32:17
    Path : D:\@@\786\notepad++.exe
    Admin mode : OFF
    Local Conf mode : ON
    OS Name : Microsoft Windows XP (32-bit) 
    OS Build : 2600.0
    Plugins : Explorer.dll mimeTools.dll NppConverter.dll NppExport.dll 
    

    Best Regards

    guy038



  • @guy038 said in [v.7.8.6] Vertical Edge Settings no longer works with Split Lines (Ctrl-I):

    beware that any subsequent Ctrl + I operation will refer to the unique number noticed while ticking the Background mode option !!

    Hidden feature!! :-)



  • @guy038 but works only as long as you don’t restart npp, correct?



  • Hi, @matthew-au, @michael-Vincent, @ekopalypse, @alan-kilborn and All,

    @ekopalypse, Ah yes ! As soon as I restarted Notepad++, it simply showed the two edge lines that I had previously set ( 30 and 60 )

    However, remember that, by default, if no vertical setting or several vertical settings are set, then the CTRL + I feature splits lines, roughly, to the windows text width !

    Cheers,

    guy038



  • Hello, @matthew-au, @michael-Vincent, @ekopalypse, @alan-kilborn and All,

    The last N++ v7.8.6 version now supports the new Vertical Multi-Edge lines feature. Unfortunately, as a consequence, this definitively breaks the native Split Lines feature ( Ctrl + I )

    A work-around has been found but needs to choose one column number only and tick once on the Background mode option ! But this prevent you from easily using multiple vertical lines, which is a pity :-(

    So, I imagined a regex S/R, that exactly simulates the N++ Split Lines feature ;-))

    Just one constraint : If your text contains some tabulation chars, you must run, first, the Edit > BLank Operations > TAB to Space option, in order to change any tab character with the appropriate number of space chars. Indeed, the regex S/R assumes that each character displayed takes the place of exactly one character. !

    The generic regex S/R, for any splitting column C is :

    SEARCH (?-s)^(?=.{C})(.{1,C-3}\x20|.{C-1})\K

    REPLACE \r\n    ( or \n if Unix files )

    So, let’s suppose that you want to split text, at column C = 80. In that case, the regex S/R must be changed as below :

    • SEARCH (?-s)^(?=.{80})(.{1,77}\x20|.{79})\K

    • REPLACE \r\n    ( or \n if Unix files )

    • Tick the Wrap around option

    • Select the Regular expression search mode

    • CLick on Replace All button, exclusively ( Do not use the Replace button ! )


    After numerous tests, I verified that the split texts are strictly identical :

    • Whatever the Split Lines option ( Ctrl + I ) or the Regex S/R is used

    • Whatever the In selection option is set or not, in the Replace dialog

    • Whatever the Line or Background mode is used, in Settings > Preferences... > Editing > Vertical Edge Settings

    • Whatever the View > Word wrap option is set or not

    • Whatever the View > Show Symbol > Show All Characters option is set or not

    • Whatever the current font used is a MonoSpace or a Proportional font, in the Style Configurator...

    In case of a proportional font, do not trust the visual vertical edge line, but rely on the real column, indicated in Settings > Preferences... > Editing > Vertical Edge Settings ! BTW, the Line mode is generally recommended for monospace fonts and the Background mode should be preferred for proportional fonts !


    As a test, we’ll simply use the License.txt file and split its contents at column 80 :

    • First of all, make sure that the single number 80 is shown in Settings > Preferences... > Editing > Vertical Edge Settings

    • Copy the License.txt file in two new tabs ( new 1 and new 2 )

    • In the new 1 file :

      • Ctrl + A

      • Ctrl + I ( Split Lines option )

    • In the new 2 file :

      • Open the Replace dialog ( Ctrl + H )

        • SEARCH (?-s)^(?=.{80})(.{1,77}\x20|.{79})\K

        • REPLACE \r\n    ( or \n if Unix files )

        • Tick the Wrap around option

        • Select the Regular expression search mode

        • Click on Replace All button, exclusively ( Do not use the Replace button ! )

    • Now, compare the two tabs with, for instance, the Compare plugin or with an external compare tool => The two tabs should be strictly identical ;-))

    Remark : Of course, this regex S/R supposed that the splitting vertical line was at position 80. So, adapt the generic regex, above, according to the real column needed !

    Best Regards,

    guy038



  • Seems to be relevant to this current discussion: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/7814



  • @guy038

    Any reason for the capturing group usage?:

    0389f62c-6ef5-4e32-b7c0-646a2b3ef5ff-image.png



  • Hi, @alan-kilborn and All,

    You’re perfectly right about it : No need of a capturing group for that purpose ! So, the generic search regex can be changed as below :

    SEARCH (?-s)^(?=.{C})(?:.{1,C-3}\x20|.{C-1})\K

    And the corresponding search regex for C = 80 is :

    SEARCH (?-s)^(?=.{80})(?:.{1,77}\x20|.{79})\K

    Indeed, although the maximum of characters, caught in group 1, not exceeds, either, C-2 or C-1 chars, the fact of using a non-capturing group should speed up the replacement process, in case of huge files !

    Cheers,

    guy038



  • Not sure this is worth a new thread … I used the following NppExec / Scintilla script to set the vertical edge column to the current column (super useful in my usage). It is now broken. Any recommendations for how to fix is appreciated. I did try what I thought was the obvious update and it didn’t work…

    ::NPXEdgeColumSetToCurrent
    NPP_CONSOLE ?
    SCI_SENDMSG SCI_SETEDGECOLUMN $(CURRENT_COLUMN)



  • @Patrick-Sheppard said in [v.7.8.6] Vertical Edge Settings no longer works with Split Lines (Ctrl-I):

    It is now broken

    What version of Notepad++ - please post your debug info (menu ? => Debug Info…). I’ll assume you’re using the new 7.8.6 version as that is an easy fix. As of N++ 7.8.6, the vertical edge mode changed to multiedge by default so you can add multiple edges. You can try:

    SCI_SENDMSG SCI_GETEDGEMODE
    ================ READY ================
    ECHO $(MSG_RESULT)
    1
    

    to verify. I’m assuming you’ll get back “3” as in EDGE_MULTILINE. You can modify your script to be:

    ::NPXEdgeColumSetToCurrent
    NPP_CONSOLE ?
    SCI_SENDMSG SCI_SETEDGEMODE EDGE_LINE
    SCI_SENDMSG SCI_SETEDGECOLUMN $(CURRENT_COLUMN)
    

    Cheers.



  • Thanks, Michael.

    I had downgraded to 7.8.5 because of this issue and was reluctant to jump back up, but I just did and your modification works a charm.

    Appreciated.


Log in to reply