Skip to content
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

feat: Implement editor.convertLineEndingOnCopy and editor:paste-without-reindenting #1229

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

icecream17
Copy link
Contributor

Currently, when copying, line endings are converted to the system EOL.

This is useful for copying and pasting into another program, but it has the drawback of copying and Ctrl+Shift+V on a LF file on Windows causing inconsistent line endings.

Two things are added for this:

  • editor.convertLineEndingOnCopy: The "off" option allows to not convert on copy
  • editor:paste-without-reindenting: This new command is like editor:paste-without-reformatting but just for indenting. So line endings are still converted and trailing white space is still removed

Both of these are potentially useful, but to avoid feature creep ideally others could weigh in.

(note the first commit's message for reviewing)
There aren't any tests for the command `editor:paste-without-reformatting` (just for all the options passed to the `paste` method itself), so I didn't add any for the new command `editor:paste-without-reindenting`

Also some documentation from my investigation of PaneElement a year ago.

The single-line PaneElement description may seem useless, but I first thought it was an entry of a pane (those are pane items).

image

Links

Discord conversation: https://canary.discord.com/channels/992103415163396136/992103415163396139/1342613487880376382

Issue and pr for original functionality: atom/atom#8365 and atom/atom#19016

Release notes

  • Add editor.convertLineEndingOnCopy setting.
  • Add editor:paste-without-reindenting command.

icecream17 and others added 2 commits February 22, 2025 00:34
…ut-reindenting

There aren't any tests for the command `editor:paste-without-reformatting` (just for all the options passed to the `paste` method itself), so I didn't add any for the new command `editor:paste-without-reindenting`

Also some documentation from my investigation of PaneElement a year ago.

The single-line PaneElement description may seem useless, but I first thought it was an entry of a pane (those are pane items).
when the outer "describe" is run, the config is set multiple times. Then the tests are run: https://jestjs.io/docs/setup-teardown#order-of-execution

This results in unexpected behaviour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant