• Adding linebreaks below characters

    14
    0 Votes
    14 Posts
    2k Views
    Alan KilbornA

    @kracovwolf said in Adding linebreaks below characters:

    so i should swap out the asterisks for <b> or style="font-weight: bold;?

    You should do that…if that is what you want to obtain.
    I think you can do a BIT of your own thinking here.

  • Global brace highlight style - disable for text files

    2
    0 Votes
    2 Posts
    209 Views
    PeterJonesP

    @erolb1 ,

    Short answer: no, there is no simple way to do that.

    Longer answer: and as far as I know, there is no complicated way to do that without editing the Notepad++ codebase.

  • How to format user defined language code?

    2
    0 Votes
    2 Posts
    1k Views
    PeterJonesP

    @moutaz-bakier ,

    User Defined Languages are just about syntax highlighting (adding color to keywords) – not about re-formatting your text for you.

    If I were trying to reformat a file with structure as simple as you’ve shown, I would just use a few search/replace pairs, all with Search Mode = Regular Expression enabled:

    FIND = ^\h*(?={|}|create)
    REPLACE = \t FIND = ^\h*(?=width|height|color)
    REPLACE = \t\t

    Those will change lines that start with any whitespace followed by { or } or create to start with a single tab; and lines that start with any whitespace followed by width or height or color into two tabs before the word. If, instead of tabs, you want 4 spaces or 8 spaces per tab, use four spaces or eight spaces in the first replace, and 8 or 16 spaces in the second replace.

    If the structure is the same, but there are more keywords that are always indented to a certain level, just add them as |keyword|another in the list of |-separated terms above. OTOH, if you actually have more complicated nesting with extra levels of { ... } or similar, and the ability for the same keywords to be at different levels depending on how deeply it’s nested, then the simplistic regex I supplied will not be enough.

    Many languages come with a “pretty print” or “tidy” utility, which allows you to pipe source code through that utility and it will come out with consistent formatting; using the NppExec plugin, you can pipe the active file through that re-formatting utility. @Michael-Vincent showns an example in this linked post of a script that will look at the file extension, and run it through one of many code reformatters, depending on language.

  • 0 Votes
    2 Posts
    160 Views
    guy038G

    Hello, @ruby-Pierce and All,

    First, I don’t know if you do use the simple double quote char " or if you need the opening and ending quotation marks ( the and chars with Unicode code-points \x{201C} and \x{201D} ), automatically provided by our NodeBB site !

    Anaway, here is a solution :

    Open the Replace dialog ( Ctrl + H )

    SEARCH ^{\R“identificationNumber” : “xxxx#######”,(?s).*?^},(\R|\z)     if couples of and are used

    OR

    SEARCH ^{\R"identificationNumber" : "xxxx#######",(?s).*?^},(\R|\z)     if the " char is only used

    REPLACE Leave EMPTY

    Tick the Wrap around option, preferably

    Select the Regular expression search mode

    Click on the Replace or Replace All buttons

    Of course, replace in the search regex, any x char by a letter and any # by a digit !

    Best Regards,

    guy038

  • Replacement does not abide Regular Expression

    5
    0 Votes
    5 Posts
    245 Views
    CsyeCokTheSollyC

    @alan-kilborn Thanks. That problem doesn’t occur now.

  • Line Number Display starting with 1

    3
    0 Votes
    3 Posts
    1k Views
    SS CheemaS

    @alan-kilborn Thank you! I was not aware of this plugin. I removed it.
    60e2eaec-fd36-46af-8f2a-08f3229196bc-image.png

  • Make Notepad++ dark (not editor theme, but editor itself)

    32
    7 Votes
    32 Posts
    32k Views
    Greg TurnerG

    @ahmed-syed I signed in to this site just to say THANK YOU!!! I did not know about the post-it mode and am absolutely loving it.
    I knew about adding virtual desktops but it’s good to see somebody else giving them some love. Most people I’ve interacted with just think it’s gimmicky, but if you know how to utilize it correctly, it can be an invaluable multi-tasking tool.

  • Is there an easy way to organize all of my NPP tabs?

    6
    0 Votes
    6 Posts
    7k Views
    Jason CoxJ

    @angrygamer Perfect! Thanks

  • Balloon popup with button hint?

    10
    0 Votes
    10 Posts
    508 Views
    Alan KilbornA

    @massimo-mula said in Balloon popup with button hint?:

    I also got NPP Portable from PortableApps.com, which is v. 1.8.9 too

    Do not do anything with portableapps.com, as that is not a recognized or supported provider of Notepad++. The official portable version of Notepad++ is on Notepad++'s own web site.

  • lexing/styling with PythonScript

    10
    1 Votes
    10 Posts
    884 Views
    Alan KilbornA

    @guy038 said in lexing/styling with PythonScript:

    …and, if your Python script support the (?-s) notation…

    So just a note on that comment:

    There are a couple of ways to use regular expressions in a PythonScript.

    One way is by using the PythonScript-specific functions, e.g. editor.research(). When you use this function, you are operating on editor data only(!) and you are using a Boost-compatible regular expression.

    The other way is to use Python’s (e.g.) re.search() function. This time, you are using Python’s own regex engine and you are acting on data that you specify, i.e., it cannot be data from the editor, directly. It can, of course be data that is copied from the editor into a Python variable.

    The second means described above is what my demo script above is using. Since Python’s regex flavor doesn’t accept (?-s) syntax, it isn’t possible to use it.

    Of course, the script could be reworked somewhat, in order to use the first method of data access, above, and then (?-s) would be available.

  • Conflict between user defined languages

    6
    0 Votes
    6 Posts
    375 Views
    John KollarJ

    I found the following issues posted on GitHub that look like they’re related to this discussion thread:

    UDL syntax highlighting and folding regions are completely broken. #10007
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/10007

    [UDL] “Force at beginning of line” for comments is buggy #9193
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9193

    Notepad++ User-Defined Language syntax coloring occasionally mess up in 64-bit version #5156
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/5156

  • File Issue: cyrillic symbols in file displayed as '?'

    3
    0 Votes
    3 Posts
    363 Views
    artie-finkelsteinA

    @mike-carlove Any chance the menu selections in ‘the Encoding’ options have been changed?

  • print page number in footer

    3
    0 Votes
    3 Posts
    1k Views
    Alan KilbornA

    @jiri-cvrk

    Just an FYI: If you are looking to obtain “Page 3 of 7” I don’t think that is currently possible … the of 7 part.

  • Avoid reload popup when closing Notepad++

    6
    0 Votes
    6 Posts
    552 Views
    Francesco RombecchiF

    @neil-schipper Dear Neil,
    Hi Neil,
    I’ve tried turning off the automatic notification feature for changed files, I’ve also tried having it update without notification but it doesn’t do exactly what I want. Obviously my problem is just a nuisance, not a real error. If there is no solution, I will be fine with this walkaround.

    I’ll rewrite the situation that I’d like to see resolved:

    File Status Detection = enabled Update without notification = unchecked
    When I try to close a tab (or close Np++, or close all tabs) that has been updated by an external program Np++ asks me whether to reload the tab (and then closes it)
  • error in macros in Notepad++

    4
    1 Votes
    4 Posts
    857 Views
    EkopalypseE

    @heinz-berecz-0

    by installing the PythonScript plugin via PluginAdmin and using the notepad object with its menuCommand, runMenuCommand and runPluginCommand methods.
    Note that you can use the standard help function that Python normally has from within the PythonScript console window.
    For example: help(notepad.runMenuCommand)

  • 0 Votes
    13 Posts
    1k Views
    QiShQ 42Q

    @alan-kilborn 100% thanks , sorry i know that it is basic questions because i just started today but i had to ask here :), ok i will check it out

  • XML Pretty Print changes Empty Element tags

    2
    0 Votes
    2 Posts
    154 Views
    Stefan PendlS

    @tom-in-seattle
    This is general XML syntax, so you may talk to the plug-in developer on the plug-in development board or the development page of the plug-in you use.

  • search and replace a set of texts

    4
    0 Votes
    4 Posts
    418 Views
    guy038G

    Hi, @nagoor-meerasa-mohammed, and All,

    OK ! So, here is the road map :

    Copy all the File 1.txt contents in, let’s say, a file named File 3.txt

    Add a separation line of, at least, three = signs

    Append all the File 2.txt contents, after the separation line

    Open the Replace dialog ( Ctrl + F )

    SEARCH (?-s)\D\K(\d+):(?=(?s:.+^=+\R.*^\1\x20)(.+))|^===+(?s).+

    REPLACE ?1\2

    Tick the Wrap around option

    Select the Regular expression search mode

    Click only on the Replace All button ( Do not use the Replace button ! )

    Close the Replace dialog ( Esc )

    Save the File 3.txt modifications ( Ctrl + S )

    Here is an example where I copied your File 1.txt text, twice, then the separation line ===== and, finally your File 2.txt text

    3:1.428238e-001):4.577779e-002,64:9.743924e-002):7.427767e-002):2.922571e-002):3.206583e-002,((((4:7.719304e-002,5:7.767254e-002):9.925778e-002,92:1.697033e-001):2.906791e-002,(7:1.281314e-001,62:1.351362e-001):2.747034e-002):1.246730e-002,((6:9.872749e-002,7:7.750112e-002):3.270381e-002,(2:1.533366e-001,91:1.316264e-001):2.139538e-002):5.698094e-002):3.332409e-002):5.389512e-002,(2:2.990773e-001,((((((6:7.144297e-002,((5:3.452890e-002,1:7.746965e-003) 3:1.428238e-001):4.577779e-002,64:9.743924e-002):7.427767e-002):2.922571e-002):3.206583e-002,((((4:7.719304e-002,5:7.767254e-002):9.925778e-002,92:1.697033e-001):2.906791e-002,(7:1.281314e-001,62:1.351362e-001):2.747034e-002):1.246730e-002,((6:9.872749e-002,7:7.750112e-002):3.270381e-002,(2:1.533366e-001,91:1.316264e-001):2.139538e-002):5.698094e-002):3.332409e-002):5.389512e-002,(2:2.990773e-001,((((((6:7.144297e-002,((5:3.452890e-002,1:7.746965e-003) ===== 1 Phalera_flavescens 2 Ochrogaster_lunifer 3 Hyphantria_cunea 4 Eudocima_salaminia 5 Eudocima_phalonia 6 Grammodes_geometrica 7 Parallelia_stuposa

    AFter clicking on the Replace All button, you should get this new text :

    Hyphantria_cunea1.428238e-001):4.577779e-002,64:9.743924e-002):7.427767e-002):2.922571e-002):3.206583e-002,((((Eudocima_salaminia7.719304e-002,Eudocima_phalonia7.767254e-002):9.925778e-002,92:1.697033e-001):2.906791e-002,(Parallelia_stuposa1.281314e-001,62:1.351362e-001):2.747034e-002):1.246730e-002,((Grammodes_geometrica9.872749e-002,Parallelia_stuposa7.750112e-002):3.270381e-002,(Ochrogaster_lunifer1.533366e-001,91:1.316264e-001):2.139538e-002):5.698094e-002):3.332409e-002):5.389512e-002,(Ochrogaster_lunifer2.990773e-001,((((((Grammodes_geometrica7.144297e-002,((Eudocima_phalonia3.452890e-002,Phalera_flavescens7.746965e-003) Hyphantria_cunea1.428238e-001):4.577779e-002,64:9.743924e-002):7.427767e-002):2.922571e-002):3.206583e-002,((((Eudocima_salaminia7.719304e-002,Eudocima_phalonia7.767254e-002):9.925778e-002,92:1.697033e-001):2.906791e-002,(Parallelia_stuposa1.281314e-001,62:1.351362e-001):2.747034e-002):1.246730e-002,((Grammodes_geometrica9.872749e-002,Parallelia_stuposa7.750112e-002):3.270381e-002,(Ochrogaster_lunifer1.533366e-001,91:1.316264e-001):2.139538e-002):5.698094e-002):3.332409e-002):5.389512e-002,(Ochrogaster_lunifer2.990773e-001,((((((Grammodes_geometrica7.144297e-002,((Eudocima_phalonia3.452890e-002,Phalera_flavescens7.746965e-003)

    Notes :

    The File 2.txt list of items, at the end of File 3.txt, has been deleted, too !

    Of course, any number followed with a colon, which does not exist in the list, located after the separation line =====, is not replaced at all, in the section before the ===== line

    The File 2.txt list of items, at the end of File 3.txt, do not need to be sorted, too !

    Best Regards,

    guy038

  • Someone help me

    2
    0 Votes
    2 Posts
    186 Views
    guy038G

    Hello, @whalla-magla and All,

    If we assume that there is only 1 slash per line, then use the Regular expression search mode with :

    SEARCH (?-s)/..

    REPLACE /

    then your INPUT example :

    Clarck/22yaloo Black/36narkos Galim/balisok

    becomes :

    Clarck/yaloo Black/narkos Galim/lisok

    If you meant : delete the two digits after the / character, then use the following regex S/R :

    SEARCH /\d\d

    REPLACE /

    This time, your INPUT example :

    Clarck/22yaloo Black/36narkos Galim/balisok

    becomes :

    Clarck/yaloo Black/narkos Galim/balisok

    Best Regards

    guy038

  • 0 Votes
    2 Posts
    152 Views
    Alan KilbornA

    @amelie-viennot

    It is not possible to “select” text with a search, using Notepad++ as it ships.

    If you can say more about what you really want to do, give an example, maybe, perhaps some options may be given to you.