diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-04-09 20:39:53 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-04-09 20:39:53 -0700 |
commit | 5094473b2fb94d197bb80c93c47215a628c9738a (patch) | |
tree | 42893e4a4a588e5906d0da1ba503ceb87f7fcfaa /shell/gap-buffer.mu | |
parent | f5defca1170bccaca5a7f3e35d59a38b8c7017f0 (diff) | |
download | mu-5094473b2fb94d197bb80c93c47215a628c9738a.tar.gz |
shell: highlight matching close-paren
Diffstat (limited to 'shell/gap-buffer.mu')
-rw-r--r-- | shell/gap-buffer.mu | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/shell/gap-buffer.mu b/shell/gap-buffer.mu index a5f55096..0e023da3 100644 --- a/shell/gap-buffer.mu +++ b/shell/gap-buffer.mu @@ -582,6 +582,29 @@ fn test-render-gap-buffer-with-cursor-at-start { check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "| ", "F - test-render-gap-buffer-with-cursor-at-start: bg" } +fn test-render-gap-buffer-highlight-matching-close-paren { + var gap-storage: gap-buffer + var gap/esi: (addr gap-buffer) <- address gap-storage + initialize-gap-buffer-with gap, "(a)" + gap-to-start gap + # setup: screen + var screen-on-stack: screen + var screen/edi: (addr screen) <- address screen-on-stack + initialize-screen screen, 5, 4 + # + var x/eax: int <- render-gap-buffer screen, gap, 0/x, 0/y, 1/show-cursor + check-screen-row screen, 0/y, "(a) ", "F - test-render-gap-buffer-highlight-matching-close-paren" + check-ints-equal x, 4, "F - test-render-gap-buffer-highlight-matching-open-paren: result" + check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "| ", "F - test-render-gap-buffer-highlight-matching-open-paren: cursor" + check-screen-row-in-color screen, 0xf/fg=highlight, 0/y, " ) ", "F - test-render-gap-buffer-highlight-matching-open-paren: matching paren" +} + +fn test-render-gap-buffer-highlight-matching-open-paren { +} + +fn test-render-gap-buffer-highlight-matching-open-paren-of-end { +} + ## some primitives for scanning through a gap buffer # don't modify the gap buffer while scanning # this includes moving the cursor around |