18

I wrote an answer that uses a ton of conversions:

chrono::system_clock::to_time_t(chrono::system_clock::time_point(chrono::duration_cast<chrono::seconds>(chrono::duration<double>(input))))

I can seem to get this into a code block here, but for some reason I cannot in my answer: https://stackoverflow.com/a/50495821/2642059

Is this bug somehow specific to Chrome:

Version 66.0.3359.181 (Official Build) (64-bit)

Or is there something about the state in that answer which is preventing it?

5
  • 7
    Huh... Selecting it and hitting Ctrl+K will do it, but trying to add spaces puts a linebreak after two. Only in Chrome.
    – Shog9 Mod
    Commented May 24, 2018 at 1:47
  • @Shog9 Ah, good call. I'll do that after I've given this question a chance to get answered. Commented May 24, 2018 at 1:57
  • Putting four spaces at the beginning of that line works just fine in Firefox. Commented May 24, 2018 at 2:27
  • 5
    Seems to work fine for me. (remark: you should really split the code into multiple lines, thanks to the verbosity of C++ :/)
    – user202729
    Commented May 24, 2018 at 2:56
  • 1
    Possible duplicate of Heads up: editing of long lines of code in Chrome no longer possible
    – Mr Lister
    Commented May 26, 2018 at 14:16

1 Answer 1

27

Testing with a textarea produces this result when four spaces is typed in (encoded so we can see whitespace characters):

enter image description here

Seems like Chrome inserts a linefeed character %0A after two spaces, as the current unbroken line is too long. %20 is a normal space.

This behavior was reported on the Google Chrome Help Forum

To workaround this, select the code block and click on the [Code Sample] button, or break up the line of code with spaces like how I edited your answer.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .