• Running your code from inside Notepad++

    Locked
    3
    0 Votes
    3 Posts
    36k Views
    budski82B

    Thanks for your time and reply. At this point in time it is to confusing and more of a distraction. Getting the syntax down is hard enough, worrying about shortcuts is a month or two down the road. Plus the 30 extra seconds it involves to open the command prompt window. Then filter down through the directory is really not that big a deal.

    In every tutorial regardless of the language they get incentives for getting you to install the IDE or editor they are pushing. If it is not Atom it is Codepen or Sublime, Video Studio wants you to get the Pro version. Plus it cost you at least $19.00 or more monthly for that functionality.

    I am just getting comfortable working off the cmd line and creating directories on C:\ drive. I should worry about getting the roof on before I start looking at carpeting and recliners for the TV room. Thanks for your help, back to learning …Peace…

  • 0 Votes
    7 Posts
    2k Views
    Trey HargroveT

    @Alan-Kilborn Thanks for the suggestion. Considering that the solution from @PeterJones worked and was much easier, I may try this one at a later time. Cheers.

  • is it possible to highlight all strings based on the field delimiter?

    Locked
    4
    1 Votes
    4 Posts
    703 Views
    Alan KilbornA

    @Eddie-Jr.-Panes

    I worked on it further and came up with something more generic:

    (?-s)^(?:.*?(;|,|\t)){FIELDMINUS1}\K(?:.*?)(?=(?1)|\R|\z)

    It will match various delimiters: ; or , or tab. To add or remove delimiters, just change this part of it: (;|,|\t)

    It will also work (and highlight nothing) for a field if that field position occurs in the middle of two consecutive field delimiters (also stated as two delimiters occurring back to back).

    I saw a slight problem. If FIELDMINUS1 is zero, and the first field in the data to be matched is empty (meaning a line starts off with a delimiter rather than non-delimiter), then the match is incorrect. Maybe guru of gurus @guy038 could fix this problem,?

  • key-bindings insert the current Date and Time

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Meta ChuhM

    @Александр-Корженевский

    to install TextFX in your portable notepad++ 7.6.2:
    you have to use the official “plugins admin” to install the TextFX Characters plugin.
    (the old “plugin manager” is not compatible with newer notepad++ releases)
    here is a good screen video from @andrecool-68 about it, as he answered a similar question a few days ago:

    alt

    to install PythonScript will be a bit more to do, because the folder locations of notepad++ 7.6.2 are different:

    get a new copy of PythonScript_Full_1.3.0.0.zip from here
    extract it and put it’s contents as listed below

    PythonScript.dll, plugin dll goes to:
    npp.7.6.2.bin\plugins\PythonScript\PythonScript.dll

    python27.dll goes to:
    npp.7.6.2.bin\python27.dll

    machine level scripts and python library go to:
    npp.7.6.2.bin\plugins\PythonScript\lib\
    npp.7.6.2.bin\plugins\PythonScript\scripts\
       contains sample scripts and startup. py

    manual, context-help files go to:
    npp.7.6.2.bin\plugins\doc\PythonScript\
       contains PythonScript.chm up to version 1.2.0.0
       contains html docs since version 1.3.0.0

    user level scripts go to:
    npp.7.6.2.bin\plugins\config\PythonScript\scripts\
       note: this folder will be created automatically as soon as a new script is created.

    note: you can also find more information about PythonScript installation to a non portable, installed version of notepad++ here

  • Bug: Click on "Encode in UTF-8 does not work"

    3
    0 Votes
    3 Posts
    2k Views
    Ben S.B

    @Meta-Chuh:

    Thank you. Disabling let it work now :-)

    I hope that this bug will be fixed in the next release.
    Ben

  • Tool bar customization not saved

    Locked
    3
    1 Votes
    3 Posts
    625 Views
    Eduardo GoncalvesE

    Thanks a lot Peter.
    Straight on target.

    Now, with this one, all it´s OK:
    Notepad++ v7.5.9 (64-bit)
    Build time : Oct 14 2018 - 15:19:55
    Path : C:\Program Files\Notepad++\notepad++.exe
    Admin mode : ON
    Local Conf mode : OFF
    OS : Windows 7 (64-bit)
    Plugins : mimeTools.dll ComparePlugin.dll CustomizeToolbar.dll NppConverter.dll PluginManager.dll XMLTools.dll

    Thank you.

  • I need help, Lost all of my unsaved text after windows update

    Locked
    6
    0 Votes
    6 Posts
    1k Views
    Alan KilbornA

    …unless this holds true:

    @Meta-Chuh said:

    but if the update you have run is windows 10 build 1809, i’ve heard about permanent data losses after this update (for any programs, not related to notepad++).

  • UTF-8 encoded text file misread as Windows-1258

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    David Kim83D

    @Peter-Jones
    Thanks!

    Disabling autodetect surely solve the problem.
    However I just found out UTF-8 BOM would do the trick even with autodectect on.

  • Cells Like Office

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Terry RT

    @Indra-Lung-Spirit
    If I read your question correctly, the short answer is no!

    Notepad++ is a text editor, it does NOT work with binary files as it doesn’t understand the formatting within these files (and therefore can corrupt the data within).
    In reference to cells, I assume you mean a spreadsheet program (Excel) and Notepad++ definitely isn’t one of those. It will open CSV files which can also be associated with Excel, but they are still text files.

    Terry

  • TextFx in a macro ?

    Locked
    1
    0 Votes
    1 Posts
    373 Views
    No one has replied
  • Language Definition Issues

    Locked
    1
    0 Votes
    1 Posts
    520 Views
    No one has replied
  • Ctrl key combination weird behavior

    5
    0 Votes
    5 Posts
    1k Views
    PeterJonesP

    Sorry we couldn’t find the root cause, but glad it’s stopped.

  • Any support for a colorizing nested brackets or colorized indent?

    Locked
    1
    0 Votes
    1 Posts
    544 Views
    No one has replied
  • finding some of my saved file in note++...

    Locked
    5
    0 Votes
    5 Posts
    961 Views
    Meta ChuhM

    @gurikbal-singh
    i guess you have good intentions to help,
    but if you keep posting, please try to post in full, explanatory sentences and take your time to re-read them to check if someone that is not you can understand them.

    very few of your post are understandable, for example this one can only be understood if someone follows your link to your screenshot AND already knows the answer like @Eko-palypse . for everyone else it looks like spam, or in this case a screenshot of a spam filled explorer window ;-)

    @Teddy-May
    we need more information on what exactly happened

  • Update stopped working under 7.5.9

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    Meta ChuhM

    @Eko-palypse
    theory confirmed ;-)

    @Craig-Williams
    there are major changes to the internal folder structures of notepad++, like autoCompletion and plugins, so an update to 7.6.+ means that you will have to move your existing plugins, and their custom configurations (if any exist) as well as any custom autoCompletion files to the new locations, and therefore this update should not be triggered automatically yet, as it is more of a “migration” than a normal update that’s suitable for all users.

    if you are ready to migrate, you can use the 7.6.2 installer of your choice from here and use it as updater to install over your existing notepad++.

    we will assist you if you have any problems migrating and you can’t find the correct solution in this forum.

  • Ignore Prefix or Suffix Characters

    Locked
    13
    0 Votes
    13 Posts
    3k Views
    Meta ChuhM

    @aclark13

    Unfortunately the functions in these scripts don’t use a ( so that might not work.

    the only (dirty) workaround i’ve been able to come up with, is to temporarily type an (after your function if you want to view your calltip/parameter hint or mini manual, then press backspace to remove the ( and resume with the correct syntax.

    your key word (target in this example) will stay black as long as you keep the bracket there, so it’s easy to spot if you forget to remove the opening bracket once in a while with this q’n’d workaround.

    Imgur

    please keep us informed if you come up with anything more suitable for this case.

    btw.: here’s a link to the (pretty old) autocompletion wiki if it helps:
    http://docs.notepad-plus-plus.org/index.php/Auto_Completion

  • no output when using kivy in python in notepad++

    Locked
    16
    1 Votes
    16 Posts
    2k Views
    Sean LaceyS

    it worked thank you so much

  • 0 Votes
    2 Posts
    579 Views
    Eko palypseE

    @viveksejpal said:

    not sure if this can be done easily with out modifying the npp source code.
    For example you still generate

    \BoostRegexSearch.obj

  • function list - how to get a text to identify the function

    6
    0 Votes
    6 Posts
    1k Views
    Eko palypseE

    jN Notepad++ plugin might be a good starting point for you.

  • 1 Votes
    11 Posts
    2k Views
    Eric BornE

    @alan-kilborn said:

    How exactly does the script do this? Does it invoke the menu commands for styling? I ask because, since you are apparently adept at scripting, you could do the styling in a more manual way, and thus avoid limitations about case sensitive/insensitive that you are seeing. Had this not occurred to you?

    Due to not knowing how to do it (newbie in PythonScript/Scintille), and having found an example that used the MENUCOMMAND.SEARCH_MARKALLEXT1…5, I originally came up with next:
    # Code in startup.py
    # not shown: some code to read the keywords from the top of the result-file...
    # then next (dirty) code performed the coloring, albeit case sensitive:
    iColorIndex = 1
    for keyword in lstKeywords:
    editor.gotoPos(startpos)
    editor.setAnchor(startpos+len(keyword))
    exec('notepad.menuCommand( MENUCOMMAND.SEARCH_MARKALLEXT%d )' % iColorIndex) # color 1..cnst_MaxColors
    iColorIndex += 1
    if iColorIndex > cnst_MaxColors:
    break
    startpos += len(keyword) + 1 # +1 for the space

    Your tip about the SendKeys Python library: I definitely will check this out (on my todo-list).

    @guy038

    I probably mis-wrote my point: as @alan-kilborn said, I liked to have it done w/o any manual intervention.
    But thx for your neat comments anyway:)

    @alan-kilborn

    Didn’t know about the functionality of the editor.XXX_indicator_XXX() Scintilla commands.
    So I tested your “example”: it DOES THE JOB perfectly!
    In your code, we are not dependent anymore of any settings bit, because “re.I” is specified explicitly, brilliant!

    So you supplied the perfect solution and I am very grateful for this!

    To explain how my piece of the startup.py code works, here a shot of the first few lines of a “result-file” I mentioned earlier, though I couldn’t achieve the formatting like it is shown in my launched Notepad++:
    (note: my apologies for the bad formatting, but I have no skills on this whatsoever, read little in the help, then came up with next)

    ##LANGUAGE=SERESULTS
    Runtime: 0.10 s
    SE.py version V01.01
    User arguments: script python startup
    Used arguments: script python startup
    TotalMatches = 631 (displayed = 44)
    SkipsFor(+) = 0
    SkipsFor(-) = 0
    -------------------------------------------------------------------
    #Header
    #Date 2018/12/14
    #Title
    #Keywords ORGIIIEGB IIITTIMMERS warning Notepad++ plugins PythonScript PluginManager PythonScript_1.0.8.0.msi specialties features files NiceToKnows problems startup
    #Body
    2015/09/11:
    NEVER install pythonScript using the PluginManager, because that gives problems!
    Instead, use the installer PythonScript_1.0.8.0.msi (Stop Notepad++, execute this .msi, then start Notepad++ again))
    ` Configfile:` ` C:\Users\borne\AppData\Roaming\Notepad++\plugins\config\PythonScriptStartup.cnf` ` startup.py:` ` C:\Program Files (x86)\Notepad++\plugins\PythonScript\scripts\startup.py`
    #EndBody
    -------------------------------------------------------------------
    #Header
    #Date 2018/12/21
    #Title todo Turning a python script into a website
    #Keywords ORGIIIEGB todo Turning a python script into a website
    #Body
    todo: try this out:
    https://blog.pythonanywhere.com/169/
    #EndBody
    -------------------------------------------------------------------
    #Header
    #Date 2018/12/20
    #Title
    #Keywords ORGIIIEGB C:\db\Python_Sources\Notepad++PluginPythonScript\Examples\ BracketHighlighter.py ColumnLexer.py CTags Based Autocompletion.py Disable Virtual Space.py Enable Virtual Space.py EnhancedPythonLexer.py Event Handler Demo.py Formatter.py HideLines.py InsertRuler.py LogfileLexer.py MultiEdit.py Python Regex Replacements.py RegexTester.py Remove and Modify selected lines.py ReplaceDefaultReplaceDialog.py Sorter.py StartWithLocalPython.py Swap2Words.py
    #Body
    C:\db\Python_Sources\Notepad++PluginPythonScript\Examples\
    BracketHighlighter.py
    ColumnLexer.py
    CTags Based Autocompletion.py

    (note that the structured database text file is almost the same:
    strip off the part before the first ‘-------------’ and replace all lines ‘-----------’ with empty lines)

    And here is the resulting startup.py containing your EXCELLENT solution:

    # The lines up to and including sys.stderr should always come first # Then any errors that occur later get reported to the console # If you'd prefer to report errors to a file, you can do that instead here. import sys from Npp import * import traceback import re # Set the stderr to the normal console as early as possible, in case of early errors sys.stderr = console # Define a class for writing to the console in red class ConsoleError: def __init__(self): global console self._console = console; def write(self, text): self._console.writeError(text); # Set the stderr to write errors in red sys.stderr = ConsoleError() # This imports the "normal" functions, including "help" import site # This sets the stdout to be the currently active document, so print "hello world", # will insert "hello world" at the current cursor position of the current document sys.stdout = editor #def switch_language_view(args): # notepad.activateBufferID(args["bufferID"]) # lineone = editor.getLine(0) # if '##' in lineone: # #lineone = lineone[lineone.rfind('##'):].replace('##', '') # language = lineone[lineone.rfind('=')+1:] # #lineone = "MENUCOMMAND." + lineone.upper() # try: # #notepad.menuCommand( eval(lineone) ) # #notepad.menuCommand(lineone) # notepad.runMenuCommand("Language", language) # except: # pass def style(x): return 26 - x def match_found(m): editor.indicatorFillRange(m.span(0)[0], m.span(0)[1] - m.span(0)[0]) ##command to link notification #notepad.callback(switch_language_view, [NOTIFICATION.FILEOPENED]) #editor.indicatorClearRange(0, editor.getTextLength()) skip this, as nothing is colored yet try: sFirstLinesOfDoc = editor.getTextRange(0,255) sTarget1 = '##LANGUAGE=SERESULTS' sTarget2 = 'Used arguments: ' pos = sFirstLinesOfDoc.find(sTarget1) if pos == 0: # ok, we are probably dealing with a results file, so continue processing cnst_FirstStyle = 1 cnst_MaxStyles = 5 # 5 Token Styles (== Scintilla indicators, thx @Alan-Kilborn) pos = sFirstLinesOfDoc.find(sTarget2) if pos >= 0: # also found this, so way to go startpos = pos + len(sTarget2) endpos = sFirstLinesOfDoc.find('\r\n', startpos) lstKeywords = sFirstLinesOfDoc[startpos:endpos].split() currentStyle = cnst_FirstStyle for keyword in lstKeywords: editor.setIndicatorCurrent(style(currentStyle)) editor.research(r'\Q' + keyword, match_found, re.I) currentStyle += 1 if currentStyle > cnst_MaxStyles: break except: # next error processing code doesn't work: # - no error can be seen afterwards, even not in the console when it is instructed to open automatically when an error occurs # (note: the console then opens correctly, but no error appears) # - also editor.insertText() doesn't work from this exception-block strError = r'Exception in file C:\Program Files (x86)\Notepad++\plugins\PythonScript\scripts\startup.py' strError += '\n' + traceback.format_exc(100) + '\n' editor.insertText(0, strError) # insert the error at top of file print strError

    @alan-kilborn said:
    …Scintilla is not to blame for any case-sensitive problems…

    Of course, you’re right.
    I never want to blame anything or anybody, not to mention the fact, that my interpretation often differs from authors’ intention, so I rather play it safe and fair with the gap in between :)

    Recap: I am very grateful for your help, gentleman! I am glad that there are people like you, reading problems and react very professionally! (payed services are often worse!)

    As a thank you, if you would like to test the searchtool out yourself, let me know how and I’m glad to send you a copy!