#247 Fix Auto-close comments not preserving following text

closed
5
2004-02-19
2004-02-19
No

In the Aug., 22nd, 2003 version of DrJava, when the
Auto-close comments preference is checked, if the user
has some text between the cursor position and the end
of line, and he presses Enter, the Auto-close comments
code does not preserve that text.

Discussion

    • status: open --> closed
     
  • Logged In: YES
    user_id=644952

    Closed by fixing the bug. Turned out to be in the Indentation
    logic. Jonathan and me paired together to fix it. The final
    code does fix the bug (no text lost) but could be improved to
    handle already-closed-comments more intelligently, in a
    future feature request or so.

     
  • Charles Reis
    Charles Reis
    2004-02-19

    Logged In: YES
    user_id=429731

    What do you mean by "does not preserve"? The text isn't
    deleted, is it? When I try it out, it appears to place the
    remaining text within the block comment. Is there a
    specific case where this causes a problem?

     
  • Charles Reis
    Charles Reis
    2004-02-19

    Logged In: YES
    user_id=429731

    Ah, I didn't realize it was already addressed. Still, I'm
    interested to know what the problem was.

     
  • Charles Reis
    Charles Reis
    2004-02-19

    Logged In: YES
    user_id=429731

    Actually, is your fix already in the current dev release?
    Because I just noticed that the behavior of the stable
    appears to be more desirable than the current dev release
    (given that I still can't reproduce the bug).

    Specifically, suppose you have:
    public void myMethod() {...}

    Put the cursor before public, start a block comment, and hit
    enter. In the stable, the method contract is preserved
    outside the block comment. In the current dev release, the
    method contract is sucked inside the block comment.

    What was the problem case?