aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/editor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui/editor.rs')
-rw-r--r--helix-term/src/ui/editor.rs25
1 files changed, 10 insertions, 15 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index d2925e35..138456ca 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -1,32 +1,28 @@
use crate::{
commands,
- compositor::{Component, Compositor, Context, EventResult},
+ compositor::{Component, Context, EventResult},
key,
- keymap::{self, Keymaps},
+ keymap::Keymaps,
ui::{Completion, ProgressSpinners},
};
use helix_core::{
coords_at_pos,
graphemes::ensure_grapheme_boundary_next,
- syntax::{self, Highlight, HighlightEvent},
+ syntax::{self, HighlightEvent},
LineEnding, Position, Range,
};
-use helix_lsp::LspProgressMap;
use helix_view::{
document::Mode,
- graphics::{Color, CursorKind, Modifier, Rect, Style},
+ graphics::{CursorKind, Modifier, Rect, Style},
input::KeyEvent,
keyboard::{KeyCode, KeyModifiers},
Document, Editor, Theme, View,
};
use std::borrow::Cow;
-use crossterm::{
- cursor,
- event::{read, Event, EventStream},
-};
-use tui::{backend::CrosstermBackend, buffer::Buffer as Surface};
+use crossterm::event::Event;
+use tui::buffer::Buffer as Surface;
pub struct EditorView {
keymaps: Keymaps,
@@ -396,7 +392,7 @@ impl EditorView {
viewport: Rect,
surface: &mut Surface,
theme: &Theme,
- is_focused: bool,
+ _is_focused: bool,
) {
use helix_core::diagnostic::Severity;
use tui::{
@@ -406,7 +402,6 @@ impl EditorView {
};
let cursor = doc.selection(view.id).cursor();
- let line = doc.text().char_to_line(cursor);
let diagnostics = doc.diagnostics().iter().filter(|diagnostic| {
diagnostic.range.start <= cursor && diagnostic.range.end >= cursor
@@ -612,7 +607,7 @@ impl Component for EditorView {
// clear status
cx.editor.status_msg = None;
- let (view, doc) = current!(cx.editor);
+ let (_, doc) = current!(cx.editor);
let mode = doc.mode();
let mut cxt = commands::Context {
@@ -709,7 +704,7 @@ impl Component for EditorView {
}
}
- fn render(&self, mut area: Rect, surface: &mut Surface, cx: &mut Context) {
+ fn render(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
// clear with background color
surface.set_style(area, cx.editor.theme.get("ui.background"));
@@ -745,7 +740,7 @@ impl Component for EditorView {
}
}
- fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
+ fn cursor(&self, _area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
// match view.doc.mode() {
// Mode::Insert => write!(stdout, "\x1B[6 q"),
// mode => write!(stdout, "\x1B[2 q"),