Skip to content

Commit d896603

Browse files
committed
fix: crash when paste in goto input
1 parent 8f99659 commit d896603

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,23 @@ This is a visualization of JavaScript/CSS source map data, which is useful for d
1616

1717
Right clicks on the minify code. Select `Source Map Visualization` in the context menu.
1818

19+
Or press `` `` `P` in the vscode and type `Source Map Visualization`.
20+
21+
Supported source map:
22+
23+
1. Inline base64 source map. `//# sourceMappingURL=data:application/json;base64,`
24+
2. External source map url. `//# sourceMappingURL=index.js.map`
25+
3. Sibling code and source map. `index.js` and `index.js.map`.
26+
4. Guess possible source map. `index.js` and `index.map`.
27+
1928
![Demo](https://raw.githubusercontent.com/cncolder/vscode-source-map-visualization/main/docs/demo.gif)
2029

30+
### Tips
31+
32+
You can select partial code in the editor. This is useful when you want to visualize the source map of a specific `<script>` tag in html.
33+
34+
You can copy and paste the code to the existed `Source Map Visualization` panel.
35+
2136
## Features
2237

2338
- 🚀 Excellent performance.

res/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
if (line > 0 && col > 0)
1616
window.generatedTextArea.scrollTo(col, line - 1)
1717
})
18+
gotoInput.addEventListener('paste', (e) => {
19+
e.stopPropagation()
20+
})
1821
toolbar.lastElementChild.appendChild(gotoInput)
1922

2023
const blackhole = document.createElement('div')

0 commit comments

Comments
 (0)