@@ -3,7 +3,7 @@ import * as assert from 'assert';
3
3
import { getAndUpdateModeHandler } from '../../extension' ;
4
4
import { Mode } from '../../src/mode/mode' ;
5
5
import { ModeHandler } from '../../src/mode/modeHandler' ;
6
- import { newTest } from '../testSimplifier' ;
6
+ import { newTest , newTestOnly } from '../testSimplifier' ;
7
7
import { assertEqualLines , setupWorkspace } from './../testUtils' ;
8
8
9
9
suite ( 'Mode Visual Line' , ( ) => {
@@ -585,4 +585,26 @@ suite('Mode Visual Line', () => {
585
585
} ) ;
586
586
}
587
587
} ) ;
588
+
589
+ suite ( 'Vi{ should not select the ending brace, if it is on a new line.' , ( ) => {
590
+ test ( 'Vi{ selection content test' , async ( ) => {
591
+ // Insert the full block using insert mode simulation
592
+ await modeHandler . handleMultipleKeyEvents ( 'i{\nsome text on new line\n}' . split ( '' ) ) ;
593
+
594
+ // Back to normal mode
595
+ await modeHandler . handleKeyEvent ( '<Esc>' ) ;
596
+
597
+ // Move cursor to start of "some text..."
598
+ await modeHandler . handleMultipleKeyEvents ( [ 'g' , 'g' , 'j' , 'l' , 'l' , 'l' , 'l' ] ) ;
599
+
600
+ // Simulate Vi{
601
+ await modeHandler . handleMultipleKeyEvents ( [ 'V' , 'i' , '{' ] ) ;
602
+
603
+ const doc = modeHandler . vimState . editor . document ;
604
+ const sel = modeHandler . vimState . editor . selection ;
605
+ const selectedText = doc . getText ( sel ) ;
606
+
607
+ assert . strictEqual ( selectedText , ' some text on new line' ) ;
608
+ } ) ;
609
+ } ) ;
588
610
} ) ;
0 commit comments