What I did:
Placed a small text file (UTF-8, no BOM) - into the template-folder.
What happens:
I generate a new file from this "template" - from within Akelpad
But the first line is missing. Is this on purpose?
Anything I am doing wrong?
Posted: Mon May 23, 2016 6:13 am
by FeyFre
Akuro
Yes, it is. First string will contain "caret placeholder". When you create new document from template you may want set caret into specific position of template. For this purpose exists "caret placeholder" - the sequence of characters. During creation of new file plugin will remove all entries of "caret placeholder" from template text and place caret into position of first entry of it in template text. All built-in templates are use this feature.
Posted: Mon May 23, 2016 10:10 am
by Akuro
Thank you FeyFre,
Actually, I was wondering whether I could make Akelpad remember the caret position. Can you tell me how to enter that information into a template? Or point me to resources explaining it?
Posted: Mon May 23, 2016 2:25 pm
by FeyFre
Akuro
Here is example, which is included in distribution:
<!--CARET-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title><!--CARET--></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
</body>
</html>
As you can see, first line of file is "<!--CARET-->". It is "caret placeholder". Then, line 5. "<title><!--CARET--></title>". Template plugin will insert text of template file into editor(w/o 1st line), then it will search for all entries of "<!--CARET-->" in inserted text, and remove them. Next it will set care position to 1st entry of "<!--CARET-->" - inside title tags, so you ready to enter title of page.
IF you want remember position of caret in files you edit, you should enable it in settings: Setting -> Registry -> Recent files -> Remember caret position. It is built-in into AkelPad function, independent of any plugins.
Posted: Mon May 23, 2016 8:10 pm
by Akuro
FeyFre
Thanks a ton for the explanation.
The option is enabled in Settings -> Registry -> Recent files ->
But I cannot get it to work to remember/ store the wanted caret-position. Prbably because it is not an htm-file, but a plain text file (snippet file, but really nothing but plain text). Oh well,,,,
Posted: Mon May 23, 2016 10:01 pm
by FeyFre
IF we still talking about Templates, then: you must manually specify caret placeholder in template file. And it can be file of any type/content.
Posted: Tue May 24, 2016 12:09 am
by Akuro
Ha, now it works. Don't know what went wrong on the first go-around.
Well, anyway, thanks again, FeyFre. I really appreciate it.