marijnh/CodeMirror — pull request #949 by mightyguava (2012-11-11 15:33:42+00:00)
Title: Fixes for vim keymap

Hi, thanks for this great editor! I recently started using it for some lightweight editing in the browser without ssh and it's a huge time saver.

This is also my first pull request so copying what @lopuhin did on his big vim change. @misfo @jankeromnes @chris-morgan @maks

## Bugs fixed

- dw/de at end of line deletes newline
- gg and G do not work for line counts, e.g. 20G = go to line 20
- all of the forward word navigation/yank commands were off by 1 (this might have been intended but I think it's best to match vim)

## Improvements

gg and G was broken by a previous change that introduced a repTimes variable to keep track of count, and conflicted with the count variable. I consolidated them into the same repeatTimes variable and did a refactoring of the moveToWord/findWord logic. Also cleaned up a few comments.

## Testing

Tested manually in all the browsers I had on hand: IE9, Chrome 23, Firefox 16.