mirror of https://github.com/lapce/lapce.git
Make auto_closing_matching_pairs dependent on BufferContent (#2188)
This commit is contained in:
parent
b92c519e29
commit
d64935b972
|
@ -37,6 +37,7 @@
|
|||
- [#2072](https://github.com/lapce/lapce/pull/2072): Fix connection issues from Windows to lapce proxy
|
||||
- [#2069](https://github.com/lapce/lapce/pull/2045): Fix not finding git repositories in parent path
|
||||
- [#2131](https://github.com/lapce/lapce/pull/2131): Fix overwriting symlink
|
||||
- [#2188](https://github.com/lapce/lapce/pull/2188): Fix auto closing matching pairs in inappropriate inputs
|
||||
|
||||
## 0.2.5
|
||||
|
||||
|
|
|
@ -1372,12 +1372,19 @@ pub fn do_insert(
|
|||
config: &LapceConfig,
|
||||
) -> Vec<(RopeDelta, InvalLines, SyntaxEdit)> {
|
||||
let old_cursor = cursor.mode.clone();
|
||||
let auto_closing = config.editor.auto_closing_matching_pairs
|
||||
& match self.content {
|
||||
BufferContent::File(_) => true,
|
||||
BufferContent::Local(_) => false,
|
||||
BufferContent::SettingsValue(_) => false,
|
||||
BufferContent::Scratch(_, _) => true,
|
||||
};
|
||||
let deltas = Editor::insert(
|
||||
cursor,
|
||||
&mut self.buffer,
|
||||
s,
|
||||
self.syntax.as_ref(),
|
||||
config.editor.auto_closing_matching_pairs,
|
||||
auto_closing,
|
||||
);
|
||||
// Keep track of the change in the cursor mode for undo/redo
|
||||
self.buffer_mut().set_cursor_before(old_cursor);
|
||||
|
|
Loading…
Reference in New Issue