From baba2fd55d85daa649d582114d6f3462430a5545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Gu=CC=88ell=20Segarra?= Date: Tue, 30 Apr 2024 16:19:00 +0200 Subject: [PATCH] formatting code and updating CHANGELOG --- CHANGELOG.md | 6 ++++++ README.md | 6 ------ package-lock.json | 4 ++-- package.json | 2 +- src/extension.ts | 6 ++++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aeb780c..9520520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.1.2] - 2024-04-30 + +### Changed + +- fix: highlight entire line when used on empty selection. Thanks to [@rcoopr](https://github.com/rcoopr) for the contribution. + ## [1.1.1] - 2024-04-30 ### Changed diff --git a/README.md b/README.md index c28e369..628832b 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,6 @@ This project is licensed under the [**MIT License**](https://github.com/mguellse I'm Marc Güell Segarra, a freelance software developer at [Ondori.dev](https://ondori.dev). -## Contributors - -A big shout out to: - -- David Kincaid ([@DaelonSuzuka](https://github.com/DaelonSuzuka)) - ##  Buy Me a Coffee ☕ If you found this extension useful, consider **[buying me a coffee](https://buymeacoffee.com/mguellsegarra)!** diff --git a/package-lock.json b/package-lock.json index d1f89f2..bf3a726 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "highlight-on-copy", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "highlight-on-copy", - "version": "1.1.1", + "version": "1.1.2", "license": "MIT", "devDependencies": { "@types/mocha": "^10.0.6", diff --git a/package.json b/package.json index 285a8dd..534210d 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Highlight on Copy", "publisher": "mguellsegarra", "description": "Briefly flash and highlight selected copied text", - "version": "1.1.1", + "version": "1.1.2", "icon": "icon.png", "engines": { "vscode": "^1.88.0" diff --git a/src/extension.ts b/src/extension.ts index 4eb0623..9e9ef45 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -29,7 +29,7 @@ export function activate(context: vscode.ExtensionContext) { }); // Apply decoration - editor.setDecorations(decorationType, getSelections(editor)); + editor.setDecorations(decorationType, getSelections(editor)); // Remove decoration after specified timeout setTimeout(() => { @@ -45,7 +45,9 @@ export function deactivate() { vscode.commands.executeCommand("setContext", "highlightOnCopy.init", false); } -function getSelections(editor: vscode.TextEditor): readonly vscode.Selection[] | vscode.Range[] { +function getSelections( + editor: vscode.TextEditor +): readonly vscode.Selection[] | vscode.Range[] { const selections = editor.selections; if (selections.length === 1 && selections[0].isEmpty) { return [editor.document.lineAt(selections[0].anchor).range];