Skip to content

Commit

Permalink
fixes #45
Browse files Browse the repository at this point in the history
  • Loading branch information
dlants committed Feb 4, 2025
1 parent 0092cac commit 27f9822
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 0 additions & 4 deletions node/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export class Sidebar {
split: sidebarPosition,
width: WIDTH,
height: displayHeight,
style: "minimal",
},
])) as WindowId;
const displayWindow = new NvimWindow(displayWindowId, this.nvim);
Expand All @@ -118,7 +117,6 @@ export class Sidebar {
split: "below",
width: WIDTH,
height: inputHeight,
style: "minimal",
},
])) as WindowId;

Expand All @@ -134,8 +132,6 @@ export class Sidebar {
const winOptions = {
wrap: true,
linebreak: true,
number: false,
relativenumber: false,
cursorline: true,
};

Expand Down
13 changes: 13 additions & 0 deletions node/tools/diff.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import type { Line } from "../nvim/buffer";
describe("node/tools/diff.spec.ts", () => {
it("insert into new file", async () => {
await withDriver(async (driver) => {
await driver.nvim.call("nvim_set_option_value", [
"relativenumber",
true,
{},
]);

await driver.showSidebar();
await driver.inputMagentaText(
`Write me a short poem in the file poem.txt`,
Expand Down Expand Up @@ -47,6 +53,7 @@ describe("node/tools/diff.spec.ts", () => {
});

expect(await poemWin.getOption("diff")).toBe(true);
expect(await poemWin.getOption("relativenumber")).toBe(true);

const poemText = (
await (await poemWin.buffer()).getLines({ start: 0, end: -1 })
Expand Down Expand Up @@ -118,6 +125,11 @@ describe("node/tools/diff.spec.ts", () => {

it("replace in existing file", async () => {
await withDriver(async (driver) => {
await driver.nvim.call("nvim_set_option_value", [
"relativenumber",
true,
{},
]);
await driver.showSidebar();
await driver.inputMagentaText(
`Update the poem in the file node/test/fixtures/poem.txt`,
Expand Down Expand Up @@ -164,6 +176,7 @@ Paints its colors in the light.`,
});

expect(await poemWin.getOption("diff")).toBe(true);
expect(await poemWin.getOption("relativenumber")).toBe(true);

const poemText = (
await (await poemWin.buffer()).getLines({ start: 0, end: -1 })
Expand Down
2 changes: 0 additions & 2 deletions node/tools/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export async function displayDiffs({
win: -1, // global split
split: "right",
width: WIDTH,
style: "minimal",
},
])) as WindowId;

Expand Down Expand Up @@ -130,7 +129,6 @@ export async function displayDiffs({
win: fileWindowId, // global split
split: "left",
width: WIDTH,
style: "minimal",
},
]);

Expand Down

0 comments on commit 27f9822

Please sign in to comment.