Skip to content

Commit

Permalink
テーブル外でTabやShift+Tabを押したときの挙動にvscodeのビルトインコマンドを利用することで動作を改善した
Browse files Browse the repository at this point in the history
  • Loading branch information
takumisoft68 committed Sep 2, 2020
1 parent 0e98274 commit 6b757c4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

All notable changes to the "markdowntable" extension will be documented in this file.

### - 0.2.1 (2020/9/2)

- Fix bugs of navigate to next/prev cell
- Bahavior when Tab key pressing out of table.
- Bahavior when Shift+Tab key pressing out of table.

## 0.2.0 (2020/9/1)

- [Fix] Keep white spaces indentation on the left of table when formatting.
- before
![keepindent_before](images/keep_indent_before.gif)
- ![keepindent_before](images/keep_indent_before.gif)
- after
![keepindent](images/keep_indent.gif)
- ![keepindent](images/keep_indent.gif)

- [Add] Navigate to prev cell when you press Shift+Tab key in table.
![navigate_prev](images/navigate_prev_cell.gif)
- ![navigate_prev](images/navigate_prev_cell.gif)

## 0.1.1 (2020/08/07)

Expand Down
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,39 @@ Markdown table features.

Key binding to `Tab`.

- **Auto navigate to next cell when you press Tab key in table.**
- **Auto navigate to next cell when pressing Tab key in table.**
- When out of table, vscode's default "tab" behavior is operated.
- **Auto insert new row, when the cursor is in last row in table.**
- with auto format
![navigate](images/navigate_next_cell.gif)
- ![navigate](images/navigate_next_cell.gif)

### 2.1. Navigate to prev cell

Key binding to `Shift`+`Tab`.

- **Auto navigate to prev cell when you press Shift+Tab key in table.**
- **Auto navigate to prev cell when pressing Shift+Tab key in table.**
- When out of table, vscode's default "outdent" behavior is operated.
- with auto format
![navigate_prev](images/navigate_prev_cell.gif)
- ![navigate_prev](images/navigate_prev_cell.gif)

### 2.2. Convert to table from TSV text

Key binding to `Shift + Alt + T`.

- **Tips: This feature is supposed to make table from excel cells.**
![convert](images/table_from_excel.gif)
- ![convert](images/table_from_excel.gif)

### 2.3. Format table

Key binding to `Shift + Alt + F`.

- **Auto format column width of all tables in current document**
![formattable](images/format_table.gif)
- ![formattable](images/format_table.gif)

### 2.4. Insert column

- Add context menu to insert column
![insert](images/insert.gif)
- ![insert](images/insert.gif)

## 3. Extension Settings

Expand All @@ -64,15 +66,11 @@ What's focused on.

## 5. Release Notes

### - 0.2.0 (2020/9/1)
### - 0.2.1 (2020/9/2)

- Keep white spaces indentation on the left of table when formatting.
- before
![keepindent_before](images/keep_indent_before.gif)
- after
![keepindent](images/keep_indent.gif)
- [Add] Navigate to prev cell when you press Shift+Tab key in table.
![navigate_prev](images/navigate_prev_cell.gif)
- Fix bugs of navigate to next/prev cell
- Bahavior when Tab key pressing out of table.
- Bahavior when Shift+Tab key pressing out of table.

## 7. Links

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 @@
"publisher": "TakumiI",
"displayName": "Markdown Table",
"description": "A minimal extension for markdown table. Add context menu to edit markdown table.",
"version": "0.2.0",
"version": "0.2.1",
"repository": {
"type": "git",
"url": "https://github.com/takumisoft68/vscode-markdown-table"
Expand Down
12 changes: 4 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ export function activate(context: vscode.ExtensionContext) {
new vscode.Position(cur_selection.active.line, 10000)));
// テーブル内ではなかったら終了
if (!currentLine.trim().startsWith('|')) {
// 通常のVSCodeの入力処理
vscode.commands.executeCommand('default:type', {
text: ' '.repeat(editor.options.tabSize as number)
});
// 通常のインデント
vscode.commands.executeCommand('tab');
return;
}

Expand Down Expand Up @@ -134,10 +132,8 @@ export function activate(context: vscode.ExtensionContext) {
new vscode.Position(cur_selection.active.line, 10000)));
// テーブル内ではなかったら終了
if (!currentLine.trim().startsWith('|')) {
// 通常のVSCodeの入力処理
vscode.commands.executeCommand('default:type', {
text: ' '.repeat(editor.options.tabSize as number)
});
// 通常のアウトデント
vscode.commands.executeCommand('outdent');
return;
}

Expand Down

0 comments on commit 6b757c4

Please sign in to comment.