• 0 Votes
    2 Posts
    225 Views

    @Sykledust said in Suggestion: make inc files not default associated with any language:

    in order to allow automatic syntax highlighting one have to edit “%AppData%\Notepad++\langs.xml”, and (in my experience) this has to be re-done for every NP++ update.

    In the Settings > Style Configurator, you can literally just go into the language you do want it to be, go to the User ext.: box and add it – no editing of langs.xml needed. Here’s a screenshot of adding it to the C language: e27f3429-368c-456b-a82f-59255f616620-image.png

    Once you’ve hit Save & Close from the Style Configurator, then the next time you open an *.inc file in Notepad++, it will be under the new language, not Pascal, because user-extensions take priority over the default list from langs.xml. This change, like other user-defined changes, does stay chosen if you do a normal update of Notepad++, because Notepad++ updates (under normal circumstances) do not overwrite the user-edited config files.

    this has to be re-done for every NP++ update.

    Even if you did it in langs.xml, this is incorrect: a normal upgrade does not delete or overwrite %AppData%\Notepad++\langs.xml or other such files – so unless you deleted that file (or the whole %AppData%\Notepad++\ folder), or something else weird was going on, it would keep that choice.

    (Obviously, installing on a new computer will require making the config change again, but this is true for every option in Notepad++.)

  • 0 Votes
    2 Posts
    247 Views

    @heraldww said in How to read every line in a file edit box:

    How to read every line in a file edit box

    Notepad++ can open many files at once.
    Now I want to traverse every line of each opened file.
    What function do I need to call?
    I don’t want to read files directly from the hard drive.
    I need to read them from the memory interface through an API
    What function should be called?

    I assume you’re talking about writing a plugin or a script. I can give you a clue regarding plugins; the script logic should be similar, but I don’t know the details.

    To get the contents of an active tab, use SCI_GETTEXT or SCI_GETLINE, along with other functions you’ll find described nearby in the same document to get the length of the text or the number of lines.

    Notepad++ keeps one or two views open, with a Scintilla control in each view and the document of the active tab in that view loaded into the Scintilla control; the documents in the other tabs are not loaded into Scintilla controls, and to the best of my knowledge there is no way to read their contents without loading them into a Scintilla control.

    You can switch active tabs, though, and thereby traverse all open files. I don’t have an example handy, but the information you need is in this Notepad++ documentation.

    NPPM_GETNBOPENFILES will tell you how many files are open in each view, and NPPM_ACTIVATEDOC will activate a specific document, so that should get you most of the way there.

  • How to use LuaScript examples

    Aug 16, 2024, 7:36 PM
    0 Votes
    3 Posts
    443 Views

    @Brad-Morgan luaautoindent.lua example is OnChar() so is not quite suitable for the task to reformat a whole document.

    You can download CodeFormat.exe from
    https://github.com/CppCXY/EmmyLuaCodeStyle/releases .
    Seems only 64 bit so unsure if 32 bit is available.

    win32-x64.zip is what I downloaded and tested with. CodeFormat.exe can reformat a whole document. Extract CodeFormat.exe from the zip to the plugins config directory which if installed Notepad++ is %AppData%\Notepad++\plugins\Config .

    You can add this code to LuaScript’s Edit Startup Script:

    npp.AddShortcut('Reformat Lua Code', '', function() local configDir = npp:GetPluginsConfigDir() local codeFormatPath = configDir .. '\\CodeFormat.exe' local filePath = npp:GetFullCurrentPath() local command = '""' .. codeFormatPath .. '" ' .. 'format -f "' .. filePath .. '" -d"' local file = io.popen(command) if file then local text = file:read('*a') file:close() if text and text ~= '' then editor:SetText(text) end end end)

    Need to restart Notepad++ to see the entry named Reformat Lua Code in the menu Plugins -> LuaScript .
    filePath will contain the path to the lua file. New1, New2… temporary files are not expected to work.

    A test file:

    t = {'a', 'b', 'c'}

    Click the Reformat Lua Code entry reformats the document to:

    t = { 'a', 'b', 'c' }

    The change is set in the document buffer.

  • Need help figuring this out.

    Aug 17, 2024, 8:11 PM
    0 Votes
    3 Posts
    210 Views

    @Mike-0 said in Need help figuring this out.:

    Also can you tell me how to do a wildcard search in Notepad ++
    /*. I seem to remember it was something like this, but I rarely use wildcards these days.

    You can use regular expressions. Start by reading the relevant section of the online manual and then come back if you have questions.

  • Help for a JSON formatting.

    Aug 16, 2024, 10:33 AM
    0 Votes
    2 Posts
    816 Views

    Ordinarily I would recommend JsonTools for this sort of task, but your JSON is a real mess, with arrays that contain a confused jumble of different types, so JsonTools is less useful than it might otherwise be. Likely whatever suggestion I give will only work in this specific situation.

    That said, if you open the JsonTools tree view and execute the RemesPath query @[5][0][2][Version, FileReferences], then click the Save query result button, that would print the JSON you want in a new buffer.

    There’s lots of RemesPath documentation in the GitHub repo linked above. PythonScript is also a reasonable option for this sort of problem.

  • copy and paste problem

    Aug 14, 2024, 9:20 AM
    0 Votes
    6 Posts
    820 Views

    @ohlogic It seems that a different wine version did not suffice, though installing Diodon, a clipboard manager, seems to be ok for now, if anything changes, I’ll update this post. Good day.

  • 0 Votes
    2 Posts
    181 Views

    @Branislav-Trnkocy

    See THIS recent discussion on the same topic.

  • -1 Votes
    4 Posts
    326 Views

    @mkupper said in Hiding Line number column has totally disappeared now!:

    it can be a challenge to discover where a setting is

    Which is why my recommendation is always to check the User Manual > Preferences if you don’t find it right away, and search for the setting you are looking for using your browser’s find-in-page feature: searching for line number on that page finds it pretty quickly.

    And until partway into the next major version, I keep notes like (this preference used to be in **MISC** section, before v8.x.y) – but sometime after a Major release, I clear out those old notes. (For example, the most recent change for Line Number was in v7.9.2, when it and all the other marginalia moved into Margins/Border/Edge; I didn’t get rid of the note until long after v8.0 was documented … actually, it was after v8.5 before I removed the v7.x notes – two years of trying to make it easier to find a setting that moved)

  • 0 Votes
    3 Posts
    229 Views

    @Alan-Kilborn said in I want to find informal and replace to formal words.:

    If you had a two-element list of everything,

    What do you mean by two element list of everything.

  • Folder as Workspace Docking

    Mar 25, 2023, 8:40 PM
    0 Votes
    14 Posts
    1k Views

    @rdipardo This is still happening in 2024, and the solution still works. One note; The entry starting with ‘<GUIConfig name=“DockingManager” …’ and ending with ‘</GUIConfig>’ should all be deleted, not just the lines between them. Thanks for the help. I was tearing out what little hair I have left!

  • 0 Votes
    8 Posts
    1k Views

    To any future readers:

    There’s actually an option #4 and #5 that didn’t exist, or that I didn’t know about, in 2021:

    v8.6.6 added the ability to have the GLOBALCLASS style, which gives you a separate keyword list. see this post for how to use it

    In this post, I show how to use a script to enable the “substyle” feature of Scintilla/Lexilla, which allows adding new keyword lists to certain lexers. Fortunately, the C++ lexer is one. The instructions in that post are for PHP, but if you do the edits in the CPP_SubstyleLexer and append the color/keyword-list info to the SCE_C_IDENTIFIER element, you can have your own custom lists of keywords for C++.

  • 0 Votes
    4 Posts
    1k Views

    Hello, @Sylvester-Bullitt, @peterjones, @coises and All,

    The @coises’s answer is quite clever. Personally, I ended up with this search/mark regex :

    SEARCH / MARK (?=(?-i:\u\l))(?i:(\u)\1)

    which uses a look-ahead expression at the beginning, instead of the look-behind expression at the end of the @coises’s regex :

    (?i:(\u)\1)(?<=(?-i:\u\l))

    You could say: it’s a minor difference, but it isn’t !! Indeed, as our Boost regex engine dos not allow look-behinds containing non-fixes expressions, my version has the advantage to work with any syntax of the look-ahead !

    For example, from the INPUT text :

    Aaaaaaaa Axxxxxx Bbbbbbbbbbbbbbbbbbbb Bxxxxxx Cccc Cxxxxxx AAAAAAAA Axxxxxx BBBBBBBBBBBBBBBBBBBB Bxxxxxx CCCC Cxxxxxx

    The regex (?=(?-i:\u\l+))(?i:(\u)\1+) would mark the left part of the first three lines, before the space char

    But the regex (?i:(\u)\1+)(?<=(?-i:\u\l+)) would just display the message Find: Invalid regular expression

    Best Regards,

    guy038

  • phonetic transformatios

    Aug 5, 2024, 11:10 PM
    0 Votes
    5 Posts
    214 Views

    there might be dictionary list with additional phonetic (IPA) representation . so working on the phonetics would be better.

    so the concept of soundex and other phonetic algorithms is to transform phonem-types (like fricatives) into a representating number, a number string is generated which flattens out many tiny differences and makes words basically constructed.

  • Notepad++ does not see an NAS

    Aug 5, 2024, 2:33 PM
    0 Votes
    4 Posts
    276 Views

    @Robert-Guertin

    In addition to what @PeterJones wrote, you may always use the UNC Notation
    \\<ServerName>\<ShareName>\<filepath>
    to access your file, no matter if running as Admin or not.

  • 0 Votes
    4 Posts
    862 Views

    @mkupper Disabling the touchpad fixed it :)
    Apologies for the red herring… :(

  • File extension List

    Jul 25, 2024, 12:32 PM
    0 Votes
    11 Posts
    1k Views

    @PeterJones ,
    Bravo @PeterJones. Hope to get to that point, someday.
    :-)

  • 0 Votes
    12 Posts
    644 Views

    @Lycan-Thrope said in [Problem seeing some line numbers when

    Take the sections one by one until you find the offending issue. It’s painstaking, but it’s about the only way to fix it with the tools we have available, being the UDL…when the other option is writing a full on lexer.

    Welcome to Notepad++ UDL creation. :-)

    I appreciate all the help that you, and all the other respondents have provided here. As much as I wish it was a simple solution, sometimes it’s not and you just have to slog through a problem to get a resolution. Either way, it’s good to have a place to be able to ask questions and get good help in return.

    Thanks to all of you for the good information! (and quick replies!)

  • 0 Votes
    9 Posts
    15k Views

    @Jay-Imerman said in Alt-Up/Down Arrow Line Movement:

    let me please second this request

    If this is truly a request, it’s in the wrong place.
    See HERE.

    But, I’d say…don’t bother making it an official request, as it is very likely to be denied. The author long ago created the ability to remap commands to different keycombos, so users should avail themselves of that.

  • 0 Votes
    4 Posts
    372 Views

    Existing feature request right here -> github issue 2221

    Also, although this is not drag and drop the document list follows the tab bar and even if the tab bar is hidden you can still use the shortcuts from the tab bar to position files in the document list (down, up, start, end, …) (CTRL-SHIFT_PD, …)

  • 2 Votes
    4 Posts
    3k Views

    Existing feature request right here -> github issue 2221

    Also, although this is not drag and drop the document list follows the tab bar and even if the tab bar is hidden you can still use the shortcuts from the tab bar to position files in the document list (down, up, start, end, …) (CTRL-SHIFT_PD, …)