fix close parens behavior in interactions and comments
original commit: c0a412ed0ef9a4e5e3529569ce1f171d8bd10378
This commit is contained in:
parent
ba24e8fa61
commit
827dc1286d
|
@ -994,10 +994,12 @@ added get-regions
|
|||
;; -> (values (or #f number) (or #f number) (or #f string) boolean)
|
||||
(define/private (find-next-close-paren pos closers [adj? #t])
|
||||
(define next-pos (skip-whitespace pos 'forward #t))
|
||||
(define tree (lexer-state-tokens (find-ls next-pos)))
|
||||
(define start-pos (begin (send tree search! next-pos)
|
||||
(send tree get-root-start-position)))
|
||||
(define end-pos (send tree get-root-end-position))
|
||||
(define ls (find-ls next-pos))
|
||||
(define ls-start (lexer-state-start-pos ls))
|
||||
(define tree (lexer-state-tokens ls))
|
||||
(send tree search! (- next-pos ls-start))
|
||||
(define start-pos (+ ls-start (send tree get-root-start-position)))
|
||||
(define end-pos (+ ls-start (send tree get-root-end-position)))
|
||||
|
||||
#;(printf "~a |~a| |~a|~n" (list pos next-pos start-pos end-pos (send tree get-root-data)) closers (get-text start-pos end-pos))
|
||||
|
||||
|
|
|
@ -509,6 +509,7 @@
|
|||
(preferences:get 'framework:fixup-parens)
|
||||
(or smart-skip
|
||||
(and (preferences:get 'framework:automatic-parens)
|
||||
(not (in-string/comment? this))
|
||||
'adjacent))))
|
||||
|
||||
(define/public (tabify-on-return?) #t)
|
||||
|
|
|
@ -179,6 +179,7 @@
|
|||
; description before-cursor after-cursor
|
||||
'(("in-line-comment" ";; abc def " " ghi ")
|
||||
("end-of-line-comment" ";; abc def " "")
|
||||
("end-of-line-comment-with-close-paren" ";; abc def " " ) \n )")
|
||||
("in-block-comment" "#| abc def " " ghi |#")
|
||||
))
|
||||
(for ([s scenarios])
|
||||
|
|
Loading…
Reference in New Issue
Block a user