zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
39.25k stars 2.03k forks source link

vim: assistant::QuoteSelection does not handle VisualLineMode #13037

Open silvenon opened 2 weeks ago

silvenon commented 2 weeks ago

Check for existing issues

Describe the bug / provide steps to reproduce it

As shown in the attached video, visual block mode doesn't play well with the assistant's "quote selection" feature at the moment, it acts just like the regular visual mode — instead of copying entire lines it copies from where the cursor was at the begining of the visual block mode to the end.

Environment

Zed: v0.139.3 (Zed) OS: macOS 14.5.0 Memory: 16 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

This attached video shows two cases with the same result:

  1. quoting selection with the visual block mode, only quotes part of the selection
  2. quoting selection with the regular visual mode, starting from the same character

https://github.com/zed-industries/zed/assets/471278/babb6db9-2664-4067-aae5-c4b75d97b834

notpeter commented 2 weeks ago

Got it. The defect is that the block captured by the "quote selection" function does not match the selection made with block selection mode. It incorrectly creates a regular character selection between the start/end positions instead of the expanded block selection displayed in your editor pane.