question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Indentation issue with newline in strings

See original GitHub issue

Environment data

  • VS Code version: 1.31.1
  • Extension version (available under the Extensions sidebar): 2019.2.5416
  • OS and version: Manjaro
  • Python version (& distribution if applicable, e.g. Anaconda): Miniconda 3.7
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
  • Relevant/affected Python packages and their versions: XXX

Expected behaviour

No indentation after print("\n").

Actual behaviour & Steps to reproduce:

peek 2019-02-27 00-07

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Jedi Python language engine.
##########Linting Output - pylint##########

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:6

github_iconTop GitHub Comments

6reactions
Ronkirocommented, Feb 27, 2019

Occurs with any strings that contains \.

i.e.: ‘a\ a’, ‘\’, “\”, “a\”

3reactions
AlanLivingstoncommented, Mar 29, 2019

Why was P1 removed? This is an incredibly annoying bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proper indentation for multiline strings? - python
@trk, it's multiline in the sense that the string contains newlines (aka multiple lines), but yes it uses joining to circumvent the formatting...
Read more >
Changing the Indentation of a Multiline String - O'Reilly
Problem. You have a string made up of multiple lines, and you need to build another string from it, adding or removing leading...
Read more >
Handle line breaks (newlines) in Python - nkmk note
This article describes how to handle strings including line breaks (line feeds, new lines) in Python. Create a string containing line breaks.
Read more >
YAML Multiline Strings
(To get a newline using the folded style, leave a blank line by putting two newlines in. Lines with extra indentation are also...
Read more >
Proper Indentation for Python Multiline Strings - YouTube
Full Tutorial: https://blog.finxter.com/proper- indentation -for-python- multiline - strings /Email Academy: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found