mirror of https://github.com/lapce/lapce.git
find box results should use current buffer
This commit is contained in:
parent
483275c83e
commit
85e41dcc50
|
@ -14,6 +14,7 @@
|
||||||
use crate::{editor::view::LapceEditorView, svg::get_svg, tab::LapceIcon};
|
use crate::{editor::view::LapceEditorView, svg::get_svg, tab::LapceIcon};
|
||||||
|
|
||||||
pub struct FindBox {
|
pub struct FindBox {
|
||||||
|
parent_view_id: WidgetId,
|
||||||
input_width: f64,
|
input_width: f64,
|
||||||
result_width: f64,
|
result_width: f64,
|
||||||
result_pos: Point,
|
result_pos: Point,
|
||||||
|
@ -71,6 +72,7 @@ pub fn new(
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
Self {
|
Self {
|
||||||
|
parent_view_id,
|
||||||
input_width: 200.0,
|
input_width: 200.0,
|
||||||
result_width: 75.0,
|
result_width: 75.0,
|
||||||
result_pos: Point::ZERO,
|
result_pos: Point::ZERO,
|
||||||
|
@ -193,25 +195,7 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let buffer = match &data.main_split.active_tab.as_ref() {
|
let buffer = data.editor_view_content(self.parent_view_id);
|
||||||
Some(active_tab) => {
|
|
||||||
match data
|
|
||||||
.main_split
|
|
||||||
.editor_tabs
|
|
||||||
.get(active_tab)
|
|
||||||
.unwrap()
|
|
||||||
.active_child()
|
|
||||||
{
|
|
||||||
lapce_data::data::EditorTabChild::Editor(view_id, _, _) => {
|
|
||||||
data.editor_view_content(*view_id)
|
|
||||||
}
|
|
||||||
lapce_data::data::EditorTabChild::Settings(view_id, _) => {
|
|
||||||
data.editor_view_content(*view_id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None => return,
|
|
||||||
};
|
|
||||||
|
|
||||||
let rect = ctx.size().to_rect();
|
let rect = ctx.size().to_rect();
|
||||||
ctx.with_save(|ctx| {
|
ctx.with_save(|ctx| {
|
||||||
|
|
Loading…
Reference in New Issue