Let 'c' add a comment on inline diffs even if not all diffs are expanded
Previously, the c key would only add a comment if all inline diffs were expanded, and hence the diff cursor was in effect. This change lets comments get added via the 'c' key even when not all diffs are expanded. Bug: Issue 7017 Change-Id: I443c5be29c6df2cc00b764b8152f0aed6e135f21
This commit is contained in:
@@ -534,7 +534,7 @@
|
||||
const isRangeSelected = this.diffs.some(diff => {
|
||||
return diff.isRangeSelected();
|
||||
}, this);
|
||||
if (this._showInlineDiffs && !isRangeSelected) {
|
||||
if (!isRangeSelected) {
|
||||
e.preventDefault();
|
||||
this._addDraftAtTarget();
|
||||
}
|
||||
|
||||
@@ -494,6 +494,10 @@ limitations under the License.
|
||||
MockInteractions.pressAndReleaseKeyOn(element, 75, null, 'k');
|
||||
assert.equal(element.$.fileCursor.index, 0);
|
||||
assert.equal(element.selectedIndex, 0);
|
||||
|
||||
sandbox.stub(element, '_addDraftAtTarget');
|
||||
MockInteractions.pressAndReleaseKeyOn(element, 67, null, 'c');
|
||||
assert.isTrue(element._addDraftAtTarget.called);
|
||||
});
|
||||
|
||||
test('i key shows/hides selected inline diff', () => {
|
||||
|
||||
Reference in New Issue
Block a user