XBrackets plugin

Discuss and announce AkelPad plugins
  • Author
  • Message
DV
Offline
Posts: 1294
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

se7h wrote:подобный функционал лучше всего добавить в плагин CodeFold[/url]
Это правда. XBrackets работает со скобками на уровне обычного текста, абстрагируясь от таких понятий, как языки программирования, и в общем-то не претендуя на стопроцентную достоверность нахождения парных скобок. Настройки для пропуска скобок после // и экранированных скобок ( \] , \{ ) сужают область абстрагирования, но опять же не связаны с понятиями языков программирования и блоков кода. Фигурные скобки { } рассматриваются плагином точно так же, как все остальные, без каких-либо дополнительных предположений о контексте их использования.

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

Post by Deim0s »

DV
Спасибо за добавления параметра hlt_bkgnd. Если можно, ещё пара вопросов:
Можно ли сделать, что бы выделение самого AkelPad "перебивало" выделение XBrackets?
Сейчас:
Image
Хотелось бы:
Image
Сейчас при выделении слова, двойным кликом в том числе, если выделение находится перед/после скобки, включается подсветка:
Image
Image
Можно ли сделать, что бы этого не происходило при выделении?
Image

DV
Offline
Posts: 1294
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

Deim0s wrote:Можно ли сделать, что бы выделение самого AkelPad "перебивало" выделение XBrackets?
Можно сделать лучше:

Code: Select all

color = (background_color + highlight_color)/2
Т.е. наложение цветов: подсветку скобок на фоне выделенного текста.

По поводу второго вопроса - works as designed.

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

Post by Deim0s »

DV
Можно сделать лучше:
Если взять вот такую ситуацию с выделением:

Image
(это как хотелось бы, но без второго вопроса пока невозможно :D)

то сейчас выглядит так:

Image

если я Вас правильно понял:
Т.е. наложение цветов: подсветку скобок на фоне выделенного текста.
будет выглядеть так:

Image

Было бы не плохо на данный момент, если можно реализовать.

DV
Offline
Posts: 1294
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

XBrackets v.3.5
+ при активном 'hlt_bkgnd' цвет подсветки накладывается на цвет выделения

Offline
Posts: 120
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

New version of Akelpad, both 3.7.4 and 4.4.1, not work well with Xbrackets.dll.
I set custom Brackets most use in Chinese in Xbrackets.ini. When I enter a LeftBracket "(" via a IME, but I unable to get the RightBracket ")".
When I change sourcecode in Akeldll.h from precious version of Xbrackets

Code: Select all

#define AKELDLL MAKE_IDENTIFIER(1, 1, 0, 1)
into

Code: Select all

#define AKELDLL MAKE_IDENTIFIER(1, 2, 0, 0)
in order to test if bug with Xbrackets. But the result is Xbrakcets still unable to autoComplete bracket. That show XBrackets is OK, but Akelpad.
Following is my XBrackets.ini:

Code: Select all

[Options]
OptionsFlags=4619
HighlightRGB=D0404000
HtmlFileExts=htm; xml; php
Comment1FileExts=cs; java; js; php
next_char_ok=.,!?:;<)]}"'>/ »’”〕〉》」』〗】)]}
prev_char_ok=([{<= «‘“〔〈《「『〖【([{
user_brpairs=«» ‘’ “” 〔〕 〈〉 《》 「」 『』 〖〗 【】 () [] {}
hlt_bothbr=1
ovr_autobr=0
sel_autobr=0
all_autobr=3
hlt_bkgnd=0


DV
Offline
Posts: 1294
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

cnnnc wrote:I set custom Brackets most use in Chinese in Xbrackets.ini. When I enter a LeftBracket "(" via a IME, but I unable to get the RightBracket ")".
Can you send me your "XBrackets.ini" via e-mail or upload it somewhere? (but not to rapidshare or similar, please!)
Or it would be even better if you could debug Brackets plugin. (Of course, I can debug the plugin by myself, but I have absolutely no knowledge of Eastern languages). It would be wonderful to set a breakpoint in the beginning of OnEditCharPressed function and follow to the end of this function or at least to this line:

Code: Select all

nBracketType = getLeftBracketType(wch);
to understand what is getting wrong.

Offline
Posts: 120
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

Open following URL and then select download:

http://cid-df3847632ddf72c3.skydrive.li ... ackets.ini

Oh, I unable to debug it!

DV
Offline
Posts: 1294
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

Well, it looks like a problem of IME or whatever that generates or passes a character code to be inserted in AkelPad's edit window.
When I intercept WM_CHAR inside XBrackets plugin and replace the character code with 0xFF08 (this is the code op the opening bracket you mentioned), this bracket is autocompleted by XBrackets. So the plugin seems to work correctly. So it looks the problem is somewhere between your input (when the pressed character code must be generated) and AkelEdit window which must receive the character code through WM_CHAR message. Either incorrect character code is generated or it is incorrectly passed to AkelEdit.

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

Post by Instructor »

DV
У cnnnc должно быть символ вставляется через WM_IME_CHAR.

DV
Offline
Posts: 1294
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

Instructor wrote:DV
У cnnnc должно быть символ вставляется через WM_IME_CHAR.
А разве WM_IME_CHAR не генерирует потом WM_CHAR? Для не-юникодных окон сказано прямо:
For a non-Unicode window, if the WM_IME_CHAR message includes a double-byte character and the application passes this message to DefWindowProc, the IME converts this message into two WM_CHAR messages, each containing one byte of the double-byte character.
А что с юникодными, надо гадать на кофейной гуще, полагаю.

Offline
Posts: 120
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

DV
Have you keep previous Version of Xbrackets about 26 Aug 2009 release?
If yes please send me a copy for test.

DV
Offline
Posts: 1294
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

cnnnc wrote:Have you keep previous Version of Xbrackets about 26 Aug 2009 release?
No, I did not. However I can ensure you that it works with IME in the same way as the latest version - i.e. has no special support of IME at all :)
I can upload a test version with test support of IME if you want. What uploading server would you prefer in such case?

Offline
Posts: 120
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

Oh, no, thanks

And I test several Previous versions of Akelpad with XBrackets:
4.3.6 and HigherVersion not autocomplete Chinesebrackets well with XBrackets,
but 4.3.5 and LowerVersion did.

DV
Offline
Posts: 1294
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

cnnnc, if you built XBrackets sources by yourself, you can try the following patch:

file XBrackets\Plugin.c, line 502

change

Code: Select all

  if (bBracketsAutoComplete)
  {
    if (uMsg == WM_CHAR)
    {
to

Code: Select all

  if (bBracketsAutoComplete)
  {
    if ((uMsg == WM_CHAR) ||
        (uMsg == WM_IME_CHAR && g_bAkelEdit && !g_bOldWindows))
    {
Post Reply