loosen slightly the requirements for changing existing chars
in the c:x;r;a keystroke
This commit is contained in:
parent
f40ad2ca9d
commit
fce4cbad3a
|
@ -1,6 +1,7 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require racket/list)
|
(require racket/list)
|
||||||
(provide adjustable-chars
|
(provide adjustable-chars
|
||||||
|
double-barred-chars
|
||||||
up-chars
|
up-chars
|
||||||
dn-chars
|
dn-chars
|
||||||
lt-chars
|
lt-chars
|
||||||
|
@ -36,4 +37,8 @@
|
||||||
|
|
||||||
(define adjustable-chars
|
(define adjustable-chars
|
||||||
(remove-duplicates
|
(remove-duplicates
|
||||||
(append up-chars dn-chars lt-chars rt-chars)))
|
(append up-chars dn-chars lt-chars rt-chars)))
|
||||||
|
|
||||||
|
(define double-barred-chars
|
||||||
|
(remove* '(#\+ #\- #\|)
|
||||||
|
adjustable-chars))
|
|
@ -1506,10 +1506,10 @@
|
||||||
(define dn (xy->pos t x (+ y 1)))
|
(define dn (xy->pos t x (+ y 1)))
|
||||||
(define lt (xy->pos t (- x 1) y))
|
(define lt (xy->pos t (- x 1) y))
|
||||||
(define rt (xy->pos t (+ x 1) y))
|
(define rt (xy->pos t (+ x 1) y))
|
||||||
(define i-up? (and (i? t up) (member c up-chars)))
|
(define i-up? (and (i? t up) (or (member c up-chars) (member c double-barred-chars))))
|
||||||
(define i-dn? (and (i? t dn) (member c dn-chars)))
|
(define i-dn? (and (i? t dn) (or (member c dn-chars) (member c double-barred-chars))))
|
||||||
(define i-lt? (and (i? t lt) (member c lt-chars)))
|
(define i-lt? (and (i? t lt) (or (member c lt-chars) (member c double-barred-chars))))
|
||||||
(define i-rt? (and (i? t rt) (member c rt-chars)))
|
(define i-rt? (and (i? t rt) (or (member c rt-chars) (member c double-barred-chars))))
|
||||||
(cond
|
(cond
|
||||||
[(and i-up? i-dn? i-lt? i-rt?) (set t pos "╬")]
|
[(and i-up? i-dn? i-lt? i-rt?) (set t pos "╬")]
|
||||||
[(and i-dn? i-lt? i-rt?) (set t pos "╦")]
|
[(and i-dn? i-lt? i-rt?) (set t pos "╦")]
|
||||||
|
@ -1526,7 +1526,7 @@
|
||||||
(when i-dn? (loop dn))
|
(when i-dn? (loop dn))
|
||||||
(when i-lt? (loop lt))
|
(when i-lt? (loop lt))
|
||||||
(when i-rt? (loop rt))))
|
(when i-rt? (loop rt))))
|
||||||
(send t end-edit-sequence)))
|
(send t end-edit-sequence)))
|
||||||
|
|
||||||
(define (scan-for-start-pos t pos)
|
(define (scan-for-start-pos t pos)
|
||||||
(define-values (x y) (pos->xy t pos))
|
(define-values (x y) (pos->xy t pos))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user