<p>I quickly browsed sources. I might be wrong saying that such a behavior is Scintilla's work. It might be in editors, not in the library. Just Geany may have copied this logic from Scite, a demo editor. But, it doesn't matter which module provides the matching logic. This inside-braces/outside-braces logic was designed for a control on the quick selection. Let's activate "extra selection" plugin and use "Select to matching brace". In the example "[text]"  we can quickly select either the text inside braces or the text including these braces. On one hand, it is good, on another hand, it has a side effect that I mentioned above.  A few years ago, I did discuss this problem on Scite forum. The option to control the quick selection is important for users. Then, I came up with an idea of LUA script for alternative brace matching in case of complex expressions. I recently introduced Geany to few colleagues, and people were confused with matching. Because brace matching is one of Geany core functionality, it is possible to create another function in Geany for alternative matching. LUA is not ideal for it.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1998#issuecomment-442240139">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ8ZRDR4Q8V0Gjx3reWypD2g6I5hbks5uzbrQgaJpZM4YziNa">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ-9NSQHkaQ-etwsmibFzqFr5WCP3ks5uzbrQgaJpZM4YziNa.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@dyura in #1998: I quickly browsed sources. I might be wrong saying that such a behavior is Scintilla's work. It might be in editors, not in the library. Just Geany may have copied this logic from Scite, a demo editor. But, it doesn't matter which module provides the matching logic. This inside-braces/outside-braces logic was designed for a control on the quick selection. Let's activate \"extra selection\" plugin and use \"Select to matching brace\". In the example \"[text]\"  we can quickly select either the text inside braces or the text including these braces. On one hand, it is good, on another hand, it has a side effect that I mentioned above.  A few years ago, I did discuss this problem on Scite forum. The option to control the quick selection is important for users. Then, I came up with an idea of LUA script for alternative brace matching in case of complex expressions. I recently introduced Geany to few colleagues, and people were confused with matching. Because brace matching is one of Geany core functionality, it is possible to create another function in Geany for alternative matching. LUA is not ideal for it."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1998#issuecomment-442240139"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/1998#issuecomment-442240139",
"url": "https://github.com/geany/geany/issues/1998#issuecomment-442240139",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [geany/geany] A problem with \"go to matching brace\" command. (#1998)",
"sections": [
{
"text": "",
"activityTitle": "**Yury**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@dyura",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"geany/geany\",\n\"issueId\": 1998,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"geany/geany\",\n\"issueId\": 1998\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/geany/geany/issues/1998#issuecomment-442240139"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 416162650\n}"
}
],
"themeColor": "26292E"
}
]</script>