Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split support #691

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
3713a5c
allow render multiple rich text
raphamorim Sep 28, 2024
5954cae
map rich texts from objects
raphamorim Sep 28, 2024
11f7e2b
add TODO about dimensions
raphamorim Sep 28, 2024
d4e827a
render text in different areas
raphamorim Sep 28, 2024
6be811c
clear render data on clear
raphamorim Sep 28, 2024
2cfdaef
add to text example
raphamorim Sep 28, 2024
b6b8f71
integrate with rio
raphamorim Sep 28, 2024
2ddcf7e
add hooks for macos
raphamorim Sep 28, 2024
5ca2921
add split config
raphamorim Sep 28, 2024
ddfacd6
add split.rs
raphamorim Sep 29, 2024
a6de579
change the api to use sel()
raphamorim Sep 29, 2024
d35a8d7
simplify stuff
raphamorim Sep 29, 2024
c1d06f3
remove unnecessary stuff
raphamorim Sep 29, 2024
6897286
fix line compute
raphamorim Sep 29, 2024
d3039a3
introduce renderable
raphamorim Sep 30, 2024
b88ba62
remove unncessary borrow on draw_layout
raphamorim Oct 2, 2024
bcd99c5
disable line render for now
raphamorim Oct 4, 2024
8ae110f
add CloseRequested for windows/linux
raphamorim Oct 4, 2024
a3040d4
layout as part of rte
raphamorim Oct 4, 2024
987950c
use scaled font size
raphamorim Oct 5, 2024
c8b27cf
build dimensions on content
raphamorim Oct 5, 2024
bbcf50f
work in progress
raphamorim Oct 5, 2024
56d72ca
add width and height for layout
raphamorim Oct 5, 2024
57d2f88
remove many properties from global layout struct
raphamorim Oct 5, 2024
6dd23aa
rename SugarloafLayout to RootStyle
raphamorim Oct 5, 2024
3812389
start refactoring context
raphamorim Oct 5, 2024
ccb8ba2
refactor contextdimension
raphamorim Oct 5, 2024
c382bfb
retrieve objects from grid
raphamorim Oct 6, 2024
f2112a5
margin should be on root
raphamorim Oct 6, 2024
8169802
add a single test
raphamorim Oct 6, 2024
6a699f4
wip quad
raphamorim Oct 7, 2024
df095bf
plug split_right function
raphamorim Oct 7, 2024
e7a20fa
split right (basic poc functionality)
raphamorim Oct 7, 2024
16ea4fe
update split right test
raphamorim Oct 7, 2024
4433044
if configuration is triggered then split right
raphamorim Oct 8, 2024
d7a6147
remove unnecessary stuff
raphamorim Oct 8, 2024
23c6eb7
use rich_text_id on layout properties
raphamorim Oct 8, 2024
1503b01
select next and prev split
raphamorim Oct 8, 2024
2ff7131
change panel style
raphamorim Oct 8, 2024
a17d7f5
change format on contextgrid
raphamorim Oct 8, 2024
b57e97d
update docs
raphamorim Oct 8, 2024
eb66233
update docs
raphamorim Oct 8, 2024
6214ca8
update api
raphamorim Oct 8, 2024
bee398c
use cursor from rendereable content
raphamorim Oct 9, 2024
34753d1
resize start
raphamorim Oct 10, 2024
f8eac7a
remove extra padding
raphamorim Oct 10, 2024
2c04b7d
fix old right/down reference
raphamorim Oct 12, 2024
a40356e
readd has_regained_focus redraw
raphamorim Oct 13, 2024
dcc66cd
rescale (fix dpi change issue)
raphamorim Oct 13, 2024
d3f2414
key bindings for linux and windows
raphamorim Oct 13, 2024
16a462e
format code
raphamorim Oct 14, 2024
97f7a3c
fix other examples on sugarloaf
raphamorim Oct 14, 2024
c658393
use route_id as topic id
raphamorim Oct 15, 2024
e034b4d
update releases.md
raphamorim Oct 16, 2024
b98745a
return line implementation
raphamorim Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 32 additions & 35 deletions docs/docs/config/bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You can see the default [default key bindings](/docs/default-key-bindings)

Rio allows you to add new keybindings and overwrite any default key bindings.

Keybinds are built using the following trigger fields:
Bindings are built using the following trigger fields:

| Name | Description |
| ------------- | --------------- |
Expand All @@ -34,7 +34,7 @@ keys = [
]
```

### [Key](#key)
## [Key](#key)

Each value in key binding will specify an identifier of the key pressed:

Expand All @@ -48,43 +48,40 @@ Each value in key binding will specify an identifier of the key pressed:
- `numpadenter` `numpadadd` `numpadcomma` `numpaddivide` `numpadequals` `numpadsubtract` `numpadmultiply`
- `numpad1` `numpad2` `numpad3` `numpad4` `numpad5` `numpad6` `numpad7` `numpad8` `numpad9` `numpad0`

### [Action](#action)
## [Action](#action)

Execute a predefined action in Rio terminal.

#### [Basic Actions](#basic-actions)
### [Basic Actions](#basic-actions)

| Action | Description |
| :--------------- | :---------------------------------------------------------------------------- |
| None | |
| ReceiveChar | |
| ToggleVIMode | |
| Paste | Paste command |
| Copy | |
| OpenConfigEditor | |
| Copy | Copy command |
| OpenConfigEditor | Open configuration file on configured editor property |
| ResetFontSize | |
| IncreaseFontSize | |
| DecreaseFontSize | |
| Run(string) | Example: Running command `Run(code)` or `Run(code ~/.config/rio/config.toml)` |
| PasteSelection | |
| ClearSelection | |
| CreateWindow | Create a Rio window instance |
| Quit | Exit Rio |

#### [Window Actions](#window-actions)
### [Split Actions](#split-actions)

| Action | Description |
| :----------- | :---------- |
| CreateWindow | |
| Quit | |

#### [Pane Actions](#pane-actions)

| Action | Description |
| :---------------- | :---------- |
| SplitHorizontally | |
| SplitVertically | |
| ClosePane | |
| Action | Description |
| :----------------- | :------------------------------------------------------------------------- |
| SplitRigh | Create a split by right side |
| SplitDown | Create a split by under current pane |
| SelectNextSplit | Select next split |
| SelectPrevSplit | Select previous split |
| CloseSplitOrTab | Close split, if split is the last then will close the tab |

#### [Tab Actions](#tab-actions)
### [Tab Actions](#tab-actions)

| Action | Description |
| :------------------- | :------------------------------------------------------------------ |
Expand All @@ -96,7 +93,7 @@ Execute a predefined action in Rio terminal.
| SelectLastTab | |
| SelectTab(tab_index) | Example: Select first tab `SelectTab(0)`, second tab `SelectTab(1)` |

#### [Scroll Actions](#scroll-actions)
### [Scroll Actions](#scroll-actions)

| Action | Description |
| :----------------- | :------------------------------------------------------------------------- |
Expand All @@ -108,29 +105,29 @@ Execute a predefined action in Rio terminal.
| ScrollToTop | |
| ScrollToBottom | |

### [Search](#search)
### [Search Actions](#search-actions)

| Action | Description |
| :----------------- | :------------------------------------------------------------------------- |
| SearchForward | |
| SearchBackward | |
| SearchConfirm | |
| SearchClear | |
| SearchFocusNext | |
| SearchFocusPrevious | |
| SearchDeleteWord | |
| SearchHistoryNext | |
| SearchHistoryPrevious | |
| SearchBackward | |
| SearchConfirm | |
| SearchClear | |
| SearchFocusNext | |
| SearchFocusPrevious | |
| SearchDeleteWord | |
| SearchHistoryNext | |
| SearchHistoryPrevious | |

### [Bytes](#bytes)
## [Bytes](#bytes)

Send a byte sequence to the running application.

The `bytes` field writes the specified string to the terminal. This makes
it possible to pass escape sequences, like `PageUp` ("\x1b[5~"). Note that applications use terminfo to map escape sequences back
to keys. It is therefore required to update the terminfo when changing an escape sequence.

### [With](#with)
## [With](#with)

Key modifiers to filter binding actions

Expand All @@ -157,7 +154,7 @@ with = "control | shift"
A `~` operator can be used before a mode to apply the binding whenever
the mode is *not* active, e.g. `~Alt`. -->

### [Mode](#mode)
## [Mode](#mode)

There is currently four different modes:

Expand All @@ -176,7 +173,7 @@ keys = [
]
```

### [Text](#text)
## [Text](#text)

`text` can be used to write specific text on key press:

Expand All @@ -188,7 +185,7 @@ keys = [
]
```

### [Overwriting](#overwriting)
## [Overwriting](#overwriting)

Bindings are always filled by default, but will be replaced when a new binding with the same triggers is defined. To unset a default binding, it can be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for a no-op if you do not wish to receive input characters for that binding.

Expand Down
25 changes: 20 additions & 5 deletions docs/docs/config/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ language: 'en'
- `clickable` - Enable click on tabs to switch.
- `use-current-path` - Use same path whenever a new tab is created (Note: requires [`use-fork`](/docs/config/use-fork) to be set to false).
- `color-automation` - Set a specific color for the tab whenever a specific program is running, or in a specific directory.
- `use-split` - Enable split panels feature.

```toml
[navigation]
Expand All @@ -15,8 +16,11 @@ clickable = false
hide-if-single = true
use-current-path = false
color-automation = []
use-split = true
```

## Mode

Rio has multiple styles of showing navigation/tabs.

### Bookmark
Expand Down Expand Up @@ -90,7 +94,18 @@ Usage:
mode = "Plain"
```

### Hide if is only one tab
## Split

Enable split feature. It is enabled by default.

```toml
[navigation]
use-split = true
```

![Demo split](/assets/features/demo-split.png)

## Hide if is only one tab

The property `hide-if-single` hides navigation UI if there is only one tab. It does not work for `NativeTab`.

Expand All @@ -101,7 +116,7 @@ Default is `true`.
hide-if-single = true
```

### Color automation for navigation
## Color automation for navigation

Rio supports specifying the color of tabs using the `program` and `path` options.

Expand All @@ -119,7 +134,7 @@ color-automation = [
]
```

#### Program
### Program

The example below sets `#FFFF00` as color background whenever `nvim` is running.

Expand All @@ -138,7 +153,7 @@ color-automation = [
]
```

#### Path
### Path

The example below sets `#FFFF00` as color background when in the `/home/geg/.config/rio` path.

Expand All @@ -159,7 +174,7 @@ color-automation = [
<img alt="example navigation with path color automation using Bookmark" src="/rio/assets/features/demo-colorized-navigation-path-2.png" width="48%"/>
</p>

#### Program and path
### Program and path

It is possible to use both `path` and `program` at the same time.

Expand Down
16 changes: 14 additions & 2 deletions docs/docs/default-key-bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ language: 'en'
| Select the last tab | `Command + 9` |
| Search forward | `Command + f` |
| Search backward | `Command + b` |
| Split right | `Command + d` |
| Split down | `Command + Shift + d` |
| Select next split | `Command + ]` |
| Select prev split | `Command + [` |

### Windows

Expand Down Expand Up @@ -62,6 +66,10 @@ language: 'en'
| Select the last tab | `Control + Shift + 9` |
| Search forward | `Control + Shift + f` |
| Search backward | `Control + Shift + b` |
| Split right | `Control + Shift + r` |
| Split down | `Control + Shift + d` |
| Select next split | `Control + Shift + ]` |
| Select prev split | `Control + Shift + [` |

### Linux and BSD

Expand All @@ -88,8 +96,12 @@ language: 'en'
| Select the seventh tab | `Control + Shift + 7` |
| Select the eighth tab | `Control + Shift + 8` |
| Select the last tab | `Control + Shift + 9` |
| Search forward | `Control + Shift + f` |
| Search backward | `Control + Shift + b` |
| Search forward | `Control + Shift + f` |
| Search backward | `Control + Shift + b` |
| Split right | `Control + Shift + r` |
| Split down | `Control + Shift + d` |
| Select next split | `Control + Shift + ]` |
| Select prev split | `Control + Shift + [` |

### Search

Expand Down
1 change: 1 addition & 0 deletions docs/docs/features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ Short introduction of Rio terminal features.
- [Color automation for navigation](/docs/features/color-automation-for-navigation)
- [Sixel protocol](/docs/features/sixel-protocol)
- [Spawn or Fork](/docs/features/spawn-or-fork)
- [Split panels](/docs/features/split-panels)

Note: Many other features are in development.
13 changes: 13 additions & 0 deletions docs/docs/features/split-panels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: 'Split panels'
language: 'en'
---

Rio supports split feature and it is enabled by default.

```toml
[navigation]
use-split = true
```

![Demo split](/assets/features/demo-split.png)
3 changes: 3 additions & 0 deletions docs/docs/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ language: 'en'

## Unreleased

- Initial split support.
- Added `SplitDown`, `SplitRight`, `CloseSplitOrTab`, `SelectNextSplit` and `SelectPrevSplit` actions.
- Major rewrite of sugarloaf font glyph logic.
- Fix: Window doesn't receive mouse events on Windows 11 by [@igorsaux](https://github.com/igorsaux).
- Support to hex RGBA (example: `#43ff64d9`) on colors/theme by [@bio](https://github.com/bio) on [#696](https://github.com/raphamorim/rio/pull/696).

Expand Down
Binary file added docs/static/assets/features/demo-split.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading