version 1.14, 2008/06/13 19:01:53 |
version 1.15, 2008/06/14 08:46:30 |
|
|
* The hacks in this file implement automatic matching * of (), [], {}, and |
* The hacks in this file implement automatic matching * of (), [], {}, and |
* other characters. It would be better to have a full-blown syntax table, |
* other characters. It would be better to have a full-blown syntax table, |
* but there's enough overhead in the editor as it is. |
* but there's enough overhead in the editor as it is. |
* |
|
* Since I often edit Scribe code, I've made it possible to blink arbitrary |
|
* characters -- just bind delimiter characters to "blink-matching-paren-hack" |
|
*/ |
*/ |
|
|
#include "def.h" |
#include "def.h" |
|
|
* Balance table. When balance() encounters a character that is to be |
* Balance table. When balance() encounters a character that is to be |
* matched, it first searches this table for a balancing left-side character. |
* matched, it first searches this table for a balancing left-side character. |
* If the character is not in the table, the character is balanced by itself. |
* If the character is not in the table, the character is balanced by itself. |
* This is to allow delimiters in Scribe documents to be matched. |
|
*/ |
*/ |
static struct balance { |
static struct balance { |
char left, right; |
char left, right; |
|
|
|
|
/* |
/* |
* Hack to show matching paren. Self-insert character, then show matching |
* Hack to show matching paren. Self-insert character, then show matching |
* character, if any. Bound to "blink-matching-paren-command". |
* character, if any. Bound to "blink-and-insert". |
*/ |
*/ |
int |
int |
showmatch(int f, int n) |
showmatch(int f, int n) |