@@ -204,7 +204,6 @@ function (on, topic, declare, Color, dom, Tooltip, Text, model, viewHandler,
204204 * @param {Integer } fileId
205205 */
206206 loadBlameView : function ( path , fileId ) {
207- this . set ( 'selection' , [ 1 , 1 , 1 , 1 ] ) ;
208207 var res = model . gitservice . getRepositoryByProjectPath ( path ) ;
209208
210209 if ( ! res . isInRepository )
@@ -250,14 +249,27 @@ function (on, topic, declare, Color, dom, Tooltip, Text, model, viewHandler,
250249 if ( ! fileInfo )
251250 return ;
252251
252+ var selection = message . nodeInfo
253+ ? [
254+ message . nodeInfo . range . range . startpos . line ,
255+ message . nodeInfo . range . range . startpos . column ,
256+ message . nodeInfo . range . range . endpos . line ,
257+ message . nodeInfo . range . range . endpos . column ]
258+ : [ 1 , 1 , 1 , 1 ] ;
259+
253260 commitCache = { } ;
254261 that . loadFile ( fileInfo . id ) ;
262+ that . set ( 'selection' , selection ) ;
263+ that . jumpToPos ( selection [ 0 ] , selection [ 1 ] ) ;
264+
255265 that . loadBlameView ( fileInfo . path , fileInfo . id ) ;
256266
257267 topic . publish ( 'codecompass/setCenterModule' , that . id ) ;
258268
259269 urlHandler . setStateValue ( {
260- center : that . id
270+ center : that . id ,
271+ select : selection . join ( '|' ) ,
272+ fid : fileInfo . id
261273 } ) ;
262274 } ) ;
263275 }
0 commit comments