Skip to content

Commit 796e7ef

Browse files
committed
chore: enable mouse capture only on archived mode
1 parent 73001a2 commit 796e7ef

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async fn main() -> anyhow::Result<()> {
165165
});
166166

167167
enable_raw_mode()?;
168-
execute!(io::stdout(), EnableMouseCapture, cursor::Hide)?;
168+
execute!(io::stdout(), cursor::Hide)?;
169169

170170
while let Ok((signal, queue)) = sig::run(
171171
text_editor::State {
@@ -191,6 +191,8 @@ async fn main() -> anyhow::Result<()> {
191191

192192
match signal {
193193
Signal::GotoArchived => {
194+
execute!(io::stdout(), EnableMouseCapture)?;
195+
194196
archived::run(
195197
text_editor::State {
196198
texteditor: TextEditor::new(String::new()),
@@ -211,7 +213,7 @@ async fn main() -> anyhow::Result<()> {
211213
// Re-enable raw mode and hide the cursor again here
212214
// because they are disabled and shown, respectively, by promkit.
213215
enable_raw_mode()?;
214-
execute!(io::stdout(), EnableMouseCapture, cursor::Hide)?;
216+
execute!(io::stdout(), DisableMouseCapture, cursor::Hide)?;
215217

216218
crossterm::execute!(
217219
io::stdout(),

0 commit comments

Comments
 (0)