• How to make punctuation correctly in SRT file

    8
    0 Votes
    8 Posts
    1k Views
    CoisesC

    @Mohamed-Mohamed Just a thought: have you checked to see if the Fix common errors feature in Subtitle Edit, with proper adjustment at Options | Settings… | Tools | Edit settings for fixing continuation style… | Edit custom continuation style… can do what you want more easily? I haven’t used those settings, so I can’t advise in any detail, but it is a purpose-built tool for editing and correcting subtitles.

  • I need to delete anything before ANY number, AND the number in a line

    5
    0 Votes
    5 Posts
    1k Views
    greg gregG

    @Terry-R thanks Terry, I didnt even bothered to do it all, I just searched for (?-s).+\d+\s and replaced with nothing. worked like a charm, no backfiring at all, not even those 0,01% I was expecting to have.

  • Non-existent files (tabs) disappear on program launch

    7
    0 Votes
    7 Posts
    733 Views
    TeasyT

    @Alan-Kilborn
    is shooting down people trying to help this program a hobby of yours?
    or do you get paid for it?

    Edit: can someone report this guy?
    (i don’t have enough “reputation” points on this forum)
    reading his post history shows overly negative tone
    shooting down people on a regular basis
    which i’m certain does not improve the quality of the product nor its community!

  • Regex use

    14
    0 Votes
    14 Posts
    25k Views
    guy038G

    Hello, @mkupper and All,

    @mkupper, thank you for your appreciation !

    First, I would say that the \C and \X syntaxes are far from noob regex syntaxes !

    The \C syntax, as said in my previous post, should detect individual bytes of an UTF-8 file but, actually, returns the current NON-EOF character just like the well-known (?-s). syntax

    The \X syntax matches :

    Any single Non-diacritic character

    0 or more associated diacritic characters, following the Non-diacritic char

    For instance, the regex --o\x{0306}\x{0320}\x{0340}--o\x{0318}\x{0346}\x{0305}-- would exactly match the 14-chars string --ŏ̠̀--o̘͆̅-- and could be replaced by the regex --\X--\X--. Just enlarge the characters to their maximum for good readability ! However, note that the simple 8-chars string -------- would also be matched by the --\X--\X-- regex !

    Secondly, I must admit that talking about Unicode characters, in a general way, made me drift towards my Total_Chars.txt file discussion !

    But, even if we use the previous THEORICAL syntax, against the Total_Chars.txt file :

    (?xs) ( (?| (?= [\x{0000}-\x{007F}] ) (\C) ( ) ( ) ( ) | # 128 1-byte chars in part INSIDE the BMP | (?= [\x{0080}-\x{07FF}] ) (\C) (\C) ( ) ( ) | # 1,920 2-byte chars , in part INSIDE the BMP | 63,454 chars (?= [\x{0800}-\x{FFFF}] ) (\C) (\C) (\C) ( ) | # 61,406 3-byte chars , in part INSIDE the BMP | (?= [\x{10000}-\x{1FFFFF}] ) (\C) (\C) (\C) (\C) # 262,136 4-byte chars , in part OUTSIDE the BMP, with code > \x{FFFF} ( = 4 × 65,534 ) ) )

    We could NOT find any result for two reasons :

    The \C regex does not work with our present Boost regex engine ( See above )

    The characters over \x{FFFF} are not properly handled by the Boost regex engine

    So the last line (?= [\x{10000}-\x{1FFFFF}] ) (\C) (\C) (\C) (\C), regarding characters outside the BMP, should be changed as (?s).[\x{D800}-\x{DFFF}]

    Using this regex, against the Total_Chars file, in the Find dialog, with the Wrap around button checked, does return 262,136 characters, when you click on the Count button

    You may also convert this regex in a range delimited by two surrogate pairs as character boundaries

    Open the Mark dialog ( Ctrl + M )

    Untick all box options

    Enter the regex \x{D800}\x{DC00}.+\x{DB7F}\x{DFFD} ( first char of Plane 1 to last allowed char of Plane 14 )

    Tick the Purge for each search and Wrap around options

    Select the Regular expression search mode

    Click on the Mark All button ( 1 hit )

    Click on the Copy Marked Text button

    Open a new file ( Ctrl + N )

    Paste the contents of the clipboard

    Again, using the (?s).[\x{D800}-\x{DFFF}] regex on the entire file or a simple Ctrl + A gives a count of 262,136 characters for this new file !

    Thirdly, I would like to insist on the fact that, both, the LastResort-Regular.ttf font and the Total_Chars text file deal only with characters and NOT with the individual bytes of these chars, depending of their current encoding !

    So, in a sense, it’s not connected to the beginning of my initial post, regarding individual bytes. Sorry for the confusion !

    Best Regards,

    guy038

  • default page

    8
    0 Votes
    8 Posts
    829 Views
    mkupperM

    @Coises said in default page:

    HKCR.txt\ShellNew

    Thank you. The puzzle for me is that I don’t have a HKCR\.txt\ShellNew key. Granted, I can create one.

    However, I was trying to figure out is how and why “Text document” is available in Windows explorer’s “New” button list and right click list. I have 11 choices available for “New.” For ten of them I saw the ShellNew subkey and the values used to create new files. Those all made sense to me. The missing or invisible key of the 11 was whatever mechanism is used for new “Text document”.

    I ran a profiler on explorer.exe and see that it’s building the New list out of a cache and that it pulled the information related to “Text Document” out of the resources for Notepad.exe ms-resource://Microsoft.WindowsNotepad/Resources/ShellNewDisplayName_Txt. I’m guessing that because I left the Windows 11 Notepad.exe store app installed that it tells Windows Explorer to add itself to the new list.

  • FIND/SEARCH not showing the results

    3
    0 Votes
    3 Posts
    469 Views
    PeterJonesP

    @gocorona-go ,

    This FAQ was added today because this question is starting to come up frequently enough to warrant its own FAQ entry.

  • How to Navigate to a Parent Directory in the Folder as Workspace

    2
    0 Votes
    2 Posts
    212 Views
    PeterJonesP

    @Bernard ,

    Folder as Workspace (“FaW”) uses the Folder you choose as the Workspace as the root/top-level of what it display. You cannot use it to navigate “above” that root.

    If you want generic directory navigation through a panel similar to the FaW, what you probably want is the Explorer plugin (available to install through Plugins > Plugins Admin interface), which allows you to navigate to any directory in your filesystem, rather than using a fixed folder as the root of what you see in FaW.

  • Add text to end of line

    5
    0 Votes
    5 Posts
    704 Views
    DoğancanD

    @PeterJones Now I understand. I can edit the code you gave. So much detail is unnecessary for me.

  • Help - Remove a line from a specific text but keep a part of the text

    10
    0 Votes
    10 Posts
    2k Views
    L ML

    @PeterJones Thanks it’s working now.

    I also figured out some occurences had only the CR from this answer:
    https://community.notepad-plus-plus.org/post/17010

    And could modify as this to accomodate:
    Find: \r(\sIV,)
    Replace: ($1)

  • Let Comment Flags Keep Aligned

    2
    0 Votes
    2 Posts
    218 Views
    TBugReporterT

    Here’s what I do for this. Add this to the <Macros> section of your shortcuts.xml file:

    <Macro name="Col. 1 Remark" Ctrl="yes" Alt="yes" Shift="no" Key="75"> <Action type="0" message="2349" wParam="0" lParam="0" sParam="" /> <Action type="1" message="2170" wParam="0" lParam="0" sParam="REM " /> </Macro>

    Key 75 is the letter K, so this adds a Ctrl-Alt-K keystroke to your configuration (you said Ctrl-Q, but my solution isn’t a toggle like that keystroke; if you want Ctrl-Alt-Q, change 75 to 81); message 2349 says to go to the beginning of the line (unconditionally, i.e. not just the beginning of the text on the line); and message 2170 says to type the given text - REM and a space (the forum won’t let me show the space in red here). If you edit other types of files this way, you can change to the comment string for whatever language you’re using, and assign a different key for that one.

  • My save notepad is all gone and removed, Help me restore

    2
  • How to remove first 50 lines on each files using NOTEPAD PLUS

    2
    0 Votes
    2 Posts
    772 Views
    Alan KilbornA

    @N-O

    1 - find: (?-s)(?:.*\R){50}(?s)(.*) / repl: ${1} / mode: regular expression / (note: other ways to do it certainly possible)

    2 - find: (?-s)(.*\R){50}\z / repl: nothing / mode: regular expression / (note: other ways to do it certainly possible)

    3 - not currently possible to do in one action

    (4) - you’d have to ask for it in a feature request; see HERE for a description of the process

    note: 1 and 2 could be written so that it was a single operation accomplishing both – I did not do that

  • improve SCI_LINEDELETE shortcut

    27
    1 Votes
    27 Posts
    4k Views
    Victorel PetrovichV

    @Alan-Kilborn said in improve SCI_LINEDELETE shortcut:

    The “caret by itself” situation is handled to delete its line. Just not “caret by itself on an otherwise non-selected line”.

    I prefer less exceptions; but to each his own.
    Indeed, scripting solves the differences.

    @Alan-Kilborn said in improve SCI_LINEDELETE shortcut:

    Please tell me you aren’t prototyping a Scintilla patch using these scripts you’ve submitted in this thread. Such a patch should be much simpler than that.

    I know.

  • Bold Question

    3
  • Opening file with command line in an existing instance

    3
    0 Votes
    3 Posts
    1k Views
    E

    @PeterJones Oh my gosh, that’s all I needed. Thank you so much, I made batch file also, it makes me so comfortable.

  • after update: shortcut &N lost in rightclick menu

    3
    0 Votes
    3 Posts
    336 Views
    cschardtC

    @PeterJones
    perfect, thanks!

  • No Folder as Work-Space

    4
    0 Votes
    4 Posts
    424 Views
    BernardB

    @Alan-Kilborn thank you kindly . i was wondering how NP++ would decide what folder to display . thank you again

  • replace all text in a bracket

    8
    0 Votes
    8 Posts
    2k Views
    Terry RT

    @daniel-Louwrens said in replace all text in a bracket:

    I tried a find and replace using the exact chars you suggested but
    the program showed 0 replaced.

    Did you set the search mode to regular expression?

    If that isn’t the issue then you need to provide the examples via the requested method. Follow that post I referred to, otherwise you are just wasting people’s time on this forum (who do want to help).

    Terry

  • replace in txtFile with mixed Codepage letters utf8 and ANSI

    3
    0 Votes
    3 Posts
    618 Views
    Rainer KlinglerR

    @PeterJones Thank you very much - it works! But you must be careful after some replaces exists new “wrong” Chars in ANSI view with the possibility of also not wanted newly replacements … so the replace all button is dangerous…

  • Files open twice

    17
    0 Votes
    17 Posts
    3k Views
    CoisesC

    @Coises said in Files open twice:

    I’ve opened an issue for this: Symbolic links and hard links can result in the same physical file being open in multiple tabs.

    It seems the matter is not as straightforward as it appeared to me. At least one person strongly disapproves of changing the current behavior at all.

    I don’t really use symlinks. If some of you do, and have clear ideas about how they should work — whether they should resolve to the target name, like a shortcut, or remain as their own name in their own directory, like a hard link — you might be able to contribute to the discussion at the link above.

    Three notes:

    I offered a pull request along with the issue, but another user (the same one who objects to changing anything) discovered an important flaw. While that’s mixed up in the discussion, it’s really a separate issue from what should happen. If we reach a consensus on what should happen, I’m sure there will be a way to fix the flaw (which causes symlinks with a relative path to fail completely).

    As things are, File|Open and double-click in Explorer behave differently than opening from the command line and right-click|Open with Notepad++ in Explorer. I see no way to change the File|Open and double-click behavior, because Windows is resolving the symlink in those cases before Notepad++ ever sees it. As far as I can tell, the person who doesn’t want things changed believes the other behavior is “correct,” and doesn’t care that the behavior in some cases doesn’t match. Honestly, the more I look at the way different programs behave, the more it seems to me there is no consistency regarding this in Windows. I’m not sure if that’s an argument for letting the chips fall where they may, or if Notepad++ should still at least be consistent with itself.

    Though I now think I was unwise to do so, I combined two distinct issues: opening symlinks in particular, and avoiding opening the same file by two separate names (which affects both symlinks and hardlinks). The latter is the one more directly relevant to the original complaint in this thread. The fix for that appears straightforward and is independent of the flaw that caused a problem with my pull request. (My solution just activates the tab holding a file which is already open, regardless of whether you’re trying to open it under a different name.) However, the user who does not want anything changed apparently does not want Notepad++ to suppress opening the same file under two different names either.