Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Formatting with eclipse formatter introduces empty document in undo manager #18

Closed
markiewb opened this Issue · 4 comments

2 participants

@markiewb
Owner

No description provided.

@markiewb markiewb referenced this issue in emmetio/netbeans
Merged

Proposal for issue3 #10

@junichi11

Is the following NG?

NbDocument.runAtomic(document, new Runnable() {
    @Override
    public void run() {
        try {
            document.remove(0, length);
            document.insertString(0, result, null);
        } catch (BadLocationException ex) {
            Exceptions.printStackTrace(ex);
        }
    }
});
if (editor != null) {
    editor.setCaretPosition(Math.max(0, Math.min(caret, document.getLength())));
}

https://github.com/markiewb/eclipsecodeformatter_for_netbeans/blob/master/src/de/markiewb/netbeans/plugins/eclipse/formatter/EclipseFormatterUtilities.java#L59-L63

@markiewb
Owner

@junichi11 : Yes it works. Thanks. I will integrate it.

@junichi11

:+1:
You are welcome :)

@markiewb
Owner

Fixed in 1.5

@markiewb markiewb closed this
@markiewb markiewb was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.