From 302ef89bee8f4a749b60960f17b930bc22f0a0c4 Mon Sep 17 00:00:00 2001 From: momei <2262754355@qq.com> Date: Fri, 28 Nov 2025 23:18:16 +0800 Subject: [PATCH 1/2] fix: keep white space --- webview/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/webview/style.css b/webview/style.css index 1445ad5..14fcfe2 100644 --- a/webview/style.css +++ b/webview/style.css @@ -852,6 +852,7 @@ body { } #snippet { + white-space: pre; max-width: 100%; word-break: break-all; color: var(--vscode-editor-foreground); From 097756419ae428d5d832b83f7a9fbb13aa7c5c49 Mon Sep 17 00:00:00 2001 From: momei <2262754355@qq.com> Date: Fri, 28 Nov 2025 23:19:36 +0800 Subject: [PATCH 2/2] chore: format --- README.md | 6 +- style.css | 4 +- tailwind.config.js | 8 +- webview/index.html | 152 ++++++++++++++++++------------- webview/src/code.js | 50 +++++----- webview/src/index.js | 96 ++++++++++---------- webview/src/snap.js | 2 +- webview/style.css | 211 +++++++++++++++++++++++-------------------- 8 files changed, 278 insertions(+), 251 deletions(-) diff --git a/README.md b/README.md index f1f6caa..d33955a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # CodeSnap-plus + **(Fork from CodeSnap-luo)** -📸 Take beautiful screenshots of your code in VS Code! +📸 Take beautiful screenshots of your code in VS Code! And you can hightlight the line just by click the line number.  @@ -22,7 +23,6 @@ And you can hightlight the line just by click the line number. - Show line numbers - Many other configuration options - ## Basic Usage Instructions 1. Open the command palette (Ctrl+Shift+P on Windows and Linux, Cmd+Shift+P on OS X) and search for `CodeSnap-plus`. @@ -36,8 +36,8 @@ And you can hightlight the line just by click the line number. - If you'd like to bind CodeSnap to a hotkey, open up your keyboard shortcut settings and bind `codesnap-plus.start` to a custom keybinding. - If you'd like to copy to clipboard instead of saving, click the image and press the copy keyboard shortcut (defaults are Ctrl+C on Windows and Linux, Cmd+C on OS X), or bind `codesnap.shutterAction` to `copy` in your settings - ## Hightlight Usage Instructions + If you want to hightlight the line just click the line number, and the line will be hightlighted. - Click once: Style **focus** diff --git a/style.css b/style.css index 4337148..0213b1e 100644 --- a/style.css +++ b/style.css @@ -119,12 +119,10 @@ body { font-size: calc(var(--vscode-editor-font-size) + 2px); } - -.line-code-size-nofirst>span>span:nth-child(1) { +.line-code-size-nofirst > span > span:nth-child(1) { font-size: var(--vscode-editor-font-size); } - #save-container { margin-top: 1rem; margin-bottom: 1rem; diff --git a/tailwind.config.js b/tailwind.config.js index 292b143..d9a5b52 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,8 +1,8 @@ /** @type {import('tailwindcss').Config} */ module.exports = { - content: ['./webview/index.html','./webview/src/**/*.js'], + content: ['./webview/index.html', './webview/src/**/*.js'], theme: { - extend: {}, + extend: {} }, - plugins: [], -} + plugins: [] +}; diff --git a/webview/index.html b/webview/index.html index 16e1a50..e91adb8 100644 --- a/webview/index.html +++ b/webview/index.html @@ -22,91 +22,116 @@