SideBySide2: Fix truncated long lines

CM3 needs a call to refresh() after setHeight to get the horizontal
width correct for any lines longer than the window width.

Bug: Issue 2428
Change-Id: I608264d71c98829c2f39d9acef12445088591bbb
This commit is contained in:
Shawn Pearce
2013-12-05 13:59:54 -08:00
committed by David Pursehouse
parent 527200c83d
commit 6c99b232da

View File

@@ -239,11 +239,18 @@ public class SideBySide2 extends Screen {
Window.enableScrolling(false);
final int height = getCodeMirrorHeight();
cmA.setHeight(height);
cmB.setHeight(height);
operation(new Runnable() {
@Override
public void run() {
cmA.setHeight(height);
cmB.setHeight(height);
cmA.refresh();
cmB.refresh();
cmB.setCursor(LineCharacter.create(0));
cmB.focus();
}
});
diffTable.sidePanel.adjustGutters(cmB);
cmB.setCursor(LineCharacter.create(0));
cmB.focus();
prefetchNextFile();
}
@@ -1376,6 +1383,20 @@ public class SideBySide2 extends Screen {
return cmB;
}
void operation(final Runnable apply) {
cmA.operation(new Runnable() {
@Override
public void run() {
cmB.operation(new Runnable() {
@Override
public void run() {
apply.run();
}
});
}
});
}
private void prefetchNextFile() {
String nextPath = header.getNextPath();
if (nextPath != null) {