简体   繁体   中英

Visual Studio Code creates new lines on its own while coding in python

Visual Studio Code creates new lines on its own while using Python, I have no idea how to get rid of it, and it drives me mad.

Example:

ap.add_argument("-p", "--path", help="path",
                default="C:\Data\file.txt")

I want this to be in one line, it's not exactly long, but Visual Studio Code knows better and just won't let me. It goes back to two lines after saving the file.

Your visual studio has a syntax for python and it uses its syntax to auto save python file into the proper format.

在此处输入图像描述

First go to settings and preferences and change the auto save format and not wanting it to be like that (Preferences->Settings->User).

Then make use of word wrap (View->Word Wrap).

在此处输入图像描述

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM