Author Topic: Comment wrapping goofy?  (Read 19805 times)

Dswag89

  • Community Member
  • Posts: 63
  • Hero Points: 4
Re: Comment wrapping goofy?
« Reply #15 on: August 14, 2006, 12:25:01 PM »
Thanks Scott, that solved all of my problems.  In my excitement to try out comment features, I think I dug myself a hole and unearthed all of these oddities of comment-wrapping!  This issue of back-to-back comments will not occur in the course of my daily coding, so it won't be a problem.  As for the last issue about the extra "**" and you writing better comments than me... well, I must have learned by osmosis over the weekend, because I can't recreate the problem this morning!   >:(  I was doing it *WITHOUT FAIL* on Thursday, but can't even re-download the file from my original post and get it to happen.  There's a ghost somewhere! (must be in front of the keyboard ;-)).  Thanks for all the help and discussion folks, it was timely and helpful.

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Comment wrapping goofy?
« Reply #16 on: August 15, 2006, 05:09:54 PM »
Editing a .cs file, this comment below has a blank line above it, and a blank line below it; it starts in column 17.

Code: [Select]
                // debug junk
                // aaa bbbb ccccc
                // dddd eeee ffff

If I put the cursor on 'j' and press Backspace (CUA emulation), I get this;
Code: [Select]
                // debugjunk aaa bbbb ccccc
                // dddd eeee ffff
With the cursor still on 'j', I press enter and get this:
Code: [Select]
                // debug
                // junk aaa bbbb ccccc dddd eeee ffff

Back to the original, with some more context.  Put the cursor after the last 'f', press enter, a new comment line appears as expected.
Code: [Select]
            //----------------------
            // TESTING
            //----------------------
            if (fiTest.Length < 1 && (fiTest.Length != fiGold.Length)) {
                // Debugging junk
                // System.Diagnostics.Debug.WriteLine("0-length test file");
                // throw new Exception("0-length test file");

                // debug junk
                // aaa bbbb ccccc
                // dddd eeee ffff
                //
               
                return false;
            }
            //--------------------------
            // End testing
            //--------------------------

            char[] testHeader = new char[fileLength];
            using (StreamReader testReader = new System.IO.StreamReader(@testFile))
            {   
                testReader.BaseStream.Seek(0,System.IO.SeekOrigin.Begin);
                testReader.Read(testHeader,0,fileLength);
            }

Cursor is one space past last comment char; press Backspace.
Code: [Select]
            //----------------------
            // TESTING
            //----------------------
            if (fiTest.Length < 1 && (fiTest.Length != fiGold.Length)) {
                // Debugging junk
                // System.Diagnostics.Debug.WriteLine("0-length test file");
                // throw new Exception("0-length test file");

                // debug junk
                // aaa bbbb ccccc
                // dddd eeee ffff


                return false;
            }
            //--------------------------
            // End testing
            //--------------------------

            char[] testHeader = new char[fileLength];
            using (StreamReader testReader = new System.IO.StreamReader(@testFile)){    //
                testReader.BaseStream.Seek(0,System.IO.SeekOrigin.Begin);
                testReader.Read(testHeader,0,fileLength);
            }

Comment characters are removed (but not the line), and the cursor ends up on the 't' in testReader in the using statment.

Dswag89

  • Community Member
  • Posts: 63
  • Hero Points: 4
Re: Comment wrapping goofy?
« Reply #17 on: August 15, 2006, 05:31:45 PM »
Okay Wanderer... now you're just *trying* to break it, like I was. ;)

I tried to paste your first set of comments into one of my test files and got completely different results.  These "C++" style comments would not reflow, neither automatically, nor with Document... Reflow Comment (it was grayed out).  When I hit <ENTER> at the end of a line, new comment-indicators (//) did appear, but I had to backspace through those two and through the 16 spaces to get back to the previous line.

And who knows *what* is going on with the cursor going down some 3 lines and picking some keyword to latch on to...

In the end, though, I think that we're really finding nits to pick with a system that works pretty well!

Dan

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Comment wrapping goofy?
« Reply #18 on: August 15, 2006, 08:55:05 PM »
Unfortunately I've to agree with Wanderer.
Sometimes I couldn't really understand the 'wrap-effects'.
Sometimes I retried one of these situations later on to get the point (or to report a bug) but w/ different behaviour.
The cursor-pos dependency obviously explains why it's hard to setup the same conditions ...

Sure - it needs some more refinement, nevertheless it's a very helpful feature.

HS2
« Last Edit: August 15, 2006, 08:59:14 PM by hs2 »

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Comment wrapping goofy?
« Reply #19 on: August 15, 2006, 09:09:54 PM »
I'm not trying to break it, and I don't think these are trivial.  I was trying to edit a comment, and it seemed quite unpredictable as to what was going to happen.

As for the last case, with the cursor going down some number of lines: compare more closely the last two snippets, and notice that a '{' was moved and '//' was inserted after the '{'. 

I agree it is a useful feature, but it sure needs some attention to fit-and-finish...

Dswag89

  • Community Member
  • Posts: 63
  • Hero Points: 4
Re: Comment wrapping goofy?
« Reply #20 on: August 16, 2006, 10:33:13 AM »
Oh my!  Missed that last bit! :o  You're absolutely right Wanderer, the moved brace and comment 3 lines away is very odd (and potentially dangerous)!  I did realize the cursor moved down significantly, but missed the whole bit abuot the "beautification" performed on your code.  My bad. 

I'm also in agreement with HS2, things are *not* repeatable from one time to the next... hence my "ghost" theory earlier in this thread... maybe it is not in front of the keyboard after all?

In SlickEdit we trust...