Coder plugin (1)

Discuss and announce AkelPad plugins
Locked
  • Author
  • Message
Offline
Posts: 876
Joined: Tue Jul 24, 2007 8:54 am

Post by Fr0sT »

opk44
спасибо большое! Заработало! Сворачивает как с надписью, так и без. Директивы компилятора тоже стали нормально отображаться. Кстати, похоже, глюк: строка

Code: Select all

5	0	${VAR}	0	"{$"	"}"	""	""	""
присутствовала, но не работала. Думаю, если это починить, то и фолды регионов заработают без трюка с "{ ".

Также еще один глюк: код

Code: Select all

begin

case a of
	1:
		begin
		end;
	2:
		begin
		end;
end;

end;
если свернуть самый первый begin, останется "сиротский" end.

Также я улучшил секцию Words (ключевые слова - в нижний регистр, немного перетасовал их по логике, добавил несколько новых). Линк

Подсветка для ActiveScript:
копипаст
файл

Offline
Posts: 874
Joined: Sat Jan 16, 2010 2:03 pm

Post by opk44 »

Fr0sT wrote:case..."сиротский" end.
Если это "вопрос", то причина - флаг "130=2+128"

Code: Select all

;130=2+128
130	0	0	0	"case"            "end"     " 	;.}"
, где "128" - don't catch fold end (не захватывать конец блока).
Если оставить флаг 2, то "сиротский" end в вашем примере исчезнет.
А вот хорошо это или плохо ответить затрудняюсь (ну "не компетентен"). Наверное была какая-то причина сделать так, как сейчас.

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

При открытии большого файла видно, что сначала применяется подсветка по умолчанию (которая для файлов без расширения) и только затем соответствующая расширению. Оптимизировать бы. :)

Offline
Posts: 382
Joined: Wed Sep 28, 2011 3:05 pm

Post by Cuprum »

Поработав в редакторе достаточно времени могу констатировать, что в том, что касается анализа языка, в 4.6.5. есть слабые места. Например. Это, похоже, из той же оперы (очень раздражает, если честно:) ). Также еще проблема в том, что невозможно назначить разные цветовые схемы на разные типы файлов из GUI. А поскольку сейчас одна цветовая схема применяется ко всем файлам возникают проблемы с переменными. И решаются они совсем не удобно.
В противовес, настройка подсветки синтаксиса в Notepad++ сделана весьма толково. Почему бы не сделать по подобию?

Offline
Posts: 5
Joined: Sun Nov 06, 2011 8:08 am

Post by stabud »

Здравствуйте!

Скажите пожалуйста, можно ли добавить как-то свою языковую подсветку (FreeBasic) в меню? Я скопировал и переименовал файл vbs.coder , но никакого эффекта.

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

Post by VladSh »

Cuprum
В Notepad++ используется Scintilla, т.е. отлаженый и много гже использующийся компонент. Чисто для подсветки есть Colorer, который можно портировать под любой редактор.
Иначе как есть сейчас - использовать свой движок-плагин, и пока мириться с мелкими недочётами.


stabud
Сделайте Ctrl+клик мышью по пункту меню с выбором языков и увидите как формируются внешние вызовы.

Offline
Posts: 382
Joined: Wed Sep 28, 2011 3:05 pm

Post by Cuprum »

VladSh
Иначе как есть сейчас - использовать свой движок-плагин, и пока мириться с мелкими недочётами.
Весь вопрос упирается в "пока". Просто интересно, планируется ли что-то предпринять в этом направлении. Искал на форуме комментарии от Instructor-a по этому поводу и не нашел :(

Offline
Posts: 366
Joined: Mon Jan 10, 2011 5:28 pm
Contact:

Post by Lenchik »

Cuprum
Думаю, что раз с момента создания плагина Coder (а то и вовсе Highlight) ничего настолько глобально не изменилось, то и дальше не изменится. Выбор уже сделан.
Желающие, думаю, могут создать альтернативный плагин на базе той же Scintilla. :wink:

Offline
Posts: 5
Joined: Sun Nov 06, 2011 8:08 am

Post by stabud »

stabud
Сделайте Ctrl+клик мышью по пункту меню с выбором языков и увидите как формируются внешние вызовы.
Простите , но я не понял. Сделал как вы сказали, открылось меню, записал туда новый пункт , но при установке темы, галочки стоят на моем пункте и на пункте без темы. Ключевые слова не подсвечиваются и автодополнение для этой темы не работает. Хотя я по сути просто взял готовый файл vbs.coder переименовал его в fb.coder.

В меню записал:

"FreeBasic" Call("Coder::Settings", 1, "fb")

Что не так делаю? Или может что я не сделал дополнительно?

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

Post by FeyFre »

stabud, Вы внутри Coder файла расширение задали или оставили старое?
Также при добавлении нового Coder кодер файла нужно чистить кеш(файл cache)

Offline
Posts: 5
Joined: Sun Nov 06, 2011 8:08 am

Post by stabud »

FeyFre wrote:stabud, Вы внутри coder файла расширение задали или оставили старое?
Также при добавлении нового Coder кодер файла нужно чистить кеш(файл cache)
Внутренности

Code: Select all

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

;Colors
; Color need to be in #RRGGBB format.
; If color equal to zero, then color ignored.
;
;Font styles
; 0  ignored.
; 1  normal.
; 2  bold.
; 3  italic.
; 4  bold italic.
;
;For comfort file viewing/editing set tab size to 8 or higher.


Extensions:
;==========
;File types
;==========
bas2


;----------------------------------------------;
;                  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 catch and don't highlight quote start ("Quotes:" section only).
;   256  don't catch 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).
; 16384  only quote start string is catched ("Quotes:" section only).


Font:
;=================================================================
;FontStyle             FontSize              FaceName
;=================================================================
${HighLight_FontStyle} ${HighLight_FontSize} ${HighLight_FaceName}


Colors:
;==========================================================================================================================================================================================================================================================
;BasicTextColor             BasicBkColor              SelTextColor              SelBkColor              LineTextColor              LineBkColor              ColumnColor              MarkerColor              CaretColor              UrlColor
;==========================================================================================================================================================================================================================================================
${HighLight_BasicTextColor} ${HighLight_BasicBkColor} ${HighLight_SelTextColor} ${HighLight_SelBkColor} ${HighLight_LineTextColor} ${HighLight_LineBkColor} ${HighLight_ColumnColor} ${HighLight_MarkerColor} ${HighLight_CaretColor} ${HighLight_UrlColor}


AutoMark:
;====================================================================================================================
;AutoMarkFlags             AutoMarkFontStyle              AutoMarkTextColor              AutoMarkBkColor
;====================================================================================================================
${HighLight_AutoMarkFlags} ${HighLight_AutoMarkFontStyle} ${HighLight_AutoMarkTextColor} ${HighLight_AutoMarkBkColor}


Quotes:
;======================================================================
;Flags  Font    Color   Color   Quote   Quote   Escape  Quote   Quote
;       style   text    bkgrnd  start   end     char    include exclude
;======================================================================
;5=1+4
5	3	${STR}	0	`"`	`"`	""	""	""
;1=1
1	3	${COMM}	0	"'"	""	""	""	""


Delimiters:
;======================================
;Flags  Font    Color   Color   Char(s)
;       style   text    bkgrnd
;======================================
1	0	0	0	" "
1	0	0	0	"	"
1	0	${DEL1}	0	(
1	0	${DEL1}	0	)
1	0	${DEL2}	0	[
1	0	${DEL2}	0	]
1	0	${DEL2}	0	:
1	0	${DEL2}	0	=
1	0	${DEL2}	0	.
1	0	${DEL2}	0	,
1	0	${DEL2}	0	;


Words:
;===================================
;Flags  Font    Color   Color   Word
;       style   text    bkgrnd
;===================================
0	0	${OP}	0	Call
0	0	${OP}	0	Class
0	0	${OP}	0	Const
0	0	${OP}	0	Dim
0	0	${OP}	0	Erase
0	0	${OP}	0	ExecuteGlobal
0	0	${OP}	0	Execute
0	0	${OP}	0	Explicit
0	0	${OP}	0	Function
0	0	${OP}	0	Get
0	0	${OP}	0	Let
0	0	${OP}	0	Option
0	0	${OP}	0	Preserve
0	0	${OP}	0	Private
0	0	${OP}	0	Property
0	0	${OP}	0	Public
0	0	${OP}	0	Randomize
0	0	${OP}	0	ReDim
0	0	${OP}	0	Rem
0	0	${OP}	0	Set
0	0	${OP}	0	Sub
;--Math--
0	0	${OP}	0	AddressOf
0	0	${OP}	0	And
0	0	${OP}	0	ByRef
0	0	${OP}	0	ByVal
0	0	${OP}	0	Eqv
0	0	${OP}	0	Imp
0	0	${OP}	0	In
0	0	${OP}	0	Is
0	0	${OP}	0	Mod
0	0	${OP}	0	Not
0	0	${OP}	0	Or
0	0	${OP}	0	Xor
;--Types--
0	0	${TYPE}	0	Boolean
0	0	${TYPE}	0	Byte
0	0	${TYPE}	0	Currency
0	0	${TYPE}	0	Date
0	0	${TYPE}	0	Decimal
0	0	${TYPE}	0	Double
0	0	${TYPE}	0	Empty
0	0	${TYPE}	0	Integer
0	0	${TYPE}	0	Long
0	0	${TYPE}	0	Object
0	0	${TYPE}	0	Single
0	0	${TYPE}	0	String
0	0	${TYPE}	0	Variant
;--Conditional--
0	0	${IF}	0	Case
0	0	${IF}	0	Do
0	0	${IF}	0	Each
0	0	${IF}	0	ElseIf
0	0	${IF}	0	Else
0	0	${IF}	0	End
0	0	${IF}	0	Error
0	0	${IF}	0	Exit
0	0	${IF}	0	For
0	0	${IF}	0	GoTo
0	0	${IF}	0	If
0	0	${IF}	0	Loop
0	0	${IF}	0	Next
0	0	${IF}	0	On
0	0	${IF}	0	Resume
0	0	${IF}	0	Select
0	0	${IF}	0	Step
0	0	${IF}	0	Then
0	0	${IF}	0	To
0	0	${IF}	0	Until
0	0	${IF}	0	Wend
0	0	${IF}	0	While
0	0	${IF}	0	With


;----------------------------------------------;
;                   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  don't catch fold end ("Folds:" section) or skip end ("Skips:" section).
;   256  additional to 128 flag - more priority is given to sibling level instead of parent level ("Folds:" section only).
;   512  comment fold - fold ignore any other folds and skips inside ("Folds:" section only).
;  1024  reserved.
;  2048  deny fold - founded fold will be ignored ("Folds:" section only).
;  4096  xml fold - "<tag" and "</tag>", "<single" and "/>", "<single" and ">" ("Folds:" section only).
;  8192  don't check delimiters from left of fold start ("Folds:" section only).
; 16384  don't check delimiters from right of fold start ("Folds:" section only).
; 32768  don't check delimiters from left of fold end ("Folds:" section only).
; 65536  don't check delimiters from right of fold end ("Folds:" section only).


FoldPanel:
;=================================================================================================================================================================================================================================================================================================================================================================================================================================================================
;PanelFirstBkColor            PanelSecondBkColor             PanelNormalFoldColor             PanelActiveFoldColor             PanelNormalNodeOpenBkColor             PanelNormalNodeCloseBkColor             PanelActiveNodeOpenBkColor             PanelActiveNodeCloseBkColor             PanelNormalNodeOpenSignColor             PanelNormalNodeCloseSignColor             PanelActiveNodeOpenSignColor             PanelActiveNodeCloseSignColor
;=================================================================================================================================================================================================================================================================================================================================================================================================================================================================
${CodeFold_PanelFirstBkColor} ${CodeFold_PanelSecondBkColor} ${CodeFold_PanelNormalFoldColor} ${CodeFold_PanelActiveFoldColor} ${CodeFold_PanelNormalNodeOpenBkColor} ${CodeFold_PanelNormalNodeCloseBkColor} ${CodeFold_PanelActiveNodeOpenBkColor} ${CodeFold_PanelActiveNodeCloseBkColor} ${CodeFold_PanelNormalNodeOpenSignColor} ${CodeFold_PanelNormalNodeCloseSignColor} ${CodeFold_PanelActiveNodeOpenSignColor} ${CodeFold_PanelActiveNodeCloseSignColor}


FoldList:
;================================================
;ListTextColor            ListBkColor
;================================================
${CodeFold_ListTextColor} ${CodeFold_ListBkColor}


TagMark:
;============================================================================================================
;TagMarkFlags            TagMarkFontStyle             TagMarkTextColor             TagMarkBkColor
;============================================================================================================
${CodeFold_TagMarkFlags} ${CodeFold_TagMarkFontStyle} ${CodeFold_TagMarkTextColor} ${CodeFold_TagMarkBkColor}


Skips:
;=====================================
;Flags  Skip            Skip    Escape
;       start           end     char
;=====================================
1	`"`             `"`     ""
1	"'"             ""	""
0	"Exit Function"	""	""
0	"Exit Sub"	""	""


Folds:
;=====================================================================
;Flags  Font    Color   Color   Fold        Fold            Delimiters
;       style   text    bkgrnd  start       end
;=====================================================================
0	0	0	0	"Sub"       "End Sub"       " 	"
0	0	0	0	"Function"  "End Function"  " 	"
;40=8+32
40	0	0	0	"Class"     "End Class"     " 	"
;40=8+32
40	0	0	0	"While"     "WEnd"          " 	"
;40=8+32
40	0	0	0	"For"       "Next"          " 	"
;40=8+32
40	0	0	0	"Do"        "Loop"          " 	"
;40=8+32
40	0	0	0	"With"      "End With"      " 	"
;--Select...Case...End Select--
;40=8+32
40	0	0	0	"Select"    "End Select"    " 	"
;424=8+32+128+256
424	0	0	0	"Case"      "Case"          " 	"
;424=8+32+128+256
424	0	0	0	"Case"      "End Select"    " 	"
;--If...Else...End If--
;2120=8+64+2048
2120	0	0	0	"If"        "Then"          " 	"
;8=8
8	0	0	0	"If"        "Then"          " 	"
;40=8+32
40	0	0	0	"If"        "End If"        " 	"
;424=8+32+128+256
424	0	0	0	"If"        "ElseIf"        " 	"
;424=8+32+128+256
424	0	0	0	"If"        "Else"          " 	"
;40=8+32
40	0	0	0	"ElseIf"    "End If"        " 	"
;424=8+32+128+256
424	0	0	0	"ElseIf"    "ElseIf"        " 	"
;424=8+32+128+256
424	0	0	0	"ElseIf"    "Else"          " 	"
;40=8+32
40	0	0	0	"Else"      "End If"        " 	"


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

Blocks:
;======================================================================
;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 assigned from Coder::Settings.
; $;       comment line.
;======================================================================
$~With
With $[]
${AutoComplete_Indent}$[]
End With

$~Each
For Each $[] In $[]
${AutoComplete_Indent}$[]
Next

$~For
For $[] To $[]
${AutoComplete_Indent}$[]
Next

$~Until
Do Until $[]
${AutoComplete_Indent}$[]
Loop

$~While
Do While $[]
${AutoComplete_Indent}$[]
Loop

$~Select
Select Case $[]
${AutoComplete_Indent}Case $[]
${AutoComplete_Indent}$[]
${AutoComplete_Indent}Case $[]
${AutoComplete_Indent}$[]
${AutoComplete_Indent}Case Else
${AutoComplete_Indent}$[]
End Select

$~If
If $[] Then
${AutoComplete_Indent}$[]
End If

$~Sub
Sub $[]($[])
${AutoComplete_Indent}$[]
End Sub

$~Class
Class $[]
${AutoComplete_Indent}$[]
End Class

$~Function
Function $[]($[])
${AutoComplete_Indent}$[]
End Function

$~MsgBox
MsgBox "$[]"

$~echo
WScript.Echo "$[]"


Файл cache удалял.

Offline
Posts: 4
Joined: Sat Jul 16, 2011 9:27 pm

Post by ~uname »

AkelPad 4.6.5 x64
Coder.dll 6.8.0.0

После запуска AkelPad при клике по ассоциированному файлу, Coder::CodeFold неактивен в первой из вкладок прошлой сессии сохранённых с помощью Sessions::Main

Статус функции CodeFold при этом — «работает»

Offline
Site Admin
Posts: 6403
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

Serge Yolkin wrote:Ну, очень хочется опцию: открывать файл со свернутым фолдингом (чтобы не имитировать нажатие Alt+Ctrl+= при открытии)
Реализовано.

stabud
У FreeBasic расширения файлов "bas2"?

~uname
В разрабатываемой версии уже было исправлено.

Offline
Posts: 5
Joined: Sun Nov 06, 2011 8:08 am

Post by stabud »

Instructor wrote:
stabud
У FreeBasic расширения файлов "bas2"?
Нет конечно, у Freebasic расширение файлов .bas и .bi

Это я уже от безысходности прописывал оригинальный тип, на случай наложения :D

Я писал, что попросту скопировал файл другой темы. Если все будет работать, то сам напишу туда ключевые команды FreeBasic. Но пока мне не удается этого сделать. А изменять имеющийся файл темы не хочется (есть желание дополнить).

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

Post by Fr0sT »

JS неверно подсвечивает часть строки
a = b/2 + c/2;
как регулярку. Если с этим можно что-то сделать, было бы неплохо
Locked