How to create abbreviations for java code
-
Interesting. I never did the pull request to nppPluginList to add it. Wonder how it got there? Also, that’s not the latest version; 0.1.1.1 is available on the GitHub releases page.
It appears @chcg added it with a commit last summer. And in December, updated it to 0.1.1.1.
For adding to the list (though I’ve never done it), the nppPluginList page implies you just do a Pull Request to add it into the JSON files. You can search for closed PR to see what the PR look like that get plugins updated (I couldn’t find any PR attached to @chcg’s commits, though I admit navigating these things isn’t second nature to me yet, so there might be an associated PR with his commits).
-
@PeterJones said in How to create abbreviations for java code:
And in December, updated it to 0.1.1.1.
I wonder why it still shows as 0.1.0.1 in PA then?
but feel pretty weird about it being published in some list with me as the goto / author.
Yea, not to fault @chcg in any way, but it does seem awkward for you, given the project’s history.
-
@Alan-Kilborn said in How to create abbreviations for java code:
I wonder why it still shows as 0.1.0.1 in PA then?
In what version of Notepad++ / nppPluginList?
v7.8.4 shows 0.1.1.1 for me:
(both have the DLL’s RClick > Properties > Details showing 1.1.7.0)
-
Ah, I’m forgetting that PA isn’t quite “live”, like PM used to be. A shallow replacement, sadly. And all that work put into it, too…
Yea, I’m running a slightly older N++, so it makes sense.
Sorry to confuse because I forgot how things work. -
@Michael-Vincent said in How to create abbreviations for java code:
Happy to make it available on GitHub, but feel pretty weird about it being published in some list with me as the goto / author.
Especially if annoying people like me start asking you to make fixes, rather than the original author. Then you might have to start supporting it, or ignoring those people. :-)
I say this for no particular reason, because I wouldn’t ask you to look into why, when I installed 0.1.1.1 via Plugins Admin, it defaulted to an empty QuickText.conf.ini, rather than using the values for the defaults – because if I were to ask you about that, it would be like trying to assign you ownership, and I wouldn’t do that. ;-)
When that happens, then the Options… dialog is unintelligible; if that happens to someone else, they should Plugins > QuickText > Open Config File…, and paste in the contents of https://raw.githubusercontent.com/vinsworldcom/nppQuickText/master/Config/QuickText.conf.default.ini and save, then Plugins > QuickText > Refresh Configuration… – though it would be nice to not have to go through those hoops.
Oh, you meant because of copyright/license/ownership? That makes sense, too. It was released under GPL2, so as long as you attribute the original authors, maintain license, and make it clear that you have made changes from the original, there’s nothing wrong. (I’m never sure whether GPL requires you to change the name of the project if you make a fork or not, though it doesn’t seem to be that way: IANAL.
In other open-source communities – like Perl’s CPAN, it is possible to take ownership of abandoned open-source projects, and those don’t require renames, so I would assume it’s the same here.) -
@PeterJones said in How to create abbreviations for java code:
like Perl’s CPAN, it is possible to take ownership of abandoned open-source projects
Yes, I’ve done that. And I know Perl better than C++ so feel more comfortable actually supporting my Perl modules.
I don’t know why it doesn’t use the default one supplied with the ZIP file / install. Thanks for the work-around. I guess I never noticed already having it installed and working - probably had to jump through those hoops the first time I set it up from the original author and then my subsequent “upgrades” were just overwriting the DLL - the config and INI file where already in place.
Not sure if this helps now that you’ve figured it out:
QuickText.conf.default.ini = is an example of the the Plugin’s config file
QuickText.default.ini = is an example for the code snippetsWhen installed, it should end up like this:
$(NPP_INSTALL_DIR)\plugins\ |_ QuickText | |_ QuickText.dll | |_ QuickText.ini |_ Config |_ QuickText.conf.ini
Cheers.
-
I wouldn’t do that. ;-)
But in all seriousness, if you’d like bug reports or feature requests to be tracked on your github, I can add them. If it’s good enough for you, and you aren’t planning on any support or future fixes, then I don’t want to clutter your repo with issues that will just be ignored for years (or forever).
(If you don’t reply, I’ll assume “no issues, please”.)
-
I don’t mind you or anyone adding issues to track as long as you don’t mind they may never be fixed :-P
Seriously though, I found QuickText the most “useful” snippet plugin for how I worked and 2 things happened, I moved to 64-bit and Notepad++ updated Scintilla - both of which “broke” my usage of QuickText. I hacked at it with my sub-par C++ skills and was able to get 64-bit compiled with the new N++ plugin architecture and Scintilla updates so was pleased to just keep using it.
I haven’t given much thought to how I’d re-architect QuickText to address some of my minor gripes, but as it is now, it just “works” so I leave it alone.
I’m “more actively” updating “my” other plugins - again, none of these are “mine”, they are clones of other people’s work that either seemed abandoned, not updated in years or my request for features were turned down, so I implemented them myself. For the same reason as QuickText, I’m hesitant on listing them officially.
But for “power users” like yourself, that can stand a bit of “buginess” and hopefully no seg-fault crashes, feel free to try them out. Again, feedback welcomed (but possibly ignored :-) (coding N++ plugins isn’t my day job).
Cheers.
-
@PeterJones said in How to create abbreviations for java code:
I can add them.
5 issues!?!?! WOW, I should have said “no issues please!” LOL.
Joking aside, thanks for taking a look and taking the time to do the write-ups. I think 11 is an easy fix, 12 I’ve notice myself and just lived with it by editing the QuickText.ini file directly to add multiple new snippets. 13 I didn’t realize, although GLOBAL tags didn’t work at all in previous original versions. 14 and 15 - dealing with Unicode scare me :-(
I’ll probably approach in what I think is easiest: 11, 13, 12 and back burner 14 and 15 for now.
Cheers.
-
@Michael-Vincent said in How to create abbreviations for java code:
I should have said “no issues please!” LOL.
I tried to warn you. ;-)
None are showstoppers for me. Until I train myself to actually use the quick text snippets, they won’t be efficiency stoppers.
And I have a pythonscript implementation of #15, so for now I have a workaround on that one:
gist forpyscReplaceBackslashSequence.py (the mention of nppQuickText actually interrupted my development, while I explored to see if it would be enough for me; I ended up finalizing my script anyway) -
@PeterJones said in How to create abbreviations for java code:
actually interrupted my development, while I explored to see if it would be enough for me
I hear that. Frequently I’ll wish there was a quicker way to do something or something I’ll see a peer doing in VS Code and I’ll think “there must be a Notepad++ way to do this”. I’ll get sidetracking trying to find something.
I’ll look for a plugin or look for a way to script it in NppExec (my goto scripting engine). In fact I have a bunch of NppExec scripts (compile, style, help manual / docs, run, debug, open include files) that do a bit of formatting then send arguments to a monster Windows batch file that actually executes the task.
Sometime a find a plugin that’s promising, but it doesn’t do everything or it’s just 32-bit and then I’ll find myself cloning and hacking at it (JAPH, or in this case JAN++PH [Just Another Notepad++ Plugin Hacker]) to get what I want. That’s how all of “my” plugins came to be.
Cheers.
-
Hello, @michael-vincent, @peterjones and All,
First, many thanks for building an
x64
version of theQuickText
plugin and for all the bug fixesMay I bother you, a little bit, with a couple of weird things, still occurring in your last
0.1.2.4
version ?
A)
: First problem :-
Let suppose that you place the caret right after a word, which is not a tag, for the current language
-
If you run the option
Plugins > QuickText > Replace Tag
, it writes :-
The
»
character, in anANSI
encoded file ( An\xbb
byte ) -
The value
xBB
, in reverse video, in anyUnicode
encoded text ( Indeed, this single byte is not valid in an Unicode file ! )
-
This also happens if you run the
Plugins > QuickText > Replace Tag
option anywhere inside some blank range of text or even in an empty text. Is it the normal behaviour or is it a bug, due to my oldWin XP SP3
laptop ?!
B)
Second problem :-
Let’s suppose that the tags file
QuickText.ini
is opened, with other tabs, in your current N++ session -
Then, you decide to delete the only tab (
copyright
) of theGLOBAL
section, using thePlugins > QuickText > Options...
option. After validating the suppression :- If the current tab is the
QuickText.ini
you must, first, switch to an other tab
- If the current tab is the
-
Now, switch to the
QuickText.ini
tab to get the expected dialog : “This file has been modified by another program, do you want to reload it ?” -
After a click on the
Yes
button of this dialog, you can notice that the layout of the sections ofQuickText.ini
has become completely different !-
All the
ini
sections, which do not have any tag, have been deleted, including the[255]
GLOBAL one, of course -
From now on, the different sections are sorted alphabetically and NOT numerically
-
C)
Third problem :- Let’s suppose that you change the TEXT section as below :
[0] LANGUAGE_NAME=TXT LANGUAG_NAME=TXT_1 LANGUAGES_NAME=TXT_2
-
After saving these changes, run the
Plugins > QuickText > Refresh Configuration
option -
Then, paste the text, below, in a new text tab :
aaaaa LANGUAGE_NAME zzzzz aaaaa LANGUAG_NAME zzzzz aaaaa LANGUAGES_NAME zzzzz
- And run the option
Plugins > QuickText > Replace Tag
for each word in capitals
We get :
aaaaa LANGUAGE_NAMExBB zzzzz aaaaa TXT_1 zzzzz aaaaa TXT_2 zzzzz
I would have expected that the
LANGUAGE_NAME
tag would have been expanded to the string TXT OR to the current language, for any language different of Normal TextBTW, why, in
[0]
section, theLANGUAGE_NAME
is expanded to TXT whereas the language is TEXT ?
D)
To end with , a possible improvement :- It would be better to include all the other languages, with code over
49
, giving the following defaultQuickText.ini
file :
[0] LANGUAGE_NAME=TXT [1] LANGUAGE_NAME=PHP for.sl=for (\$i = 0; \$i < $; ++\$i)\n $ for.ml=for (\$i = 0; \$i < $; ++\$i)\n{\n $\n} foreach.sl=foreach (\$$ as \$k => \$v)\n $ foreach.ml=foreach (\$$ as \$k => \$v)\n{\n $\n} function.public=public function $($)\n{\n $\n} function.protected=protected function $($)\n{\n $\n} function.private=private function $($)\n{\n $\n} function.public.static=public static function $($)\n{\n $\n} function.protected.static=protected static function $($)\n{\n $\n} function.private.static=private static function $($)\n{\n $\n} [2] LANGUAGE_NAME=C case=case $: $\n$ def=#define $\n$ default=default $: $\n$ dowhile=do\n{\n $\n}\nwhile ($);\n$ dowhiles=do\n $\nwhile ($);\n$ else=else\n{\n $\n}\n$ elseif=else if ($)\n{\n $\n}\n$ elseifs=else if ($)\n $\n$ elses=else\n $\n$ for=for ($;$;$)\n{\n $\n}\n$ fors=for ($;$;$)\n $\n$ func=$ $($)\n{\n $\n return $;\n}\n$ if=if ($)\n{\n $\n}\n$ ifelse=if ($)\n{\n $\n}\nelse\n{\n $\n}\n$ ifelses=if ($)\n{\n $\n}\nelse\n $\n$ ifs=if ($)\n $\n$ ifselse=if ($)\n $\nelse\n{\n $\n}\n$ ifselses=if ($)\n $\nelse\n $\n$ inc=#include <$>\n$ incl=#include "$"\n$ main=int main(int argc, char* argv[])\n{\n $\n}\n switch=switch ($)\n{\n $\n}\n$ while=while ($)\n{\n $\n}\n$ whiles=while ($)\n $\n$ [3] LANGUAGE_NAME=CPP case=case $: $\n$ class=class $ {\nprivate:\n $\nprotected:\n $\npublic:\n $\n};\n$ def=#define $\n$ default=default $: $\n$ dowhile=do\n{\n $\n}\nwhile ($);\n$ dowhiles=do\n $\nwhile ($);\n$ else=else\n{\n $\n}\n$ elseif=else if ($)\n{\n $\n}\n$ elseifs=else if ($)\n $\n$ elses=else\n $\n$ for=for ($;$;$)\n{\n $\n}\n$ fors=for ($;$;$)\n $\n$ func=$ $($)\n{\n $\n return $;\n}\n$ hclass=#ifndef $\n#define $\n\nclass $ {\nprivate:\n $\nprotected:\n $\npublic:\n $\n};\n\n#endif\n$ if=if ($)\n{\n $\n}\n$ ifelse=if ($)\n{\n $\n}\nelse\n{\n $\n}\n$ ifelses=if ($)\n{\n $\n}\nelse\n $\n$ ifs=if ($)\n $\n$ ifselse=if ($)\n $\nelse\n{\n $\n}\n$ ifselses=if ($)\n $\nelse\n $\n$ inc=#include <$>\n$ incl=#include "$"\n$ main=int main(int argc, char* argv[])\n{\n $\n}\n switch=switch ($)\n{\n $\n}\n$ while=while ($)\n{\n $\n}\n$ whiles=while ($)\n $\n$ [4] LANGUAGE_NAME=CS [5] LANGUAGE_NAME=OBJC [6] LANGUAGE_NAME=JAVA [7] LANGUAGE_NAME=RC [8] LANGUAGE_NAME=HTML a-id=<a id="$" href="$">$</a> b=<b>$</b> body=<body>\n $\n</body>\n$ body-id=<body id="$">\n $\n</body>\n$ br=<br /> color.black=#000000 color.blue=#0000FF color.cyan=#00FFFF color.green=#00FF00 color.grey=#C0C0C0 color.mangenta=#FF00FF color.white=#FFFFFF color.yellow=#FFFF00 comment=<!-- $ -->\n$ div-class=<div class="$">\n</div> div-id=<div id="$">\n</div> div-id-class=<div id="$" class="$">\n $\n</div> div.p=<div class="p">\n $\n</div> doctype.html.4.loose=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\n "http://www.w3.org/TR/html4/loose.dtd"> doctype.html.4.strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"\n "http://www.w3.org/TR/html4/strict.dtd"> doctype.xhtml.1.0.loose=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> doctype.xhtml.1.0.strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> doctype.xhtml.1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\n "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> fieldset=<fieldset class="$">\n $\n</fieldset> form=<form name="$" action="$">\n $\n</form>\n$ h1=<h1>$</h1> h2=<h2>$</h2> h3=<h3>$</h3> h4=<h4>$</h4> h5=<h5>$</h5> h6=<h6>$</h6> head=<head>\n $\n</head>\n$ html-body=<html>\n<head>\n <title>$</title>\n $\n </head>\n <body>\n $\n </body>\n</html> i=<i>$</i>$ img=<img src="$" alt="$" />\n$ input=<input type="$" name="$" />\n$ li=<li>$</li> lil=<li>\n $\n</li> link=<a href="$">$</a>$ ol=<ol>\n <li>$</li>\n</ol> p=<p>\n $\n</p> pre=<pre>$</pre>\n$ pre-class=<pre class="$">\n $\n</pre> prel=<pre>\n $\n</pre> span=<span>$</span> table-id=<table id="$">\n <tr>\n <td id="$">\n $\n </td>\n </tr>\n</table> td=\n<td>\n $\n</td> title=<title>$</title>\n$ tr=\n<tr>\n $\n</tr> ul=<ul>\n <li>$</li>\n</ul> url=http:// www=http://www. [9] LANGUAGE_NAME=XML [10] LANGUAGE_NAME=MAKEFILE [11] LANGUAGE_NAME=PASCAL [12] LANGUAGE_NAME=BATCH [13] LANGUAGE_NAME=INI [14] LANGUAGE_NAME=NFO [15] LANGUAGE_NAME=USER [16] LANGUAGE_NAME=ASP [17] LANGUAGE_NAME=SQL [18] LANGUAGE_NAME=VB [19] LANGUAGE_NAME=JS for.sl=for (var i = 0; i < $; ++i)\n $ for.ml=for (var i = 0; i < $; ++i)\n{\n $\n} foreach.sl=for (var x in $)\n $ foreach.ml=for (var x in $)\n{\n $\n} [20] LANGUAGE_NAME=CSS [21] LANGUAGE_NAME=PERL Dumper=use Data::Dumper; \$Data::Dumper::Sortkeys=1; print Dumper \ $; exit;$ csv=my \$csv = Text::CSV->new( {sep_char => ',', binary => 1} )\n or die Text::CSV->error_diag;\n\nopen my \$fh, '<', \$$\n or die "\$!";\n\nwhile ( my \$row = \$csv->getline(\$fh) ) {\n $\n}\nif ( not \$csv->eof ) {\n my ( \$cde, \$str, \$pos ) = \$csv->error_diag;\n}\n$ else=else {\n $\n}\n$ elsif=if ( $ ) {\n $\n} elsif ( $ ) {\n $\n} else {\n $\n}\n$ for=for my \$$ ( $ ) {\n $\n}\n$ if=if ( $ ) {\n $\n}\n$ ifelse=if ( $ ) {\n $\n} else {\n $\n}\n$ mlread=my \$START = '$';\nmy \$STOP = '$';\nmy \$INCLUDE_START = $1;\nmy \$INCLUDE_STOP = $1;\nmy @data;\nfor ( $ ) {\n if ( /\$START/ .. /\$STOP/ ) {\n next if ( not \$INCLUDE_START and /\$START/ );\n push @data, \$_ unless ( not \$INCLUDE_STOP and /\$STOP/ );\n process_data() if ( /\$STOP/ );\n next;\n }\n process_nodata();\n}\nprocess_data\n\nsub process_data {\n return if not @data;\n # operate on @data\n $\n @data = ();\n}\n\nsub process_nodata {\n # operate on \$_\n $\n}\n$ open=open my \$fh, '<', \$$;\nmy @lines = <\$fh>;\nclose \$fh;\n$ package=package $;\nuse Class::Struct;\nstruct( $ => '\$', $ => '@', $ => '$Module::Name' );\n1;\n$ sopen=my \$lines;\n{\n local \$/ = undef;\n open my \$fh, '<', \$$;\n \$lines = <\$fh>;\n close \$fh;\n}\n$ start=#!perl\n\nuse strict;\nuse warnings;\n\n$ sub=sub $ {\n my (\$$) = @_;\n\n $\n}\n$ wantarray=my @rets;\nmy \$retType = wantarray;\n\nif ( not defined \$retType ) {\n print "$@rets";\n} elsif (\$retType) {\n return @rets;\n} else {\n return \@rets;\n}\n$ while=while ( $ ) {\n $\n}\n$ [22] LANGUAGE_NAME=PYTHON [23] LANGUAGE_NAME=LUA [24] LANGUAGE_NAME=TEX [25] LANGUAGE_NAME=FORTRAN [26] LANGUAGE_NAME=BASH [27] LANGUAGE_NAME=FLASH [28] LANGUAGE_NAME=NSIS [29] LANGUAGE_NAME=TCL else=} else {\n $ foreach=foreach $ $ {\n $\n}\n$ if=if { $ } {\n $\n}\n$ ifelse=if { $ }\n $\n} else {\n $\n} proc=# $\nproc $ { $ } {\n $\n}\n$ regsub=regsub -all {$} "$" {$} $\n$ [30] LANGUAGE_NAME=LISP [31] LANGUAGE_NAME=SCHEME [32] LANGUAGE_NAME=ASM [33] LANGUAGE_NAME=DIFF [34] LANGUAGE_NAME=PROPS [35] LANGUAGE_NAME=PS [36] LANGUAGE_NAME=RUBY [37] LANGUAGE_NAME=SMALLTALK [38] LANGUAGE_NAME=VHDL Ris=Rising_Edge ( $ )$ access=type $ is access $;\n$ alias=alias $ is $;\n$ archi=architecture $ of $ is\n$\nbegin\n$\nend $;\n$ array=type $ is\n array ( $ ) of $;\n$ assert=assert ( $ )\n report "$"\n sevrity $;\n$ block=$ : block $\nbegin\n $\nend block $;\n$ case=case $ is\n when $ =>\n $;\n when others =>\n $;\nend case;\n$ com=--\n-- $\n-- component=component $\n port (\n $\n );\nend component $;\n$ config=for $ : $\n use $\n $;\n$ constant=constant $: $;\n$ elsif=elsif ( $ ) then\n $; entity=entity $ is\n port (\n $\n );\nend $;\n$ enum=type $ is ( $, $ ); exit=exit $ when $;\n$ file=file $ : $ is $;\n$ for=$ : for $ in $ downto $ loop\n $;\nend loop $;\n$ function=function (\n $\n )return $ is\n $\nbegin\n $\nend $; functiond=function $ (\n $\n) return $;\n$ geneif=$ : if ( $ = $ ) generate\n $\nbegin\n $\nend generate $; generate=$ : for $ in $ downto $ generate\n $\nbegin\n $\nend generate $;\n$ generic=generic (\n $\n );\n$ genmap=generic map (\n $\n)\n$ group=group $ is ( $ );\n$ ieee=library ieee;\n use ieee.std_logic_1164.all;\n $ if=if ( $ ) then\n $;\n$end if;\n$ ifelse=if ( $ ) then\n $\nelse\n $\nend if;\n$ ifelsif=if ( $ ) then\n $\nelsif ( $ )\n $\nend if;\n$ loop=$ : loop\n $\nend loop;\n$ map=$ : $\n port map (\n $\n );\n$ mapgen=$ : $\n generic map (\n $\n )\n port map (\n $\n );\n$ next=$ : next $ when $;\n$ numeric=use ieee.numeric_std.all;\n$ pack=package $ is\n $\nend package $;\n\npackage body $ is\n $\nend package body $;\n$ port=port (\n $\n );\n$ procedure=procedure $ (\n $\n ) is\n$\nbegin\n $\nend procedure $;\n$ procedured=procedure $ (\n $\n);\n$ process=$ : process ( $ )\nbegin\n $\nend process $;\n$ proclk=$ : process ( $, $ )\n begin\n if ( $ = '$' ) then\n $ <= $;\n elsif( Rising_Edge( $ ) ) then\n $\n end if;\nend process $; protected=protected\n $\nend protected ; record=type $ is\n record\n $ : $ ;\nend record $;\n$ start=library ieee;\n use ieee.std_logic_1164.all;\n\nentity $ is\n port (\n $\n );\nend $;\n\narchitecture $ of $ is\n$\nbegin\n$\nend $;\n$ std=signal $ : std_logic$;\n$ stdpi=$ : in std_logic;\n$ stdpio=$ : inout std_logic;\n$ stdpo=$ : out std_logic;\n$ stdtextio=use ieee.std_logic_textio.all;\n$ stdv=signal $ : std_logic_vector( $ downto 0);\n$ stdvar=variable $ : std_logic;\n$ stdvpi=$ : in std_logic_vector( $ downto $);\n$ stdvpio=$ : inout std_logic_vector( $ downto $);\n$ stdvpo=$ : out std_logic_vector( $ downto $);\n$ stdvvar=variable $ : std_logic_vector( $ downto 0);\n$ subtype=subtype $ is $;\n$ textio=use std.textio.all;\n$ units=units\n $;\nend units;\n$ waitf=wait for $;\n$ waitu=wait until $;\n$ waituf=wait until $ for $;\n$ when=when $ =>\n $;$ whene=when ( $ ) else $; while=$ : while $ loop\n $;\nend loop;\n$ x=x"$"$ [39] LANGUAGE_NAME=KIX [40] LANGUAGE_NAME=AU3 [41] LANGUAGE_NAME=CAML [42] LANGUAGE_NAME=ADA [43] LANGUAGE_NAME=VERILOG [44] LANGUAGE_NAME=MATLAB [45] LANGUAGE_NAME=HASKELL [46] LANGUAGE_NAME=INNO [47] LANGUAGE_NAME=SEARCHRESULT [48] LANGUAGE_NAME=CMAKE [49] LANGUAGE_NAME=YAML [50] LANGUAGE_NAME=COBOL [51] LANGUAGE_NAME=GUI4CLI [52] LANGUAGE_NAME=D [53] LANGUAGE_NAME=POWERSHELL [54] LANGUAGE_NAME=R [55] LANGUAGE_NAME=JSP [56] LANGUAGE_NAME=COFFEESCRIPT [57] LANGUAGE_NAME=JSON [58] LANGUAGE_NAME=JAVASCRIPT [59] LANGUAGE_NAME=FORTRAN_77 [60] LANGUAGE_NAME=BAANC [61] LANGUAGE_NAME=SREC [62] LANGUAGE_NAME=IHEX [63] LANGUAGE_NAME=TEHEX [64] LANGUAGE_NAME=SWIFT [65] LANGUAGE_NAME=ASN1 [66] LANGUAGE_NAME=AVS [67] LANGUAGE_NAME=BLITZBASIC [68] LANGUAGE_NAME=PUREBASIC [69] LANGUAGE_NAME=FREEBASIC [70] LANGUAGE_NAME=CSOUND [71] LANGUAGE_NAME=ERLANG [72] LANGUAGE_NAME=ESCRIPT [73] LANGUAGE_NAME=FORTH [74] LANGUAGE_NAME=LATEX [75] LANGUAGE_NAME=MMIXAL [76] LANGUAGE_NAME=NIMROD [77] LANGUAGE_NAME=NNCRONTAB [78] LANGUAGE_NAME=OSCRIPT [79] LANGUAGE_NAME= REBOL [80] LANGUAGE_NAME=REGISTRY [81] LANGUAGE_NAME=RUST [82] LANGUAGE_NAME=SPICE [83] LANGUAGE_NAME=TXT2TAGS [84] LANGUAGE_NAME=VISUALPROLOG [85] LANGUAGE_NAME=EXTERNAL [255] LANGUAGE_NAME=GLOBAL copyright=Copyright (C) $ 20$\n\nhttp://$\n\nAll rights reserved\n$
Thanks for taking the time to read this post through to the end ;-))
Best Regards,
guy038
-
-
A) This does not happen for me. It is probably as expected for now since I always use ANSI encoded files and my QuickText.ini is ANSI encoded. As @PeterJones documented in the GitHub issues, UNICODE does not work in this plugin and since there is a mess of someone else’s old code, I’m not prioritizing fixing that - sorry.
B) The tab switching to get the change notification happens for me with any file in N++. Not sure that’s related. The order of sections is as expected as well since when the file is rewritten, it’s written according to looping through the C++ vector storing the languages - I don’t believe any sort is applied. So however they are in there, they are written out. I’ll see if there’s a way to easily sort, but I don’t think it’s necessary.
C) LANGUAGE_NAME is not a tag. It’s a comment. The original version didn’t even check for it so if yo had them, they would show up as tags. I ignored them originally, but then they weren’t rewritten to the file on save so disappeared. Now I purposefully placed them back in, but they should never be visible in the Options dialog as Tags to expend. I’ll see if I can make that more clear by making them #LANGUAGE_NAME. So the behavior if replacing tags is as expected, the first one does not expand since it is not a valid tag (not seen in Options dialog) and you’re hitting the issue in A) about encoding. The second and third don’t match the regex I look to ignore for comments so show up as valid tags and are expanded.
D) I think would be too difficult to implement as I’d need to track all languages with some placeholder in the vector even though they don’t have tags. And as in B), they certainly wouldn’t stay in order.
Hope that helps explain some of the behavior. I’ll see about changing C) to make the comment more obvious but I don’t think the rest will be fixed anytime soon unfortunately. I just don’t have the skills or time for that kind of re-write.
Cheers.
-
Hi, @michael-vincent, @peterjones and All,
Many thanks for your prompt reply :
Regarding point
A)
:In fact , I don’t really mind about this
QuickText.dll
behaviour, when trying to run thePlugins > QuickText > Replace Tag
option, with caret close to a word which is not a tag, for current language. But, out of curiosity, what happens when using theReplace Tag
option, in your system ?BTW, as my settings for
Setting > Preferences... > new Document > Encoding
isUTF_8
, with theApplied to opened ANSI files
option ticked AND as theQuickText.ini
file does not have any character with Unicode code-point over\x007F
, the chosen encoding for theQuickText.ini
file is alwaysUTF_8
, when starting N++ !Even if I force the
QuickText.ini
to have anANSI
encoding, I still get thexbb
character, in reverse video, if current fie is Unicode encoded or the»
character if current file isANSI
encoded !Regarding point
B)
:I just wanted to emphasize that, after suppression of the unique global tag
copyright
, in addition to all the changes of theQuickText.in
file, which occurs, if the current N++ file isQuickText.ini
file, then the update dialog does not appear. You’ll need to switch to any other tab and, then, switch back to theQuickText.ini
to get this dialog !!Regarding point
C)
:Ah…OK, I understand ! And you’re right : probably the syntax
#LANGUAGE_NAME
would remove the ambiguity !Regarding point
D
Oh ! I was not asking for a dynamic and updated list of all N++ possible languages, at any time, but, only, for a static updated list of present languages, used in the
v7.8.4
release !Cheers,
guy038
-
Thanks for the feedback. Let me try to explain further.
A)
When using either the menu optionPlugins > QuickText > Replace Tag
or the shortcut key I have mapped to that (which isTab
) anywhere in a document I just get a ‘tab’ inserted (which I have N++ converting into 4 spaces). The same goes for in proximity to a tag. If my caret is adjacent to the end of a tag word for the current doc type, then the hotkey or the menu option both perform as expected - expanding the tag without insertion of any weird characters.Note my default file type in N++ is ANSI and when I menu option
Plugins > QuickText > Open Tags File
, that opens as ANSI as well.I’m still thinking this is an ANSI / Unicode thing, but it could also be the shortcut key you have mapped to the menu option, unless just using the menu option directly still produces the weird character insertion. If that’s the case, I’m sticking with my ANSI / Unicode issue which @PeterJones describes in GitHub issues 14 and 15.
B)
I believe this is just default behavior of N++. Proof of concept: create 2 files:%TEMP%\deleteme.txt:
this file will be deleted
%TEMP%\deleteme.bat:
@echo off REM this is a 7 second sleep ping -n 7 localhost > NUL del %TEMP%\deleteme.txt
Open %TEMP%\deleteme.txt in N++. In a command prompt, run the deleteme.bat file and while it’s doing its 7 second sleep, click back to N++ and activate the tab with deleteme.txt. You’ll notice nothing happens. Even after the batch file completes and deletes the file you’re looking at, N++ does nothing. You’ll need to click a different tab and the click back to the deleteme.txt tab for N++ to prompt that the file has changed do you want to reload from disk.
I see this as the same. You have QuickText.ini open. You make a change which rewrites it. Unless you somehow reactivate the tab with QuickText.ini in it (click off it than back on it) you won’t get the N++ reload from disk prompt.
C)
I made that change and pushed to GitHub. There is no precompiled release, you’ll need to compile yourself. Note there are other changes you may need to manually make like removing the hash “#” as an allowedChar from your plugins/config/QuickText.conf.ini file and manually adding the hash “#” in front of all the LANGUAGE_NAME= in your plugins/QuickText/QuickText.ini file. For new installs, you won’t need to do this, but if you already have an install, you probably need to. Sorry.D)
Again, this is someone else’s code that I understand about 10% of and given my poor C++ skills, I don’t really know how to improve it (i.e., GitHub issues 14 and 15 mentioned above). The tags are read into memory and are not read on demand from the file. So when reading in the tags, if a language does not have a tag, there is no entry created in the C++ vector in memory. Now when it comes time to save the file, we use an “iterator” to go through the C++ vector in memory (which no longer has any of the languages that had no tags) and it goes in whatever order a C++ iterator does (I have no idea how to make it sort nicely). In fact, like I said previously, there was no place in the memory list to store the LANGUAGE_NAME so when the file was rewritten, all that was lost. I just added that back in as part of these latest fixes.You can see all this in the GitHub:
https://github.com/vinsworldcom/nppQuickText/blob/develop/lib/INIMap.cppHere we have the regex when reading the tags in to ignore the LANGUAGE_NAME - now with the hash “#” to make like a coment.
Here we have the WriteFile() routine that saves the tags file. You’ll see I had to add the “lang_menu” argument as input so I could map to the language name by ID and get the #LANGUAGE_NAME= rewritten (which wasn’t there in the original code. Also you can see the for() loop base on an iterator. It’s iterating through a data structure with key/value pairs so not easy for me to just us a for() loop with index to loop through all languages and write them to file regardless of whether they have tags or not. It could be possible, but beyond my abilities.
All this to say I was surprised to see that this is in the Plugins Admin - I probably never noticed since I already had it installed, it never showed as “available” for me. This isn’t “my” code, just my improvements to work for me which I’m happy to share, but purposely didn’t publish myself knowing there were shortcomings / bugs / etc. that when exposed to a wider audience, people would want fixed, but would be beyond my capabilities (i.e., time, skills, general code-base understanding).
Hope that helps clarify things.
Cheers.
-
Hi, @michael-vincent, @peterjones and All,
Thanks, again for all your explanations
- Regarding point
A
I understood the problem. If I use the
TAB
key ( which has theSCI_TAB
duplicate ) everything is OK !Before, I used the
Ctrl + Alt + =
shortcut for thePlugins > QuixckText > Replace Tag
command, which, indeed, writes the single byte\xBB
, whatever the file encodingAfter some searches, I found out that the
QuickText
plugin simply displays the character whose decimal value is the scan-code of the key, read by theShortcut Mapper
. Of course, for key codes over127
, the result is different between anANSI
andUnicode
file !Here is, below, an almost exhaustive list, where :
-
Column
1
contains the name of keys, used withShift
and/orCtrl
and/orAlt
, in theShortcut Mapper
-
Column
2
contains the character displayed, in anUnicode
file, by theQuickText
plugin, when caret is not close to an abbreviation tag -
Column
3
contains the character displayed, in anANSI
file, by theQuickText
plugin, when caret is not close to an abbreviation tag -
Column
4
contains the decimal N++ Scan-code of the key, read by theShortcut Mapper
•-----------•-------•-----•-----• | 1 | 2 | 3 | 4 | •-----------•-------•-----•-----• | Backspace | BS | BS | 08 | | Tab | TAB | TAB | 09 | | Enter | CR | CR | 13 | | Esc | ESC | ESC | 27 | | Spacebar | SPC | SPC | 32 | | Page up | ! | ! | 33 | | Page down | " | " | 34 | | End | # | # | 35 | | Home | $ | $ | 36 | | Left | % | % | 37 | | Up | & | & | 38 | | Right | ' | ' | 39 | | Down | ( | ( | 40 | | INS | - | - | 45 | | DEL | . | . | 46 | •-----------•-------•-----•-----• | ; | xBA | º | 186 | | = | xBB | » | 187 | | , | xBC | ¼ | 188 | | . | xBE | ¾ | 190 | | / | xBF | ¿ | 191 | | ~ | xC0 | À | 192 | | [ | xDB | Û | 219 | | \ | xDC | Ü | 220 | | ] | xDD | Ý | 221 | | ' | xDE | Þ | 222 | | <> | xE2 | â | 226 | •-----------•-------•-----•-----• | F1 | p | p | 112 | | F2 | q | q | 113 | | ......... | ..... | ... | ... | | F11 | z | z | 122 | | F12 | { | { | 123 | •-----------•-------•-----•-----• | 0 | 0 | 0 | 48 | | 1 | 1 | 1 | 49 | | ......... | ..... | ... | ... | | 8 | 8 | 8 | 56 | | 9 | 9 | 9 | 57 | •-----------•-------•-----•-----• | A | A | A | 65 | | B | B | B | 66 | | ......... | ..... | ... | ... | | Y | Y | Y | 89 | | Z | Z | Z | 90 | •-----------•-------•-----•-----• | Numpad 0 | ` | ` | 96 | | Numpad 1 | a | a | 97 | | ......... | ..... | ... | ... | | Numpad 8 | h | h | 104 | | Numpad 9 | i | j | 105 | | Num * | j | j | 106 | | Num + | k | k | 107 | | Num - | m | m | 109 | | Num . | n | n | 110 | | Num / | o | o | 111 | •-----------•-------•-----•-----• | 1 | 2 | 3 | 4 | •-----------•-------•-----•-----•
- Regarding point
B
:
Ah…, OK ! This behaviour is normal and is not related to the
QuickText
plugin at all ! BTW, thanks for your instructive example ;-))
- Regarding point
C
:
As you said :
-
I deleted the
#
symbol from the allowedChars variable, in theQuickText.conf.ini
file -
I changed any line
LANGUAGE-NAME=....
with the comment# LANGUAGE-NAME=....
, in the `QuickText.ini file
Note that, in my configuration, these two
.ini
files areUTF-8
encoded !And it seems that every abbreviation tag is fully functional, when the corresponding language is selected ;-)) I just did few tests, in various languages, of course !
Remark : I noticed that all the
# LANGUAGE_NAME
entries are considered as abbreviation tags, in thePlugins > QuickText > Options...
dialog
- Regarding point
D
As my
C
skills are quite near0
, I simply decided to give it a try. So, I just added all languages, with code from50
( COBOL ) to84
( Visual Prolog ) to theQuickText.ini
fileAnd, I was happily surprised to find that, after defining an abbreviation tag for these two new languages, in the
QuickText.ini
file, the hit of theESC
key correctly expanded them to their substitution text, just as expected, once the COBOL or Visual Prolog language was selected, for a standardUTF-8
encoded file :-))In the next post, you’ll find the exact contents of my
QuickText.ini
file, without few abbreviation tags used during my tests, of course !Best Regards,
guy038
- Regarding point
-
Hi, all,
As promised, the contents of my customized
QuickText.ini
file :[0] # LANGUAGE_NAME=TXT [1] # LANGUAGE_NAME=PHP for.sl=for (\$i = 0; \$i < $; ++\$i)\n $ for.ml=for (\$i = 0; \$i < $; ++\$i)\n{\n $\n} foreach.sl=foreach (\$$ as \$k => \$v)\n $ foreach.ml=foreach (\$$ as \$k => \$v)\n{\n $\n} function.public=public function $($)\n{\n $\n} function.protected=protected function $($)\n{\n $\n} function.private=private function $($)\n{\n $\n} function.public.static=public static function $($)\n{\n $\n} function.protected.static=protected static function $($)\n{\n $\n} function.private.static=private static function $($)\n{\n $\n} [2] # LANGUAGE_NAME=C case=case $: $\n$ def=#define $\n$ default=default $: $\n$ dowhile=do\n{\n $\n}\nwhile ($);\n$ dowhiles=do\n $\nwhile ($);\n$ else=else\n{\n $\n}\n$ elseif=else if ($)\n{\n $\n}\n$ elseifs=else if ($)\n $\n$ elses=else\n $\n$ for=for ($;$;$)\n{\n $\n}\n$ fors=for ($;$;$)\n $\n$ func=$ $($)\n{\n $\n return $;\n}\n$ if=if ($)\n{\n $\n}\n$ ifelse=if ($)\n{\n $\n}\nelse\n{\n $\n}\n$ ifelses=if ($)\n{\n $\n}\nelse\n $\n$ ifs=if ($)\n $\n$ ifselse=if ($)\n $\nelse\n{\n $\n}\n$ ifselses=if ($)\n $\nelse\n $\n$ inc=#include <$>\n$ incl=#include "$"\n$ main=int main(int argc, char* argv[])\n{\n $\n}\n switch=switch ($)\n{\n $\n}\n$ while=while ($)\n{\n $\n}\n$ whiles=while ($)\n $\n$ [3] # LANGUAGE_NAME=CPP case=case $: $\n$ class=class $ {\nprivate:\n $\nprotected:\n $\npublic:\n $\n};\n$ def=#define $\n$ default=default $: $\n$ dowhile=do\n{\n $\n}\nwhile ($);\n$ dowhiles=do\n $\nwhile ($);\n$ else=else\n{\n $\n}\n$ elseif=else if ($)\n{\n $\n}\n$ elseifs=else if ($)\n $\n$ elses=else\n $\n$ for=for ($;$;$)\n{\n $\n}\n$ fors=for ($;$;$)\n $\n$ func=$ $($)\n{\n $\n return $;\n}\n$ hclass=#ifndef $\n#define $\n\nclass $ {\nprivate:\n $\nprotected:\n $\npublic:\n $\n};\n\n#endif\n$ if=if ($)\n{\n $\n}\n$ ifelse=if ($)\n{\n $\n}\nelse\n{\n $\n}\n$ ifelses=if ($)\n{\n $\n}\nelse\n $\n$ ifs=if ($)\n $\n$ ifselse=if ($)\n $\nelse\n{\n $\n}\n$ ifselses=if ($)\n $\nelse\n $\n$ inc=#include <$>\n$ incl=#include "$"\n$ main=int main(int argc, char* argv[])\n{\n $\n}\n switch=switch ($)\n{\n $\n}\n$ while=while ($)\n{\n $\n}\n$ whiles=while ($)\n $\n$ [4] # LANGUAGE_NAME=CS [5] # LANGUAGE_NAME=OBJC [6] # LANGUAGE_NAME=JAVA [7] # LANGUAGE_NAME=RC [8] # LANGUAGE_NAME=HTML a-id=<a id="$" href="$">$</a> b=<b>$</b> body=<body>\n $\n</body>\n$ body-id=<body id="$">\n $\n</body>\n$ br=<br /> color.black=#000000 color.blue=#0000FF color.cyan=#00FFFF color.green=#00FF00 color.grey=#C0C0C0 color.mangenta=#FF00FF color.white=#FFFFFF color.yellow=#FFFF00 comment=<!-- $ -->\n$ div-class=<div class="$">\n</div> div-id=<div id="$">\n</div> div-id-class=<div id="$" class="$">\n $\n</div> div.p=<div class="p">\n $\n</div> doctype.html.4.loose=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\n "http://www.w3.org/TR/html4/loose.dtd"> doctype.html.4.strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"\n "http://www.w3.org/TR/html4/strict.dtd"> doctype.xhtml.1.0.loose=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> doctype.xhtml.1.0.strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> doctype.xhtml.1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\n "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> fieldset=<fieldset class="$">\n $\n</fieldset> form=<form name="$" action="$">\n $\n</form>\n$ h1=<h1>$</h1> h2=<h2>$</h2> h3=<h3>$</h3> h4=<h4>$</h4> h5=<h5>$</h5> h6=<h6>$</h6> head=<head>\n $\n</head>\n$ html-body=<html>\n<head>\n <title>$</title>\n $\n </head>\n <body>\n $\n </body>\n</html> i=<i>$</i>$ img=<img src="$" alt="$" />\n$ input=<input type="$" name="$" />\n$ li=<li>$</li> lil=<li>\n $\n</li> link=<a href="$">$</a>$ ol=<ol>\n <li>$</li>\n</ol> p=<p>\n $\n</p> pre=<pre>$</pre>\n$ pre-class=<pre class="$">\n $\n</pre> prel=<pre>\n $\n</pre> span=<span>$</span> table-id=<table id="$">\n <tr>\n <td id="$">\n $\n </td>\n </tr>\n</table> td=\n<td>\n $\n</td> title=<title>$</title>\n$ tr=\n<tr>\n $\n</tr> ul=<ul>\n <li>$</li>\n</ul> url=http:// www=http://www. [9] # LANGUAGE_NAME=XML [10] # LANGUAGE_NAME=MAKEFILE [11] # LANGUAGE_NAME=PASCAL [12] # LANGUAGE_NAME=BATCH [13] # LANGUAGE_NAME=INI [14] # LANGUAGE_NAME=NFO [15] # LANGUAGE_NAME=USER [16] # LANGUAGE_NAME=ASP [17] # LANGUAGE_NAME=SQL [18] # LANGUAGE_NAME=VB [19] # LANGUAGE_NAME=JS for.sl=for (var i = 0; i < $; ++i)\n $ for.ml=for (var i = 0; i < $; ++i)\n{\n $\n} foreach.sl=for (var x in $)\n $ foreach.ml=for (var x in $)\n{\n $\n} [20] # LANGUAGE_NAME=CSS [21] # LANGUAGE_NAME=PERL Dumper=use Data::Dumper; \$Data::Dumper::Sortkeys=1; print Dumper \ $; exit;$ csv=my \$csv = Text::CSV->new( {sep_char => ',', binary => 1} )\n or die Text::CSV->error_diag;\n\nopen my \$fh, '<', \$$\n or die "\$!";\n\nwhile ( my \$row = \$csv->getline(\$fh) ) {\n $\n}\nif ( not \$csv->eof ) {\n my ( \$cde, \$str, \$pos ) = \$csv->error_diag;\n}\n$ else=else {\n $\n}\n$ elsif=if ( $ ) {\n $\n} elsif ( $ ) {\n $\n} else {\n $\n}\n$ for=for my \$$ ( $ ) {\n $\n}\n$ if=if ( $ ) {\n $\n}\n$ ifelse=if ( $ ) {\n $\n} else {\n $\n}\n$ mlread=my \$START = '$';\nmy \$STOP = '$';\nmy \$INCLUDE_START = $1;\nmy \$INCLUDE_STOP = $1;\nmy @data;\nfor ( $ ) {\n if ( /\$START/ .. /\$STOP/ ) {\n next if ( not \$INCLUDE_START and /\$START/ );\n push @data, \$_ unless ( not \$INCLUDE_STOP and /\$STOP/ );\n process_data() if ( /\$STOP/ );\n next;\n }\n process_nodata();\n}\nprocess_data\n\nsub process_data {\n return if not @data;\n # operate on @data\n $\n @data = ();\n}\n\nsub process_nodata {\n # operate on \$_\n $\n}\n$ open=open my \$fh, '<', \$$;\nmy @lines = <\$fh>;\nclose \$fh;\n$ package=package $;\nuse Class::Struct;\nstruct( $ => '\$', $ => '@', $ => '$Module::Name' );\n1;\n$ sopen=my \$lines;\n{\n local \$/ = undef;\n open my \$fh, '<', \$$;\n \$lines = <\$fh>;\n close \$fh;\n}\n$ start=#!perl\n\nuse strict;\nuse warnings;\n\n$ sub=sub $ {\n my (\$$) = @_;\n\n $\n}\n$ wantarray=my @rets;\nmy \$retType = wantarray;\n\nif ( not defined \$retType ) {\n print "$@rets";\n} elsif (\$retType) {\n return @rets;\n} else {\n return \@rets;\n}\n$ while=while ( $ ) {\n $\n}\n$ [22] # LANGUAGE_NAME=PYTHON [23] # LANGUAGE_NAME=LUA [24] # LANGUAGE_NAME=TEX [25] # LANGUAGE_NAME=FORTRAN [26] # LANGUAGE_NAME=BASH [27] # LANGUAGE_NAME=FLASH [28] # LANGUAGE_NAME=NSIS [29] # LANGUAGE_NAME=TCL else=} else {\n $ foreach=foreach $ $ {\n $\n}\n$ if=if { $ } {\n $\n}\n$ ifelse=if { $ }\n $\n} else {\n $\n} proc=# $\nproc $ { $ } {\n $\n}\n$ regsub=regsub -all {$} "$" {$} $\n$ [30] # LANGUAGE_NAME=LISP [31] # LANGUAGE_NAME=SCHEME [32] # LANGUAGE_NAME=ASM [33] # LANGUAGE_NAME=DIFF [34] # LANGUAGE_NAME=PROPS [35] # LANGUAGE_NAME=PS [36] # LANGUAGE_NAME=RUBY [37] # LANGUAGE_NAME=SMALLTALK [38] # LANGUAGE_NAME=VHDL Ris=Rising_Edge ( $ )$ access=type $ is access $;\n$ alias=alias $ is $;\n$ archi=architecture $ of $ is\n$\nbegin\n$\nend $;\n$ array=type $ is\n array ( $ ) of $;\n$ assert=assert ( $ )\n report "$"\n sevrity $;\n$ block=$ : block $\nbegin\n $\nend block $;\n$ case=case $ is\n when $ =>\n $;\n when others =>\n $;\nend case;\n$ com=--\n-- $\n-- component=component $\n port (\n $\n );\nend component $;\n$ config=for $ : $\n use $\n $;\n$ constant=constant $: $;\n$ elsif=elsif ( $ ) then\n $; entity=entity $ is\n port (\n $\n );\nend $;\n$ enum=type $ is ( $, $ ); exit=exit $ when $;\n$ file=file $ : $ is $;\n$ for=$ : for $ in $ downto $ loop\n $;\nend loop $;\n$ function=function (\n $\n )return $ is\n $\nbegin\n $\nend $; functiond=function $ (\n $\n) return $;\n$ geneif=$ : if ( $ = $ ) generate\n $\nbegin\n $\nend generate $; generate=$ : for $ in $ downto $ generate\n $\nbegin\n $\nend generate $;\n$ generic=generic (\n $\n );\n$ genmap=generic map (\n $\n)\n$ group=group $ is ( $ );\n$ ieee=library ieee;\n use ieee.std_logic_1164.all;\n $ if=if ( $ ) then\n $;\n$end if;\n$ ifelse=if ( $ ) then\n $\nelse\n $\nend if;\n$ ifelsif=if ( $ ) then\n $\nelsif ( $ )\n $\nend if;\n$ loop=$ : loop\n $\nend loop;\n$ map=$ : $\n port map (\n $\n );\n$ mapgen=$ : $\n generic map (\n $\n )\n port map (\n $\n );\n$ next=$ : next $ when $;\n$ numeric=use ieee.numeric_std.all;\n$ pack=package $ is\n $\nend package $;\n\npackage body $ is\n $\nend package body $;\n$ port=port (\n $\n );\n$ procedure=procedure $ (\n $\n ) is\n$\nbegin\n $\nend procedure $;\n$ procedured=procedure $ (\n $\n);\n$ process=$ : process ( $ )\nbegin\n $\nend process $;\n$ proclk=$ : process ( $, $ )\n begin\n if ( $ = '$' ) then\n $ <= $;\n elsif( Rising_Edge( $ ) ) then\n $\n end if;\nend process $; protected=protected\n $\nend protected ; record=type $ is\n record\n $ : $ ;\nend record $;\n$ start=library ieee;\n use ieee.std_logic_1164.all;\n\nentity $ is\n port (\n $\n );\nend $;\n\narchitecture $ of $ is\n$\nbegin\n$\nend $;\n$ std=signal $ : std_logic$;\n$ stdpi=$ : in std_logic;\n$ stdpio=$ : inout std_logic;\n$ stdpo=$ : out std_logic;\n$ stdtextio=use ieee.std_logic_textio.all;\n$ stdv=signal $ : std_logic_vector( $ downto 0);\n$ stdvar=variable $ : std_logic;\n$ stdvpi=$ : in std_logic_vector( $ downto $);\n$ stdvpio=$ : inout std_logic_vector( $ downto $);\n$ stdvpo=$ : out std_logic_vector( $ downto $);\n$ stdvvar=variable $ : std_logic_vector( $ downto 0);\n$ subtype=subtype $ is $;\n$ textio=use std.textio.all;\n$ units=units\n $;\nend units;\n$ waitf=wait for $;\n$ waitu=wait until $;\n$ waituf=wait until $ for $;\n$ when=when $ =>\n $;$ whene=when ( $ ) else $; while=$ : while $ loop\n $;\nend loop;\n$ x=x"$"$ [39] # LANGUAGE_NAME=KIX [40] # LANGUAGE_NAME=AU3 [41] # LANGUAGE_NAME=CAML [42] # LANGUAGE_NAME=ADA [43] # LANGUAGE_NAME=VERILOG [44] # LANGUAGE_NAME=MATLAB [45] # LANGUAGE_NAME=HASKELL [46] # LANGUAGE_NAME=INNO [47] # LANGUAGE_NAME=SEARCHRESULT [48] # LANGUAGE_NAME=CMAKE [49] # LANGUAGE_NAME=YAML [50] # LANGUAGE_NAME=COBOL [51] # LANGUAGE_NAME=GUI4CLI [52] # LANGUAGE_NAME=D [53] # LANGUAGE_NAME=POWERSHELL [54] # LANGUAGE_NAME=R [55] # LANGUAGE_NAME=JSP [56] # LANGUAGE_NAME=COFFEESCRIPT [57] # LANGUAGE_NAME=JSON [58] # LANGUAGE_NAME=JAVASCRIPT [59] # LANGUAGE_NAME=FORTRAN_77 [60] # LANGUAGE_NAME=BAANC [61] # LANGUAGE_NAME=SREC [62] # LANGUAGE_NAME=IHEX [63] # LANGUAGE_NAME=TEHEX [64] # LANGUAGE_NAME=SWIFT [65] # LANGUAGE_NAME=ASN1 [66] # LANGUAGE_NAME=AVS [67] # LANGUAGE_NAME=BLITZBASIC [68] # LANGUAGE_NAME=PUREBASIC [69] # LANGUAGE_NAME=FREEBASIC [70] # LANGUAGE_NAME=CSOUND [71] # LANGUAGE_NAME=ERLANG [72] # LANGUAGE_NAME=ESCRIPT [73] # LANGUAGE_NAME=FORTH [74] # LANGUAGE_NAME=LATEX [75] # LANGUAGE_NAME=MMIXAL [76] # LANGUAGE_NAME=NIMROD [77] # LANGUAGE_NAME=NNCRONTAB [78] # LANGUAGE_NAME=OSCRIPT [79] # LANGUAGE_NAME= REBOL [80] # LANGUAGE_NAME=REGISTRY [81] # LANGUAGE_NAME=RUST [82] # LANGUAGE_NAME=SPICE [83] # LANGUAGE_NAME=TXT2TAGS [84] # LANGUAGE_NAME=VISUALPROLOG [85] # LANGUAGE_NAME=EXTERNAL [255] # LANGUAGE_NAME=GLOBAL copyright=Copyright (C) $ 20$\n\nhttp://$\n\nAll rights reserved\n$
When I says customized, this just means that I changed the lines beginning with
LANGUAGE_NAME=...
by lines# LANGUAGE_NAME=...
and I added all the languages from[50]
to[85]
However, I did not add and/or remove any abbreviation tag !
BR
guy038
-
That’s great news about
A)
, I think I’ve seen that behavior myself once or twice when usingAlt
as a modifier for a hotkey that does text insert - it put a weird character in so I just removed theAlt
modifier for the hotkey chord. I’m gladTab
works for you!ONE NOTE: Maybe I should have made this clearer - the ‘#LANGUAGE_NAME’ needs to be NO SPACES between the hash “#” and the “LANGUAGE_NAME”. I see in your example, you’ve put a space between. If you remove the space, everything should work as expected - you should not see them as expansions in the Options dialog.
Sorry for the confusion.
Also, thanks for the breakdown in
A)
about the character insertions based on modifiers and encoding - very helpful going forward. And thanks for your QuickText.ini file. I’ll incorporate that into future releases as well as making the QuickText.default.ini file just QuickText.ini so it should hopefully work “out of the box”.I did some looking at the codebase this morning. Again my limited C++ knowledge hampers my efforts, but it looks like sorting the languages will be harder than I expected since in the Combo box of the Options dialog, the order matters when selecting a language - it returns a zero-based index which is then matched to the N++ language list (enum LangType in Notepad_plus_msgs.h, an include file from the N++ project) which itself has the same order as the LANGUAGES I use in QuickText. All this matters to match the appropriate language. I suppose a more complicated data structure to store the language ID rather than putting it in a vector array by the ID would be more visually appealing, but certainly more C++ work than I have skills for at the moment.
My thought behind this was to be able to add User Defined Languages instead of just adding all tags in the USER language for all user defined languages. But again, all user defined languages return an ID of 15 - they need to be differentiated by string matching the name after matching the ID of 15 - logic that QuickText and the data structure to store the language don’t yet have.
Finally, I was playing with DoxyIt over the weekend and like the way they do named hotspots hopping in the inserted comment text. QuickText just uses the “$” character to indicate hotspots and removes it when inserting to the document. It’d be nice to actually regex match $(.*) like in DoxyIt so QuickText could have named hotspots, but alas the code implementing the hotspot identification is just iterating character matching through the string - I’d need to redesign that as well to do a regex match and account for the additional characters.
I just don’t have the C++ chops to make these changes easily (although they probably are pretty straightforward for someone who knows what they’re doing in C++).
Cheers.
-
I’ve started learning the Visual Studio environment at work, and have a license there now; I might download the Community edition at home, and if I can find time, start looking at this plugin.
I was hoping over the weekend to get the first release of my Perl-driving-Notepad++ module (Win32::Mechanize::NotepadPlusPlus) into CPAN, which would have freed up my spare-mental-time for a new project, at least until I move on to the next improvements on that one. But as I was doing my final checks, I discovered that it is failing the test suite with perl v5.20 and earlier (I had developed with newer perl, and had just assumed since I had used compatible syntax that it would work back to 5.20, or even to 5.10), so my freetime is still focused on getting that working and released. Once that is released to CPAN, I will probably start trying my hand at Visual Studio-based NPP-plugin exploration at home; with my setback, it may be another week or two before I can get to that.
(As with @Michael-Vincent, they don’t actually pay me to do Notepad++ plugin/helper development, though a few of my simpler/quicker things, I can justify as “helping make my work more efficient in the long term”, even when they aren’t directly related to my job.)
-
Hi, @michael-vincent, @peterjones and All,
As you suggested, @michael-vincent, I removed the space char between the
#
symbol and the stringLANGUAGE_NAME
. But, after saving and restarting N++, the pseudo abbreviation tags#LANGUAGE_NAME=....
still appear in dialog, when choosing thePlugins > QucikText > Options...
!?Luckily, it does not interfere with the abbreviation tags management of the last version
0.1.2.4
of theQuickText
plugin, which remains correct ;-))Cheers,
guy038
P.S. :
Actually, I just did an additional test, changing any line
#LANGUAGE_NAME=....
into linesLANGUAGE_NAME=....
and, this time, these lines are not displayed in the Options dialog ;-))