дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 01:01:17 +02:00
The button sits left of the line's first non-space character, over the indent or the gutter, but the hover area started at the text and ended four characters in: moving the pointer to the button left the area and hid it before it could be clicked. The area now includes the gutter, and while the button is shown it reaches the button's right edge on that line. Fixes #6832
24 рядки
1.0 KiB
TypeScript
24 рядки
1.0 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { hoveredLine } from "./runToCursor";
|
|
|
|
describe("inlay Run to Cursor", () => {
|
|
const line = { number: 3, text: " foo()" };
|
|
it("targets a non-blank line when hovering its first characters", () => {
|
|
expect(hoveredLine(100, 8, 100, line)).toBe(2);
|
|
expect(hoveredLine(100, 8, 132, line)).toBe(2);
|
|
});
|
|
it("counts the gutter left of the text, as the button can sit over it", () => {
|
|
expect(hoveredLine(100, 8, 99, line)).toBe(2);
|
|
expect(hoveredLine(100, 8, 40, line)).toBe(2);
|
|
});
|
|
it("ignores the pointer further right and blank lines", () => {
|
|
expect(hoveredLine(100, 8, 133, line)).toBeNull();
|
|
expect(hoveredLine(100, 8, 104, { number: 4, text: " " })).toBeNull();
|
|
});
|
|
it("keeps the line on the way to a button drawn past the first characters (a deep indent)", () => {
|
|
const deep = { number: 7, text: " return x" };
|
|
expect(hoveredLine(100, 8, 200, deep, 226)).toBe(6);
|
|
expect(hoveredLine(100, 8, 227, deep, 226)).toBeNull();
|
|
});
|
|
});
|