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

Indention off when pasting with autoIndentOnPaste: true #584

Closed
jnunemaker opened this issue Jun 13, 2013 · 8 comments
Closed

Indention off when pasting with autoIndentOnPaste: true #584

jnunemaker opened this issue Jun 13, 2013 · 8 comments
Labels

Comments

@jnunemaker
Copy link

I have this in my config.cson:

'editor':
  'autoIndent': true
  'autoIndentOnPaste': true

But anytime I paste something that has a single line with }), the indention gets off one level after it. It gets off one line for each line that has only }) on it.

If I copy this and paste it:

foo({
  bar

  another({

  })
  thing
})
something

I get this:

foo({
  bar

  another({

    })
    thing
    })
    something

But expect this:

foo({
  bar

  another({

  })
  thing
})
something

If I turn auto indent on paste off it works, but then everything else I paste doesn't auto indent correctly.

@probablycorey
Copy link

I can't reproduce this, so I need moar info:

What language are you using?
What version of Atom are you on?
Can you paste your entire config.cson in?

On Thu, Jun 13, 2013 at 8:17 AM, John Nunemaker notifications@github.comwrote:

I have this in my config.cson:

'editor':
'autoIndent': true
'autoIndentOnPaste': true

But anytime I paste something that has a single line with }), the
indention gets off one level after it. It gets off one line for each line
that has only }) on it.

If I copy this and paste it:

foo({
bar

another({

})
thing
})
something

I get this:

foo({
bar

another({

})
thing
})
something

But expect this:

foo({
bar

another({

})
thing
})
something

If I turn auto indent on paste off it works, but then everything else I
paste doesn't auto indent correctly.


Reply to this email directly or view it on GitHubhttps://github.com//issues/584
.

@jnunemaker
Copy link
Author

Language is ruby. I'll check atom version and such when I get back home.

On Jun 13, 2013, at 11:49 AM, Corey Johnson notifications@github.com wrote:

I can't reproduce this, so I need moar info:

What language are you using?
What version of Atom are you on?
Can you paste your entire config.cson in?

On Thu, Jun 13, 2013 at 8:17 AM, John Nunemaker notifications@github.comwrote:

I have this in my config.cson:

'editor':
'autoIndent': true
'autoIndentOnPaste': true

But anytime I paste something that has a single line with }), the
indention gets off one level after it. It gets off one line for each line
that has only }) on it.

If I copy this and paste it:

foo({
bar

another({

})
thing
})
something

I get this:

foo({
bar

another({

})
thing
})
something

But expect this:

foo({
bar

another({

})
thing
})
something

If I turn auto indent on paste off it works, but then everything else I
paste doesn't auto indent correctly.


Reply to this email directly or view it on GitHubhttps://github.com//issues/584
.


Reply to this email directly or view it on GitHub.

@jnunemaker
Copy link
Author

Atom 10.0.

'core':
  'hideGitIgnoredFiles': true
  'ignoredNames': [
    'vendor'
  ]
  'themes': [
    'atom-mac-theme'
    'Solarized (dark)'
  ]
'editor':
  'autoIndent': true
  'autoIndentOnPaste': false
  'fontSize': 20
  'fontFamily': 'Anonymous Pro'
  'hideGitIgnoredFiles': true
  'showIndentGuide': true
'stripTrailingWhitespace':
  'singleTrailingNewline': true
'fuzzyFinder':
  'ignoredNames': [
    'vendor'
  ]
'git-diff':
  'enabled': true

On Jun 13, 2013, at 11:49 AM, Corey Johnson notifications@github.com wrote:

I can't reproduce this, so I need moar info:

What language are you using?
What version of Atom are you on?
Can you paste your entire config.cson in?

On Thu, Jun 13, 2013 at 8:17 AM, John Nunemaker notifications@github.comwrote:

I have this in my config.cson:

'editor':
'autoIndent': true
'autoIndentOnPaste': true

But anytime I paste something that has a single line with }), the
indention gets off one level after it. It gets off one line for each line
that has only }) on it.

If I copy this and paste it:

foo({
bar

another({

})
thing
})
something

I get this:

foo({
bar

another({

})
thing
})
something

But expect this:

foo({
bar

another({

})
thing
})
something

If I turn auto indent on paste off it works, but then everything else I
paste doesn't auto indent correctly.


Reply to this email directly or view it on GitHubhttps://github.com//issues/584
.


Reply to this email directly or view it on GitHub.

@probablycorey
Copy link

I'm looking into this, I don't have any answers yet but here is what I've found.

The textmate grammar to decrease the indent on lines matching this regex /^\s*([}\]](,?\s*(#|$)|\.[a-zA-Z_]\w*\b)|(end|rescue|ensure|else|elsif|when)\b)/

Which doesn't mach the line }), so it is what I would expect to happen. BUT textmate and sublime paste the text correctly, so we are missing something.

@probablycorey
Copy link

It seems like textmate only auto indents the first line on paste. Is this the behavior we want to emulate?

@jnunemaker
Copy link
Author

I think that makes sense. Auto indent the first line and the rest should be indented in relation to the first line when they were copied. Not sure if what I said makes sense to anyone else, but it does in my head. Let me know if not and I'll explain more.

@nathansobo
Copy link
Contributor

I think it's a good behavior too. The thing we do now could be called
auto-format on paste, and is something we can maybe do "someday".

On Fri, Jun 21, 2013 at 4:55 PM, John Nunemaker notifications@github.comwrote:

I think that makes sense. Auto indent the first line and the rest should
be indented in relation to the first line when they were copied. Not sure
if what I said makes sense to anyone else, but it does in my head. Let me
know if not and I'll explain more.


Reply to this email directly or view it on GitHubhttps://github.com//issues/584#issuecomment-19845176
.

@lock
Copy link

lock bot commented Jan 27, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants