Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion held_core/src/interface/app.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{get_application, APPLICATION};
use super::get_application;

pub trait App {
fn exit(&mut self);
Expand Down
2 changes: 0 additions & 2 deletions held_core/src/view/render/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::str::Chars;

use cell::Cell;

use crate::utils::{position::Position, rectangle::Rectangle};
Expand Down
1 change: 0 additions & 1 deletion src/application/handler/app.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::application::mode::command::CommandData;
use crate::application::mode::{ModeData, ModeKey};
use crate::application::Application;
use crate::errors::*;
Expand Down
2 changes: 1 addition & 1 deletion src/application/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use mode::{
use smallvec::SmallVec;
use state::ApplicationStateData;

use std::{cell::RefCell, collections::HashMap, mem, rc::Rc, sync::Arc};
use std::{cell::RefCell, collections::HashMap, mem, rc::Rc};

use crate::{
modules::perferences::{Perferences, PerferencesManager},
Expand Down
2 changes: 0 additions & 2 deletions src/application/mode/command.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::{collections::HashMap, process::CommandArgs};

use held_core::{
utils::position::Position,
view::{colors::Colors, style::CharStyle},
Expand Down
12 changes: 2 additions & 10 deletions src/modules/perferences/yaml.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
use std::path::PathBuf;

use super::{
Perferences, APP_INFO, LINE_WRAPPING_KEY, SOFT_TAB_KEY, TAB_WIDTH_KEY, THEME_KET, THEME_PATH,
};
use crate::{
errors::*,
modules::perferences::{LANGUAGE_KEY, LANGUAGE_SYNTAX_KEY, SYNTAX_PATH},
};
use app_dirs2::{app_dir, AppDataType};
use super::{Perferences, LINE_WRAPPING_KEY, SOFT_TAB_KEY, TAB_WIDTH_KEY, THEME_KET};
use crate::modules::perferences::{LANGUAGE_KEY, LANGUAGE_SYNTAX_KEY};
use yaml_rust::Yaml;

pub struct YamlPerferences {
Expand Down
2 changes: 1 addition & 1 deletion src/view/presenter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{borrow::Cow, cell::RefCell, fmt::Debug, rc::Rc};
use std::{borrow::Cow, fmt::Debug};

use super::{
colors::map::ColorMap,
Expand Down
5 changes: 3 additions & 2 deletions src/view/render/render_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ impl CachedRenderBuffer {

if !equal {
let mut cache_cell = CachedCell::default();
let content_len = cell_content.len();
let grapheme_count = cell.content.graphemes(true).count().max(1);
cache_cell.colors = cell.colors;
cache_cell.style = cell.style;
cache_cell.content = cell_content;
for i in (index + 1)..(index + content_len) {
let end_index = (index + grapheme_count).min(self.cells.len());
for i in (index + 1)..end_index {
self.cells[i] = None
}

Expand Down
1 change: 0 additions & 1 deletion src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ impl Workspace {
.or_else(|| Some(self.syntax_set.find_syntax_plain_text()))
.cloned();

drop(buffer);
self.get_buffer_mut(id)
.ok_or(ErrorKind::EmptyWorkspace)?
.syntax_definition = definition;
Expand Down
Loading