Index: src/orca/braille.py
===================================================================
--- src/orca/braille.py	(revision 4067)
+++ src/orca/braille.py	(working copy)
@@ -816,7 +816,7 @@
 
     _lines = []
     _regionWithFocus = None
-    viewport = [0, 0]
+    viewport = [viewport[0], 0]
 
 def setLines(lines):
     global _lines
@@ -880,13 +880,18 @@
     [string, offset, attributeMask] = line.getLineInfo()
 
     # If the cursor is too far right, we scroll the viewport
-    # so the cursor will be on the last cell of the display.
-    #
-    if _regionWithFocus.cursorOffset >= _displaySize[0]:
-        offset += _regionWithFocus.cursorOffset - _displaySize[0] + 1
+    totalOffset = offset + _regionWithFocus.cursorOffset
+    if totalOffset > (viewport[0] + _displaySize[0]):
+        viewport[0] = max(0, totalOffset - _displaySize[0]/3 + 1)
+    elif totalOffset == (viewport[0] + (_displaySize[0] - 1)):
+        viewport[0] = max(0, totalOffset - _displaySize[0]/3 + 1)
+    elif totalOffset < viewport[0]:
+        viewport[0] =  max(0, totalOffset - _displaySize[0]*2/3)
 
-    viewport[0] = max(0, offset)
+    # the cursor is within the current display
+    # so we dont need to do anything else.
 
+
 def refresh(panToCursor=True, targetCursorCell=0):
     """Repaints the Braille on the physical display.  This clips the entire
     logical structure by the viewport and also sets the cursor to the
@@ -943,14 +948,14 @@
     # right of the display if we need to pan right.
     #
     if panToCursor and (cursorOffset >= 0):
-        if len(string.decode("UTF-8")) <= _displaySize[0]:
-            viewport[0] = 0
+        if (cursorOffset - focusOffset) <= _displaySize[0]/3:
+            viewport[0] = max(0, focusOffset)
         elif targetCursorCell:
             viewport[0] = max(0, cursorOffset - targetCursorCell + 1)
         elif cursorOffset < viewport[0]:
-            viewport[0] = max(0, cursorOffset)
+            viewport[0] = max(0, cursorOffset - _displaySize[0]*2/3)
         elif cursorOffset >= (viewport[0] + _displaySize[0]):
-            viewport[0] = max(0, cursorOffset - _displaySize[0] + 1)
+            viewport[0] = max(0, cursorOffset - _displaySize[0]/3 + 1)
 
     startPos = viewport[0]
     endPos = startPos + _displaySize[0]
