question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pasted code lacks trailing newline

See original GitHub issue

Repro:

  • Consider following code in the Haskell scratch file:
main :: IO ()
main = pure ()
  • Move caret to first line, then “Edit → Cut” it then “Edit → Paste” back

Expected: the code looks unchanged

Instead:

main :: IO ()main = pure ()

Environment:

IntelliJ IDEA 2018.2.5 (Ultimate Edition)
Build #IU-182.4892.20, built on October 16, 2018
JRE: 1.8.0_152-release-1248-b19 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.18.15-1-default

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:35 (35 by maintainers)

github_iconTop GitHub Comments

2reactions
rikvdkleijcommented, Dec 17, 2018

I have changed the id of the Haskell filetype so it overrides the default one of IntelliJ. So there is only Haskell file type left. Hopefully that fixes this issue.

0reactions
develop7commented, May 6, 2019

I apologize: this time it is on me and the GPaste tool which had “trim items” option set to On.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why should text files end with a newline? - Stack Overflow
If content is added to the end of the file, then the line that was previously the last line will have been edited...
Read more >
Sanitizing files with no trailing newline « \1 - backreference.org
As it happens, certain applications produce text files with the final newline character missing on the last line.
Read more >
What's the point in adding a new line to the end of a file?
The C standard specifies that a C file should end with a newline (C11, 5.1.1.2, 2.) and that a last line without a...
Read more >
Why is Vim adding a newline? Is this a convention? - Super User
then Vim won't add a trailing newline character at the end of the final line if the file didn't already have one. That...
Read more >
"Revision file lacks trailing newline" on a "small" project
Hi, We have a SVN server on Solaris 8 with many repositories. To migrate, I do dumps. But for one repository, I have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found