Skip to content

Commit

Permalink
fix insert-before annotation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahhh committed Dec 16, 2024
1 parent a1656ce commit 867a6ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ function performAction(
newWorkspace.splice(target.index + 1, 0, [pickedItem]);
annotation = {
type: "workspace-pick",
src: [source, pickedIndex],
src: [source >= target.index + 1 ? source + 1 : source, pickedIndex],
dst: [target.index + 1, 0],
};
} else {
Expand Down
5 changes: 4 additions & 1 deletion src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from "./edits";
import {
Action,
ActionAnnotation,
Definitions,
Flowchart,
Frame,
Expand Down Expand Up @@ -707,7 +708,9 @@ async function main() {
const lyrTop = lyr.spawnLater(); // so drop target lines go above the contents

const contents = scene.value.contents;
let annotation = undefined;
let annotation:
| (ActionAnnotation & { type: "workspace-pick" })
| undefined = undefined;
if (scene.actionAnnotation?.type === "workspace-pick") {
annotation = scene.actionAnnotation;
}
Expand Down

0 comments on commit 867a6ab

Please sign in to comment.