SideBySide2: Bind Shift-N to search-prev in vim mode
Shift-N is find previous search result. With no search active this should stay as next comment. Change-Id: Ia7ab1417a121b3d7b3a9f8b44d49dbb335f1f330
This commit is contained in:
@@ -311,7 +311,7 @@ public class SideBySide2 extends Screen {
|
||||
.on("N", maybeNextVimSearch(cm))
|
||||
.on("P", chunkManager.diffChunkNav(cm, Direction.PREV))
|
||||
.on("Shift-M", header.reviewedAndNext())
|
||||
.on("Shift-N", commentManager.commentNav(cm, Direction.NEXT))
|
||||
.on("Shift-N", maybePrevVimSearch(cm))
|
||||
.on("Shift-P", commentManager.commentNav(cm, Direction.PREV))
|
||||
.on("Shift-O", commentManager.openCloseAll(cm))
|
||||
.on("Shift-Left", moveCursorToSide(cm, DisplaySide.A))
|
||||
@@ -781,6 +781,19 @@ public class SideBySide2 extends Screen {
|
||||
};
|
||||
}
|
||||
|
||||
private Runnable maybePrevVimSearch(final CodeMirror cm) {
|
||||
return new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (cm.hasVimSearchHighlight()) {
|
||||
CodeMirror.handleVimKey(cm, "N");
|
||||
} else {
|
||||
commentManager.commentNav(cm, Direction.NEXT).run();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private Runnable maybeNextVimSearch(final CodeMirror cm) {
|
||||
return new Runnable() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user