Require alt-tab
for AcceptEditPrediction
when tab
inserting whitespace is desired (#24705)
Moves tab whitespace insertion logic out of `AcceptEditPrediction` handler. `edit_prediction_requires_modifier` context will now be true when on a line with leading whitespace, so that `alt-tab` is used to accept predictions in this case. This way leading indentation can be typed when edit predictions are visible Release Notes: - N/A Co-authored-by: Ben <ben@zed.dev> Co-authored-by: Joao <joao@zed.dev>
This commit is contained in:
parent
2e7a89c5e3
commit
498bb518ff
3 changed files with 27 additions and 69 deletions
|
@ -4236,6 +4236,21 @@ impl MultiBufferSnapshot {
|
|||
indent
|
||||
}
|
||||
|
||||
pub fn is_line_whitespace_upto<T>(&self, position: T) -> bool
|
||||
where
|
||||
T: ToOffset,
|
||||
{
|
||||
for char in self.reversed_chars_at(position) {
|
||||
if !char.is_whitespace() {
|
||||
return false;
|
||||
}
|
||||
if char == '\n' {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
pub fn prev_non_blank_row(&self, mut row: MultiBufferRow) -> Option<MultiBufferRow> {
|
||||
while row.0 > 0 {
|
||||
row.0 -= 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue