Skip to content

Commit 2579b12

Browse files
committed
feat: change default fail symbol
1 parent 32c272e commit 2579b12

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

denops/fall/component/input.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as fn from "jsr:@denops/std@^7.3.2/function";
33
import * as buffer from "jsr:@denops/std@^7.3.2/buffer";
44
import type { Dimension } from "jsr:@vim-fall/core@^0.3.0/coordinator";
55

6-
import { Spinner } from "../lib/spinner.ts";
6+
import { Spinner, UNICODE_SPINNER } from "../lib/spinner.ts";
77
import { adjustOffset } from "../lib/adjust_offset.ts";
88
import { getByteLength } from "../lib/stringutil.ts";
99
import { BaseComponent, type ComponentProperties } from "./_component.ts";
@@ -12,6 +12,10 @@ export const HIGHLIGHT_HEADER = "FallInputHeader";
1212
export const HIGHLIGHT_CURSOR = "FallInputCursor";
1313
export const HIGHLIGHT_COUNTER = "FallInputCounter";
1414

15+
const HEAD_SYMBOL = ">";
16+
const FAIL_SYMBOL = "✕";
17+
const SPINNER = UNICODE_SPINNER;
18+
1519
/**
1620
* Parameters for the InputComponent, extending ComponentProperties.
1721
* Includes properties specific to the input component like title, spinner, and symbols.
@@ -50,7 +54,7 @@ export type InputComponentParams = ComponentProperties & {
5054
* └ spinner └ truncated
5155
*
5256
* ╭─────────────────────────────────╮
53-
* │> QUE█Y 0/0X
57+
* │> QUE█Y 0/0✕
5458
* ╰────────────────────────────────┊╯
5559
* └ failSymbol
5660
* ```
@@ -78,9 +82,9 @@ export class InputComponent extends BaseComponent {
7882
) {
7983
super(params);
8084
this.#title = title ?? "";
81-
this.#spinner = new Spinner(spinner);
82-
this.#headSymbol = headSymbol ?? ">";
83-
this.#failSymbol = failSymbol ?? "X";
85+
this.#spinner = new Spinner(spinner ?? SPINNER);
86+
this.#headSymbol = headSymbol ?? HEAD_SYMBOL;
87+
this.#failSymbol = failSymbol ?? FAIL_SYMBOL;
8488
}
8589

8690
/** The title of the input component */

denops/fall/component/input_test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ test({
501501
await component.render(denops);
502502
await denops.cmd("redraw");
503503
assertEquals(await fn.getbufline(denops, info.bufnr, 1, "$"), [
504-
"X Hello 0/0",
504+
" Hello 0/0",
505505
]);
506506
});
507507

@@ -544,14 +544,14 @@ test({
544544
await component.render(denops);
545545
await denops.cmd("redraw");
546546
assertEquals(await fn.getbufline(denops, info.bufnr, 1, "$"), [
547-
"> Hel 1/2 X",
547+
"> Hel 1/2 ",
548548
]);
549549

550550
component.truncated = true;
551551
await component.render(denops);
552552
await denops.cmd("redraw");
553553
assertEquals(await fn.getbufline(denops, info.bufnr, 1, "$"), [
554-
"> el 1/2+ X",
554+
"> el 1/2+ ",
555555
]);
556556
});
557557
});

0 commit comments

Comments
 (0)