Skip to content

Commit

Permalink
Cursor to start of line scrolls correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
danlucraft committed Mar 13, 2010
1 parent 10cab9f commit 3a7866a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion plugins/edit_view_swt/lib/edit_view_swt.rb
Expand Up @@ -178,7 +178,16 @@ def biggest_visible_line
end

def ensure_visible(offset)
@mate_text.viewer.reveal_range(offset, 1)
line = @document.line_at_offset(offset)
line_start_offset = @document.offset_at_line(line)
if offset == line_start_offset
# This doesn't work. Bug in JFace.SourceViewer?
@mate_text.viewer.reveal_range(offset, 1)
# so we do this too:
@mate_text.get_control.set_horizontal_pixel(0)
else
@mate_text.viewer.reveal_range(offset, 1)
end
end

def update_grammar(new_mirror)
Expand Down

0 comments on commit 3a7866a

Please sign in to comment.