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:

committed by
David Pursehouse

parent
527200c83d
commit
6c99b232da
@@ -239,11 +239,18 @@ public class SideBySide2 extends Screen {
|
|||||||
Window.enableScrolling(false);
|
Window.enableScrolling(false);
|
||||||
|
|
||||||
final int height = getCodeMirrorHeight();
|
final int height = getCodeMirrorHeight();
|
||||||
cmA.setHeight(height);
|
operation(new Runnable() {
|
||||||
cmB.setHeight(height);
|
@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);
|
diffTable.sidePanel.adjustGutters(cmB);
|
||||||
cmB.setCursor(LineCharacter.create(0));
|
|
||||||
cmB.focus();
|
|
||||||
|
|
||||||
prefetchNextFile();
|
prefetchNextFile();
|
||||||
}
|
}
|
||||||
@@ -1376,6 +1383,20 @@ public class SideBySide2 extends Screen {
|
|||||||
return cmB;
|
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() {
|
private void prefetchNextFile() {
|
||||||
String nextPath = header.getNextPath();
|
String nextPath = header.getNextPath();
|
||||||
if (nextPath != null) {
|
if (nextPath != null) {
|
||||||
|
Reference in New Issue
Block a user