查找和Visual Studio代码
取代我在一个文件中的以下行我编辑在VSCode:查找和Visual Studio代码
...............111.........111.............111..
我想0
s到全部更换.
秒。然而,当我强调这一行,做一个查找/替换为.
S,所有的.
S上的文件被替换,而不仅仅是我有选择,行的人,甚至当我在切换选择“查找“按钮。这是一个错误?在其他编辑器中,如果我选择了一段文本然后执行查找/替换,它将只会查找/替换所选块中的匹配项。
下面是你应该能够重现该问题有一个片段。 ...............111.........111.............111..
行位于test_unicode
函数内。
def test_simple2(self):
"""Simple CSV transduction test with empty fields, more complex idx, different pack_size.
100011000001000 ->
..........111....................111..........11111..........111..
"""
field_width_stream = pablo.BitStream(int('1000110001000001000', 2))
idx_marker_stream = pablo.BitStream(int('11101', 2))
pack_size = 4
target_format = TransductionTarget.JSON
csv_column_names = ["col1", "col2", "col3", "col4", "col5"]
pdep_marker_stream = pablo.BitStream(generate_pdep_stream(field_width_stream,
idx_marker_stream,
pack_size, target_format,
csv_column_names))
self.assertEqual(pdep_marker_stream.value, 63050402300395548)
def test_unicode(self):
"""Non-ascii column names.
Using UTF8. Hard coded SON boilerplate byte size should remain the same, column name
boilerplate bytes should expand.
100010010000000 ->
2 + 4 + 9 2 + 4 + 6 2 + 4 + 7
...............111.........111.............111..
"""
field_width_stream = pablo.BitStream(int('100010001000', 2))
idx_marker_stream = pablo.BitStream(1)
pack_size = 64
target_format = TransductionTarget.JSON
csv_column_names = ["한국어", "中文", "English"]
pdep_marker_stream = pablo.BitStream(generate_pdep_stream(field_width_stream,
idx_marker_stream,
pack_size, target_format,
csv_column_names))
self.assertEqual(pdep_marker_stream.value, 1879277596)
我在Ubuntu 16.04使用VSCode 1.12.2。
我能得到它的工作,但工作流程是穷人:
- CTR-H打开查找/替换
- 选择文本的行
- 点击“评选查找”右边的图标
- 输入您的发现,并在其输入替换字符
- 请点击全部替换图标
它可以工作,但您必须重新审阅每个新选择的工作流程(当然CTR-H除外)。顺便说一句,我在Sublime Text中有完全相同的行为。
你能不能用正则表达式去找到你的线路?他们只包含。和1吗?
从VSCode开发者:
与选择打开 查找窗口小部件时,但它是太容易引发意外 并产生了很多投诉,我们用于自动启用查找选择。你可能想 集“editor.find.autoFindInSelection”:真,这将使其工作 你期望的方式。
VSCode GitHub issue有更多的细节,如果任何人有兴趣。
编辑:autoFindInSelection
选项可从VSCode 1.13开始。该版本目前正在开发中(截至2017年7月6日),所以此修补程序在新版本发布之前无法使用。
虽然这并不能解决问题......唯一的问题是,如果每次选择一组新文本时连续执行F/R,则需要重新调整查找字段**以使其更改其集合*找到上下文*。 –
我可以在这种情况下,正则表达式做到这一点,但它似乎是大材小用。在一般情况下,我认为一个更直接的查找/替换工具会很有用。我可能会在他们的git hub页面上打开一个问题。 – Adam
打开这个问题是个好主意。令我惊讶的是,VSCode和Sublime让你跳过这些直接的任务。例如,你不能在我的答案中反转上面的第3项和第4项 - 这看起来很容易出错和沮丧。 – Mark
问题已打开:https://github.com/Microsoft/vscode/issues/27083。如果他们解决问题,他们会发布一个答案。 – Adam