【问题标题】:My python code is auto wrapping in VS Code我的 python 代码在 VS Code 中自动换行
【发布时间】:2021-08-26 13:57:58
【问题描述】:

当我在 VS 代码中编写 Python 代码时,它需要过多地控制它的外观,这对我来说很难理解。有没有办法阻止它自动换行?

我想要什么:

tn.write(('print(sci:StateString())' + '\n').encode('ascii'))
state = (tn.read_until(b">  ").strip(b">  ").decode('ascii'))
state = state.rstrip()

我得到了什么:

tn.write(
    ('print(sci:StateString())' + '\n').encode('ascii'))
state = (tn.read_until(b">  ").strip(
    b">  ").decode('ascii'))
state = state.rstrip()

【问题讨论】:

标签: visual-studio-code code-formatting


【解决方案1】:

您可能正在使用 prettier 之类的代码格式化程序。

您可以通过查看您拥有的格式化程序来禁用或更改其格式化方式。

【讨论】:

  • OP 可能正在使用其他代码格式化程序。
【解决方案2】:

我禁用了似乎已经完成工作的 Python“IntelliSense”

谢谢!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-12-09
    • 2023-02-24
    • 2020-05-20
    • 1970-01-01
    • 2021-04-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多