最佳答案
我在用 VSCode 编辑的文件中有以下一行:
...............111.........111.............111..
我想用 0
代替所有的 .
。然而,当我突出显示这一行并对 .
执行查找/替换操作时,文档中的 所有将被替换,而不仅仅是我选择的那一行中的 .
,甚至当我切换“ Find in select”按钮时也是如此。这是窃听器吗?在其他编辑器中,如果我选择一个文本块,然后执行查找/替换操作,那么它只会在选定的块中查找/替换匹配项。
下面是一个代码片段,您应该可以用它来重现问题。...............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。