Notepad2e icon indicating copy to clipboard operation
Notepad2e copied to clipboard

Improved Split Lines bugs with Batch File scheme

Open ProgerXP opened this issue 1 year ago • 1 comments
trafficstars

#320 enabled, F12 -> Batch File, paste this document, Ctrl+A, Ctrl+I:

rem foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo 
rem
rem xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
rem
rem foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo 
rem foo

Issues:

  • Empty line appears after 3rd rem, and another rem appears after it (which wasn't present in the original nor is required for line wrapping)
  • Stray m appears after the extraneous rem (the first point)
  • The long xxxx... line is put on a separate line rather than being left alone on its own rem-prefixed line (since xxxx... cannot be broken and wrapped)
  • Last two lines are just all wrong: one starts with em em rather than rem, then goes an empty rem line and the rest of it goes on the separate line without the rem prefix
  • The last line in the output has stray em near the end

Expected output:

rem foo foo ...
rem foo foo ...
rem foo foo ...
rem
rem xxxx...
rem
rem foo foo...
rem foo foo...
rem foo foo...

Note: the purpose of rem foo (last input line) is to confirm that it's correctly joined with the preceding line - something that doesn't happen with this simple document ([ ] = selection):

[rem foo
rem foo]

I suspect there's some buffer overrun due to the comment prefix being 4 characters in this scheme since I don't see this problem with JavaScript or INI. Do we have some hardcoded limit on the prefix length?


Update: actually, one of these problems does appear in other schemes (JS/INI):

; foo
;
; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The output must be the same but it gets an empty ; line before the long line.

ProgerXP avatar Jan 12 '24 19:01 ProgerXP

Issue with Config File (INI):

# XXXXXXX XXXXXX
# 1. XX
(blank line at the end)

Ctrl+A, Ctrl+I - Notepad 2e will either crash or produce lots of empty # lines.

ProgerXP avatar May 22 '24 09:05 ProgerXP