Recent

Author Topic: SynFacilCompletion highlighter  (Read 18068 times)

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #30 on: January 03, 2018, 02:58:30 pm »
When typing text in the SynEdit after some time an error occurs which pictures.
If you disable hlt.KeyUp(Sender, Key, Shift); and hlt.UTF8KeyPress(Sender, UTF8Key); Everything works fine no errors the backlight works.

Do you mean the error occurs after some minutes of typing in SynEdit?
I always use SynFacilCompletion in mode "Autocompletion" and have no problems.

Do you have the error picture?

I need to recreate the problem in a project to check.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #31 on: January 03, 2018, 05:02:55 pm »
When typing text in the SynEdit after some time an error occurs which pictures.
If you disable hlt.KeyUp(Sender, Key, Shift); and hlt.UTF8KeyPress(Sender, UTF8Key); Everything works fine no errors the backlight works.

Do you mean the error occurs after some minutes of typing in SynEdit?
I always use SynFacilCompletion in mode "Autocompletion" and have no problems.

Do you have the error picture?

I need to recreate the problem in a project to check.


Да вы правильно поняли
Эту ошибку можно вызвать из проекта что я скинул выше

Yes, you understand correctly
This error can be cause from a project that I threw above

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #32 on: January 03, 2018, 07:12:25 pm »
I see.

The error has nothing to do with using the SynEdit for a while. It's produced in some circumstances, like  When changing  the Editor tab, when the completion window is opened.

In general, I would say you need to include several error treatment routines, no only for SYnFacilCompletion.

Maybe you can use SynFacilUtils: https://github.com/t-edson/SynFacilUtils. It includes a frontend class for SynFacilCompletion and SynEdit.

And for manage several Editor tabs, you can check PicPas: https://github.com/t-edson/PicPas
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #33 on: January 03, 2018, 08:35:54 pm »
I see.

The error has nothing to do with using the SynEdit for a while. It's produced in some circumstances, like  When changing  the Editor tab, when the completion window is opened.

In general, I would say you need to include several error treatment routines, no only for SYnFacilCompletion.

Maybe you can use SynFacilUtils: https://github.com/t-edson/SynFacilUtils. It includes a frontend class for SynFacilCompletion and SynEdit.

And for manage several Editor tabs, you can check PicPas: https://github.com/t-edson/PicPas
Хорошо спасибо буду искать способ исправления ошибки
Good thank you I will look for the way to fix the error

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #34 on: January 04, 2018, 06:46:35 am »
I see.

The error has nothing to do with using the SynEdit for a while. It's produced in some circumstances, like  When changing  the Editor tab, when the completion window is opened.

In general, I would say you need to include several error treatment routines, no only for SYnFacilCompletion.

Maybe you can use SynFacilUtils: https://github.com/t-edson/SynFacilUtils. It includes a frontend class for SynFacilCompletion and SynEdit.

And for manage several Editor tabs, you can check PicPas: https://github.com/t-edson/PicPas
Случайно увидел у вас в коде такую функцию, решил использовать и вот чудо все заработало!!!
Возможно в будущих версия учтете и добавите сразу исправление ошибки чтоб другие не сталкивались!

Accidentally saw you in the code such a feature, decided to use and that's a miracle it worked!!!
Perhaps in future version I will consider and add a bug fix that others have not experienced!
Code: Pascal  [Select][+][-]
  1. procedure TForm1.PageControl1Change(Sender: TObject);
  2. begin
  3.  
  4.  hlt.SelectEditor(SynEdit));
  5. end;
  6.          

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #35 on: January 04, 2018, 06:55:56 am »
И чтоб вообще быть точным вот мой код
And that actually to be exact here is my code

Code: Pascal  [Select][+][-]
  1. procedure TForm1.PageControl1Change(Sender: TObject);
  2. begin
  3.  
  4.  hlt.SelectEditor(( PageControl1.ActivePage.FindComponent('syed' +IntToStr(PageControl1.ActivePageIndex + 1)) as TSynEdit));
  5.  
  6.  
  7. end;            

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #36 on: January 04, 2018, 07:07:56 am »
И еще после перехода на версию 1.20 как я заметил перестала вызываться вот это строка
And even after the upgrade to version 1.20 as I noticed stopped volunteering here is a string

Code: Pascal  [Select][+][-]
  1. <Keyword>void defaultproperties struct function extends class union enum char short int long double float signed unsigned const static extern auto register volatile</Keyword>

Code: Pascal  [Select][+][-]
  1. </List>
  2.  
  3. </Completion>
  4.  <Attribute Name="Especiales" ForeCol="#00bfff" Bold="True"> </Attribute>
  5.   <Attribute Name="Keyword"  ForeCol="Blue"> </Attribute>
  6.   <Attribute Name="DIRECTIVE" ForeCol="#a1a130"></Attribute>
  7.    <Attribute Name="Comment"  ForeCol="#228b22"> </Attribute>
  8.    <Attribute Name="SYMBOL" ForeCol="Red"></Attribute>
  9.    <Attribute Name="STRING" ForeCol="#a1a130"></Attribute>
  10.   <Comment Start="//" ></Comment>
  11.   <Comment Start="/*" End="*/" Multiline="true" Folding="true"></Comment>
  12.  
  13.    <Token CharsStart="$" Content = '0..9ABCDEFabcdef' Attribute='NUMBER' > </Token>
  14.    <Token CharsStart="@" Content = '0..9ABCDEFabcdef' Attribute='NUMBER'> </Token>
  15.  
  16.    <Identifiers CharsStart= "A..Za..z_" Content = "A..Za..z0..9_">
  17.  <Especiales>
  18. var local
  19.  </Especiales>
  20.  </Identifiers>
  21.  
  22.   <String Start='"' End='"'></String>
  23.  
  24.   <Keyword>void defaultproperties struct function extends class union enum char short int long double float signed unsigned const static extern auto register volatile</Keyword>
  25.    <Keyword>if else switch case default break goto return for while do continue typedef sizeof NULL</Keyword>
  26.    <Block Start="{" End= "}"> </Block>
  27.   <Token Start="#" Attribute='DIRECTIVE'> </Token>
  28.  
  29. </Language>

И не могли бы вы мне правильно собрать эту подсветку?
And could you give me the right to collect the ambient lighting?
« Last Edit: January 04, 2018, 07:22:55 am by BIT »

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #37 on: January 04, 2018, 10:46:41 am »
Еще 1 ошибка при удаление PageControl1.ActivePage.Free и переходе на другой Page возможно ошибка  не связана с вашим модулем но как правильно уничтожить?
hlt.UnSelectEditor;   //release editor (only necessary if we are to call to SelectEditor(), again)
  hlt.Free;  //destroy the highlighter


1 more error when deleting PageControl1.ActivePage.Free and move to another Page perhaps the error is not with your module but how to destroy?
hlt.UnSelectEditor; //release editor (only necessary if we are to call to SelectEditor(), again)
hlt.Free; //destroy the highlighter
« Last Edit: January 04, 2018, 11:16:36 am by BIT »

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #38 on: January 04, 2018, 12:37:10 pm »
Решил эту ошибку так может кому то пригодится
Solved this error so maybe someone will be useful

Code: Pascal  [Select][+][-]
  1. Tab.OnShow:= @TabShow;
  2.  
  3.  
  4. procedure TForm1.TabShow(Sender: TObject);
  5. begin
  6.        
  7. hlt.SelectEditor(( PageControl1.ActivePage.FindComponent('syed' +IntToStr(PageControl1.ActivePageIndex + 1)) as TSynEdit));
  8.  
  9. end;  
  10.  
  11.  

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #39 on: January 04, 2018, 12:44:07 pm »
Да что же это такое теперь вот эта ошибка))) но она как я поняли из вашего модуля точно!

То есть если удалить последнею вкладку все работает отлично но если удалить любую другую получаю при переходе на вкладку такую ошибку

What is it now here is the mistake))) but it as I understood from your module for sure!

That is, if you remove the last tab, everything works fine but if you remove any other getting when you go to the tab that mistake
« Last Edit: January 04, 2018, 01:14:17 pm by BIT »

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #40 on: January 04, 2018, 05:42:57 pm »
Я как понял  PageControl на свое усмотрение возвращает Sender вкладки(( Сделал пока так  PageControl1.ActivePage.TabVisible:=false; 
Если кто сталкивался с такой проблемой помогите это не вариант что я сделал PageControl1.ActivePage.TabVisible:=false;

I understand PageControl in its sole discretion returns the Sender tab(( PageControl1 Done yet.ActivePage.TabVisible:=false;
If who faced such problem help is not an option what did I do PageControl1.ActivePage.TabVisible:=false;

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #41 on: January 04, 2018, 10:19:40 pm »
Accidentally saw you in the code such a feature, decided to use and that's a miracle it worked!!!
Code: Pascal  [Select][+][-]
  1. procedure TForm1.PageControl1Change(Sender: TObject);
  2. begin
  3.  hlt.SelectEditor(SynEdit));
  4. end;
  5.  

Where did you find this code?
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #42 on: January 04, 2018, 10:53:27 pm »
И еще после перехода на версию 1.20 как я заметил перестала вызываться вот это строка
And even after the upgrade to version 1.20 as I noticed stopped volunteering here is a string

Code: Pascal  [Select][+][-]
  1. <Keyword>void defaultproperties struct function extends class union enum char short int long double float signed unsigned const static extern auto register volatile</Keyword>

Do you refer the Keyword list is not include in the completion list?

It's because it is not included in the Completion definition. You need to do something like:

Code: XML  [Select][+][-]
  1. <Completion>
  2.   <List name='UnrealScript' IconIndex='938'>
  3. "IsPKMode();//bool"
  4. "RequestExit();"
  5. "RequestAuthCardKeyLogin( int uid, string value);"
  6. ...
  7.     </List>
  8.  
  9.     <OpenOn >
  10.       <Include list="UnrealScript"></Include>
  11.       <Include Attribute="Keyword"></Include>
  12.     </OpenOn>
  13.  
  14. </Completion>
  15.  
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

BIT

  • Full Member
  • ***
  • Posts: 158
Re: SynFacilCompletion highlighter
« Reply #43 on: January 04, 2018, 11:06:04 pm »
Accidentally saw you in the code such a feature, decided to use and that's a miracle it worked!!!
Code: Pascal  [Select][+][-]
  1. procedure TForm1.PageControl1Change(Sender: TObject);
  2. begin
  3.  hlt.SelectEditor(SynEdit));
  4. end;
  5.  

Where did you find this code?

оказалось что он уже  был в описание)  hlt.SelectEditor(); вообщем неважно. Я отключил ваш компонент и испробовал все тоже самое с вкладками после удаления вкладки предыдущие компоненты на вкладке становятся недоступны теперь я поманю что это никак не связано с вашим компонентом спасибо за помощь удачи!

it turned out that he was already in the description) hlt.SelectEditor(); actually doesn't matter. I disabled your component and tried all the same with the tabs after removing the previous tab components in the tab are unavailable now, I beckon that it has nothing to do with your component thanks for the help good luck!

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: SynFacilCompletion highlighter
« Reply #44 on: August 31, 2020, 05:37:14 pm »
SynFacilCompletion library for completion code in SynEdit is updated to version 1.22: https://github.com/t-edson/SynFacilCompletion
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018