| | |
Code line numbers - causing paste problems
![]() |
The new line numbers inserted when using syntax coloring code tags is causing me problems when copying and pasting code. Here are some examples:
http://www.daniweb.com/techtalkforum...311344-32.html
I copy and paste the code to my editor. This is how it looks when it's selected in my browser:
Sometimes, instead of line numbers I get pound symbols (#) instead. I'm using Firefox 2.0.
http://www.daniweb.com/techtalkforum...311344-32.html
I copy and paste the code to my editor. This is how it looks when it's selected in my browser:
http://img522.imageshack.us/img522/7406/picture1ji6.pngAnd this is how my code looks when it's in the editor:
1.
#include <stdio.h>
2.
#include <string.h>
3.
4.
int main(void) {
5.
6.
char mystring[] = "this is a test.\n";
7.
char *p = strchr(mystring, '\n');
8.
if (p != NULL) *p = '\0';
9.
printf("%s no newlines should occur.\n", mystring);
10.
11.
} "Technological progress is like an axe in the hands of a pathological criminal."
I don't have this problem at all. I tried copying/pasting from both Firefox and IE into Windows Notepad. Perhaps it's a problem with your editor?
In the meantime, a workaround would be to click the Reply w/ Quote button and then copy the post contents from the editor window.
Since the majority of the code posted within the forums is just for discussion purposes, I thought the line numbers would be a great aid towards talking about a particular piece of code. ie. "You have an error on line #5"
In the meantime, a workaround would be to click the Reply w/ Quote button and then copy the post contents from the editor window.
Since the majority of the code posted within the forums is just for discussion purposes, I thought the line numbers would be a great aid towards talking about a particular piece of code. ie. "You have an error on line #5"
Nah, before I was using Xcode, but using TextEdit didn't seem to make a difference. To me, it seems to be somewhat on the browser end of things.
Just tried Safari now - no difference.
I'll let you know how things are on Linux when I next boot onto Debian.
Thanks; it seems like I'll be needing to do this whenever I need to try out code in my compiler from now on.
Just tried Safari now - no difference.
I'll let you know how things are on Linux when I next boot onto Debian.
•
•
•
•
In the meantime, a workaround would be to click the Reply w/ Quote button and then copy the post contents from the editor window.
"Technological progress is like an axe in the hands of a pathological criminal."
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Although it may first seem like a great idea... That actually happens about 0.5% of the time. IMO it's not worthwhile to inconvenience 99.5% of the rest.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
0.5% of the time you discuss the code snippets and 99.5% of the time you copy them into your editor and compile them? I suspect that's not the case with the vast majority of traffic to the programming forums.
•
•
•
•
0.5% of the time you discuss the code snippets and 99.5% of the time you copy them into your editor and compile them? I suspect that's not the case with the vast majority of traffic to the programming forums.
BTW, I found this, FWIW.
Last edited by Dave Sinkula; Feb 6th, 2007 at 1:59 am.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Other Threads in the DaniWeb Community Feedback Forum
- Previous Thread: User Control Panel not working
- Next Thread: formatting playing up
| Thread Tools | Search this Thread |
+ abuse beginners bookmark bored box bug bugs calamity code codebox codesnippets codetags code_snippet comments cpuintensive daniweb design editcodesnippet end-of-the-world favouriteforums feedback ff3 flamewar glitch ie6 itsatag! kids layout login lulz negative newfeature poll post preview privatemessaging problem profanitytest profile quality quick rashakil-fol reply reputation reputation-power sandwich score search snippet socialgroups solvedthreads sub-forum suggestion tagcloud tagging tags theactualrulerofthetag-cloud:3 therulerofthetag-cloud:[ thread threadtagging today's-posts unansweredposts upgrade user voting whining







