Skip to content

Commit ed6e0ae

Browse files
committed
🚿 Remove deprecated features
1 parent 2dc0c48 commit ed6e0ae

File tree

5 files changed

+1
-171
lines changed

5 files changed

+1
-171
lines changed

β€Ždenops_std/buffer/buffer.ts

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -389,38 +389,7 @@ export interface ReplaceOptions {
389389
}
390390

391391
/**
392-
* Assign content to the buffer with given format and encoding.
393-
*
394-
* @deprecated Use `decode()` and `replace()` individually instead.
395-
*/
396-
export async function assign(
397-
denops: Denops,
398-
bufnr: number,
399-
data: Uint8Array,
400-
options: AssignOptions = {},
401-
): Promise<void> {
402-
const { content, fileformat, fileencoding } = await decode(
403-
denops,
404-
bufnr,
405-
data,
406-
options,
407-
);
408-
const preprocessor = options.preprocessor ?? ((v: string[]) => v);
409-
const repl = preprocessor(content);
410-
await replace(denops, bufnr, repl, {
411-
fileformat,
412-
fileencoding,
413-
});
414-
}
415-
416-
export interface AssignOptions extends DecodeOptions {
417-
preprocessor?: (repl: string[]) => string[];
418-
}
419-
420-
/**
421-
* Concrete the buffer
422-
*
423-
* This function will perform the followings
392+
* Concrete the buffer.
424393
*
425394
* - The `buftype` option become "nofile"
426395
* - The `swapfile` become disabled

β€Ždenops_std/buffer/buffer_test.ts

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { default as Encoding } from "https://cdn.skypack.dev/encoding-japanese@2
44
import * as fn from "../function/mod.ts";
55
import {
66
append,
7-
assign,
87
concrete,
98
decode,
109
ensure,
@@ -339,115 +338,6 @@ test({
339338
},
340339
});
341340

342-
await t.step({
343-
name: "assign()",
344-
fn: async (t) => {
345-
await t.step({
346-
name: "assings content to a buffer",
347-
fn: async () => {
348-
const bufnr = await fn.bufnr(denops);
349-
const encoder = new TextEncoder();
350-
await assign(
351-
denops,
352-
bufnr,
353-
encoder.encode(
354-
"こんにけわ\nδΈ–η•Œ\n",
355-
),
356-
);
357-
assertEquals([
358-
"こんにけわ",
359-
"δΈ–η•Œ",
360-
], await fn.getline(denops, 1, "$"));
361-
362-
await assign(
363-
denops,
364-
bufnr,
365-
encoder.encode(
366-
"δ»Šγ™γγƒ€γ‚¦γƒ³γƒ­γƒΌ\nド",
367-
),
368-
);
369-
assertEquals([
370-
"δ»Šγ™γγƒ€γ‚¦γƒ³γƒ­γƒΌ",
371-
"ド",
372-
], await fn.getline(denops, 1, "$"));
373-
},
374-
});
375-
await t.step({
376-
name: "assings content to a buffer with specified fileencoding",
377-
fn: async () => {
378-
const bufnr = await fn.bufnr(denops);
379-
const encode = (text: string, encoding: string): Uint8Array => {
380-
return new Uint8Array(
381-
Encoding.convert(
382-
Encoding.stringToCode(text),
383-
encoding,
384-
"UNICODE",
385-
),
386-
);
387-
};
388-
await assign(
389-
denops,
390-
bufnr,
391-
encode("こんにけわ\nδΈ–η•Œ\n", "sjis"),
392-
{
393-
fileencoding: "sjis",
394-
},
395-
);
396-
assertEquals([
397-
"こんにけわ",
398-
"δΈ–η•Œ",
399-
], await fn.getline(denops, 1, "$"));
400-
401-
await assign(
402-
denops,
403-
bufnr,
404-
encode("δ»Šγ™γγƒ€γ‚¦γƒ³γƒ­γƒΌ\nド", "euc-jp"),
405-
{
406-
fileencoding: "euc-jp",
407-
},
408-
);
409-
assertEquals([
410-
"δ»Šγ™γγƒ€γ‚¦γƒ³γƒ­γƒΌ",
411-
"ド",
412-
], await fn.getline(denops, 1, "$"));
413-
},
414-
});
415-
await t.step({
416-
name: "assings content to a buffer with specified fileformat",
417-
fn: async () => {
418-
const bufnr = await fn.bufnr(denops);
419-
const encoder = new TextEncoder();
420-
await assign(
421-
denops,
422-
bufnr,
423-
encoder.encode(
424-
"こんにけわ\r\nδΈ–η•Œ\r\n",
425-
),
426-
{
427-
fileformat: "dos",
428-
},
429-
);
430-
assertEquals([
431-
"こんにけわ",
432-
"δΈ–η•Œ",
433-
], await fn.getline(denops, 1, "$"));
434-
435-
await assign(
436-
denops,
437-
bufnr,
438-
encoder.encode(
439-
"δ»Šγ™γγƒ€γ‚¦γƒ³γƒ­γƒΌ\r\nド",
440-
),
441-
);
442-
assertEquals([
443-
"δ»Šγ™γγƒ€γ‚¦γƒ³γƒ­γƒΌ",
444-
"ド",
445-
], await fn.getline(denops, 1, "$"));
446-
},
447-
});
448-
},
449-
});
450-
451341
await t.step({
452342
name: "concrete concretes the buffer and the content become persistent",
453343
fn: async () => {

β€Ždenops_std/helper/batch.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

β€Ždenops_std/helper/mod.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*
44
* @module
55
*/
6-
export * from "./batch.ts";
76
export * from "./echo.ts";
87
export * from "./execute.ts";
98
export * from "./load.ts";

β€Ždenops_std/test/mod.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
Β (0)