Skip to content

Commit

Permalink
Fix source editing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny-Hui committed Aug 8, 2024
1 parent 76e52f4 commit 1ca6a54
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/layout/Project.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
</div>

<div>
<Editor selectedFile={$selectedFile}/>
<Editor />
</div>
</main>

Expand Down
7 changes: 3 additions & 4 deletions src/components/layout/editor/Editor.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script lang="ts">
import type { Unit, TranslationFile } from "../../../../lib/types";
import Listing from "./listing/Listing.svelte";
import EditingPane from "./editing/EditingPane.svelte";
import SuggestionPane from "./subpane/SuggestionPane.svelte";
export let selectedFile: TranslationFile;
import { selectedFile } from "../../../stores/data";
let editingPane: EditingPane;
function setTargetText(event) {
Expand All @@ -17,10 +16,10 @@
<Listing />
</div>
<div class="editor">
<EditingPane bind:this={editingPane} {selectedFile}/>
<EditingPane bind:this={editingPane} selectedFile={$selectedFile}/>
</div>
<div class="suggestion">
<SuggestionPane on:applyTargetText={setTargetText} {selectedFile}/>
<SuggestionPane on:applyTargetText={setTargetText} selectedFile={$selectedFile}/>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/editor/editing/EditingPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
if(unit == null) {
setTargetText("");
} else {
setTargetText(unit.target ?? (selectedFile?.isSource ? unit.source : ""));
setTargetText(selectedFile?.isSource ? unit.source : unit.target);
}
}
Expand Down

0 comments on commit 1ca6a54

Please sign in to comment.