vim-flight entertainment (#3574)
- vim2 compiling (but mostly commented out) - More code written, similar lack of workingness so far Still todo: [ ] Figure out the focus/blur stuff [ ] Uncoment more code [ ] Fix VimTestContext [ ] Uncomment the tests Release Notes: - N/A
This commit is contained in:
@@ -1923,9 +1923,9 @@ impl Editor {
|
||||
self.buffer.read(cx).replica_id()
|
||||
}
|
||||
|
||||
// pub fn leader_peer_id(&self) -> Option<PeerId> {
|
||||
// self.leader_peer_id
|
||||
// }
|
||||
pub fn leader_peer_id(&self) -> Option<PeerId> {
|
||||
self.leader_peer_id
|
||||
}
|
||||
|
||||
pub fn buffer(&self) -> &Model<MultiBuffer> {
|
||||
&self.buffer
|
||||
@@ -9096,10 +9096,7 @@ impl Editor {
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_blur(&mut self, cx: &mut ViewContext<Self>) {
|
||||
// todo!()
|
||||
// let blurred_event = EditorBlurred(cx.handle());
|
||||
// cx.emit_global(blurred_event);
|
||||
pub fn handle_blur(&mut self, cx: &mut ViewContext<Self>) {
|
||||
self.blink_manager.update(cx, BlinkManager::disable);
|
||||
self.buffer
|
||||
.update(cx, |buffer, cx| buffer.remove_active_selections(cx));
|
||||
@@ -9283,10 +9280,6 @@ pub enum EditorEvent {
|
||||
Closed,
|
||||
}
|
||||
|
||||
pub struct EditorFocused(pub View<Editor>);
|
||||
pub struct EditorBlurred(pub View<Editor>);
|
||||
pub struct EditorReleased(pub WeakView<Editor>);
|
||||
|
||||
impl EventEmitter<EditorEvent> for Editor {}
|
||||
|
||||
impl FocusableView for Editor {
|
||||
|
||||
@@ -1049,7 +1049,12 @@ impl EditorElement {
|
||||
.chars_at(cursor_position)
|
||||
.next()
|
||||
.and_then(|(character, _)| {
|
||||
let text = SharedString::from(character.to_string());
|
||||
// todo!() currently shape_line panics if text conatins newlines
|
||||
let text = if character == '\n' {
|
||||
SharedString::from(" ")
|
||||
} else {
|
||||
SharedString::from(character.to_string())
|
||||
};
|
||||
let len = text.len();
|
||||
cx.text_system()
|
||||
.shape_line(
|
||||
|
||||
Reference in New Issue
Block a user