New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command to paste without reformatting #15976

merged 3 commits into from Oct 24, 2017


None yet
3 participants

nathansobo commented Oct 23, 2017

This PR adds a command to paste without performing any reformatting, regardless of the source of the copied text or the settings for the current file. The following transformations are suppressed:

  • Line ending normalization. All instances of \r\n and \n in the pasted text will be preserved regardless of the line endings in the file.
  • Auto-indent There is a global "auto-indent on paste" setting that can also be assigned per-language, but this command is a way to momentarily bypass that setting.
  • Relative indent level adjustment By default, we attempt to keep the relative indent level of all lines consistent with the copied text. Sometimes people don't want that.

screen shot 2017-10-23 at 5 16 51 pm

Relevant to recent discussion in #1407

nathansobo added some commits Oct 23, 2017

Add preserveTrailingLineIndentation option to Selection.insertText
We can use this to support a new command that preserves all formatting
when pasting.
Add `Paste without reformatting` command
It is bound to cmd-shift-V on macOS and ctrl-shift-V on Windows and
Linux. It is also available in the edit menu.

This comment has been minimized.

Show comment
Hide comment

50Wliu Oct 23, 2017


Fixes #5046


50Wliu commented Oct 23, 2017

Fixes #5046

@nathansobo nathansobo merged commit 84f6f3e into master Oct 24, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@Ben3eeE Ben3eeE deleted the paste-without-reformatting branch Oct 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment