Skip to content

Commit d4a3a61

Browse files
committed
πŸ“ Move description of buffer name format
It seems deno doc does not support module doc thus move it to `Bufname` comment
1 parent d59c0e8 commit d4a3a61

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

β€Ždenops_std/bufname/bufname.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,48 @@ import { bufnameUnusablePattern, decode, encode } from "./utils.ts";
22

33
export type BufnameParams = Record<string, string | string[] | undefined>;
44

5+
/**
6+
* Represent Vim's buffer name
7+
*
8+
* The format of the buffer name assumed is like
9+
*
10+
* ```text
11+
* {scheme}://{expr}[;{params}][#{fragment}]
12+
* ```
13+
*
14+
* Where
15+
*
16+
* - `{scheme}` is used to distinguish a buffer kind. It contains only alphabet
17+
* characters.
18+
* - `{expr}` is used to identify a buffer itself. Unusable characters, semicolons
19+
* (;), and sharps (#) are replaced with percent-encoded characters.
20+
* - `{params}` (Optional) is used to add meta information to the buffer name like
21+
* query parameters of URL. Unusable characters and sharps (#) are replaced with
22+
* percent-encoded characters.
23+
* - `{fragment}` (Optional) is used to add a suffix to the buffer name for file
24+
* type detection or so on. Unusable characters are replaced with percent-encoded
25+
* characters.
26+
*
27+
* For example,
28+
*
29+
* ```text
30+
* denops:///Users/John Titor/test.git
31+
* β””β”€β”¬β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
32+
* scheme expr
33+
*
34+
* denops:///Users/John Titor/test.git;foo=foo&bar=bar1&bar=bar2
35+
* β””β”€β”¬β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
36+
* scheme expr params
37+
*
38+
* denops:///Users/John Titor/test.git#README.md
39+
* β””β”€β”¬β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜
40+
* scheme expr fragment
41+
*
42+
* denops:///Users/John Titor/test.git;foo=foo&bar=bar1&bar=bar2#README.md
43+
* β””β”€β”¬β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜
44+
* scheme expr params fragment
45+
* ```
46+
*/
547
export type Bufname = {
648
// Scheme part of a buffer name. Note that Vim supports only alphabets in scheme part.
749
scheme: string;

β€Ždenops_std/bufname/mod.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1 @@
1-
/**
2-
* A module to provide functions to handle Vim's buffer name.
3-
*
4-
* The format of the buffer name assumed in this module is like
5-
*
6-
* ```text
7-
* {scheme}://{expr}[;{params}][#{fragment}]
8-
* ```
9-
*
10-
* Where
11-
*
12-
* - `{scheme}` is used to distinguish a buffer kind. It contains only alphabet
13-
* characters.
14-
* - `{expr}` is used to identify a buffer itself. Unusable characters, semicolons
15-
* (;), and sharps (#) are replaced with percent-encoded characters.
16-
* - `{params}` (Optional) is used to add meta information to the buffer name like
17-
* query parameters of URL. Unusable characters and sharps (#) are replaced with
18-
* percent-encoded characters.
19-
* - `{fragment}` (Optional) is used to add a suffix to the buffer name for file
20-
* type detection or so on. Unusable characters are replaced with percent-encoded
21-
* characters.
22-
*
23-
* For example,
24-
*
25-
* ```text
26-
* denops:///Users/John Titor/test.git
27-
* β””β”€β”¬β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
28-
* scheme expr
29-
*
30-
* denops:///Users/John Titor/test.git;foo=foo&bar=bar1&bar=bar2
31-
* β””β”€β”¬β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
32-
* scheme expr params
33-
*
34-
* denops:///Users/John Titor/test.git#README.md
35-
* β””β”€β”¬β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜
36-
* scheme expr fragment
37-
*
38-
* denops:///Users/John Titor/test.git;foo=foo&bar=bar1&bar=bar2#README.md
39-
* β””β”€β”¬β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”¬β”€β”€β”€β”˜
40-
* scheme expr params fragment
41-
* ```
42-
*/
431
export * from "./bufname.ts";

0 commit comments

Comments
Β (0)