diff --git a/rhodecode/public/js/src/rhodecode.js b/rhodecode/public/js/src/rhodecode.js
--- a/rhodecode/public/js/src/rhodecode.js
+++ b/rhodecode/public/js/src/rhodecode.js
@@ -385,13 +385,12 @@ function offsetScroll(element, offset){
             if (lineno.length > 0){
                 var tr = lineno.parents('tr.line');
                 tr.addClass('selected');
+
+                tr[0].scrollIntoView();
+
                 $.Topic('/ui/plugins/code/anchor_focus').prepare({
                     tr:tr,
                     remainder:remainder});
-
-                if (!remainder){
-                    tr[0].scrollIntoView();
-                }
             }
         }
     }