version 1.6, 2001/05/23 22:20:36 |
version 1.7, 2001/05/24 03:05:24 |
|
|
/* |
/* |
* Limited parenthesis matching routines |
* Limited parenthesis matching routines |
* |
* |
* 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 |
* Since I often edit Scribe code, I've made it possible to blink arbitrary |
* characters -- just bind delimiter characters to "blink-matching-paren-hack" |
* characters -- just bind delimiter characters to "blink-matching-paren-hack" |
*/ |
*/ |
|
|
|
|
}; |
}; |
|
|
/* |
/* |
* 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-matching-paren-command". |
*/ |
*/ |
int |
int |
|
|
int cbo; |
int cbo; |
int c; |
int c; |
int i; |
int i; |
int rbal; |
int rbal; |
int lbal; |
int lbal; |
int depth; |
int depth; |
|
|
|
|
|
|
|
|
/* |
/* |
* Display matching character. Matching characters that are not in the |
* Display matching character. Matching characters that are not in the |
* current window are displayed in the echo line. If in the current window, |
* current window are displayed in the echo line. If in the current window, |
* move dot to the matching character, sit there a while, then move back. |
* move dot to the matching character, sit there a while, then move back. |
*/ |
*/ |
|
|
|
|
* searching from the top of the window to dot. |
* searching from the top of the window to dot. |
*/ |
*/ |
inwindow = FALSE; |
inwindow = FALSE; |
for (tlp = curwp->w_linep; tlp != lforw(curwp->w_dotp); |
for (tlp = curwp->w_linep; tlp != lforw(curwp->w_dotp); |
tlp = lforw(tlp)) |
tlp = lforw(tlp)) |
if (tlp == clp) |
if (tlp == clp) |
inwindow = TRUE; |
inwindow = TRUE; |