Commit 2918e9299c
Unregistered key
Layout: unified · split
Cargo.lock +74 −12
| @@ -1622,12 +1622,14 @@ dependencies = [ | |||
| 1622 | 1622 | ||
| 1623 | [[package]] | 1623 | [[package]] |
| 1624 | name = "editor-types" | 1624 | name = "editor-types" |
| 1625 | version = "0.0.5" | 1625 | version = "0.0.6" |
| 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1627 | checksum = "9f826643f7fa44f8ba305301de9fba0215aa4d1f069d15a19d98d67bc71570b5" | 1627 | checksum = "687ec495f9b4b64810edb5ce1ef7166e79e7cec40bc5ab961d9dcde895e97e4b" |
| 1628 | dependencies = [ | 1628 | dependencies = [ |
| 1629 | "anyhow", | ||
| 1629 | "bitflags 2.13.2", | 1630 | "bitflags 2.13.2", |
| 1630 | "editor-types-macros", | 1631 | "editor-types-macros", |
| 1632 | "editor-types-parser", | ||
| 1631 | "enum-map", | 1633 | "enum-map", |
| 1632 | "keybindings", | 1634 | "keybindings", |
| 1633 | "regex", | 1635 | "regex", |
| @@ -1635,12 +1637,11 @@ dependencies = [ | |||
| 1635 | 1637 | ||
| 1636 | [[package]] | 1638 | [[package]] |
| 1637 | name = "editor-types-macros" | 1639 | name = "editor-types-macros" |
| 1638 | version = "0.0.5" | 1640 | version = "0.0.6" |
| 1639 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1641 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1640 | checksum = "fc2388897d6842fe58a567b8a7b4deabda77ce1129f5a2de88e7b94a88f0c76f" | 1642 | checksum = "7b5930990ea80a57334a6999d086d2df28a5b67748c32479f0cb1cca8c5d9461" |
| 1641 | dependencies = [ | 1643 | dependencies = [ |
| 1642 | "editor-types-parser", | 1644 | "editor-types-parser", |
| 1643 | "nom 8.0.0", | ||
| 1644 | "proc-macro2", | 1645 | "proc-macro2", |
| 1645 | "quote", | 1646 | "quote", |
| 1646 | "syn 3.0.6", | 1647 | "syn 3.0.6", |
| @@ -1648,12 +1649,14 @@ dependencies = [ | |||
| 1648 | 1649 | ||
| 1649 | [[package]] | 1650 | [[package]] |
| 1650 | name = "editor-types-parser" | 1651 | name = "editor-types-parser" |
| 1651 | version = "0.0.5" | 1652 | version = "0.0.6" |
| 1652 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1653 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1653 | checksum = "65739071a9f3f74a960551ad8a388d16d2c9546c1e9c0ce011e3c4d9ff93a84d" | 1654 | checksum = "86caf8408696409d3d6f58c1165ecc21a39effb55cb5c708742cc0c12f18e7eb" |
| 1654 | dependencies = [ | 1655 | dependencies = [ |
| 1655 | "nom 8.0.0", | 1656 | "logos", |
| 1657 | "pomelo", | ||
| 1656 | "thiserror 2.0.20", | 1658 | "thiserror 2.0.20", |
| 1659 | "unescape_zero_copy", | ||
| 1657 | ] | 1660 | ] |
| 1658 | 1661 | ||
| 1659 | [[package]] | 1662 | [[package]] |
| @@ -3225,6 +3228,38 @@ version = "0.4.34" | |||
| 3225 | source = "registry+https://github.com/rust-lang/crates.io-index" | 3228 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3226 | checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" | 3229 | checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" |
| 3227 | 3230 | ||
| 3231 | [[package]] | ||
| 3232 | name = "logos" | ||
| 3233 | version = "0.16.1" | ||
| 3234 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 3235 | checksum = "eb2c55a318a87600ea870ff8c2012148b44bf18b74fad48d0f835c38c7d07c5f" | ||
| 3236 | dependencies = [ | ||
| 3237 | "logos-derive", | ||
| 3238 | ] | ||
| 3239 | |||
| 3240 | [[package]] | ||
| 3241 | name = "logos-codegen" | ||
| 3242 | version = "0.16.1" | ||
| 3243 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 3244 | checksum = "58b3ffaa284e1350d017a57d04ada118c4583cf260c8fb01e0fe28a2e9cf8970" | ||
| 3245 | dependencies = [ | ||
| 3246 | "fnv", | ||
| 3247 | "proc-macro2", | ||
| 3248 | "quote", | ||
| 3249 | "regex-automata", | ||
| 3250 | "regex-syntax", | ||
| 3251 | "syn 2.0.119", | ||
| 3252 | ] | ||
| 3253 | |||
| 3254 | [[package]] | ||
| 3255 | name = "logos-derive" | ||
| 3256 | version = "0.16.1" | ||
| 3257 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 3258 | checksum = "52d3a9855747c17eaf4383823f135220716ab49bea5fbea7dd42cc9a92f8aa31" | ||
| 3259 | dependencies = [ | ||
| 3260 | "logos-codegen", | ||
| 3261 | ] | ||
| 3262 | |||
| 3228 | [[package]] | 3263 | [[package]] |
| 3229 | name = "loop9" | 3264 | name = "loop9" |
| 3230 | version = "0.1.5" | 3265 | version = "0.1.5" |
| @@ -3815,10 +3850,11 @@ dependencies = [ | |||
| 3815 | 3850 | ||
| 3816 | [[package]] | 3851 | [[package]] |
| 3817 | name = "modalkit" | 3852 | name = "modalkit" |
| 3818 | version = "0.0.30" | 3853 | version = "0.0.31" |
| 3819 | source = "registry+https://github.com/rust-lang/crates.io-index" | 3854 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3820 | checksum = "7906e266d10ebe501fa0afb585fcfa180012067679c558460e07014e828ff9d0" | 3855 | checksum = "8b83364f3f8da5c3b42911179519ac7dafed42ff09b5be31d2f68ffb6732f287" |
| 3821 | dependencies = [ | 3856 | dependencies = [ |
| 3857 | "anyhow", | ||
| 3822 | "anymap2", | 3858 | "anymap2", |
| 3823 | "arboard", | 3859 | "arboard", |
| 3824 | "bitflags 2.13.2", | 3860 | "bitflags 2.13.2", |
| @@ -3839,9 +3875,9 @@ dependencies = [ | |||
| 3839 | 3875 | ||
| 3840 | [[package]] | 3876 | [[package]] |
| 3841 | name = "modalkit-ratatui" | 3877 | name = "modalkit-ratatui" |
| 3842 | version = "0.0.30" | 3878 | version = "0.0.31" |
| 3843 | source = "registry+https://github.com/rust-lang/crates.io-index" | 3879 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3844 | checksum = "dc12f79c2070f1bfbadf97f93f338308b25416c1f8b8a943112db4974d7fed15" | 3880 | checksum = "b98b10507e0a800195aa26e1d1ff85a68fdfa4a91961456f7d803e1453885e12" |
| 3845 | dependencies = [ | 3881 | dependencies = [ |
| 3846 | "crossterm 0.29.0", | 3882 | "crossterm 0.29.0", |
| 3847 | "enum-map", | 3883 | "enum-map", |
| @@ -4517,6 +4553,26 @@ dependencies = [ | |||
| 4517 | "universal-hash", | 4553 | "universal-hash", |
| 4518 | ] | 4554 | ] |
| 4519 | 4555 | ||
| 4556 | [[package]] | ||
| 4557 | name = "pomelo" | ||
| 4558 | version = "0.2.3" | ||
| 4559 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 4560 | checksum = "d01bf7978dd0ffcfb13d27e1ec8bd0c488da8491cb40b167795ee365dff60923" | ||
| 4561 | dependencies = [ | ||
| 4562 | "pomelo-impl", | ||
| 4563 | ] | ||
| 4564 | |||
| 4565 | [[package]] | ||
| 4566 | name = "pomelo-impl" | ||
| 4567 | version = "0.2.3" | ||
| 4568 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 4569 | checksum = "31d3117854ef63946c9393b70d4f1d17070f9ac6c1484db88c8efaeef4fa1e5c" | ||
| 4570 | dependencies = [ | ||
| 4571 | "proc-macro2", | ||
| 4572 | "quote", | ||
| 4573 | "syn 2.0.119", | ||
| 4574 | ] | ||
| 4575 | |||
| 4520 | [[package]] | 4576 | [[package]] |
| 4521 | name = "portable-atomic" | 4577 | name = "portable-atomic" |
| 4522 | version = "1.15.0" | 4578 | version = "1.15.0" |
| @@ -6684,6 +6740,12 @@ dependencies = [ | |||
| 6684 | "web-time", | 6740 | "web-time", |
| 6685 | ] | 6741 | ] |
| 6686 | 6742 | ||
| 6743 | [[package]] | ||
| 6744 | name = "unescape_zero_copy" | ||
| 6745 | version = "2.4.0" | ||
| 6746 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 6747 | checksum = "745c468d775f409baa7ccf0997f0b00672da36145565366ad4a20163b71ad56c" | ||
| 6748 | |||
| 6687 | [[package]] | 6749 | [[package]] |
| 6688 | name = "unicase" | 6750 | name = "unicase" |
| 6689 | version = "2.9.0" | 6751 | version = "2.9.0" |
Cargo.toml +2 −2
| @@ -82,13 +82,13 @@ version = "4.12" | |||
| 82 | optional = true | 82 | optional = true |
| 83 | 83 | ||
| 84 | [dependencies.modalkit] | 84 | [dependencies.modalkit] |
| 85 | version = "0.0.30" | 85 | version = "0.0.31" |
| 86 | default-features = false | 86 | default-features = false |
| 87 | #git = "https://github.com/ulyssa/modalkit" | 87 | #git = "https://github.com/ulyssa/modalkit" |
| 88 | #rev = "31158b7b759ef6f4b3c0d56305fa8a68365d8a96" | 88 | #rev = "31158b7b759ef6f4b3c0d56305fa8a68365d8a96" |
| 89 | 89 | ||
| 90 | [dependencies.modalkit-ratatui] | 90 | [dependencies.modalkit-ratatui] |
| 91 | version = "0.0.30" | 91 | version = "0.0.31" |
| 92 | #git = "https://github.com/ulyssa/modalkit" | 92 | #git = "https://github.com/ulyssa/modalkit" |
| 93 | #rev = "31158b7b759ef6f4b3c0d56305fa8a68365d8a96" | 93 | #rev = "31158b7b759ef6f4b3c0d56305fa8a68365d8a96" |
| 94 | 94 | ||
src/config/mod.rs +5 −5
| @@ -508,11 +508,11 @@ pub enum SplitDirection { | |||
| 508 | Vertical, | 508 | Vertical, |
| 509 | } | 509 | } |
| 510 | 510 | ||
| 511 | impl SplitDirection { | 511 | impl From<SplitDirection> for Axis { |
| 512 | pub fn to_axis(self) -> Axis { | 512 | fn from(dir: SplitDirection) -> Axis { |
| 513 | match self { | 513 | match dir { |
| 514 | Self::Horizontal => Axis::Horizontal, | 514 | SplitDirection::Horizontal => Axis::Horizontal, |
| 515 | Self::Vertical => Axis::Vertical, | 515 | SplitDirection::Vertical => Axis::Vertical, |
| 516 | } | 516 | } |
| 517 | } | 517 | } |
| 518 | } | 518 | } |
src/keybindings.rs +2 −25
| @@ -9,7 +9,7 @@ use modalkit::env::vim::keybindings::{InputStep, VimBindings}; | |||
| 9 | use modalkit::keybindings::{EdgeEvent, EdgeRepeat, InputBindings}; | 9 | use modalkit::keybindings::{EdgeEvent, EdgeRepeat, InputBindings}; |
| 10 | 10 | ||
| 11 | use crate::base::{Keybindings, MATRIX_ID_WORD}; | 11 | use crate::base::{Keybindings, MATRIX_ID_WORD}; |
| 12 | use crate::config::{Keys, SplitDirection, TunableValues}; | 12 | use crate::config::{Keys, TunableValues}; |
| 13 | use crate::prelude::*; | 13 | use crate::prelude::*; |
| 14 | 14 | ||
| 15 | pub type IambStep = InputStep<IambInfo>; | 15 | pub type IambStep = InputStep<IambInfo>; |
| @@ -23,6 +23,7 @@ pub fn setup_keybindings(tunables: &TunableValues) -> Keybindings { | |||
| 23 | let mut ism = Keybindings::empty(); | 23 | let mut ism = Keybindings::empty(); |
| 24 | 24 | ||
| 25 | let vim = VimBindings::default() | 25 | let vim = VimBindings::default() |
| 26 | .default_split(tunables.default_split.into()) | ||
| 26 | .submit_on_enter(!tunables.send_on_enter) | 27 | .submit_on_enter(!tunables.send_on_enter) |
| 27 | .cursor_open(MATRIX_ID_WORD.clone()); | 28 | .cursor_open(MATRIX_ID_WORD.clone()); |
| 28 | 29 | ||
| @@ -79,29 +80,5 @@ impl InputBindings<TerminalKey, IambStep> for ApplicationSettings { | |||
| 79 | } | 80 | } |
| 80 | } | 81 | } |
| 81 | } | 82 | } |
| 82 | |||
| 83 | if self.tunables.default_split == SplitDirection::Vertical { | ||
| 84 | let ctrl_w = "<C-W>".parse::<TerminalKey>().unwrap(); | ||
| 85 | let key_f = "f".parse::<TerminalKey>().unwrap(); | ||
| 86 | let ctrl_f = "<C-F>".parse::<TerminalKey>().unwrap(); | ||
| 87 | |||
| 88 | let vsplit_open = IambStep::new() | ||
| 89 | .actions(vec![ | ||
| 90 | WindowAction::Split( | ||
| 91 | OpenTarget::Cursor(MATRIX_ID_WORD.clone()), | ||
| 92 | Axis::Vertical, | ||
| 93 | MoveDir1D::Next, | ||
| 94 | 1.into(), | ||
| 95 | ) | ||
| 96 | .into(), | ||
| 97 | ]) | ||
| 98 | .goto(VimMode::Normal); | ||
| 99 | |||
| 100 | let cwf = vec![once(&ctrl_w), once(&key_f)]; | ||
| 101 | let cwcf = vec![once(&ctrl_w), once(&ctrl_f)]; | ||
| 102 | |||
| 103 | bindings.add_mapping(VimMode::Normal, &cwf, &vsplit_open); | ||
| 104 | bindings.add_mapping(VimMode::Normal, &cwcf, &vsplit_open); | ||
| 105 | } | ||
| 106 | } | 83 | } |
| 107 | } | 84 | } |
src/windows/mod.rs +18 −16
| @@ -1562,12 +1562,12 @@ impl Display for GenericRoomItem { | |||
| 1562 | impl ListItem<IambInfo> for GenericRoomItem { | 1562 | impl ListItem<IambInfo> for GenericRoomItem { |
| 1563 | type Section = ListSectionHeader; | 1563 | type Section = ListSectionHeader; |
| 1564 | 1564 | ||
| 1565 | fn show( | 1565 | fn show<'a>( |
| 1566 | &self, | 1566 | &'a self, |
| 1567 | selected: bool, | 1567 | selected: bool, |
| 1568 | _: &ViewportContext<ListCursor>, | 1568 | _: &ViewportContext<ListCursor>, |
| 1569 | store: &mut ProgramStore, | 1569 | store: &'a ProgramStore, |
| 1570 | ) -> Text<'_> { | 1570 | ) -> Text<'a> { |
| 1571 | let theme = &store.application.settings.theme; | 1571 | let theme = &store.application.settings.theme; |
| 1572 | let order = store.application.settings.tunables.room_labels.as_slice(); | 1572 | let order = store.application.settings.tunables.room_labels.as_slice(); |
| 1573 | 1573 | ||
| @@ -1637,15 +1637,15 @@ impl Display for MemberItem { | |||
| 1637 | impl ListItem<IambInfo> for MemberItem { | 1637 | impl ListItem<IambInfo> for MemberItem { |
| 1638 | type Section = ListSectionHeader; | 1638 | type Section = ListSectionHeader; |
| 1639 | 1639 | ||
| 1640 | fn show( | 1640 | fn show<'a>( |
| 1641 | &self, | 1641 | &'a self, |
| 1642 | selected: bool, | 1642 | selected: bool, |
| 1643 | _: &ViewportContext<ListCursor>, | 1643 | _: &ViewportContext<ListCursor>, |
| 1644 | store: &mut ProgramStore, | 1644 | store: &'a ProgramStore, |
| 1645 | ) -> Text<'_> { | 1645 | ) -> Text<'a> { |
| 1646 | use matrix_sdk::ruma::events::room::power_levels::UserPowerLevel; | 1646 | use matrix_sdk::ruma::events::room::power_levels::UserPowerLevel; |
| 1647 | 1647 | ||
| 1648 | let info = store.application.rooms.get_or_default(self.room_id.clone()); | 1648 | let info = store.application.rooms.get(&self.room_id); |
| 1649 | let user_id = self.member.user_id(); | 1649 | let user_id = self.member.user_id(); |
| 1650 | 1650 | ||
| 1651 | let theme = &store.application.settings.theme; | 1651 | let theme = &store.application.settings.theme; |
| @@ -1670,7 +1670,7 @@ impl ListItem<IambInfo> for MemberItem { | |||
| 1670 | if let Some(name) = name { | 1670 | if let Some(name) = name { |
| 1671 | spans.push(Span::styled(name, user_style)); | 1671 | spans.push(Span::styled(name, user_style)); |
| 1672 | tags.push(Span::styled(user_id.as_str(), user_style)); | 1672 | tags.push(Span::styled(user_id.as_str(), user_style)); |
| 1673 | } else if let Some(display) = info.display_names.get(user_id) { | 1673 | } else if let Some(display) = info.and_then(|i| i.display_names.get(user_id)) { |
| 1674 | spans.push(Span::styled(display.into_owned(), user_style)); | 1674 | spans.push(Span::styled(display.into_owned(), user_style)); |
| 1675 | tags.push(Span::styled(user_id.as_str(), user_style)); | 1675 | tags.push(Span::styled(user_id.as_str(), user_style)); |
| 1676 | } else { | 1676 | } else { |
| @@ -1783,15 +1783,13 @@ impl Display for PinnedItem { | |||
| 1783 | impl ListItem<IambInfo> for PinnedItem { | 1783 | impl ListItem<IambInfo> for PinnedItem { |
| 1784 | type Section = &'static str; | 1784 | type Section = &'static str; |
| 1785 | 1785 | ||
| 1786 | fn show( | 1786 | fn show<'a>( |
| 1787 | &self, | 1787 | &'a self, |
| 1788 | selected: bool, | 1788 | selected: bool, |
| 1789 | _: &ViewportContext<ListCursor>, | 1789 | _: &ViewportContext<ListCursor>, |
| 1790 | store: &mut ProgramStore, | 1790 | store: &'a ProgramStore, |
| 1791 | ) -> Text<'_> { | 1791 | ) -> Text<'a> { |
| 1792 | let info = store.application.rooms.get_or_default(self.room_id.clone()); | ||
| 1793 | let settings = &store.application.settings; | 1792 | let settings = &store.application.settings; |
| 1794 | |||
| 1795 | let style = store.application.settings.theme.default; | 1793 | let style = store.application.settings.theme.default; |
| 1796 | let style = if selected { | 1794 | let style = if selected { |
| 1797 | style.add_modifier(StyleModifier::REVERSED) | 1795 | style.add_modifier(StyleModifier::REVERSED) |
| @@ -1799,6 +1797,10 @@ impl ListItem<IambInfo> for PinnedItem { | |||
| 1799 | style | 1797 | style |
| 1800 | }; | 1798 | }; |
| 1801 | 1799 | ||
| 1800 | let Some(info) = store.application.rooms.get(&self.room_id) else { | ||
| 1801 | return Text::styled("Unable to load room information", style); | ||
| 1802 | }; | ||
| 1803 | |||
| 1802 | let Some(msg) = info.get_pinned(&self.event_id) else { | 1804 | let Some(msg) = info.get_pinned(&self.event_id) else { |
| 1803 | let text = if info.pinned_unavailable(&self.event_id) { | 1805 | let text = if info.pinned_unavailable(&self.event_id) { |
| 1804 | "Unable to load message" | 1806 | "Unable to load message" |
src/windows/room/mod.rs +1 −1
| @@ -199,7 +199,7 @@ pub async fn room_command( | |||
| 199 | let cmd = cmd.default_relation(MoveDir1D::Next); | 199 | let cmd = cmd.default_relation(MoveDir1D::Next); |
| 200 | 200 | ||
| 201 | let act = match store.application.settings.tunables.members_split { | 201 | let act = match store.application.settings.tunables.members_split { |
| 202 | Some(dir) => cmd.default_axis(dir.to_axis()).window(target, None), | 202 | Some(dir) => cmd.default_axis(dir.into()).window(target, None), |
| 203 | None => cmd.switch(target), | 203 | None => cmd.switch(target), |
| 204 | }; | 204 | }; |
| 205 | 205 | ||
src/windows/room/scrollback.rs +9 −14
| @@ -699,7 +699,7 @@ impl EditorActions<ProgramContext, ProgramStore, IambInfo> for ScrollbackState { | |||
| 699 | 699 | ||
| 700 | return Ok(None); | 700 | return Ok(None); |
| 701 | }, | 701 | }, |
| 702 | EditAction::Yank => { | 702 | EditAction::Yank(reg, style) => { |
| 703 | let range = match motion { | 703 | let range = match motion { |
| 704 | EditTarget::CurrentPosition | EditTarget::Selection => { | 704 | EditTarget::CurrentPosition | EditTarget::Selection => { |
| 705 | Some(self._range_to(key.into())) | 705 | Some(self._range_to(key.into())) |
| @@ -778,14 +778,9 @@ impl EditorActions<ProgramContext, ProgramStore, IambInfo> for ScrollbackState { | |||
| 778 | } | 778 | } |
| 779 | 779 | ||
| 780 | let cell = RegisterCell::new(TargetShape::LineWise, yanked); | 780 | let cell = RegisterCell::new(TargetShape::LineWise, yanked); |
| 781 | let flags = RegisterPutFlags::from(ctx.resolve(style)); | ||
| 781 | let register = | 782 | let register = |
| 782 | ctx.get_register().unwrap_or(store.registers.get_default_register()); | 783 | ctx.resolve(reg).unwrap_or(store.registers.get_default_register()); |
| 783 | let mut flags = RegisterPutFlags::NONE; | ||
| 784 | |||
| 785 | if ctx.get_register_append() { | ||
| 786 | flags |= RegisterPutFlags::APPEND; | ||
| 787 | } | ||
| 788 | |||
| 789 | store.registers.put(®ister, cell, flags)?; | 784 | store.registers.put(®ister, cell, flags)?; |
| 790 | } | 785 | } |
| 791 | 786 | ||
| @@ -794,8 +789,8 @@ impl EditorActions<ProgramContext, ProgramStore, IambInfo> for ScrollbackState { | |||
| 794 | 789 | ||
| 795 | // Everything else is a modifying action. | 790 | // Everything else is a modifying action. |
| 796 | EditAction::ChangeCase(_) => Err(EditError::ReadOnly), | 791 | EditAction::ChangeCase(_) => Err(EditError::ReadOnly), |
| 797 | EditAction::ChangeNumber(_, _) => Err(EditError::ReadOnly), | 792 | EditAction::ChangeNumber(..) => Err(EditError::ReadOnly), |
| 798 | EditAction::Delete => Err(EditError::ReadOnly), | 793 | EditAction::Delete(..) => Err(EditError::ReadOnly), |
| 799 | EditAction::Format => Err(EditError::ReadOnly), | 794 | EditAction::Format => Err(EditError::ReadOnly), |
| 800 | EditAction::Indent(_) => Err(EditError::ReadOnly), | 795 | EditAction::Indent(_) => Err(EditError::ReadOnly), |
| 801 | EditAction::Join(_) => Err(EditError::ReadOnly), | 796 | EditAction::Join(_) => Err(EditError::ReadOnly), |
| @@ -873,8 +868,8 @@ impl EditorActions<ProgramContext, ProgramStore, IambInfo> for ScrollbackState { | |||
| 873 | CursorAction::Rotate(_, _) => Ok(None), | 868 | CursorAction::Rotate(_, _) => Ok(None), |
| 874 | CursorAction::Split(_) => Ok(None), | 869 | CursorAction::Split(_) => Ok(None), |
| 875 | 870 | ||
| 876 | CursorAction::Restore(_) => { | 871 | CursorAction::Restore(reg, _) => { |
| 877 | let reg = ctx.get_register().unwrap_or(store.registers.get_default_register()); | 872 | let reg = ctx.resolve(reg).unwrap_or(store.registers.get_default_register()); |
| 878 | 873 | ||
| 879 | // Get saved group. | 874 | // Get saved group. |
| 880 | let ngroup = store.cursors.get_group(self.id.clone(), ®)?; | 875 | let ngroup = store.cursors.get_group(self.id.clone(), ®)?; |
| @@ -895,8 +890,8 @@ impl EditorActions<ProgramContext, ProgramStore, IambInfo> for ScrollbackState { | |||
| 895 | Err(err) | 890 | Err(err) |
| 896 | } | 891 | } |
| 897 | }, | 892 | }, |
| 898 | CursorAction::Save(_) => { | 893 | CursorAction::Save(reg, _) => { |
| 899 | let reg = ctx.get_register().unwrap_or(store.registers.get_default_register()); | 894 | let reg = ctx.resolve(reg).unwrap_or(store.registers.get_default_register()); |
| 900 | 895 | ||
| 901 | // Lists don't have groups; override any previously saved group. | 896 | // Lists don't have groups; override any previously saved group. |
| 902 | let cursor = self.cursor.to_cursor(thread).ok_or_else(|| { | 897 | let cursor = self.cursor.to_cursor(thread).ok_or_else(|| { |
src/windows/verify.rs +4 −4
| @@ -135,12 +135,12 @@ impl fmt::Display for VerifyItem { | |||
| 135 | impl ListItem<IambInfo> for VerifyItem { | 135 | impl ListItem<IambInfo> for VerifyItem { |
| 136 | type Section = &'static str; | 136 | type Section = &'static str; |
| 137 | 137 | ||
| 138 | fn show( | 138 | fn show<'a>( |
| 139 | &self, | 139 | &'a self, |
| 140 | selected: bool, | 140 | selected: bool, |
| 141 | _: &ViewportContext<ListCursor>, | 141 | _: &ViewportContext<ListCursor>, |
| 142 | store: &mut ProgramStore, | 142 | store: &'a ProgramStore, |
| 143 | ) -> Text<'_> { | 143 | ) -> Text<'a> { |
| 144 | let mut lines = vec![]; | 144 | let mut lines = vec![]; |
| 145 | let style = store.application.settings.theme.default; | 145 | let style = store.application.settings.theme.default; |
| 146 | let bold = style.bold(); | 146 | let bold = style.bold(); |