Temporarily disable auto-indent when pasting multi-line content
See original GitHub issueIt’s just annoying when I receive IndentationError
everytime after I pasted some code snippets without modifying the indentation. Is it possible to detect the pasting action and disable auto-indent temporarily?
Also, I think the indent should be automatically shorter in the next line of a return statement.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Turning off auto indent when pasting text into vim
To turn off autoindent when you paste code, there's a special "paste" mode. Type :set paste. Then paste your code. Note that the...
Read more >vim Tutorial => Disable auto-indent to paste code
When pasting text through a terminal emulator, the auto-indent feature may destroy the indentation of the pasted text. For example:
Read more >Auto-indent on paste #25260 - microsoft/vscode - GitHub
Steps to Reproduce: 1.Create a file named 'test.php', and type some code like this: image. 2.When I try to paste these selected multiline...
Read more >How to disable auto-formatting on paste?
Hello.I'm using latest pyCharm 2.6.3If i copy-paste code from one source code file to another, pyCharm seems to apply auto formatting: it...
Read more >Why does Vim indent pasted code incorrectly?
There're two reasons: Auto insert comment · Auto indenting. For pasting in vim while auto-indent is enabled, you must change to paste mode ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is an issue with
prompt-toolkit
versions 3.0.20 through 3.0.22. I have tested it on Windows for Python 3.8, 3.9, and 3.10. With IPython 7.27.0, 7.29.0, and 8.0.1. It looks like the issue has been resolved in prompt-toolkit.I’m going to close this, basing my decision on @jamespreed research. I haven’t checked this myself, but it seems like it’s not a bug in IPython. If someone thinks otherwise - feel free to reopen / ping me.