• I've had to get rid of Notepad++ and I sad Help with BUG

    4
    0 Votes
    4 Posts
    243 Views
    A

    @BrenMar

    Are you using Comodo AV by any chance?

    If so, add Notepad++ to the HIPS section as an ‘allowed application’.

    I normally get a pop-up asking to do that, but for versions 8.8.3 and later this wasn’t happening.

    Hope this helps.

  • File Open is bugged in versions later than 8.8.2

    11
    0 Votes
    11 Posts
    225 Views
    PeterJonesP

    @Atomiser said in File Open is bugged in versions later than 8.8.2:

    was ‘HIPS’ in Comodo.

    Glad you found it

  • Hide horizontal line at folds?

    3
    0 Votes
    3 Posts
    342 Views
    ?

    @PeterJones said in Hide horizontal line at folds?:

    editor.setElementColour(ELEMENT.FOLD_LINE, (0,0,255,255))
    where the color is (RED,GREEN,BLUE,ALPHA)

    And hiding it completely can be done by either setting the ALPHA to 0

    Yes, surprisingly this works.
    While:

    or editor.setFoldFlags(0) in PythonScript

    no, not by itself: it would leave behind a green line as if text were hidden with View/Hide Lines . As the other thread showed, that command would need to be followed by additional commands to set the Alpha of those “hidden lines’line” to 0. The full equivalent in Python would be:

    editor.setFoldFlags(0) old_col=editor.getElementColour(ELEMENT.HIDDEN_LINE ) new_col=old_col[:3]+(0,) # 0 for alpha, to hide; 255 to show editor.setElementColour(ELEMENT.HIDDEN_LINE, new_col)

    I find it puzzling that the latter solution requires further changing the "hidden lines’ line " colour, while:
    editor.setElementColour(ELEMENT.FOLD_LINE, (x,x,x,0))
    is enough by itself.
    At first I thought it’s a PythonScript behind the scenes trick, but it works in NppExec too, for example with:
    SCI_SENDMSG SCI_SETELEMENTCOLOUR SC_ELEMENT_FOLD_LINE 0x00000000
    (the relevant Alpha part is the first 2 0s , making color transparent/invisible).

  • Privacy policy of Notepad++

    7
    0 Votes
    7 Posts
    239 Views
    Alan KilbornA

    I should have said that I think it is a reasonable request simply to ease this problem:

    if your boss sends you to check for privacy proof you can’t really give him anything other than “I believe it is safe”

  • NPPCrypt not fully decrypting text.

    3
    1 Votes
    3 Posts
    142 Views
    M

    @xomx said in NPPCrypt not fully decrypting text.:

    Could be. Seems to me that your file was simply out of sync somehow (common when the network is laggy or there was just a temp outage):

    To clarify the file is local to the systems I’m experiencing the issue. It’s created, open, edited, and saved here. The cloud storage is just as a backup. I’m not accessing it on a second machine.

  • Save as File Type Options

    4
    0 Votes
    4 Posts
    134 Views
    PeterJonesP

    @joesalvati68 said in Save as File Type Options:

    @PeterJones I tried replying but not sure if it went through. I copied the above picture. My actual wndow is here.

    As the post-edit window told you (you had to hit the X to close it when replying), until you get enough “upvotes”, you will have to wait for a moderator to approve all your posts.

    Notepad++ v8.8.5 (64-bit)

    Admin mode: OFF
    Local Conf mode: OFF
    Cloud Config: C:\Users\JoeSalvati\OneDrive - Arcuity ai, Inc\Notepad++_backup

    ahh, I wouldn’t have guessed you were in Cloud Config mode. So my suggestion of %AppData%\Notepad++\langs.xml was wrong. In Cloud Config mode, it would be C:\Users\JoeSalvati\OneDrive - Arcuity ai, Inc\Notepad++_backup\langs.xml


    Plugins:
    mimeTools (3.1)
    NppConverter (4.6)
    NppExec (0.8.8)
    NppExport (0.4)
    NppMenuSearch (0.9.6)

    I am doubtful, but since i’ve never used it, the culprit might be NppMenuSearch. You could try running with that plugin disabled (if you don’t know how to run with a specific plugin disabled, see the Possible Culprit: Plugin in our FAQ).

    If disbling that plugin doesn’t fix it, then open C:\Users\JoeSalvati\OneDrive - Arcuity ai, Inc\Notepad++_backup\langs.xml, and show us the first 25 lines or so, using a screenshot like:
    0959e27c-0ea2-45fe-93d4-87e39dcbe697-image.png

    or click the </> button in your reply, and pasting the text of the first 25 lines inside the ``` … ``` section:

    <?xml version="1.0" encoding="UTF-8" ?> <NotepadPlus> <!-- The keywords of the supported languages, don't touch them! --> <!-- For languages like C/C++ substyle1..8 entries, you may enter your own keywords in those entries, to have them show up in the "Default keywords" list shown in the Style Configurator --> <Languages> <Language name="normal" ext="txt" /> <Language name="actionscript" ext="as mx" commentLine="//" commentStart="/*" commentEnd="*/"> <Keywords name="instre1">add for lt tellTarget and function ne this break ge new typeof continue gt not var delete if on void do ifFrameLoaded onClipEvent while else in or with eq le return instanceof case default switch</Keywords> <Keywords name="type1">arguments constructor class dynamic false extends implements import interface intrinsic newline null private public super static true undefined Accessibility Arguments Array Boolean Button Camera ContextMenu ContextMenuItem CustomActions Color Date Error Function Key LoadVars LocalConnection Math Microphone Mouse MovieClip MovieClipLoader NetConnection NetStream Number PrintJob Object TextField StyleSheet TextFormat TextSnapshot SharedObject Selection Sound Stage String System XML XMLNode XMLSocket Void abs acos asin atan atan2 ceil cos exp floor log max min pow random round sin sqrt tan onActivity onChanged onClose onConnect onData onDragOut onDragOver onEnterFrame onID3 onKeyDown onKeyUp onKillFocus onLoad onLoadComplete onLoadError onLoadInit onLoadProgress onLoadStart onMouseDown onMouseMove onMouseUp onMouseWheel onPress onRelease onReleaseOutside onResize onRollOut onRollOver onScroller onSelect onSetFocus onSoundComplete onStatus onUnload onUpdate onXML addListener addPage addProperty addRequestHeader allowDomain allowInsecureDomain appendChild apply applyChanges asfunction attachAudio attachMovie attachSound attachVideo beginFill beginGradientFill call charAt charCodeAt clear clearInterval cloneNode close concat connect copy createElement createEmptyMovieClip createTextField createTextNode curveTo domain duplicateMovieClip endFill escape eval evaluate findText fscommand flush fromCharCode get getAscii getBeginIndex getBounds getBytesLoaded getBytesTotal getCaretIndex getCode getCount getDate getDay getDepth getEndIndex getFocus getFontList getFullYear getHours getInstanceAtDepth getLocal getMilliseconds getMinutes getMonth getNewTextFormat getNextHighestDepth getPan getProggress getProperty getRGB getSeconds getSelected getSelectedText getSize getStyle getStyleNames getSWFVersion getText getTextExtent getTextFormat getTextSnapshot getTime getTimer getTimezoneOffset getTransform getURL getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getVersion getVolume getYear globalToLocal gotoAndPlay gotoAndStop hasChildNodes hide hideBuiltInItems hitTest hitTestTextNearPos indexOf insertBefore install isActive isDown isToggled join lastIndexOf lineStyle lineTo list load loadClip loadMovie loadMovieNum loadSound loadVariables loadVariablesNum localToGlobal mbchr mblength mbord mbsubstring MMExecute moveTo nextFrame nextScene parseCSS parseFloat parseInt parseXML pause play pop prevScene print printAsBitmap printAsBitmapNum printNum push registerClass removeListener removeMovieClip removeNode removeTextField replaceSel replaceText reverse seek send sendAndLoad setBufferTime set setDate setFocus setFullYear setGain setHours setInterval setMask setMilliseconds setMinutes setMode setMonth setMotionLevel setNewTextFormat setPan setProperty setQuality setRate setRGB setSeconds setSelectColor setSelected setSelection setSilenceLevel setStyle setTextFormat setTime setTransform setUseEchoSuppression setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setVolume setYear shift show showSettings silenceLevel silenceTimeout slice sort sortOn splice split start startDrag stop stopAllSounds stopDrag substr substring swapDepths toggleHighQuality toLowerCase toString toUpperCase trace unescape uninstall unLoadClip unloadMovie unloadMovieNum unshift unwatch updateAfterEvent updateProperties useEchoSuppression valueOf watch endinitclip include initclip __proto__ _accProps _alpha _currentframe _droptarget _focusrect _framesloaded _global _height _highquality _level _lockroot _name _parent _quality _root _rotation _soundbuftime _target _totalframes _url _visible _width _x _xmouse _xscale _y _ymouse _yscale activityLevel align attributes autoSize avHardwareDisable background backgroundColor bandwidth blockIndent bold border borderColor bottomScroll bufferLenght bufferTime builtInItems bullet bytesLoaded bytesTotal callee caller capabilities caption childNodes color condenseWhite contentType currentFps customItems data deblocking docTypeDecl duration embedFonts enabled exactSettings firstChild focusEnabled font fps gain globalStyleFormat hasAccessibility hasAudio hasAudioEncoder hasEmbeddedVideo hasMP3 hasPrinting hasScreenBroadcast hasScreenPlayback hasStreamingAudio hasStreamingVideo hasVideoEncoder height hitArea hscroll html htmlText indent index italic instanceof int ignoreWhite isDebugger isFinite language lastChild leading leftMargin length loaded localFileReadDisable manufacturer maxChars maxhscroll maxscroll menu message motionLevel motionTimeout mouseWheelEnabled multiline muted name names NaN nextSibling nodeName nodeType nodeValue os parentNode password pixelAspectRatio playerType previousSibling prototype quality rate restrict resolutionX resolutionY rightMargin scaleMode screenColor screenDPI screenResolutionX screenResolutionY scroll selectable separatorBefore showMenu size smoothing status styleSheet tabChildren tabEnabled tabIndex tabStops target targetPath text textColor textHeight textWidth time trackAsMenu type underline url useCodepage useHandCursor variable version visible width wordWrap xmlDecl</Keywords> <Keywords name="substyle1" /> <Keywords name="substyle2" /> <Keywords name="substyle3" /> <Keywords name="substyle4" /> <Keywords name="substyle5" /> <Keywords name="substyle6" /> <Keywords name="substyle7" /> <Keywords name="substyle8" /> </Language> <Language name="ada" ext="ada ads adb" commentLine="--" commentStart="" commentEnd=""> <Keywords name="instre1">abort abs abstract accept access aliased all and array at begin body case constant declare delay delta digits do else elsif end entry exception exit for function generic goto if in interface is limited loop mod new not null of or others out overriding package pragma private procedure protected raise range record rem renames requeue return reverse select separate some subtype synchronized tagged task terminate then type until use when while with xor</Keywords> </Language> <Language name="asm" ext="asm" commentLine=";" commentStart="" commentEnd=""> <Keywords name="instre1">aaa aad aam aas adc add and call cbw cdqe clc cld cli cmc cmp cmps cmpsb cmpsw cwd daa das dec div esc hlt idiv imul in inc int into iret ja jae jb jbe jc jcxz je jg jge jl jle jmp jna jnae jnb jnbe jnc jne jng jnge jnl jnle jno jnp jns jnz jo jp jpe jpo js jz lahf lds lea les lods lodsb lodsw loop loope loopew loopne loopnew loopnz loopnzw loopw loopz loopzw mov movabs movs movsb movsw mul neg nop not or out pop popf push pushf rcl rcr ret retf retn rol ror sahf sal sar sbb scas scasb scasw shl shr stc std sti stos stosb stosw sub test wait xchg xlat xlatb xor bound enter ins insb insw leave outs outsb outsw popa pusha pushw arpl lar lsl sgdt sidt sldt smsw str verr verw clts lgdt lidt lldt lmsw ltr bsf bsr bt btc btr bts cdq cmpsd cwde insd iretd iretdf iretf jecxz lfs lgs lodsd loopd looped loopned loopnzd loopzd lss movsd movsx movsxd movzx outsd popad popfd pushad pushd pushfd scasd seta setae setb setbe setc sete setg setge setl setle setna setnae setnb setnbe setnc setne setng setnge setnl setnle setno setnp setns setnz seto setp setpe setpo sets setz shld shrd stosd bswap cmpxchg invd invlpg wbinvd xadd lock rep repe repne repnz repz cflush cpuid emms femms cmovo cmovno cmovb cmovc cmovnae cmovae cmovnb cmovnc cmove cmovz cmovne cmovnz cmovbe cmovna cmova cmovnbe cmovs cmovns cmovp cmovpe cmovnp cmovpo cmovl cmovnge cmovge cmovnl cmovle cmovng cmovg cmovnle cmpxchg486 cmpxchg8b loadall loadall286 ibts icebp int1 int3 int01 int03 iretw popaw popfw pushaw pushfw rdmsr rdpmc rdshr rdtsc rsdc rsldt rsm rsts salc smi smint smintold svdc svldt svts syscall sysenter sysexit sysret ud0 ud1 ud2 umov xbts wrmsr wrshr</Keywords> <Keywords name="instre2">f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcom fcomp fcompp fdecstp fdisi fdiv fdivp fdivr fdivrp feni ffree fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisub fisubr fld fld1 fldcw fldenv fldenvw fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnsavew fnstcw fnstenv fnstenvw fnstsw fpatan fprem fptan frndint frstor frstorw fsave fsavew fscale fsqrt fst fstcw fstenv fstenvw fstp fstsw fsub fsubp fsubr fsubrp ftst fwait fxam fxch fxtract fyl2x fyl2xp1 fsetpm fcos fldenvd fnsaved fnstenvd fprem1 frstord fsaved fsin fsincos fstenvd fucom fucomp fucompp fcomi fcomip ffreep fcmovb fcmove fcmovbe fcmovu fcmovnb fcmovne fcmovnbe fcmovnu</Keywords>
  • Help with Regex/Find/Macro

    2
    0 Votes
    2 Posts
    121 Views
    CoisesC

    @João-Borloth said in Help with Regex/Find/Macro:

    Good morning!
    Everyone, I couldn’t understand REGEX.
    I believe there’s a REGEX solution (Find or Filter) to solve my problem.
    I need Notepad++ to search line by line and find the lines that contain:

    A word with all letters in uppercase (example: LTDA) A word with all letters in lowercase (example: and) A word with mixed lowercase and uppercase letters (except capitalized words) (for example, find: hoUse, HOuse, HousE)
    but NOT find House.

    This would require 3 Regex and/or 3 macros.
    Example sentences:
    My HouSe is Beautiful => Find “HouSe” and “is”
    My House Is Beautiful => Ok, Don’t find anything
    MY House IS Beautiful => Find “MY”, “IS”

    Thank you

    Your example doesn’t quite match your statement. If, as per your statement, you want to find lines which contain one or more words that do not consist of a capital letter optionally followed by one or more lower case letters, then try:

    (?-is)^(?!\u\l*+([^\w\r\n]+\u\l*+)*+[^\w\r\n]*$).*+

    You can find them one by one, or click Find All to get a list.

    If, as per your example, you want to find words that do not consist of a capital letter optionally followed by one or more lower case letters, try:

    (?-is)\b(\u\l*+)?+\w++

    I tried to cover likely cases involving punctuation, but test. I’m not promising it’s perfect. (Come to think of it, I’m sure these will not handle words with apostrophes correctly.)

  • Why does Autosave plugin keep disabling autosave at timed intervals?

    5
    0 Votes
    5 Posts
    155 Views
    Mr-BrunesM

    @PeterJones that’s great. I wonder if it’s a Win11 ‘feature’ that prevents the graceful app close/shutdown.
    Either way I know now what the smoking gun looks like so will be mindful of that in future.
    Tx for the analysis and for filing the plugin issue.

  • Locking file from other editing while opened in Notepad++

    10
    0 Votes
    10 Posts
    8k Views
    Serpens66S

    @xomx thank you very much :) hopefully the plugin gets updated some day, the auto-check is quite useful…

  • [FORK] How to get Alt-0### codes to work for newlines and similar

    14
    0 Votes
    14 Posts
    328 Views
    PeterJonesP

    @guy038 ,

    I think you missed my point.

    My point was not, “you can enter C0 using Ctrl+<key>, so there’s no need/benefit to be able to also enter C0 using Alt+0###”. My point is, all you have to do to be able to get Alt+0### access for C0 codes is to turn off the option named “prevent control character (C0 code) typing into document”: if you have things set up in a way that you want to be able to enter control codes, then you are the kind of user who probably doesn’t need the accidental-Ctrl+combo “protection” that enabling that option provides.

    Making the developers try to intercept the keystrokes before Windows turns the keystrokes from multiple presses into sending a single character to the app, just because you aren’t willing to turn off the anti-C0-“protection” seems the wrong way around. N++ already provides the option that allows you to enable typing C0 codes, whether by Ctrl+<unmapped> or by Alt+0### for C0 codes, so if you want to enter C0 codes, then set the option appropriately.

    solution cannot be applied because :

    Or, I would say, the “solution cannot be applied without unmapping pre-defined shortcuts, which is simple to do using Shortcut mapper”. (Or, I would say that, if that were a “solution” I were recommending; but it wasn’t.)

    Enabling vs disabling of features always come with tradeoffs, and power users of Notepad++ make those tradeoffs every day.

    Maybe I’ll put it this way: the option is literally named “prevent control character (C0 code) typing into document”. If you want to be able to type control characters (C0 codes) into the document, you obviously have to turn off that option. This seems highly reasonable to me.

  • Adding a Language to official Notepad++

    2
    0 Votes
    2 Posts
    91 Views
    PeterJonesP

    @Dawg1104 said in Adding a Language to official Notepad++:

    Is it at all possible to add a language to Notepad++ officially?

    At all? Definitely.

    Practically? It depends on the language.

    Notepad++ uses a library called Lexilla for handling the syntax highlighting of “official” languages. Lexilla actually provides some languages that Notepad++ has not yet exposed to its users. I have actually done a couple PR where I submitted the Notepad++ code update to enable those “hidden languages”.

    But if it doesn’t already exist in Lexilla, then someone would have to write the lexer per Lexilla standards, then submit it to Lexilla. One, in theory, could just submit a request that Lexilla add the language, but unless it happens to be a language that one of the Lexilla team is interested in, there’s very little chance they will implement it – for example, awk was requested to be added to Lexilla in 2009, but since the developer isn’t interested in it, it’s never been implemented. So practically, to add a new language to Lexilla, you have to write it.

    Those are the two paths to being “officially” added. But there are more paths to unofficial:

    There might already be a UDL (User Defined Language) available in the UDL Collection, If so, anyone can easily download the UDL definition from there and install it into their copy of Notepad++ per the UDL Collection instructions or, if you already have a UDL defined, but there isn’t one for that language in the Collection, you can submit it to the collection as described in the Collection instructions if it’s a simple list of keywords and operators and maybe a folding symbol (like the { ... } of C-style languages), it’s pretty easy to make your own UDL (and then submit it to the collection) my CollectionInterface plugin makes it really easy to download and install a language from the UDL Collection. wink wink nudge nudge If the logic is more complicated than simple keyword matching, then it’s possible to write a lexer plugin (overview found in the User Manual) – and such a plugin can be submitted to the Plugins Admin. (One of the most famous lexer plugins is the GEDCOM lexer, but there are actually quite a few of the plugins that have lexing capability among their features.)

    So, what language are you looking for, that you cannot yet find?

  • Search & Replace

    3
    0 Votes
    3 Posts
    89 Views
    guy038G

    Hello, @Jose-Ramalho, @peterjones and All,

    @jose-ramalho, let’s suppose this INPUT text :

    move $a swap $b, $c

    Then :

    Open the Replace dialog ( Ctrl + H )

    Uncheck all box options

    FIND (?-s)^(.+)\t(.+)

    REPLACE \1 FIXED_TEXT \(\2\)

    Select the Regular expression search mode

    Possibly, check the Wrap around option

    Click on the Replace All button

    => You should get the following OUTPUT text :

    move FIXED_TEXT ($a) swap FIXED_TEXT ($b, $c)

    This is just my first idea. Obviously, this requires some ajustements. See you later !

    Best regards,

    guy038

  • Strange Notepad++ file recovery

    5
    0 Votes
    5 Posts
    168 Views
    xomxX

    @Notepadder said in Strange Notepad++ file recovery:

    How can I access the files in this folder from a more recent restore point as with first crash?

    If there is also a more recent Windows OS Restore Point but you selected an older one somehow (with older N++ backup folder state) during your effort to revive your PC, you can try to extract newer N++ files by ShadowExplorer.

  • DSpellCheck not underlining misspelled words

    9
    0 Votes
    9 Posts
    209 Views
    Wally WilsonW

    @PeterJones

    Hi Everyone,

    I decided to drop back and punt. I cannot get hung up on this. I have other problems, and too much to do.

    I uninstalled the latest version, then downloaded the previous version (8.8.2), installed it, and installed DSpellCheck again. It is working. The underlining is not as prominent as I would like (even after adjusting the size to max), but it will have to do.

    I want to thank everyone who replied. Unfortunately, I do not have enough points to upvote anyone — sorry.

  • When network goes away - 2 pop-ups.

    4
    0 Votes
    4 Posts
    89 Views
    PeterJonesP

    I thought someone had suggested combining it to a single dialog, but there was some deep technical reason it was infeasible

    I looked through old issues (opened and closed): the closest I could find was the Isse#12079, where the loading of the current session would prompt N times if there were N network files missing. There was quite a lot of back-and-forth (hundreds of comments), but eventually, they were able to make it work, and get a YesToAll/NoToAll message added to the dialog when multiple files from the session were not available.

    Since it was feasible in that situation, I am hoping it’s also feasible here. Thus, I created Issue #16908 to see if the “Keep non existing file” dialog (when the network goes down) and the “Reload” dialog (when the network comes back) can add the YesToAll/NoToAll buttons. I don’t know whether it’s really feasible, or if it will ever be implemented, but the request has at least been made. Those who want this feature can go to that issue and upvote and/or watch for whether or not it gets implemented.

  • Sorting text with numbers

    4
    0 Votes
    4 Posts
    160 Views
    guy038G

    Hello, @michael-gomez, @coises, @thomas-knoefel and All,

    As @coises said, you could achieve your goal with the buit-in regular expression engine of Notpead++ !

    So, from your INPUT text :

    Warsongs rolls 206 Tykee rolls 206 Shadowhunter rolls 798 Ravencauthon rolls 229 Omgwtflolroflgg rolls 479 Nephlite rolls 576 Groverton rolls 943 Blodhgram rolls 829 Azria rolls 675 Antonioklaus rolls 720

    Using the following regex S/R :

    FIND (?-s)^.+?(\d+)

    REPLACE \1 $0!

    => You should get this temporary text :

    206 Warsongs rolls 206! 206 Tykee rolls 206! 798 Shadowhunter rolls 798! 229 Ravencauthon rolls 229! 479 Omgwtflolroflgg rolls 479! 576 Nephlite rolls 576! 943 Groverton rolls 943! 829 Blodhgram rolls 829! 675 Azria rolls 675! 720 Antonioklaus rolls 720!

    Then using the menu command :

    Edit > Line operations > Sort Lines Lexicographically Descending ( Should be better sorted than using the Sort Lines As Integers Descending ! )

    You would be left with that temporary text :

    943 Groverton rolls 943! 829 Blodhgram rolls 829! 798 Shadowhunter rolls 798! 720 Antonioklaus rolls 720! 675 Azria rolls 675! 576 Nephlite rolls 576! 479 Omgwtflolroflgg rolls 479! 229 Ravencauthon rolls 229! 206 Warsongs rolls 206! 206 Tykee rolls 206!

    And, finally, with the last regex S/R, below :

    FIND ^\d+\x20

    REPLACE Leave EMPTY

    Here is you expected OUTPUT text :

    Groverton rolls 943! Blodhgram rolls 829! Shadowhunter rolls 798! Antonioklaus rolls 720! Azria rolls 675! Nephlite rolls 576! Omgwtflolroflgg rolls 479! Ravencauthon rolls 229! Warsongs rolls 206! Tykee rolls 206!

    But, indeed, as @coises mentionned it, the two records with the same integer part 206 are inverted !

    Best Regards,

    guy038

  • Missing New Notepad++ Icon in v8.83

    6
    0 Votes
    6 Posts
    167 Views
    Daniel N 0D

    Thank you both!

  • 0 Votes
    2 Posts
    112 Views
    PeterJonesP

    @yeger-eren ,

    My answer is not “AI” specific.

    Maybe syntax highlighting tweaks,

    Notepad++ syntax highlighting is already pretty good; I’m not sure there is anything that needs to be “tweaked” in that regard when looking at code that you don’t create.

    auto-format tools,

    Notepad++ does not have built-in per-language code cleanup (“auto-format”, indentation fix, etc), because very few languages have One Right Way to format – and those that think they do actually have multiple factions who do things slightly differently, anyway. Notepad++ would never be able to get enough options to make everyone happy for all 90+ of the built-in programming languages that it has syntax highlighting for, let alone the uncountable number of possible UDLs that might exist.

    That said, there are plenty of language-specific plugins for Notepad++: if you’re generating XML, then XML Tools will help you format it; if you’re working with JSON, then JsonTools or JSON Viewer would be helpful; etc. And generically, @Michael-Vincent shares an example script for the NppExec plugin that is able to run an external “pretty print” utility for multiple languages depending on file extension in this post: his script does it for C, HTML, Perl, and Python, but it shows the pattern, so if you were getting code for another language, you could definitely call any external “pretty print” for whatever language you are using.

    Also, @Ekopalypse has the NppLspClient plugin, which will allow you to connect to an LSP Server for your language – and the tips page shows examples of how to configure it for various languages. Some LSP servers will respond to the Plugins > NppLspClient > Format Document or Format Selected Text commands by formatting according to the server’s settings – but not all do.

    regex replacements, or clever macros that make the process smoother?

    Every regex (or regex/editing macro) is specific to a very limited transformation; coming up with a generic one for something as indefinite as “fixes AI-generated code” is impossible. About the closest we come is our FAQ: Generic regex formulas, which lists a few different template regex, that you can use as a starting space for doing common tasks that we’ve seen requested year after year – though none of them are specific to “AI code craziness”.

  • Opening Files

    3
    0 Votes
    3 Posts
    185 Views
    Alan KilbornA

    Here’s my script entry, which does exactly this:

    open additional ffiles to the left of the files that are already open?

    I call the script MoveJustOpenedTabToExtremeLeft.py and instructions for use appear in the comments in the source code.

    # -*- coding: utf-8 -*- from __future__ import print_function # Python2 vestige! ######################################### # # MoveJustOpenedTabToExtremeLeft (MJOTTEL) # ######################################### # note: # This script was developed and tested under Python3 64-bit on unicode (non-ANSI) encoded data. # It may work as-is using Python2 and/or ANSI-encoded data and/or 32-bits, but that would be incidental. # references: # https://community.notepad-plus-plus.org/topic/27054/opening-files # for newbie info on PythonScripts, see https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript #------------------------------------------------------------------------------- # ensure this file is not executed directly: assert __name__ != '__main__', 'Cannot run this script directly; for testing, could execute this at console >>> prompt: from MoveJustOpenedTabToExtremeLeft import MOVE_JUST_OPENED_TAB_TO_EXTREME_LEFT' # to execute, use this in (e.g.) user startup.py: # from MoveJustOpenedTabToExtremeLeft import MOVE_JUST_OPENED_TAB_TO_EXTREME_LEFT # another execution option would be to copy and then paste that line into the PythonScript console >>> box # note: if running via startup.py, need to make sure that "Initialisation" for "Python Script Configuration" is set to "ATSTARTUP" and not "LAZY". #------------------------------------------------------------------------------- from Npp import * import threading #------------------------------------------------------------------------------- class MJOTTEL(object): def __init__(self): notepad.callback(self.fileopened_callback, [NOTIFICATION.FILEOPENED]) def fileopened_callback(self, args): #print('FILEOPENED:', args) IDM_VIEW_GOTO_START = 10005 threading.Timer(0.05, lambda : notepad.menuCommand(IDM_VIEW_GOTO_START)).start() #------------------------------------------------------------------------------- MOVE_JUST_OPENED_TAB_TO_EXTREME_LEFT = MJOTTEL()

    Notes:

    the script is rather simple-minded: it works for the simple case of opening 1 file at a time. If you attempt to open 2+ at the same time (e.g. drag and drop 2+ files from Explorer into Notepad++, use File > Open and specify 2+ files, etc.), the script causes only 1 of the files to move. If this is a big limitation for functionality, I could look into how to successfully achieve it.

    the threading stuff seems like it wouldn’t be necessary, but it is. Probably what happens (I didn’t verify) is that the file-opened notification message comes before Notepad++ is entirely done with everything it does to open a file. Delaying (via the threading call) moving the tab allows control to return to Notepad++ to let it finish doing its thing, before the script moves the tab.

  • 0 Votes
    3 Posts
    132 Views
    Terry RT

    @Tall-Navy-Guy said in Backup Files for New, Unsaved Tabs Are Deleted When Tab Is Closed — Bug?:

    Actual Result
    The backup created for the unsaved tab is immediately deleted when the tab is closed — there is no way to recover the text.

    Why This Matters
    Users (myself included) rely on the periodic-backup feature as a safety net for unsaved work. Accidentally closing an unsaved tab—or closing all tabs—should not silently discard those backups; other editors retain them until the user explicitly deletes the file or disables backups.

    You really need to understand what the backup is designed to do. There is a FAQ section and in there is this post which explains in detail what it does.

    You say you rely on this process “as a safety net” yet what you really seem to say is that this will be the “one and only” copy of the data you create. I am actually concerned to learn that you are relying on some process which clearly you misunderstand for saving what seems to be critical data.

    I believe you should get a message when closing the new 1 tab (not the whole application) asking if you want to keep it (see image in @Lycan-Thrope post), so in reality the application does NOT silently discard the backup, it asks you, it seems you confirm you don’t want the data since you are asking this question. The only “silent” process will be if you close Notepad++ without first closing any tabs. When you start Notepad++ later, all tabs should remain with their content intact.

    For your idea to work you would continue to rack up endless “backup” files, all with the same starting name new 1... and have very little idea which file contains which data you want.

    If you were to search this forum you will find it littered with unhappy users who like you misunderstood the process, relied on it for their only copy, only to find that inevitably the process eventually failed them, often due to external factors outside of Notepad++'s control.

    Please read the FAQ post and I strongly suggest changing the way you use Notepad++.

    Terry