mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-10-26 11:08:40 +03:00
(oops)
This commit is contained in:
parent
bc55c4fce3
commit
7b4a50d2b5
@ -162,9 +162,9 @@
|
||||
; onClick={onClick}
|
||||
; >
|
||||
(jsx_opening_element ["<"] @indent
|
||||
(#is-not? test.startsOnSameRowAs parent.lastChild))
|
||||
(#is-not? test.startsOnSameRowAs parent.lastChild.startPosition))
|
||||
((jsx_opening_element [">"] @dedent)
|
||||
(#is-not? test.startsOnSameRowAs parent.firstChild))
|
||||
(#is-not? test.startsOnSameRowAs parent.firstChild.startPosition))
|
||||
|
||||
; We match on the whole node here because
|
||||
; (a) we need to please the dedent-while-typing heuristic, so the line text
|
||||
@ -180,13 +180,13 @@
|
||||
; alt={'foo'}
|
||||
; />
|
||||
(jsx_self_closing_element "<" @indent
|
||||
(#is-not? test.startsOnSameRowAs parent.lastChild))
|
||||
(#is-not? test.startsOnSameRowAs parent.lastChild.startPosition))
|
||||
|
||||
; There isn't a single node whose exact text will match the line content at any
|
||||
; point, so the usual heuristic won't work. Instead we set `indent.force` and
|
||||
; use `test.lastTextOnRow` to ensure that the dedent fires exactly once while
|
||||
; typing.
|
||||
((jsx_self_closing_element ">" @dedent)
|
||||
(#is-not? test.startsOnSameRowAs parent.firstChild)
|
||||
(#is-not? test.startsOnSameRowAs parent.firstChild.startPosition)
|
||||
(#is? test.lastTextOnRow)
|
||||
(#set! indent.force true))
|
||||
|
@ -3,11 +3,22 @@
|
||||
; ===
|
||||
|
||||
(jsx_opening_element [">"] @indent)
|
||||
(jsx_opening_element ["<"] @indent
|
||||
(#is-not? test.startsOnSameRowAs parent.lastChild))
|
||||
((jsx_opening_element [">"] @dedent)
|
||||
(#is-not? test.startsOnSameRowAs parent.firstChild))
|
||||
|
||||
; Support things like…
|
||||
; <div
|
||||
; className={'foo'}
|
||||
; onClick={onClick}
|
||||
; >
|
||||
(jsx_opening_element ["<"] @indent
|
||||
(#is-not? test.startsOnSameRowAs parent.lastChild.startPosition))
|
||||
((jsx_opening_element [">"] @dedent)
|
||||
(#is-not? test.startsOnSameRowAs parent.firstChild.startPosition))
|
||||
|
||||
; We match on the whole node here because
|
||||
; (a) we need to please the dedent-while-typing heuristic, so the line text
|
||||
; must match the capture node's text; and
|
||||
; (b) we don't want the dedent to trigger until the very last `>` has been
|
||||
; typed.
|
||||
(jsx_closing_element ">") @dedent
|
||||
|
||||
; Support things like…
|
||||
@ -17,13 +28,13 @@
|
||||
; alt={'foo'}
|
||||
; />
|
||||
(jsx_self_closing_element "<" @indent
|
||||
(#is-not? test.startsOnSameRowAs parent.lastChild))
|
||||
(#is-not? test.startsOnSameRowAs parent.lastChild.startPosition))
|
||||
|
||||
; There isn't a single node whose exact text will match the line content at any
|
||||
; point, so the usual heuristic won't work. Instead we set `indent.force` and
|
||||
; use `test.lastTextOnRow` to ensure that the dedent fires exactly once while
|
||||
; typing.
|
||||
((jsx_self_closing_element ">" @dedent)
|
||||
(#is-not? test.startsOnSameRowAs parent.firstChild)
|
||||
(#is-not? test.startsOnSameRowAs parent.firstChild.startPosition)
|
||||
(#is? test.lastTextOnRow)
|
||||
(#set! indent.force true))
|
||||
|
Loading…
Reference in New Issue
Block a user