Does anyone else suffer from the problem that cut&paste from the "d/l code" link discards the leading whitespace?

I've only really noticed this recently, but it may have always been so?

Browser: Opera 6.01 on NT4.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller


Replies are listed 'Best First'.
Re: d/l code link and indentation problem?
by Mr. Muskrat (Canon) on Jun 26, 2003 at 02:19 UTC
    I've never actually used cut&paste (or more appropriately copy &paste ;) after clicking the "d/l code" link. I always "save page as" instead.

      Often times I only want to load the code into my editor so that I can see it with syntax highlighting and/or so that I can use my macros to reformat it to my taste. I just make it easoer for me to read and understand the code I'm looking at. Under these circumatstances ^A^C<alt-tab>^N^V^Qpf is considerably easier than navigating to an appropriate directory, having to come up with a name, saving it, switching to the editor and loading it, remembering to throw it away afterwards.

      Mostly, I just wanted to know if I was the only one seeing the problem--was it my browser, my configuration etc--which seemed like a reasonable thing to ask, though one ............. seems to think that just asking this was sufficiently henous to be worthy of their time and effort in clicking --?

      I tracked it down a bit further and worked out why I only get bitten by it sometimes. It depends on whether the leading whitspace is spaces as in 269017 or tabs as 269051.

      It appears that browsers (Opera at least), treat spaces as a part of the content they are displaying, but tabs as not! Which given that the D/L code link deliveres the context marked as text, seems pretty bizaar? I often wished that code tags would universally convert tabs to spaces, but that probably to insignificant a detail to be bothered with changing until someone important decides it is.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller


        I guess the ease of the operations depends greatly on what browser, editor and OS. :-) On windows at least, it's easier for me to just save it and open with the appropriate editor.

        I just tested those two nodes with Mozilla and Notepad by doing a ^A^C<Alt-Tab>^N^V and it works fine. The spaces come out spaces and the tabs come out tabs. I don't have Opera (nor do I want it) but I'm sure that someone else will be able to tell you if it happens to them.

Re: d/l code link and indentation problem?
by freddo411 (Chaplain) on Jun 26, 2003 at 18:16 UTC
    Tested this in Mozilla on Win2k.

    Mozilla displays the tabs, and copy and paste captures the tabs.

    --Fred

    -------------------------------------
    Nothing is too wonderful to be true
    -- Michael Faraday