• UDL documentation (()) operator

    17
    1 Votes
    17 Posts
    2k Views
    dshuman52D

    @dshuman52

    The following code performs substitutions on a space inside single or double quotes of \b or \v respectively. That is how you activate the existing code “end if” means end\vif or ‘end case’ means end\bcase.

    only apparently in the following buffers.

    // OPERATORS2, FOLDERS_IN_CODE2, FOLDERS_IN_COMMENT, KEYWORDS1-8

    void ScintillaEditView::setUserLexer(const TCHAR *userLangName) { int setKeywordsCounter = 0; execute(SCI_SETLEXER, SCLEX_USER); UserLangContainer * userLangContainer = userLangName? NppParameters::getInstance().getULCFromName(userLangName):_userDefineDlg._pCurrentUserLang; if (!userLangContainer) return; UINT codepage = CP_ACP; UniMode unicodeMode = _currentBuffer->getUnicodeMode(); int encoding = _currentBuffer->getEncoding(); if (encoding == -1) { if (unicodeMode == uniUTF8 || unicodeMode == uniCookie) codepage = CP_UTF8; } else { codepage = CP_OEMCP; // system OEM code page might not match user selection for character set, // but this is the best match WideCharToMultiByte offers } execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold"), reinterpret_cast<LPARAM>("1")); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.isCaseIgnored"), reinterpret_cast<LPARAM>(userLangContainer->_isCaseIgnored ? "1":"0")); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.allowFoldOfComments"), reinterpret_cast<LPARAM>(userLangContainer->_allowFoldOfComments ? "1":"0")); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.foldCompact"), reinterpret_cast<LPARAM>(userLangContainer->_foldCompact ? "1":"0")); char name[] = "userDefine.prefixKeywords0"; for (int i=0 ; i<SCE_USER_TOTAL_KEYWORD_GROUPS ; ++i) { itoa(i+1, (name+25), 10); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>(name), reinterpret_cast<LPARAM>(userLangContainer->_isPrefix[i] ? "1" : "0")); } for (int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; ++i) { WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance(); const char * keyWords_char = wmc.wchar2char(userLangContainer->_keywordLists[i], codepage); if (globalMappper().setLexerMapper.find(i) != globalMappper().setLexerMapper.end()) { execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>(globalMappper().setLexerMapper[i].c_str()), reinterpret_cast<LPARAM>(keyWords_char)); } else // OPERATORS2, FOLDERS_IN_CODE2, FOLDERS_IN_COMMENT, KEYWORDS1-8 { char temp[max_char]; bool inDoubleQuote = false; bool inSingleQuote = false; bool nonWSFound = false; int index = 0; for (size_t j=0, len = strlen(keyWords_char); j<len && index < (max_char-1); ++j) { if (!inSingleQuote && keyWords_char[j] == '"') { inDoubleQuote = !inDoubleQuote; continue; } if (!inDoubleQuote && keyWords_char[j] == '\'') { inSingleQuote = !inSingleQuote; continue; } if (keyWords_char[j] == '\\' && (keyWords_char[j+1] == '"' || keyWords_char[j+1] == '\'' || keyWords_char[j+1] == '\\')) { ++j; temp[index++] = keyWords_char[j]; continue; } if (inDoubleQuote || inSingleQuote) { if (keyWords_char[j] > ' ') // copy non-whitespace unconditionally { temp[index++] = keyWords_char[j]; if (nonWSFound == false) nonWSFound = true; } else if (nonWSFound == true && keyWords_char[j-1] != '"' && keyWords_char[j+1] != '"' && keyWords_char[j+1] > ' ') { temp[index++] = inDoubleQuote ? '\v' : '\b'; } else continue; } else { temp[index++] = keyWords_char[j]; } } temp[index++] = 0; execute(SCI_SETKEYWORDS, setKeywordsCounter++, reinterpret_cast<LPARAM>(temp)); } } char intBuffer[32]; sprintf(intBuffer, "%d", userLangContainer->_forcePureLC); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.forcePureLC"), reinterpret_cast<LPARAM>(intBuffer)); sprintf(intBuffer, "%d", userLangContainer->_decimalSeparator); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.decimalSeparator"), reinterpret_cast<LPARAM>(intBuffer)); // at the end (position SCE_USER_KWLIST_TOTAL) send id values sprintf(intBuffer, "%" PRIuPTR, reinterpret_cast<uintptr_t>(userLangContainer->getName())); // use numeric value of TCHAR pointer execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.udlName"), reinterpret_cast<LPARAM>(intBuffer)); sprintf(intBuffer, "%" PRIuPTR, reinterpret_cast<uintptr_t>(_currentBufferID)); // use numeric value of BufferID pointer execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.currentBufferID"), reinterpret_cast<LPARAM>(intBuffer)); for (int i = 0 ; i < SCE_USER_STYLE_TOTAL_STYLES ; ++i) { Style & style = userLangContainer->_styleArray.getStyler(i); if (style._styleID == STYLE_NOT_USED) continue; char nestingBuffer[32]; sprintf(nestingBuffer, "userDefine.nesting.%02d", i ); sprintf(intBuffer, "%d", style._nesting); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>(nestingBuffer), reinterpret_cast<LPARAM>(intBuffer)); setStyle(style); } }
  • Weird Red Boxes

    6
    0 Votes
    6 Posts
    832 Views
    Alan KilbornA

    @Sam-Benson said in Weird Red Boxes:

    I will have to wait and see what happens.

    Sure, leave us hanging for something you could test and report back on immediately…

  • libcurl https proxy error with version 7.8.3 32 bits

    1
    0 Votes
    1 Posts
    227 Views
    No one has replied
  • Can't Save As SQL file

    3
    2 Votes
    3 Posts
    9k Views
    Sally HarrisS

    Beautiful! Thanks, just typed in the .sql extension and it worked like a charm. Appreciate your help!

  • All my themes a only have one colors of text.

    2
    0 Votes
    2 Posts
    228 Views
    Alan KilbornA

    @nick610

    That’s pretty “light” for information to be able to give a great answer. Are you actually specifying a type for the files you are looking at? This would be shown on the leftmost section of the status bar–what does it say there?

  • I am constantly losing data!

    7
    0 Votes
    7 Posts
    553 Views
    guy038G

    Hello @veridigital and All,

    I think, indeed, that @veridigital asks a rather embarrassing question…

    If we suppose that the problem of the NUL characters, following a power cut, comes from a setting, concerning the writing on the HDD, how to explain that it acts, specifically, on the files opened in Notepad++ ?

    In theory, corruptions should occur, in a random way, on any file opened by any software !?

    Seemingly, the NUL bytes story is not ended ;-)) It’s really irritating !

    Best Regards,

    guy038

    P.S. :

    Reading the @peterjones answer more carefully, I understand that Notepad++ is based on MS API. But it should certainly not be the only software ! Also, why should problems privilege Notepad++ files ?

  • remove Enter if line contains specific string

    3
    0 Votes
    3 Posts
    307 Views
    GuidovanHartenG

    Hello Ekopalyse,
    That works fine!
    Thank you very much.

  • Error with newlines from barcode scanner

    5
    0 Votes
    5 Posts
    2k Views
    PeterJonesP

    @Ict-MylabDev said in Error with newlines from barcode scanner:

    found that turning off “Enable auto-completion on each input” solved the problem.
    I have no idea what this feature is doing exactly.

    Specifically, what is happening: as you continue to scan CODE39 with the barcode scanner, it is typing C O D E 3 9 EOL. With autocompletion turned on, the first time through, Notepad++ auto-complete doesn’t do anything (nothing to autocomplete, because it’s never seen that before). The second time, after n characters from CODE39, the autocompletion mini-window appears (because it recognized the start of CODE39, which it has now previously seen), and it keeps matching as the scanner types the remainder of CODE39; the EOL at the end of the barcode scan, instead of inserting a newline in Notepad++, is used to select the active word from autocomplete, so it just leaves CODE39 but stays on the same line. The third barcode scan starts on that second line, but since it’s extended the text beyond CODE39 to CODE39C..., it isn’t matching, so the third EOL goes to Notepad++, to move the cursor to the third line. Similar sequences occur on future rows, which explains why it grows for a while. Apparently, it hits a maximum length for autocomplete on the 12th line, hence it just stays the same length, because it listens to that lase EOL on that line.

    (This can be replicated on your own without a barcode scanner by just turning on the autocomplete, and typing (not just pasting) CODE39 followed by a newline many times.)

  • Don't spin up HDD on startup

    12
    0 Votes
    12 Posts
    875 Views
    guy038G

    Hello, @gstavi,

    Reading your post to @plazer1, I decided to give it a try ! So, I saved all events, detected by Procmon, regarding the Notepad++.exe process, in a log file, when Notepad++ starts-up !

    Note that my N++ 7.8.3 configuration works fine !! So, it’s just a test and not a debugging task !. However, if you don’t mind, I would like to send you this small log file ( ~840 Kb ), with few comments of my own !

    My e-mail address is

    Again, I’m not requiring any help from you, but I just curious to know your feelings about it, as your knowledge of the Procmon utility is, of course, much better than mine.

    Thanks by advance !

    guy038

  • PowerShell Encoding issue in 7.8.3

    1
    0 Votes
    1 Posts
    298 Views
    No one has replied
  • Have 2 versions of NPP on my laptop (not on purpose). Need help

    3
    0 Votes
    3 Posts
    355 Views
    rickpepR

    That did it. Both ways. For some reason since I could only find one Notepad++.exe in the folders, i did not think ti simply search my hard drive. This is a work computer and I am not very well versed in how Windows is administered for a group. My directories for the exe look like this: “C:\ProgramData\App-V\39053732-F6F5-4330-B230-69A64467D68E\53CFA7AE-489B-47AD-9FC2-46755FB8FDAA\Root\VFS\ProgramFilesX64\Notepad++\notepad++.exe”

    I do not even see a “ProgramData” at first. Then I thought to view hidden system files and then there it was. Thanks for giving my brain a jump start.

    -Rick

  • Increase Search Results line length

    5
    0 Votes
    5 Posts
    3k Views
    Marco ManzatoM

    @Alan-Kilborn Thanks for identifying the issue on GitHub. I’ve posted a comment on the thread (would love to be more technical on that comment… but had to be just a regular complaint…)

  • Delete lines in multiple text/DAT files that contain specific characters

    17
    0 Votes
    17 Posts
    2k Views
    guy038G

    Hello, @adam-bowsky, @michael-vincent, @supasillyass and All,

    Personally, I would use the following regex S/R, which should work in all the discussed cases !

    I simply assume that the N90- string, with this exact case, is preceded with, at least, one digit !

    SEARCH (?-si)^\h*\d+N90-.*\R?

    REPLACE Leave EMPTY

    Of course, the Regular expression search mode is selected and the Wrap around option is ticked

    Give a try !

    I’ll give you some explanations when everything is right ;-))

    Best Regards

    guy038

  • Live list of all commands

    1
    0 Votes
    1 Posts
    438 Views
    No one has replied
  • Delete lines in multiple text/DAT files that contain specific characters

    3
    0 Votes
    3 Posts
    260 Views
    Adam BowskyA

    @Alan-Kilborn Apologies… I am not experienced with this.

  • Need help with editor.rereplace in the pythonscript plugin

    1
    0 Votes
    1 Posts
    325 Views
    No one has replied
  • 0 Votes
    3 Posts
    819 Views
    Bob ThebuilderB

    @Alan-Kilborn Thanks! This is exactly what I needed!

  • 0 Votes
    2 Posts
    221 Views
    Robert SR

    I fixed the issues, The dll needs to go as follows;

    Notepad++ install directory\plugins\ComparePlugin

    And now it works!

  • How to: Recording (Macro) and execute 5 regex formula (can this be done?)

    4
    0 Votes
    4 Posts
    362 Views
    Vasile CarausV

    Got it ! thanks, WORKS !

  • Need Spellchecker

    2
    0 Votes
    2 Posts
    237 Views
    dailD

    @Sylvester-Bullitt Sounds like Notepad++ is not the tool for the job.