Community
    • Login
    1. Home
    2. Popular
    Log in to post
    • All Time
    • Day
    • Week
    • Month
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics

    • All categories
    • Steven GuillemetS

      KB5127936 and changes to the Windows 11 context menu.

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      2
      0 Votes
      2 Posts
      41 Views
      PeterJonesP
      @Steven-Guillemet said: Hopefully this will let Notepad++ ditch its current method Until that patch has effectively 100% deployment, Notepad++ should not change its implementation, otherwise it breaks something that currently works for anyone who hasn’t applied that fix. (If there’s a way to make the two methods coexist peacefully, or if there’s a way the installer can test the version and use the appropriate alternative, then that’s great. But if not, then breaking a feature to support bleeding edge is a bad idea)
    • guy038G

      Other thoughts regarding the "ReWrap Text to (Clipboard or 72) width" of the old "TextFX" plugin

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      9
      9
      1 Votes
      9 Posts
      435 Views
      guy038G
      Hi, @mpheath and All, @mpheath, from your advice, I finally chose the following process : First, run a Edit > Blank Operations > TAB to Space option Then run the regex replacement below, where C represents the maximum number of chars after you want a line-break : SEARCH [\x20\r\n]*\z|(?-s)^(?=.{C+1,}).{1,C}\K(?:\x20*\R|\x20+) REPLACE \r\n for Windows files    or    \n for Unix files Finally, run a Edit > Blank operations > Trim Trailing Space option Remarks : I began the regex with [\x20\r\n]*\z which will replace possible mixed range of spaces and new lines, at the very end of current file, with a single line-ending I used the (?-s)^(?=.{C+1,}) ( instead of the (?-s)^(?=.{C+1}) as it seems slightly faster within huge files ! Compare to your regex, I still wanted to consider all spaces, possibly followed with a line-break. So, the part .{1,C}\K(?:\x20*\R|\x20+) Note that the final Trim Trailing Space action is necessary because of this specific case with a splitting after column 40 12345678901234567890123456789012345 ABCDE 12345678901234567890123456789012345 ABCDE Now, let’s try it out with a concrete example : Double-click on https://www.gutenberg.org/cache/epub/2701/pg2701.txt => The text of the novel Moby Dick or The Whale should appear Go to the second occurrence of the string CHAPTER 1. Loomings. Select from this line to the line END OF THE PROJECT GUTENBERG EBOOK MOBY DICK; OR, THE WHALE, excluded Paste it in a N++ new tab and name it Moby_ORG.txt So, the Moby.ORG.txt file should begin and end with : Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about ... ... ... ... unharming sharks, they glided by as if with padlocks on their mouths; the savage sea-hawks sailed with sheathed beaks. On the second day, a sail drew near, nearer, and picked me up at last. It was the devious-cruising Rachel, that in her retracing search after her missing children, only found another orphan. In other words : Line 1 EMPTY Line 2 FIRST line of text Line 20,707 LAST line of text Line 20,708 = \z As this file seems already wrapped to 71 chars, I decided to do, FIRST, an intelligent un-wrapping ! I verified that there was no tabulation, nor any trailing space in the Moby_ORG.txt file Then I noticed that 43 lines began with one or two space characters, without any real utility. So, I ran the Edit > Blanck operations > Trim Trailing Space option To get a correct un-wrapping process, we need to use the following regex S/R : SEARCH (?-s).+\K\R(?=.+) ( Do not insert a ^ character between the parts (?-s) and .+ ) of this regex ! ) REPLACE \x20 Finally, I saved the changes and renamed the Moby_ORG.txt as Moby_To_Wrap.txt So, the Moby_To_Wrap.txt file begins and ends as below : Call me Ishmael. Some years ago—never mind how long precisely—having little ... There now is your insular city of the Manhattoes, belted round by wharves as ... Circumambulate the city of a dreamy Sabbath afternoon. Go from Corlears Hook ... ... ... ... ... “AND I ONLY AM ESCAPED ALONE TO TELL THEE” Job. The drama’s done. Why then here does any one step forth?—Because one ... It so chanced, that after the Parsee’s disappearance, I was he whom ... In other words : Line 1 EMPTY Line 2 FIRST line of text Line 4,884 LAST line of text Line 4,885 = \z The second line of your script is always : local maxLineLength = 78 And the Settings > Preferences... Margins/Border/Edge > Vertival Edge Settings only contains the 78 value Then I copied the Moby_ORG.txt file three times, as Moby_Regex.txt, Moby_Lua.txt and Moby_Ctrl-I.txt and I applied : Your script against the Moby_Lua.txt file, The Edit > Line Operations > Slipt Lines option against the Moby_Ctrl-I.txt The following regex S/R against the Moby_Regex.txt SEARCH [\x20\r\n]*\z|(?-s)^(?=.{79,}).{1,78}\K(?:\x20*\R|\x20+) REPLACE \r\n Upon comparison, it turns out that these three files are completely different ! Compared to the Moby_Regex.txt file , I noticed that your Moby_Lua.txt sometimes grasps : More than it should, as, for example, in the lines : “Who-e debel you?”—he at last said—“you no speak-e, dam-me, I kill-e.” And so saying with a wrapping after 84 chars [image: 1793374535176-a1299916-7d59-4c0b-a524-c5edf237ba4e-image.jpeg] “Oh, I don’t mind ’em, sir,” said Archy; “I knew it all before now. Didn’t I hear ’em with a wrapping after 85 chars [image: 1793374577115-f376a0b5-7d95-4f82-80f8-54c71394606e-image.jpeg] Less than it should, as, for example, in lines : the Stoics to enable you to grin and bear it. But even this wears off in, with a wrapping after 72 chars [image: 1793374617791-130645ce-362a-43a6-bf62-c511f338cdac-image.jpeg] knowingly, would thereby render yourself liable to a criminal, with a wrapping after 61 chars [image: 1793374649953-eb346fc2-0eb6-445c-bc6f-1d4ef581b4e9-image.jpeg] Not important, though. Just in case you would work on your script a little more ! Now, using this long text ( the Moby_To Rewrap.txt file ), I confirm that the regex, below, exactly mimics the Ctrl + I feature : SEARCH (?-s)^(?=.{78})(?:.{1,76}\x20|.{77})\K REPLACE \r\n for Windows files    or    \n for Unix files However, note that the Edit > Line Operations > Split lines operation leaves a trailing space on all lines of a paragrah but the last one ! I think that further investigation would be useless and I’ll personally just use the method, shown at the beginning of this post, when I need to wrap any text ! Best Regards, guy038 Oh, I almost forgot something important : When you select some text or all contents of a file and execute the Edit > Line Operations > Split Lines option : The View > Word wrap must be OFF The View > Show Symbol must be OFF
    • Robk BlueR

      Tab spacing copying from Notepad++ into WordPress

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      5
      0 Votes
      5 Posts
      243 Views
      PeterJonesP
      @Robk-Blue said: Yes I’m using tab setting of 2. The problem seems to be weirder that just application processing tab characters differently because it’s not uniform. That tells me that you probably have a mix of spaces and tabs, without realizing it. In Notepad++, use View > Show Symbol > Show Space and Tab. You will see a middot • for spaces, and an arrow → for tabs… the width of the arrow will grow to fit the remaining space in the tab-spacing [image: 1793293737638-b2bb93e2-ae0e-4350-a0df-1708f84dd276-image.jpeg] (2 spaces)display: block; (8 spaces)font-family: Arial; (4 spaces)text-align: right; (4 spaces)font-size: 20px; So what this tells me is that your actual file, in Notpead++, is really as follows, with your WordPress being set to show 4 spaces per tab instead of two: [SPACE][SPACE]display: block; [TAB][TAB]font-family: Arial; [SPACE][TAB]text-align: right; [SPACE][TAB]font-size: 20px; Though the 8-wide version being two tabs surprises me, because that wouldn’t look aligned properly in Notepad++ [image: 1793294204910-8cac1852-6a8b-4cfd-8a8b-635c5b5185ab-image.jpeg] But my guess is it’s similar to that, if not that exactly.