Skip to content

Commit

Permalink
docs: complete folder:File
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Jan 7, 2024
1 parent 325f239 commit 1053da7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/plugin/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,35 @@ Properties:

### `folder::Folder`

- cwd
- offset
- cursor
- window
- files
- hovered

### `folder::Files`

Meta methods:

- `__len()`
- `__pairs()`

### `folder:File`

Based on [File](#file), with the following additional methods:

- `size()` - The size of this file
- `mime()` - The mime-type of this file
- `prefix()` - The prefix of this file relative to `CWD`, which used in the flat view during search. For instance, if `CWD` is `/foo`, and the file is `/foo/bar/baz`, then the prefix is `bar/`
- `icon()` - The icon of this file, [`[icons]`](../configuration/theme.md#icons) rules is applied
- `style()` - The style of this file, [`[filetype]`](../configuration/theme.md#filetype) rules is applied
- `is_hovered()` - Whether this file is hovered
- `is_yanked()` - Whether this file is yanked
- `is_selected()` - Whether this file is selected
- `found()` - When users find a file using the `find` command, the status of the file - returns `nil` if it doesn't match the user's find keyword; otherwise, returns `{idx, all}`, where `idx` is the position of matched file, and `all` represents the number of all matched files.
- `highlights()` - TODO

### `manager::Tabs`

Properties:
Expand Down

0 comments on commit 1053da7

Please sign in to comment.