From 070d600545737b53bc9f48e7b9e93cf9fa8fc171 Mon Sep 17 00:00:00 2001 From: maxomatic458 <104733404+maxomatic458@users.noreply.github.com> Date: Sat, 20 Jan 2024 19:11:17 +0100 Subject: [PATCH] respect windows newline in update_values --- src/menu/columnar_menu.rs | 2 +- src/menu/ide_menu.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/menu/columnar_menu.rs b/src/menu/columnar_menu.rs index b30ce360..0b2d7bca 100644 --- a/src/menu/columnar_menu.rs +++ b/src/menu/columnar_menu.rs @@ -543,7 +543,7 @@ impl Menu for ColumnarMenu { // editing a multiline buffer. // Also, by replacing the new line character with a space, the insert // position is maintain in the line buffer. - let trimmed_buffer = editor.get_buffer().replace('\n', " "); + let trimmed_buffer = editor.get_buffer().replace("\r\n", " ").replace('\n', " "); completer.complete( &trimmed_buffer[..editor.insertion_point()], editor.insertion_point(), diff --git a/src/menu/ide_menu.rs b/src/menu/ide_menu.rs index 2b1ea477..12ef2aee 100644 --- a/src/menu/ide_menu.rs +++ b/src/menu/ide_menu.rs @@ -679,7 +679,7 @@ impl Menu for IdeMenu { // editing a multiline buffer. // Also, by replacing the new line character with a space, the insert // position is maintain in the line buffer. - let trimmed_buffer = editor.get_buffer().replace('\n', " "); + let trimmed_buffer = editor.get_buffer().replace("\r\n", " ").replace('\n', " "); completer.complete( &trimmed_buffer[..editor.insertion_point()], editor.insertion_point(),