Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.5k stars 171 forks source link

Find is creating unwanted space when pasting line #5740

Closed pintassilgo closed 8 hours ago

pintassilgo commented 8 hours ago
  1. Triple-click somewhere in tab content to select the entire line, then copy it. As expected, line break is included in selection.
  2. Open find bar and make sure multiline input (+ button) is disabled.
  3. Paste and run Find.

Expected result: Should find.

Actual result: Doesn't find because Cuda creates a trailing space to replace the linebreak char.

I understand the reason behind replacing linebreaks by spaces in single line fields, but Cuda should trim linebreaks, removing possible occurrences at first and last position of clipboard string.

Examples (using \n for linebreak):

  1. Copied content: \ncode. Expected pasted content in findbar: code. [to be fixed]
  2. Copied content: line1\nline2; Expected pasted content in findbar: line1 line2. [good]
  3. Copied content: code\n. Expected pasted content in findbar: code. [to be fixed]
Alexey-T commented 8 hours ago

Thanks, to fix.

Alexey-T commented 4 hours ago

beta to find regressions (i tested multi-line editor, it's not affected, ok). cudatext.zip

pintassilgo commented 3 hours ago

Confirmed fixed, thanks!