Skip to content

Commit

Permalink
implement A to insert EOL. Release v0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoon committed Nov 29, 2015
1 parent 4fa94e1 commit 158bbaa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/VSCodeVim/Vim.svg?branch=master)](https://travis-ci.org/VSCodeVim/Vim) [![Build status](https://ci.appveyor.com/api/projects/status/0t6ljij7g5h0ddx8?svg=true)](https://ci.appveyor.com/project/guillermooo/vim) [![Slack Status](http://slackin.westus.cloudapp.azure.com/badge.svg)](http://slackin.westus.cloudapp.azure.com)

# VSCodeVim
# Vim

Vim emulation for Visual Studio Code.

Expand All @@ -9,7 +9,7 @@ Vim emulation for Visual Studio Code.
## Installation and Usage

1. Install [Visual Studio Code](https://code.visualstudio.com/)
2. In the command palette (`Ctrl-Shift-P` or `Cmd-Shift-P`) select `Install Extension` and search for **vim**. Alternatively, run `ext install vscodevim`
2. In the command palette (`Ctrl-Shift-P` or `Cmd-Shift-P`) select `Install Extension` and search for **vim**. Alternatively, run `ext install vim`

## Project Status

Expand All @@ -27,7 +27,7 @@ Vim emulation for Visual Studio Code.
* Indentation: `>>`, `<<`
* Deletion: `dd`, `dw`
* Editing: `u`, `ctrl+r`
* File Operations: `:q`
* File Operations: `:q`, `:w`

### Planned

Expand All @@ -40,7 +40,7 @@ In no particular order:

## Contributions

Contributions are extremely welcomed! Take a look at [Extension API](https://code.visualstudio.com/docs/extensionAPI/overview) on how to get started and our current [Issues](https://github.com/VSCodeVim/Vim/issues) to see what we are working on next.
Contributions are extremely welcomed! Take a look at [Extension API](https://code.visualstudio.com/docs/extensionAPI/overview) on how to get started and our current [ssues](https://github.com/VSCodeVim/Vim/issues) to see what we are working on next.

## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Vim",
"description": "Vim emulation for Visual Studio Code",
"icon": "images/icon.png",
"version": "0.0.1",
"version": "0.0.2",
"publisher": "vscodevim",
"galleryBanner": {
"color": "#a5c9a2",
Expand Down
2 changes: 1 addition & 1 deletion src/mode/modeInsert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class InsertMode extends Mode {
"a" : (position) => { return new vscode.Position(position.line, position.character + 1); },

// append at the end of the line
"A" : (position) => { return position; },
"A" : (position) => { return TextEditor.GetEndOfLine(position); },

// open blank line below current line
"o" : (position) => {
Expand Down
8 changes: 7 additions & 1 deletion src/textEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ export default class TextEditor {
}

static SetCurrentPosition(position: vscode.Position) {
var newSelection = new vscode.Selection(position, position);
let newSelection = new vscode.Selection(position, position);
vscode.window.activeTextEditor.selection = newSelection;
}

static GetEndOfLine(position: vscode.Position) : vscode.Position {
const lineLength = vscode.window.activeTextEditor.document.lineAt(position.line).text.length;

return new vscode.Position(position.line, lineLength);
}
}

0 comments on commit 158bbaa

Please sign in to comment.