Skip to content

Commit d5c2c68

Browse files
Bumped major version, added additional information in readme.
1 parent 80432d1 commit d5c2c68

File tree

3 files changed

+59
-23
lines changed

3 files changed

+59
-23
lines changed

README.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,53 @@ ParagraphJump allows the user to navigate swiftly between paragraphs.
66

77
* `paragraphjump.up`: Move up a paragraph
88
* `paragraphjump.down`: Move down a paragraph
9-
10-
## Extension Settings
11-
12-
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
9+
* `paragraphjump.selectup`: Select one paragraph up
10+
* `paragraphjump.selectdown`: Select one paragraph down
11+
12+
## Gettings started
13+
14+
This plugin will automatically be enabled after using one of the commands specified above.
15+
16+
### Keyboard shortcuts
17+
18+
To optimally use this plugin it is recommended to re-map your keybindings. You can do this through the **Keyboard Shortcuts** editor available
19+
through the **Preferences** -> **Keyboard Shortcuts** menu.
20+
21+
My personal bindings for this plugin is displayed below as an example:
22+
23+
```JSON
24+
{
25+
"key": "ctrl+up",
26+
"command": "paragraphjump.up",
27+
"when": "textInputFocus"
28+
},
29+
{
30+
"key": "ctrl+down",
31+
"command": "paragraphjump.down",
32+
"when": "textInputFocus"
33+
},
34+
{
35+
"key": "ctrl+shift+down",
36+
"command": "paragraphjump.selectdown",
37+
"when": "textInputFocus"
38+
},
39+
{
40+
"key": "ctrl+shift+up",
41+
"command": "paragraphjump.selectup",
42+
"when": "textInputFocus"
43+
}
44+
```
1345

1446
## Known Issues
1547

1648
None at the time.
1749

1850
## Release Notes
1951

52+
### 1.0.0
53+
54+
First full release with all the intended functionality for the plugin.
55+
2056
### 0.0.1
2157

2258
Initial release including move up and down features

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "paragraphjump",
33
"displayName": "ParagraphJump",
44
"description": "Allows the user to navigate swiftly between paragraphs",
5-
"version": "0.0.1",
5+
"version": "1.0.0",
66
"publisher": "brokenprogrammer",
77
"repository": {
88
"type": "git",

src/extension.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
import * as vscode from "vscode";
22

3-
const targetLineIsEmptyOrWhitespace = (
4-
line: number,
5-
document: vscode.TextDocument
6-
) => !document.lineAt(line).isEmptyOrWhitespace;
7-
83
enum LineOperation {
94
up = 0,
105
down = 1,
116
}
127

8+
enum MoveOperation {
9+
move = 0,
10+
select = 1,
11+
}
12+
13+
enum ParagraphJumpOperation {
14+
moveUp = 0,
15+
moveDown = 1,
16+
selectUp = 2,
17+
selectDown = 3,
18+
}
19+
20+
const targetLineIsEmptyOrWhitespace = (
21+
line: number,
22+
document: vscode.TextDocument
23+
) => !document.lineAt(line).isEmptyOrWhitespace;
24+
1325
function getNextLine(editor: vscode.TextEditor, op: LineOperation) {
1426
let document = editor.document;
1527
let line = editor.selection.active.line;
@@ -34,11 +46,6 @@ function getNextLine(editor: vscode.TextEditor, op: LineOperation) {
3446
return document.lineAt(line);
3547
}
3648

37-
enum MoveOperation {
38-
move = 0,
39-
select = 1,
40-
}
41-
4249
function moveCursor(
4350
editor: vscode.TextEditor,
4451
newPosition: vscode.Position,
@@ -53,7 +60,7 @@ function moveCursor(
5360
break;
5461
case MoveOperation.select:
5562
{
56-
let anchor = editor.selection.anchor;
63+
const anchor = editor.selection.anchor;
5764
newCursorPosition = new vscode.Selection(anchor, newPosition);
5865
}
5966
break;
@@ -62,13 +69,6 @@ function moveCursor(
6269
editor.revealRange(new vscode.Range(newPosition, newPosition));
6370
}
6471

65-
enum ParagraphJumpOperation {
66-
moveUp = 0,
67-
moveDown = 1,
68-
selectUp = 2,
69-
selectDown = 3,
70-
}
71-
7272
function performParagraphJumpOperation(
7373
editor: vscode.TextEditor,
7474
op: ParagraphJumpOperation

0 commit comments

Comments
 (0)