Skip to content

Commit

Permalink
End key works with Windows line delimiters
Browse files Browse the repository at this point in the history
  • Loading branch information
danlucraft committed Jun 30, 2010
1 parent 2752f1f commit d8a3506
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions plugins/edit_view/features/line_delimiter.feature
Expand Up @@ -37,4 +37,11 @@ Feature: Line delimiter
And I move the cursor to 4
And I press the Backspace key in the edit tab
Then the contents should be "foobar\nbaz\n"

Scenario: End goes to end of line (Windows)
When I open a new edit tab
And I replace the contents with "foo\r\nbar\r\nbaz\r\n"
And I move the cursor to 0
And I run the command Redcar::Top::MoveEndCommand
Then the cursor should be at 3

2 changes: 1 addition & 1 deletion plugins/redcar/redcar.rb
Expand Up @@ -315,7 +315,7 @@ def execute
if line_ix == doc.line_count - 1
doc.cursor_offset = doc.length
else
doc.cursor_offset = doc.offset_at_line(line_ix + 1) - 1
doc.cursor_offset = doc.offset_at_line(line_ix + 1) - doc.delim.length
end
doc.ensure_visible(doc.cursor_offset)
end
Expand Down

0 comments on commit d8a3506

Please sign in to comment.