Skip to content

Commit

Permalink
feat: implement sticky-context
Browse files Browse the repository at this point in the history
A lot more work has been put into this and those were 116 commits up to
this point.
I decided to squash all of them so that i will have an easier time
rebasing in the future.
  • Loading branch information
SoraTenshi committed Jul 27, 2024
1 parent e5372b0 commit 8ad3a03
Show file tree
Hide file tree
Showing 31 changed files with 1,184 additions and 249 deletions.
21 changes: 21 additions & 0 deletions book/src/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [`[editor.soft-wrap]` Section](#editorsoft-wrap-section)
- [`[editor.smart-tab]` Section](#editorsmart-tab-section)
- [`[editor.inline-diagnostics]` Section](#editorinline-diagnostics-section)
- [`[editor.sticky-context]` Section](#editorsticky-context-section)

### `[editor]` Section

Expand Down Expand Up @@ -433,3 +434,23 @@ end-of-line-diagnostics = "hint"
[editor.inline-diagnostics]
cursor-line = "warning" # show warnings and errors on the cursorline inline
```

### `[editor.sticky-context]` Section

Option for sticky context, which is a feature that puts bigger blocks of code
e.g. Functions to the top of the viewport

| Key | Description | Default |
| --- | --- | --- |
| `enable` | Display context of current line if outside the view | `false` |
| `indicator` | Display an additional line to indicate what part of the view is the sticky context | `false` |
| `max-lines` | The maximum number of lines to be shown as sticky context. 0 = 1/3 of the viewports height | `0` |

Example:

```toml
[editor.sticky-context]
enable = true
indicator = true
max-lines = 10
```
Loading

0 comments on commit 8ad3a03

Please sign in to comment.