Page 1 of 2 12 LastLast
Results 1 to 20 of 22
  1. #1
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Code formatting Issue

    First of all I don't underatand why the code formatting has changed to include line numbers when the problem of displaying the "Code" button on the form hasn't been fixed yet.

    In addition to the line numbering problem reported in another posting I have a problem with copying and pasting the code. When I paste the code into my text editor it comes over as a single line of code.

    Now, I must admit I use a simple text editor and have had problems with this on other forum sites as well (probably because my editor is not HTML aware?). My solution on those sites was to first open up Microsoft Word and past the text into a word document. When I did this on other sites the text would be formatted on separate lines and code formatting would be saved.

    When I tried this approach on the new code formatting I did get new lines but now all the code formatting is lost and all text is left justified in the Word document.

    Note, I did not have a problem with the old code formatting used by this site. I would simply copy and paste into my editor.

  2. #2
    AlphaSupport Guest

    Default Re: Code formatting Issue

    When I paste the code into my text editor it comes over as a single line of code.
    I will need more information to reproduce this issue.

    Can you please provide me with the following information:
    - Operating system and version used
    - Browser and browser version
    - Editor and version used

    PS "Word" is in most cases not the best solution as a code text editor.

  3. #3
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Code formatting Issue

    I use IE Version 8.0.6001.18702 on Windows XP Version 5.1.2600 Service Pack 3 Build 2600.

    I use an old text editor called QEdit.

    I know Word is not a text editor. I guess I wasn't clear. On other website when I have encountered proble copying/pasting into QEdit I would first paste the text into Word. I was guessing this worked because Word is HTML aware? Then I would take the formatted text from Word and paste it into QEdit. I use an Word 97. I know it is an old version.

    I guess the point I'm trying to make is that before you made the latest updates I had no problems with anything. Copy/paste worked fine direct to my text editor. Now it still doesn't work with my hack of using Word as an intermediate app.

    Don't worry about this too much as I know my software is older (I'm just comfortable with it). I was just hoping that you might know what changed between the old/new code tags related to the copy/paste functionalilty.

  4. #4
    AlphaSupport Guest

    Default Re: Code formatting Issue

    Unfortunately i don't have access to most of these components for testing, not even a WinXP machine anymore.

    I tried locating a download for Qedit, and all i found was a version 1.1. I had to start up my Vista machine as it did not want to run on Win7-64bit. But i was not able to reproduce the issue. Copying from IE9 running in IE8 mode on Vista and pasting it into QEdit1.1 produced results as expected.

    Have you tried using Notepad (or even Wordpad) as intermediate editor? Can you please try this for me and post the results:
    - Open any post that has a code block and wait for it to finish loading.
    - Double-click anywhere in the code-block (this should highlight all the code)
    - Copy (using Ctrl-C) the code
    - Open Notepad and paste the copied code.

    How is the result?

    PS I know it is a big change but you might want to try a more modern editor like Notepad++ (free). You might even like it.

  5. #5
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Code formatting Issue

    Yes I have tried every editor I have, Notepad, WordPad, JEdit. Nothing works.

    I just wrote a quick Java program that displays the data in the clipboard. The data in the clipboard doesn't contain any newline or carriage return characters, so the problem is not with the editors. I'm guessing the problem is with IE8. It doesn't recognize the format of the HTML you now use to format the Java source code. I can't update to IE9 until I get a new computor with Windows 7 (maybe next year).

    When I get a new computer (and more memory) I will look at upgrading to an IDE or more modern editor :)

    I just though you might have an idea about how the HTML generated by the new code formatting feature is different than the old HTML.

    Don't worry about it. Thanks for your time.
    Last edited by camickr; 10-02-2011 at 06:17 PM.

  6. #6
    AlphaSupport Guest

    Default Re: Code formatting Issue

    You might say don't worry about it but it keeps running in my mind. ;) I hate loose ends. And others, who are less vocal, might have similar problems.

    Did you ever try another browser, just to rule IE out. You might want to give Google Chrome a try. I have always been using IE (although with a shell around it named Netcaptor) as my main browser for the last 15 years, despite all the "experts" dissing it, but i have myself switched to Chrome as my main browser since a year.

    An editor like Notepad++ is lightweight so your current setup should not be a limit to use that. But if even Notepad give you the same problem, then i doubt it will be a solution for this problem.

    There is nothing specific in the way the new code blocks are presented that i can think of that should cause this. The only thing that might be an issue is that IE8 might react different on the CSS used, although none of my tests did show any problems there.

  7. #7
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Code formatting Issue

    As I mentioned I first noticed this problem on another forum a few months ago after that forum also did an update. I searched the forum to see if I could find any reason for this. Here are a couple of discussions on the topic that I found:

    Prettified code copied in Internet Explorer pastes without line breaks - Meta Stack Overflow
    Pasting code from Stackoverflow to notepad loses line breaks using IE? - Meta Stack Overflow

    The conclusion I came to was that it was a problem with the JS used to highlight the java code syntax in combination with the way certain versions of IE don't recognize the "br" tag when copying. So I didn't worry about it and just used my double copy hack to solve the problem.

    I don't know if any of the information in the links is applicable to this forum since I don't know how the Java code highlighting is done. Just thought it might help to confirm that this an IE problem in combination with the new JS (CSS?) that is now being used to do the code highlighting routines.

    The editor I use is not the issue. I have no doubt that if I switch to another browswer I won't have an issue either.

  8. #8
    AlphaSupport Guest

    Default Re: Code formatting Issue

    Please try again now. You might need to use a hard refresh in your browser.

    I can not reproduce the issue myself, so not sure if this will solve it for you.

  9. #9
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: Code formatting Issue

    I deleted all the cached files from IE, closed IE down and restarted it.

    I still only get a single line of data.

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default Re: Code formatting Issue

    Dittto here; IE/9 and vi(m). Normally I solve the issue by pasting the single line in an Eclipse editor and make Eclipse reformat everything.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  11. #11
    AlphaSupport Guest

    Default Re: Code formatting Issue

    Jos,

    Are you running IE9 in compatibility mode or something, some special settings? What OS are you on? There must be something specific about your situation, as i can not reproduce this issue myself and i don't see many people reporting this.

    Edit: Can you also please post a link to a code block where this goes wrong for you?

  12. #12
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default Re: Code formatting Issue

    IE/9 on Vista, not in compatibility mode; in this thread: HELP!!! IMMINENT project deadline! is a block of code that copies/pastes as one long line; b.t.w. the email notifications are also (sort of) incorrect when a reply contains a block of code, i.e. the block contains those silly html tags.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  13. #13
    AlphaSupport Guest

    Default Re: Code formatting Issue

    Quote Originally Posted by JosAH View Post
    IE/9 on Vista, not in compatibility mode; in this thread: HELP!!! IMMINENT project deadline! is a block of code that copies/pastes as one long line; b.t.w. the email notifications are also (sort of) incorrect when a reply contains a block of code, i.e. the block contains those silly html tags.

    kind regards,

    Jos
    Ok i have now been able to reproduce this with IE9 on Vista and will investigate more.

    About the email notifications, can someone please post a reply with a code block to this thread, so i will get a notification and see the problem.

  14. #14
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default Re: Code formatting Issue

    Quote Originally Posted by AlphaSupport View Post
    Ok i have now been able to reproduce this with IE9 on Vista and will investigate more.

    About the email notifications, can someone please post a reply with a code block to this thread, so i will get a notification and see the problem.
    Thanks for looking at it; when I receieve an email notification with code in it, I'll post it here (the email with html tags in it isn't much trouble for me, i.e. I simply read the reply on the forums).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  15. #15
    AlphaSupport Guest

    Default Re: Code formatting Issue

    Quote Originally Posted by JosAH View Post
    Thanks for looking at it; when I receieve an email notification with code in it, I'll post it here (the email with html tags in it isn't much trouble for me, i.e. I simply read the reply on the forums).

    kind regards,

    Jos
    Hello Jos,

    If you post a reply with a block of code in this thread, i will get an email notification of it.

  16. #16
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default Re: Code formatting Issue

    Quote Originally Posted by AlphaSupport View Post
    Hello Jos,

    If you post a reply with a block of code in this thread, i will get an email notification of it.
    Ok, this is what was in front of me in Eclipse:

    Java Code:
    public class Super extends Lambda {
    	
    	private static final String[] type= { "Super", ANY };
    
    	public String[] type() { return type; }
    	public boolean isTrue() { return true; }
    
    	public Super() { 
    		
    		super(new SuperBinder());
    		bind.position(this);
    		namePosition= 1;
    	}
    
    	public void endProcess(Compiler c) { push(new EndContext()); }
    
    	public void print(Writer w) throws IOException {
    		
    		w.write("->> ");
    		fetch(namePosition).print(w);
    	}
    }
    kind regards,

    Jos

    edit: darn, I don't see those white lines in the code ...
    cenosillicaphobia: the fear for an empty beer glass

  17. #17
    AlphaSupport Guest

    Default Re: Code formatting Issue

    Jos,

    Thanks. From the notification email it is pretty clear to me what is going wrong and i should be able to solve that soon.

    What do you mean with the "i don't see those white lines". Are the alternating colors difficult to read for you, or do they really not show up for you?

  18. #18
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default Re: Code formatting Issue

    Quote Originally Posted by AlphaSupport View Post
    Jos,

    Thanks. From the notification email it is pretty clear to me what is going wrong and i should be able to solve that soon.

    What do you mean with the "i don't see those white lines". Are the alternating colors difficult to read for you, or do they really not show up for you?
    They simply weren't there but now they are ... I'm becoming religious because of that mysterious behaviour; I think I'm going to dance around an old oak tree tonight ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  19. #19
    AlphaSupport Guest

    Default Re: Code formatting Issue

    If you need any help, just tie a yellow ribbon around it....

  20. #20
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default Re: Code formatting Issue

    Quote Originally Posted by AlphaSupport View Post
    If you need any help, just tie a yellow ribbon around it....
    You're talking superstition, I'm talking real hard core religion with sacrifices, money, secret handshakes and scantily clad women and all ... ;-)

    kindest regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Page 1 of 2 12 LastLast

Similar Threads

  1. Line number formatting issue
    By DarrylBurke in forum Suggestions & Feedback
    Replies: 5
    Last Post: 10-02-2011, 05:47 PM
  2. Issue compiling Java Code
    By AggressiveFish in forum Java Applets
    Replies: 4
    Last Post: 01-04-2011, 09:10 PM
  3. Formatting Issue
    By lala in forum New To Java
    Replies: 2
    Last Post: 11-21-2010, 10:18 PM
  4. Formatting Java Code
    By DoubleDee in forum Advanced Java
    Replies: 5
    Last Post: 09-18-2010, 10:33 PM
  5. Need help formatting output and some code
    By A5i19 in forum New To Java
    Replies: 6
    Last Post: 11-09-2009, 04:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •