File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
extension-test/unit/cursor-doc Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -653,6 +653,7 @@ export class LispTokenCursor extends TokenCursor {
653
653
cursor . getToken ( ) . type !== 'reader' &&
654
654
! cursor . tokenBeginsMetadata ( ) &&
655
655
cursor . getPrevToken ( ) . type !== 'reader' &&
656
+ cursor . getPrevToken ( ) . type !== 'ignore' &&
656
657
! cursor . prevTokenBeginsMetadata ( )
657
658
) {
658
659
if ( cursor . backwardSexp ( ) && ! cursor . tokenBeginsMetadata ( ) ) {
Original file line number Diff line number Diff line change @@ -747,6 +747,18 @@ describe('Token Cursor', () => {
747
747
const cursor : LispTokenCursor = a . getTokenCursor ( a . selections [ 0 ] . anchor ) ;
748
748
expect ( cursor . rangeForCurrentForm ( a . selections [ 0 ] . anchor ) ) . toBeUndefined ( ) ;
749
749
} ) ;
750
+ it ( 'Selects atomic form to the right, when squeezed by an ignore marker' , ( ) => {
751
+ const a = docFromTextNotation ( '#_|a' ) ;
752
+ const b = docFromTextNotation ( '#_|a|' ) ;
753
+ const cursor : LispTokenCursor = a . getTokenCursor ( a . selections [ 0 ] . anchor ) ;
754
+ expect ( cursor . rangeForCurrentForm ( a . selections [ 0 ] . anchor ) ) . toEqual ( textAndSelection ( b ) [ 1 ] ) ;
755
+ } ) ;
756
+ it ( 'Selects list form to the right, when squeezed by an ignore marker' , ( ) => {
757
+ const a = docFromTextNotation ( '#_|(a)' ) ;
758
+ const b = docFromTextNotation ( '#_|(a)|' ) ;
759
+ const cursor : LispTokenCursor = a . getTokenCursor ( a . selections [ 0 ] . anchor ) ;
760
+ expect ( cursor . rangeForCurrentForm ( a . selections [ 0 ] . anchor ) ) . toEqual ( textAndSelection ( b ) [ 1 ] ) ;
761
+ } ) ;
750
762
} ) ;
751
763
752
764
describe ( 'Top Level Form' , ( ) => {
You can’t perform that action at this time.
0 commit comments