amagura / eggs

Chicken Scheme eggs I either maintain or wrote
1 stars 1 forks source link

highlight matching parens/braces #1

Closed amagura closed 9 years ago

amagura commented 9 years ago

The Enhancement

If the cursor is over a paren or brace (e.g. ( or [) and said paren/brace has a matching paren/brace, the matched paren/brace pair should be highlighted in teal. If the paren/brace does not have a match, it should be highlighted in purple.

The Problem

IIRC, Arrow keys are manufacturer, therefore we'll need a function that can be used to register the current systems arrow key codes:

Example

bool register_arrwkys(char up, char down, char left, char right)
{
   return true;
}

The Scheme binding should be usable like so

(readline#register-up-arrow-key "^[[A")
;; OR
(readline#register-arrow-keys '((up . "^[[A") ...))

For now, I think recognizing the arrow keys should be more than enough, but eventually it'd be nice to be able to highlight the matching paren/brace whenever the cursor is placed on one.