vim: Change approach to fixing vim's temporary mode bug (#42894)
The `Vim.exit_temporary_normal` method had been updated (https://github.com/zed-industries/zed/pull/42742) to expect and `Option<&Motion>` that would then be used to determine whether to move the cursor right in case the motion was `Some(EndOfLine { ..})`. Unfortunately this meant that all callers now had to provide this argument, even if just `None`. After merging those changes I remember that we could probably play around with `clip_at_line_ends` so this commit removes those intial changes in favor of updating the `vim::normal::Vim.move_cursor` method so that, if vim is in temporary mode and `EndOfLine` is used, it disables clipping at line ends so that the newline character can be selected. Closes [#42278](https://github.com/zed-industries/zed/issues/42278) Release Notes: - N/A
This commit is contained in:
@@ -3028,6 +3028,10 @@ impl Editor {
|
||||
range.clone()
|
||||
}
|
||||
|
||||
pub fn clip_at_line_ends(&mut self, cx: &mut Context<Self>) -> bool {
|
||||
self.display_map.read(cx).clip_at_line_ends
|
||||
}
|
||||
|
||||
pub fn set_clip_at_line_ends(&mut self, clip: bool, cx: &mut Context<Self>) {
|
||||
if self.display_map.read(cx).clip_at_line_ends != clip {
|
||||
self.display_map
|
||||
|
||||
Reference in New Issue
Block a user