Re: Tutorial: Notepad++ shortcuts.xml macro converts unicode to the 95-keyboard ASCII characters
Marian <[email protected]>
| Newsgroups | alt.comp.os.windows-10,alt.comp.os.windows-11,alt.comp.microsoft.windows |
|---|---|
| Organization | BWH Usenet Archive (https://usenet.blueworldhosting.com) |
| Message-ID | <[email protected]> |
R.Wieser wrote: >> Currently every shortcuts.xml mapping is written out as a 6-line block: >> 1700 -> start search > Initialize.search engine > >> 1601 -> set search string (funky character) >> 1625 -> clear replace buffer > search type. lParam=0 -> standard > >> 1602 -> set replacement string (ASCII equivalent) >> 1702 -> run replace all > how to search. lParam=768 -> Search forward, wrap-around > >> 1701 -> end > Execute the search. lParam=1609 -> Replace all > >> The essential trio is: >> <Action type="3" message="1601" wParam="0" lParam="0" sParam="BADCHAR" /> >> <Action type="3" message="1602" wParam="0" lParam="0" sParam="GOODCHAR" /> >> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> >> So each mapping shrinks from 6 lines > 3 lines. > > In the light of the above, not quite. Maybe the the below ? > > -- Initialize > 1700 > 1625 > 1702 > -- Repeated block > 1601 > 1602 > 1701 I agree with anyone, no matter who they are, who makes a logically sensible argument, even if it's a choice between two essentially equivalent methods. <Action message="1700" ... /> <!-- start search --> <Action message="1601" ... /> <!-- set search string --> <Action message="1625" ... /> <!-- clear replace buffer --> <Action message="1602" ... /> <!-- set replacement string --> <Action message="1702" ... /> <!-- run replace all --> <Action message="1701" ... /> <!-- end --> Apparently you're saying we don't need to repeat the half dozen for each mapping but just repeat the essential trio after initializing at the start. <Action message="1601" sParam="BADCHAR" /> <Action message="1602" sParam="GOODCHAR" /> <Action message="1702" lParam="768" /> I agree your organization is shorter & clearer. Initialization (done once at the top): 1700 1625 1702 Then for each mapping: 1601 (set search string) 1602 (set replacement string) 1701 (end) I agree it "should" work and it would be clearer to others in many cases. Although repeating steps for each character accomplishes the same tasks.