• Ayuda txt

    4
    0 Votes
    4 Posts
    828 Views
    PeterJonesP

    @nippurdelagash ,

    Please write in English to this forum. This is the second time you have been asked.

    Notepad++ keeps track of the most recent files edited in Notepad++, either in the File menu or in the File > Recent Files… submenu, depending on the Settings > Preferences > Recent Files History settings (as documented in the user manual).

    If you don’t know where you keep your own files, then you can use a Windows OS-based search for filename across your whole filesystem, or you can use Notepad++'s built-in Search > Find in Files dialog to look for particular text in files that have a particular extension. And, in the future, I would recommend organizing your filesystem in a manner that allows you to know where your own files are – because where on the disk that you store your files is, in the end, up to you.

  • Lost unsaved windows after upgrade

    6
    0 Votes
    6 Posts
    2k Views
    guy038G

    Hi, @HappySave,

    Your name is quite humorous, considering your initial situation, where you did not know if a solution was possible !!

    Best Regards,

    guy038

  • Practical to remove "white" areas between marked data on adjacent lines?

    7
    0 Votes
    7 Posts
    359 Views
    Alan KilbornA

    @dail nailed it, and @Nick-Brown was very close (but slightly incomplete). Thanks, both of you.

    If I do this in PythonScript:

    editor.indicSetStyle(31, 16) editor.indicSetOutlineAlpha(31, editor.indicGetAlpha(31))

    Then I get the effect I’m after:

    0504a455-746f-48eb-9a80-00d66b6661ae-image.png

    Note that 31 is the indicator number for red-marking, and 16 is the value for INDIC_FULLBOX.

  • Notepad getting hanged when I fold my file

    6
    0 Votes
    6 Posts
    439 Views
    PeterJonesP

    @arpan-kumar ,

    Well, if you don’t need spell check turned on while editing XML files, you can go to Plugins > DSpellCheck > Settings, and change the “File Types” section to “Check only NOT those:” and *.xml as the text entry, as shown in my screenshot:

    8d61bf2e-5c7a-4ff2-b4f8-32c3b6ed6214-image.png

    When I do that (and APPLY or OK), it stops spell checking the XML files. I don’t know if that will be sufficient for you. (I created a 2MB XML file, and even with DSpellCheck doing spell check and finding misspelled words, I couldn’t get it to hang when folding/unfolding the various levels. So I cannot replicate your problem to know whether turning off spell checker for XML is sufficient.)

  • UDL - using keywords with spaces

    2
    0 Votes
    2 Posts
    617 Views
    PeterJonesP

    @pierre-de-la-verre

    Can you give me an example?

    677c53b9-78b9-437a-9963-5ada0efd83d4-image.png

  • how to check if 160th character of every line is 'Z' ?

    8
    0 Votes
    8 Posts
    900 Views
    Alan KilbornA

    Additional helpful information for combining search criteria is found HERE.

  • What is BUFFERENCODING.COOKIE ??

    10
    0 Votes
    10 Posts
    1k Views
    Alan KilbornA

    @alan-kilborn said in What is BUFFERENCODING.COOKIE ??:

    How is one to tell the difference, in Pythonscript, if the current file’s encoding is UTF-8 without BOM, or for example, ISO-8859-1 ?

    @peterjones said in What is BUFFERENCODING.COOKIE ??:

    I thought there would be a way to read back the character set, distinct from the GETBUFFERENCODING message… but I cannot find a message that does that. Barring that, I thought that the scintilla object might have that info somewhere, but I cannot find it there, either. …maybe @Ekopalypse has insight on this one.

    @ekopalypse said in What is BUFFERENCODING.COOKIE ??:

    Sorry, but I have no idea.

    So…it’s a bit cheesy, but one can read the status bar field that shows the encoding type to get this information (as its text string).

    We’ve discussed in this forum how to get the status bar data before using a PythonScript, but I’ve revamped my code for doing it so I’ll post the whole thing here.

    Here’s NotepadGetStatusBar.py with a demo at the end to show the current file’s encoding:

    # -*- coding: utf-8 -*- from __future__ import print_function from Npp import * import ctypes from ctypes.wintypes import BOOL, HWND, WPARAM, LPARAM, UINT class NGSB(object): # implements a "getStatusBar" function (complement to notepad.setStatusBar()) def __init__(self): self.SendMessageW = ctypes.windll.user32.SendMessageW LRESULT = LPARAM self.SendMessageW.restype = LRESULT self.SendMessageW.argtypes = [ HWND, UINT, WPARAM, LPARAM ] self.create_unicode_buffer = ctypes.create_unicode_buffer self.curr_class_256 = self.create_unicode_buffer(256) self.STATUSBAR_HANDLE = None self._determine_statusbar_handle() assert self.STATUSBAR_HANDLE def get_statusbar_by_section(self, statusbar_item_number): # statusbar_item_number can be integer 0 thru 5 or one of: # STATUSBARSECTION.DOCTYPE # STATUSBARSECTION.DOCSIZE # STATUSBARSECTION.CURPOS # STATUSBARSECTION.EOFFORMAT # STATUSBARSECTION.UNICODETYPE # STATUSBARSECTION.TYPINGMODE return self._get_statusbar_section(statusbar_item_number) def get_statusbar_as_tuple(self): section_list = [ STATUSBARSECTION.DOCTYPE, STATUSBARSECTION.DOCSIZE, STATUSBARSECTION.CURPOS, STATUSBARSECTION.EOFFORMAT, STATUSBARSECTION.UNICODETYPE, STATUSBARSECTION.TYPINGMODE, ] return tuple(list(map(lambda x: self._get_statusbar_section(x), section_list))) def _determine_statusbar_handle(self): WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM) FindWindowW = ctypes.windll.user32.FindWindowW FindWindowExW = ctypes.windll.user32.FindWindowExW EnumChildWindows = ctypes.windll.user32.EnumChildWindows GetClassNameW = ctypes.windll.user32.GetClassNameW self.STATUSBAR_HANDLE = None def enum_callback_fn(hwnd, lparam): GetClassNameW(hwnd, self.curr_class_256, 256) if self.curr_class_256.value.lower() == "msctls_statusbar32": self.STATUSBAR_HANDLE = hwnd return False # stop the enumeration return True # continue the enumeration npp_hwnd = FindWindowW(u"Notepad++", None) #print('npp_hwnd:', npp_hwnd) EnumChildWindows(npp_hwnd, WNDENUMPROC(enum_callback_fn), 0) #print('self.STATUSBAR_HANDLE:', self.STATUSBAR_HANDLE) def _get_statusbar_section(self, statusbar_item_number): assert statusbar_item_number <= 5 WM_USER = 0x400 SB_GETTEXTLENGTHW = WM_USER + 12 SB_GETTEXTW = WM_USER + 13 SBT_OWNERDRAW = 0x1000 retcode = self.SendMessageW(self.STATUSBAR_HANDLE, SB_GETTEXTLENGTHW, statusbar_item_number, 0) length = retcode & 0xFFFF type = (retcode >> 16) & 0xFFFF assert (type != SBT_OWNERDRAW) text_buffer = self.create_unicode_buffer(length) retcode = self.SendMessageW(self.STATUSBAR_HANDLE, SB_GETTEXTW, statusbar_item_number, ctypes.addressof(text_buffer)) retval = '{}'.format(text_buffer[:length]) return retval if __name__ == '__main__': print(NGSB().get_statusbar_by_section(STATUSBARSECTION.UNICODETYPE))

    Running the script will print the current file’s encoding (from statusbar information) to the Pythonscript console window.

  • Search, Use Result to Add Code

    10
    0 Votes
    10 Posts
    527 Views
    Alan KilbornA

    @richard-howard said in Search, Use Result to Add Code:

    So, after your ‘encouraging me’ to do a little research before just asking for the answer, I found something that works.

    Awesome. You can only get better by taking such initiative.

  • Printing Contrast Is Too Light!

    7
    0 Votes
    7 Posts
    2k Views
    Simon KravisS

    @simon-kravis These settings fixed the problem
    3371f9d6-3fbb-46d5-b1d7-897a9d53133a-image.png

  • [CRITAL-HELP] File Content Lost When Save

    14
    0 Votes
    14 Posts
    1k Views
    Jaci ColvinJ

    @terry-r Thanks Terry. It is already ticked. I don’t know why it wasn’t notifying me of updates and I never deliberately disabled it. Not sure why that happened. Just now that I think about it, it used to asked for updates, but not in some time. I’ve manually done it now anyway.

    Will need to go and rewrite a second file it’s wiped on me now :(

  • replacement

    3
    0 Votes
    3 Posts
    227 Views
    Си ДжейС

    @alan-kilborn said in replacement:

    ${1}3000

    thank you

  • regex replace performance regression

    15
    2 Votes
    15 Posts
    1k Views
    guy038G

    Hi, @cmeriaux, @peterjones, @alan-kilborn, @arkadiuszmichalski and All,

    So, I"m going on testing some examples of text, dealing with replacements, bookmarks and replacement modifiers ! Note that I did not consider the Admin case, rather identical !

    First, I used the @sasumner’s file data8279.txt ( 300,000 lines ) and I performed two types of text :

    A global replacement of (?-s)^.*NotepadPP.*\R with Nothing, with the Wrap around option ticked ( First table, below )

    A mark operation of the string NotepadPP, with the Bookmark line and Wrap around option ticked, but not the Match case one, followed with a Search > Bookmark > Remove Bookmarked Lines operation ( Second table, below )

    203,236 occurrences were deleted or were marked then deleted !

    •===============•=============•==========•=================• | Archi- | Version | User Mode | | | |----------•-----------------| | tecture | Notepad++ | Time | Ratio x32/x64 | •===============•=============•==========•=================• | Win XP x32 | 7.9.2 | 65.0 s | -/- | •===============•=============•==========•=================• | Win 10 x32 | 7.9.2 | 47.6 s | | •---------------•-------------•----------• 1.27 | | Win 10 x64 | 7.9.2 | 37.5 s | | •===============•=============•==========•=================• | Win 10 x32 | 7.9.5 | 47.4 s | | •---------------•-------------•----------• 1.27 | | Win 10 x64 | 7.9.5 | 37.4 s | | •===============•=============•==========•=================• | Win 10 x32 | 8.0 | 86.2 s | | •---------------•-------------•----------• 1.22 | | Win 10 x64 | 8.0 | 70.4 s | | •===============•=============•==========•=================• | Win 10 x32 | 8.1.5 | 47.6 s | | •---------------•-------------•----------• 1.27 | | Win 10 x64 | 8.1.5 | 37.5 s | | •===============•=============•==========•=================• | Win 10 x32 | 8.1.9.2 | 47.5 s | | •---------------•-------------•----------• 1.28 | | Win 10 x64 | 8.1.9.2 | 37.2 s | | •===============•=============•==========•=================• •===============•=============•====================================• | Archi- | Version | User Mode | | | |------------------•-----------------| | tecture | Notepad++ | Time | Ratio x32/x64 | •===============•=============•==================•=================• | Win XP x32 | 7.9.2 | 10.0 s + 64.2 s | -/- | •===============•=============•==================•=================• | Win 10 x32 | 7.9.2 | 4.9 s + 49.1 s | | •---------------•-------------•------------------• 1.36 | | Win 10 x64 | 7.9.2 | 2.1 s + 37.5 s | | •===============•=============•==================•=================• | Win 10 x32 | 7.9.5 | 4.8 s + 49.1 s | | •---------------•-------------•------------------• 1.35 | | Win 10 x64 | 7.9.5 | 2.3 s + 37.6 s | | •===============•=============•==================•=================• | Win 10 x32 | 8.0 | 20.0 s + 49.1 s | | •---------------•-------------•------------------• 1.31 | | Win 10 x64 | 8.0 | 14.8 s + 37.8 s | | •===============•=============•==================•=================• | Win 10 x32 | 8.1.5 | 4.8 s + 49.3 s | | •---------------•-------------•------------------• 1.35 | | Win 10 x64 | 8.1.5 | 2.3 s + 37.7 s | | •===============•=============•==================•=================• | Win 10 x32 | 8.1.9.2 | 4.8 s + 49.2 s | | •---------------•-------------•------------------• 1.37 | | Win 10 x64 | 8.1.9.2 | 2.1 s + 37.4 s | | •===============•=============•==================•=================•

    In the second table, I decomposed the total time in two parts :

    Time to bookmark the lines

    Time to delete these lines

    I summarized the two values before calculating the ratio x32/x64

    Interpretation of the results :

    If xe except the special case of the v8.0 version, the results are very similar, for the two tables :

    In the first case, the more complicated regex (?-s)^.*NotepadPP.*\R decrease a bit the ratio between the x32 and x64 versions

    In the second case, both the mark operation and the deletion of lines have an impact, but the ratio between the x32 and x64 versions is a bit better

    Note that, regarding the v8.0 version, in the second table, the performance regression comes from the bad results of the mark operation only !

    I performed a last test, using the same Search and Replace regexes than in my initial issue :

    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9636

    So the regex S/R :

    SEARCH \w

    REPLACE \U$0

    I, then, created a file containing 1,000 lines ( every odd ones ) with the French text :

    C’est là, près de la forêt, dans un gîte, où régnait un grand capharnaüm, que l’aïeul ôta sa flûte et son bâton de son canoë.

    And I added 1,000 English lines ( every even ones ) :

    Here is a example of text, containing the complete French set of accentuated characters, traditionally used.

    After replacement, 184,000 occurrences have been modified :

    •===============•=============•==========•=================• | Archi- | Version | User Mode | | | |----------•-----------------| | tecture | Notepad++ | Time | Ratio x32/x64 | •===============•=============•==========•=================• | Win XP x32 | 7.9.2 | 18.7 s | -/- | •===============•=============•==========•=================• | Win 10 x32 | 7.9.2 | 10.5 s | | •---------------•-------------•----------• 2.56 | | Win 10 x64 | 7.9.2 | 4.1 s | | •===============•=============•==========•=================• | Win 10 x32 | 7.9.5 | 10.3 s | | •---------------•-------------•----------• 2.51 | | Win 10 x64 | 7.9.5 | 4.1 s | | •===============•=============•==========•=================• | Win 10 x32 | 8.0 | 38.5 s | | •---------------•-------------•----------• 1.41 | | Win 10 x64 | 8.0 | 27.4 s | | •===============•=============•==========•=================• | Win 10 x32 | 8.1.5 | 10.4 s | | •---------------•-------------•----------• 2.54 | | Win 10 x64 | 8.1.5 | 4.1 s | | •===============•=============•==========•=================• | Win 10 x32 | 8.1.9.2 | 10.4 s | | •---------------•-------------•----------• 2.54 | | Win 10 x64 | 8.1.9.2 | 4.1 s | | •===============•=============•==========•=================•

    Interpretation of the results :

    Again, if we except the special case of the v8.0 version :

    The results, whatever the version, are quite similar, for each case ( x32 and x64 )

    The ratio x32/x64 is similar to the one of my previous post ( ~ 2.52 ) !

    Best Regards,

    guy038

  • Regex Search With Quotations

    7
    0 Votes
    7 Posts
    3k Views
    DevSrc8D

    @peterjones thanks for all your help!

    is there a marked as Solved for this forum?

  • Sorting columns numerically

    3
    0 Votes
    3 Posts
    409 Views
    Cadaver182C

    @astrosofista said in Sorting columns numerically:

    Sort Lines as Integers Ascending

    Thanks a lot, works flawlessly!

  • Big borders around edit space

    2
    0 Votes
    2 Posts
    226 Views
  • Indenting multiple empty lines

    2
    0 Votes
    2 Posts
    390 Views
    PeterJonesP

    @danz4c ,

    That’s the way it’s designed.

    If you want to get empty lines indented as well, use column select (alt+drag) on the zeroth column, then hit TAB.

  • On Dark mode, the compare not show text

    2
    0 Votes
    2 Posts
    338 Views
    PeterJonesP

    @mas-cas ,

    See my answer to last week’s “Unreadable lines when comparing in dark mode

  • black boxes on all files I open

    4
    0 Votes
    4 Posts
    1k Views
    Alan KilbornA

    @patrick-donovan said in black boxes on all files I open:

    Not a very techy guy

    I think that’s going to have to improve dramatically for you to get very far. :-)

  • Regex: Find all html links that have minimum 3 letters after .com/

    3
    0 Votes
    3 Posts
    246 Views
    Hellena CrainicuH

    @neil-schipper thanks.

    WORKS:

    Regex Search: https://website\.com/en\w{1,}

  • Bookmarks disappear upon save & reopening file

    3
    0 Votes
    3 Posts
    716 Views
    Alan KilbornA

    Bookmarks are saved as part of the “session”.
    If you close a file, it gets removed from the session, and when reopened, it looks like a new file to the session (thus no bookmarks).

    There’s a demo PythonScript HERE that could be “rounded out” to pseudo-provide a load/save extension for bookmarks.

    For me, and I presume most users, the capability in Notepad++ currently is enough.