[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Forum » General category » BASIC programming » FIND MATCHING BRACE - SCINTILLA EDITOR
FIND MATCHING BRACE - SCINTILLA EDITOR
ZlatkoDate: Monday, 2019-12-23, 9:08 PM | Message # 1
Lieutenant
Group: Administrators
Messages: 62
Reputation: 0
Status: Offline
case IDM_EDIT_FINDMATCHINGBRACE: {
Sci_Position iBrace2 = -1;
Sci_Position iPos = SciCall_GetCurrentPos();
int ch = SciCall_GetCharAt(iPos);
if (ch < 0x80 && strchr("()[]{}<>", ch)) {
iBrace2 = SciCall_BraceMatch(iPos, 0);
} else { // Try one before
iPos = SciCall_PositionBefore(iPos);
ch = SciCall_GetCharAt(iPos);
if (ch < 0x80 && strchr("()[]{}<>", ch)) {
iBrace2 = SciCall_BraceMatch(iPos, 0);
}
}
if (iBrace2 != -1) {
SciCall_GotoPos(iBrace2);
}
}
break;
 
ZlatkoDate: Monday, 2019-12-23, 9:09 PM | Message # 2
Lieutenant
Group: Administrators
Messages: 62
Reputation: 0
Status: Offline
case IDM_EDIT_SELTOMATCHINGBRACE: {
Sci_Position iBrace2 = -1;
Sci_Position iPos = SciCall_GetCurrentPos();
int ch = SciCall_GetCharAt(iPos);
if (ch < 0x80 && strchr("()[]{}<>", ch)) {
iBrace2 = SciCall_BraceMatch(iPos, 0);
} else { // Try one before
iPos = SciCall_PositionBefore(iPos);
ch = SciCall_GetCharAt(iPos);
if (ch < 0x80 && strchr("()[]{}<>", ch)) {
iBrace2 = SciCall_BraceMatch(iPos, 0);
}
}
if (iBrace2 != -1) {
if (iBrace2 > iPos) {
SciCall_SetSel(iPos, iBrace2 + 1);
} else {
SciCall_SetSel(iPos + 1, iBrace2);
}
}
}
break;
 
Forum » General category » BASIC programming » FIND MATCHING BRACE - SCINTILLA EDITOR
  • Page 1 of 1
  • 1
Search: