Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backmerge: #6272 - Cursor position after adding preset in sequence mode causes an incorrect sequence formation #6437

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,6 @@ export class SequenceMode extends BaseMode {
const history = new EditorHistory(editor);
const modelChanges = new Command();
const selections = SequenceRenderer.selections;
const wasCanvasEmptyBeforeInsertion = SequenceRenderer.isEmptyCanvas();

if (selections.length > 0) {
if (this.isSelectionsContainAntisenseChains(selections)) {
Expand Down Expand Up @@ -1760,11 +1759,6 @@ export class SequenceMode extends BaseMode {
);
history.update(modelChanges);
}

if (wasCanvasEmptyBeforeInsertion) {
this.turnOnEditMode();
SequenceRenderer.moveCaretForward();
}
}

private createRnaPresetNode(preset: IRnaPreset, position: Vec2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ export class SequenceRenderer {

SequenceRenderer.forEachNode(({ twoStrandedNode, nodeIndexOverall }) => {
if (
twoStrandedNode.senseNode?.monomer === monomer ||
twoStrandedNode.antisenseNode?.monomer === monomer
twoStrandedNode.senseNode?.monomers.includes(monomer) ||
twoStrandedNode.antisenseNode?.monomers.includes(monomer)
) {
newCaretPosition = nodeIndexOverall;
}
Expand All @@ -483,8 +483,8 @@ export class SequenceRenderer {

SequenceRenderer.forEachNode(({ twoStrandedNode, nodeIndexOverall }) => {
if (
twoStrandedNode.senseNode?.monomer === monomer ||
twoStrandedNode.antisenseNode?.monomer === monomer
twoStrandedNode.senseNode?.monomers.includes(monomer) ||
twoStrandedNode.antisenseNode?.monomers.includes(monomer)
) {
newCaretPosition = nodeIndexOverall;
}
Expand Down Expand Up @@ -1154,8 +1154,8 @@ export class SequenceRenderer {

SequenceRenderer.forEachNode(({ twoStrandedNode }) => {
if (
twoStrandedNode.senseNode?.monomer === monomer ||
twoStrandedNode.antisenseNode?.monomer === monomer
twoStrandedNode.senseNode?.monomers.includes(monomer) ||
twoStrandedNode.antisenseNode?.monomers.includes(monomer)
) {
rendererToReturn =
twoStrandedNode.senseNode?.renderer ||
Expand Down
Loading