我在 VSCode 中编辑的文件中有以下行:...............111.........111.............111..
我要全部更换.
s 与 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 除外)。顺便说一句,我在 Sublime Text 中有完全相同的行为。
你能用正则表达式来找到你的行吗?它们只包含 . 和 1 吗?
关于replace - 在 Visual Studio 代码中查找和替换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44335619/