style: format codebase with cargo fmt
parent
5e1de2ec96
commit
48f63a88ea
|
@ -12,8 +12,7 @@
|
|||
#[template_child]
|
||||
pub minimap: TemplateChild<sourceview::Map>,
|
||||
#[template_child]
|
||||
pub sourceview: TemplateChild<sourceview::View>
|
||||
|
||||
pub sourceview: TemplateChild<sourceview::View>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
@ -34,4 +33,3 @@
|
|||
impl ObjectImpl for EchidnaCoreEditor {}
|
||||
impl WidgetImpl for EchidnaCoreEditor {}
|
||||
impl BoxImpl for EchidnaCoreEditor {}
|
||||
|
|
@ -13,19 +13,13 @@ glib::wrapper! {
|
|||
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl EchidnaCoreEditor {
|
||||
|
||||
|
||||
pub fn new<P: glib::IsA<sourceview::File>>(file: Option<&P>) -> Self {
|
||||
let this: Self =
|
||||
glib::Object::new(&[]).expect("Failed to create 'EchidnaCoreEditor' component.");
|
||||
let this_imp = this.to_imp();
|
||||
// Without cloning it, for some reasons the Rust compiler complains about &this.to_imp().sourceview not being IsA<sourceview::View>
|
||||
this_imp
|
||||
.minimap
|
||||
.set_view(&this_imp.sourceview.clone());
|
||||
this_imp.minimap.set_view(&this_imp.sourceview.clone());
|
||||
|
||||
if file.is_some() {
|
||||
let file = file.unwrap();
|
||||
|
@ -49,7 +43,6 @@ impl EchidnaCoreEditor {
|
|||
let language_manager = LanguageManager::new();
|
||||
let language = language_manager.guess_language(Some(&info.name().to_str().expect("Could not open the file because its name is not supported by Unicode.")), None);
|
||||
|
||||
|
||||
match language {
|
||||
Some(lang) => buffer.set_language(Some(&lang)),
|
||||
None => {}
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
pub mod app;
|
||||
pub mod editor;
|
||||
pub mod sidebar;
|
||||
pub mod window;
|
||||
pub mod editor;
|
Loading…
Reference in New Issue