Skip to content

Commit

Permalink
Use new custom input component in buffer picker
Browse files Browse the repository at this point in the history
  • Loading branch information
mcobzarenco committed Jul 31, 2022
1 parent 10c7dd5 commit 92ff409
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions zee/src/components/prompt/buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ use size_format::SizeFormatterBinary;
use std::{borrow::Cow, convert::TryInto, path::PathBuf};
use zi::{
components::{
input::{Cursor, Input, InputChange, InputProperties, InputStyle},
select::{Select, SelectProperties},
text::{Text, TextAlign, TextProperties},
},
unicode_width::UnicodeWidthStr,
Bindings, Callback, Colour, Component, ComponentExt, ComponentLink, Container, FlexBasis,
Bindings, Callback, Component, ComponentExt, ComponentLink, Container, FlexBasis,
FlexDirection, Item, Key, Layout, Rect, ShouldRender, Style,
};

use zee_edit::Cursor;
use zee_grammar::Mode;

use super::{
Expand All @@ -20,6 +20,7 @@ use super::{
Theme,
};
use crate::{
components::input::{Input, InputChange, InputProperties, InputStyle},
editor::{BufferId, ContextHandle},
task::TaskId,
};
Expand Down Expand Up @@ -99,7 +100,7 @@ impl Component for BufferPicker {
Self {
properties,
link,
input: "\n".into(),
input: Rope::new(),
cursor: Cursor::new(),
selected_index: 0,
current_task_id: None,
Expand Down Expand Up @@ -159,6 +160,7 @@ impl Component for BufferPicker {

fn view(&self) -> Layout {
let input = Input::with(InputProperties {
context: self.properties.context,
style: InputStyle {
content: self.properties.theme.input,
cursor: self.properties.theme.cursor,
Expand Down Expand Up @@ -234,8 +236,7 @@ impl Component for BufferPicker {
})
.style(Style::normal(
self.properties.theme.item_unfocused_background,
Colour::rgb(251, 73, 52),
// self.properties.theme.action.background,
self.properties.theme.action.background,
)),
)
} else {
Expand Down Expand Up @@ -274,7 +275,7 @@ impl Component for BufferPicker {
"num-results",
TextProperties::new()
.content(format!(
"{} of {} ",
"{} of {}",
self.matcher.num_ranked(),
self.properties.entries.len()
))
Expand Down

0 comments on commit 92ff409

Please sign in to comment.