Templates plugin

Discuss and announce AkelPad plugins
  • Author
  • Message
Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

Обновление BETA10

Updated BETA10

1 во вставленном через Insert шаблоне присутствует метка курсора
Это фича. Могу заоптимайзить.

Offline
Posts: 3217
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Даунгрейд по сравнению с предыдущей версией - Call("Templates::Open") не работает ни при каких условиях.
b9 рулит.

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

Перескачайте версию.

Offline
Posts: 3217
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Всё равно не работает. "Кнопка для нажимания".

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

VladSh, работает. Или мне опять продемонстрировать видео?

Offline
Posts: 3217
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

FeyFre, почему о5? Чем в прошлый раз закончилась его демонстрация?

Ваше видео - недостаточное условие для того, чтобы оно у меня заработало)
Разве что поможет Вам опять найти ошибку...

Думаю, и без видео можно обойтись.
Условия те же: Templates::Main не в автозагрузке.

Добавлено:
Перескачал ещё раз. Плаг не работает вообще, т.е. и функция Main тоже, даже когда она в автозагрузке. Но по Ctrl+N хоть создаётся обычный файл.

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

VladSh
Условия те же: Templates::Main не в автозагрузке.
У меня тоже. Убедитесь что скачалось новое(размер 11264 метка времени 02/08/2010 11:46:43)

Offline
Posts: 3217
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Оказывается браузер почему-то "вытягивал" из кэша... Перекачал, всё заработало. Проблема на этот раз моя, приношу свои извинения.

Insert тоже навсегда исчезло?..

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

Не исчезало.
Если некуда вставлять он не отобразится.
(Пометил галочку исправить ещё один баг).

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

Обновление BETA11

Updated BETA11

Offline
Posts: 139
Joined: Fri Feb 12, 2010 11:33 am

Post by Deim0s »

FeyFre,
С релизом!
Заметил такую вещь: в какой кодировке не был бы шаблон, плагин открывает и отображает его в правильной кодировке, но в окне AkelPad выбирается всегда cp 1251 (по умолчанию в настройках AkelPad) и для сохранения документа (если кодировка отлична от cp 1251) уже приходится выбирать кодировку вручную. Нельзя ли сделать синхронизацию, т.е. если шаблон, к примеру в utf -16 le, то и в окне AkelPad открывался в ней же?

В заголовке окна плагина ошибка. :)

P.S. Может кому пригодятся стандартные:

Code: Select all

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
 </head>
 <body>

 </body>
</html>

Code: Select all

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
 </head>
 <body>

 </body>
</html>

Code: Select all

<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
 </head>
 <body>

 </body>
</html>

Code: Select all

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
 </head>
 <body>

 </body>
</html>

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
 </head>
 <body>

 </body>
</html>

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
 </head>
 <body>

 </body>
</html>

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
 </head>
 <body>

 </body>
</html>

Code: Select all

<!DOCTYPE html>
<html>
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
 </head>
 <body>

 </body>
</html>

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 </head>
 <body>

 </body>
</html>

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 </head>
 <body>

 </body>
</html>

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 </head>
 <body>

 </body>
</html>

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>}::|::{</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 </head>
 <body>

 </body>
</html>

Offline
Posts: 876
Joined: Tue Jul 24, 2007 8:54 am

Post by Fr0sT »

Code: Select all

@ECHO OFF
:: < Script definition >

:: check parameters
IF "%1"=="" GOTO :NoParam

:: main stuff here
}::|::{

EXIT /B %ERRORLEVEL%

:NoParam
ECHO %~n0. Command line error: "%*"
EXIT /B 1


Code: Select all

// === [script name] ===
// (c) 2010
//
// []
// Arguments:
//
//
// Example:
//	Call("Scripts::Main", 1, "", "")
//

var hWndEdit;
var Usage = "Usage: [...] and execute Call(\"Scripts::Main\", 1, \""+WScript.ScriptName+"\", \"\")";

function ReportError(msg, printUsage)
{
	AkelPad.MessageBox(hWndEdit, msg+(printUsage?("\n"+Usage):""), WScript.ScriptName, 48 /*MB_ICONEXCLAMATION*/);
	WScript.Quit();
}

if (hWndEdit = AkelPad.GetMainWnd())
{
	// check arguments
	if (!WScript.Arguments(0))
		ReportError("Expect parameter", true);

	}::|::{
}

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

В заголовке окна плагина ошибка.
На каком языке?
Заметил такую вещь:
Да, шаблон может быть в любой распознаваемой редактором кодировке. Но плагин не открывает шаблон, он просто читает его, и вставляет в новый документ, я не думаю что это хорошая идея - принудительно, без спросу менять кодировку новому документу, установленную пользователем в настройках, которая используется только в операциях сохранения(работа с текстом в любом случае выполняется в UCS-2)

Offline
Posts: 139
Joined: Fri Feb 12, 2010 11:33 am

Post by Deim0s »

FeyFre,
На каком языке?
На русском, Выбирете -> Выберите.

По второму вопросу, Вы правы в принципе, единственный момент, если попадётся чужой шаблон с диакритикой или на "крючках", гадать придётся при сохранении. Может флаг, вроде "Использовать кодировку шаблона" можно сделать?

Code: Select all

;----------------------------------------------;
;           Coder plugin syntax file           ;
;----------------------------------------------;

;For comfort file viewing/editing set tab size to 8 or higher.


;==========
;File types
;==========
Extensions:
}::|::{


;----------------------------------------------;
;                  HighLight                   ;
;----------------------------------------------;

;Flags (sum of the members)
;    1  case sensitive.
;    2  word is a composition of characters ("Words:" section only). Example: "0123456789" - highlight words that contain only digits.
;    4  quote end required ("Quotes:" section only).
;    8  quote start string is ignored and last meet delimiter used as quote start ("Quotes:" section only).
;   16  quote end string is ignored and first meet delimiter used as quote end ("Quotes:" section only).
;   32  don't highlight quote start ("Quotes:" section only).
;   64  don't highlight quote end ("Quotes:" section only).
;  128  don't match and don't highlight quote start ("Quotes:" section only).
;  256  don't match and don't highlight quote end ("Quotes:" section only).
;  512  quote start, delimiter or word located at line start.
; 1024  quote end, delimiter or word located at line end.
; 2048  quote start is surrounded with delimiters ("Quotes:" section only).
; 4096  quote end is surrounded with delimiters ("Quotes:" section only).
; 8192  quote doesn't contain delimiters. ("Quotes:" section only).
;
;Font styles
; 0  ignored.
; 1  normal.
; 2  bold.
; 3  italic.
; 4  bold italic.
;
;Colors
; Color need to be in #RRGGBB format.
; If color equal to zero, then color ignored.


;========================
;Font   Font    Face
;style  size    name
;========================
Font:
0	0	""


;==============================================================================
;Basic  Basic   Sel     Sel     Line    Line    Column  Marker  Caret   URL
;text   bkgrnd  text    bkgrnd  text    bkgrnd
;==============================================================================
Colors:
0	0	0	0	0	0	0	0	0	0


;======================================================================
;Flags  Font    Color   Color   Quote   Quote   Escape  Quote   Quote
;       style   text    bkgrnd  start   end     char    include exclude
;======================================================================
Quotes:


;======================================
;Flags  Font    Color   Color   Char(s)
;       style   text    bkgrnd
;======================================
Delimiters:


;===================================
;Flags  Font    Color   Color   Word
;       style   text    bkgrnd
;===================================
Words:


;----------------------------------------------;
;                   CodeFold                   ;
;----------------------------------------------;

;Flags (sum of the members)
;   1  case sensitive.
;   2  force get fold name for function list from left at the fold start. ("Folds:" section only).
;   4  force get fold name for function list from right at the fold start, including fold start. ("Folds:" section only).
;   8  fold start located at line start. ("Folds:" section only).
;  16  fold start located at line end. ("Folds:" section only).
;  32  fold end located at line start. ("Folds:" section only).
;  64  fold end located at line end. ("Folds:" section only).
; 128  one-level fold - use fold start string as fold end string, fold end string is ignored. ("Folds:" section only).
; 256  comment fold - fold ignore any other folds and skips inside. ("Folds:" section only).


;=============================
;Flags  Skip    Skip    Escape
;       start   end     char
;=============================
Skips:


;=================================
;Flags  Fold    Fold    Delimiters
;       start   end
;=================================
Folds:


;----------------------------------------------;
;                 AutoComplete                 ;
;----------------------------------------------;

;====================================
;Set variables for "Blocks:" section.
;
;VAR "VALUE"
;====================================
Variables:


;======================================================================
;Abbreviations and blocks
;
; $~abbr   abbreviation.
; $[]      set caret to this position. Can be multiple (hot spots).
; $[text]  select text. Can be multiple (hot spots).
; $$       symbol $.
; $\]      escape symbol ]. Can be used in $[text] block: $[One [1$\].
; ${VAR}   variable name that has been set in "Variables:" section.
; $;       comment line.
; $#       comment line.
;======================================================================
Blocks:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
}::|::{

Offline
Posts: 876
Joined: Tue Jul 24, 2007 8:54 am

Post by Fr0sT »

если попадётся чужой шаблон с диакритикой или на "крючках", гадать придётся при сохранении
Зачем гадать, сохраняй всё всегда в utf8. Однобайтовые кодировки - реликт, их надо изживать
Post Reply