@@ -1006,13 +1006,29 @@ define(function (require, exports, module) {
10061006
10071007 describe ( "Select Line - editor with visible range" , function ( ) {
10081008
1009- it ( "shouldn't select past end of visible range" , function ( ) {
1009+ it ( "shouldn't select past end of visible range, IP in middle of last visible line " , function ( ) {
10101010 makeEditorWithRange ( { startLine : 1 , endLine : 5 } ) ;
10111011 myEditor . setSelection ( { line : 5 , ch : 4 } , { line : 5 , ch : 4 } ) ;
10121012 CommandManager . execute ( Commands . EDIT_SELECT_LINE , myEditor ) ;
10131013
10141014 expectSelection ( { start : { line : 5 , ch : 0 } , end : { line : 5 , ch : 5 } } ) ;
10151015 } ) ;
1016+
1017+ it ( "shouldn't select past end of visible range, IP at start of last visible line" , function ( ) {
1018+ makeEditorWithRange ( { startLine : 1 , endLine : 5 } ) ;
1019+ myEditor . setSelection ( { line : 5 , ch : 0 } , { line : 5 , ch : 0 } ) ;
1020+ CommandManager . execute ( Commands . EDIT_SELECT_LINE , myEditor ) ;
1021+
1022+ expectSelection ( { start : { line : 5 , ch : 0 } , end : { line : 5 , ch : 5 } } ) ;
1023+ } ) ;
1024+
1025+ it ( "should extend selection to include last line of visible range" , function ( ) {
1026+ makeEditorWithRange ( { startLine : 1 , endLine : 5 } ) ;
1027+ myEditor . setSelection ( { line : 4 , ch : 4 } , { line : 4 , ch : 4 } ) ;
1028+ CommandManager . execute ( Commands . EDIT_SELECT_LINE , myEditor ) ;
1029+
1030+ expectSelection ( { start : { line : 4 , ch : 0 } , end : { line : 5 , ch : 0 } } ) ;
1031+ } ) ;
10161032 } ) ;
10171033
10181034 } ) ;
0 commit comments