Position cursor on first column on diff chunk navigation
Navigation by clicking on the scroll bar still positions the cursor on the last column. Only initial position and navigation per keys 'p' and 'n' is changed. Change-Id: I968171ed1293d722c07f816e3c4a154d23cdac7a
This commit is contained in:
parent
dd47950027
commit
5ac80fd937
|
@ -317,7 +317,7 @@ class ChunkManager {
|
||||||
|
|
||||||
DiffChunkInfo target = chunks.get(res);
|
DiffChunkInfo target = chunks.get(res);
|
||||||
CodeMirror targetCm = host.getCmFromSide(target.getSide());
|
CodeMirror targetCm = host.getCmFromSide(target.getSide());
|
||||||
targetCm.setCursor(Pos.create(target.getStart()));
|
targetCm.setCursor(Pos.create(target.getStart(), 0));
|
||||||
targetCm.focus();
|
targetCm.focus();
|
||||||
targetCm.scrollToY(
|
targetCm.scrollToY(
|
||||||
targetCm.heightAtLine(target.getStart(), "local") -
|
targetCm.heightAtLine(target.getStart(), "local") -
|
||||||
|
|
|
@ -204,7 +204,7 @@ public class CodeMirror extends JavaScriptObject {
|
||||||
if (lineAtHeight(height - 20) < line) {
|
if (lineAtHeight(height - 20) < line) {
|
||||||
scrollToY(heightAtLine(line, "local") - 0.5 * height);
|
scrollToY(heightAtLine(line, "local") - 0.5 * height);
|
||||||
}
|
}
|
||||||
setCursor(Pos.create(line));
|
setCursor(Pos.create(line, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public final native ScrollInfo getScrollInfo() /*-{
|
public final native ScrollInfo getScrollInfo() /*-{
|
||||||
|
|
Loading…
Reference in New Issue