最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

linux - vscode: Copying a search term copies the whole line rather than the search term - Stack Overflow

programmeradmin5浏览0评论

I'm using vscode on Windows, Linux and MacOS, mostly for Python development. I'm using the Microsoft Python plugin for syntax highlighting, etc.

Whenever I highlight a symbol (could be a function, method or just a variable) then copy the highlighted symbol, pasting the highlighted symbol results in pasting the entire line where that symbol was copied from.

A typical scenario follows:

Ctrl-F in vscode to begin a search. Enter or paste the symbol name in the search box, then press enter.

When the search term is found, and highlighted by vscode, right-click copy (or Ctrl-C) to put the text in the clipboard buffer. Go to the desired paste area in the editor, left-click to position the cursor, press Ctrl-C or right-click Paste. This is where the entire line containing the searched-for text gets pasted.
I then have to delete most of the pasted text, or undo the paste and just type in the searched-for text.

I would expect that pasting the highlighted symbol would only paste that symbol, not the entire line where it was copied from.

I'm using vscode on Windows, Linux and MacOS, mostly for Python development. I'm using the Microsoft Python plugin for syntax highlighting, etc.

Whenever I highlight a symbol (could be a function, method or just a variable) then copy the highlighted symbol, pasting the highlighted symbol results in pasting the entire line where that symbol was copied from.

A typical scenario follows:

Ctrl-F in vscode to begin a search. Enter or paste the symbol name in the search box, then press enter.

When the search term is found, and highlighted by vscode, right-click copy (or Ctrl-C) to put the text in the clipboard buffer. Go to the desired paste area in the editor, left-click to position the cursor, press Ctrl-C or right-click Paste. This is where the entire line containing the searched-for text gets pasted.
I then have to delete most of the pasted text, or undo the paste and just type in the searched-for text.

I would expect that pasting the highlighted symbol would only paste that symbol, not the entire line where it was copied from.

Share asked Mar 31 at 21:50 Reddy KilowattReddy Kilowatt 471 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

When VSCode highlights a desired search term, it does not actually select it - it is highlighted in a different colour to denote this.

You can press CTRL+D to 'properly' highlight the word you've searched for, which will then allow you to copy it.

发布评论

评论列表(0)

  1. 暂无评论