Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Fix multiple indentation on paste #12793

Closed
wants to merge 3 commits into from
Closed

Fix multiple indentation on paste #12793

wants to merge 3 commits into from

Conversation

patstew
Copy link

@patstew patstew commented Sep 27, 2016

This is a copy of #11267 with a small addition to prevent one of the tests failing and only change the behaviour when there's a leading newline. Fixes #9045 #5473.

brentshermana and others added 3 commits September 27, 2016 12:27
…nteraction with autoIndentOnPaste. I wish the fix were less ugly, but shorter attempts didnt fully function
block appropriately on paste, otherwise keep indentation as normal.
@hgdsraj
Copy link

hgdsraj commented Sep 30, 2016

Have you tested this for pasting very large files? It seems as though it may significantly slow down performance as n (str.length) approaches infinity.

Raj

@patstew
Copy link
Author

patstew commented Sep 30, 2016

Nope, I pretty much just nicked it from the referenced PR, and haven't given it much testing. I think what you're suggesting would only be an issue with a selection consisting solely of millions of newline characters though.

@hgdsraj
Copy link

hgdsraj commented Sep 30, 2016

Ahh I see, I misread the parameters of the while loop. Looks like a pretty
unlikely corner case. Can we think of any faster ways to do this?

Looks okay otherwise.

On Thu, Sep 29, 2016, 5:28 PM patstew [email protected] wrote:

Nope, I pretty much just nicked it from the referenced PR, and haven't
given it much testing. I think what you're suggesting would only be an
issue with a paste consisting solely of millions of newline characters
though.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#12793 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ARyOJXOuB-wIUkKADP8rzhZkW06j8byfks5qvFfEgaJpZM4KHkdK
.

@Planteur
Copy link

Planteur commented Feb 3, 2017

Any update on this PR? The indentation problem is quite annoying.

@patstew
Copy link
Author

patstew commented May 3, 2017

I've had another go at fixing this - see this package: https://atom.io/packages/fix-indent-on-paste
It would be useful to get feedback on whether that package works as people expect - if so I'll update this PR with the same code

@sadick254
Copy link
Contributor

Hey @patstew. Apologies for not looking into this on time. I know this PR has been here for a very long time, during that time Atom has seen a number of changes. Due to the changes, this PR has now become outdated. Is it possible for you to resolve the conflicts?

@sadick254
Copy link
Contributor

Thank you for your PR!

We haven't gotten a response to our conflict resolution request. I'm going to close this but don't hesitate to reach out if you have or find time to resolve the conflicts, we'll be happy to reopen the PR.

@sadick254 sadick254 closed this Sep 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pasting with a newline in front adds last lines indentation to pasted one
5 participants