diff --git a/CHANGELOG.md b/CHANGELOG.md index 927ab50..dcc17d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ All notable changes to the "annotateToggle" extension will be documented in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. +## [0.0.5] +- Don't jump to beginning when focusing file. ## [0.0.4] - Don't fold tabs in the background @@ -13,6 +15,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how ## [0.0.2] - Fold other open tabs too +- Allowing the simultaneous folding of multiple windows. Also make sure the folding works correctly on +startup. ## [0.0.1] - Initial release \ No newline at end of file diff --git a/README.md b/README.md index 4352494..42c0882 100644 --- a/README.md +++ b/README.md @@ -8,28 +8,30 @@ annotations used by the ruby on rails annotate gem. ## Requirements - - ## Extension Settings This extension contributes the following settings: * `annotateToggle.annotateTogglesVisible`: Specifies whether the annotateToggles are visible or hidden. Is changed by the the toggle command -* `annotateToggle.autoRunCommand`: Specifies whether the command should be automatically run when a Ruby file is opened. ## Known Issues - - ## Release Notes +## [0.0.5] +- Don't jump to beginning when focusing file. -### 0.0.2 -Allowing the simultaneous folding of multiple windows. Also make sure the folding works correctly on -startup. - -### 0.0.1 +## [0.0.4] +- Don't fold tabs in the background +- set the toggle status globally instead of per workspace -Initial release of the extension +## [0.0.3] +- Fold and unfold tabs in the background when tabbing +## [0.0.2] +- Fold other open tabs too +- Allowing the simultaneous folding of multiple windows. Also make sure the folding works correctly on +startup. +## [0.0.1] +- Initial release diff --git a/package.json b/package.json index b1ae113..6548fa5 100644 --- a/package.json +++ b/package.json @@ -36,11 +36,6 @@ "configuration": { "type": "object", "properties": { - "annotateToggle.autoRunCommand": { - "type": "boolean", - "default": true, - "description": "Specifies whether the command should be automatically run when a Ruby file is opened." - }, "annotateToggle.annotateVisible": { "type": "boolean", "default": true, diff --git a/src/extension.ts b/src/extension.ts index 4787b73..3f7701d 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -88,7 +88,7 @@ async function updateAnnotateTogglesVisibility() { if (foldingRanges[0]) { await vscode.window.showTextDocument(editor.document, editor.viewColumn).then(async () => { if (editor) { - return await toggleFoldingForEditor(editor, isAnnotateVisible); + return await toggleFoldingForEditor(editor, isAnnotateVisible, true); } }); } @@ -142,7 +142,7 @@ async function foldOrUnfold(editor: vscode.TextEditor, startLine: number, endLin direction: 'down', // Change this as per requirements selectionLines: [startLine, endLine] // Apply the fold/unfold action to the start line }; - console.log(command, vscode.window.activeTextEditor?.document?.fileName === editor.document.fileName, editor.document.fileName, args, editor.selection.start, editor.selection.end, editor.selection.anchor.line); + //console.log(command, vscode.window.activeTextEditor?.document?.fileName === editor.document.fileName, editor.document.fileName, args, editor.selection.start, editor.selection.end, editor.selection.anchor.line); if (vscode.window.activeTextEditor?.document?.fileName === editor.document.fileName) { return await vscode.commands.executeCommand(command, args); } else { @@ -156,13 +156,15 @@ async function foldOrUnfold(editor: vscode.TextEditor, startLine: number, endLin return Promise.resolve(); } -async function toggleFoldingForEditor(editor: vscode.TextEditor, isAnnotateVisible: boolean): Promise { +async function toggleFoldingForEditor(editor: vscode.TextEditor, isAnnotateVisible: boolean, jumpCursor: boolean): Promise { const foldingRange = getFirstFoldingRange(editor.document); if (foldingRange) { const startLine = foldingRange.start; const endLine = foldingRange.end; - setCursorPosition(editor, startLine); + if(jumpCursor) { + setCursorPosition(editor, startLine); + } return await foldOrUnfold(editor, startLine, endLine, isAnnotateVisible); } else { console.log("no folding range"); @@ -194,7 +196,7 @@ export async function activate(context: vscode.ExtensionContext) { const document = editor.document; if (document.languageId === 'ruby' || document.fileName.endsWith(".rb.git")) { let isAnnotateVisible = getGlobalAnnotateVisible(); - await toggleFoldingForEditor(editor, isAnnotateVisible); + await toggleFoldingForEditor(editor, isAnnotateVisible, false); } } });