Skip to content

Autocompletion interprets backslashes as escape sequences #8397

@git-afsantos

Description

@git-afsantos

Description of the Issue

This happens to me a lot when writing LaTeX files. On Windows, I tend to use the Ctrl+Enter feature to autocomplete words. If the word has a \r or \n in it, it gets replaced with a carriage return or a line feed.
For instance, writing Listing~\ref{fig:fig1} and later on writing List to autocomplete, gets me Listing~ on the current line, and ef on the next (new) line.

The issue happens when there is only a single choice for autocompletion and the choice box is not displayed. If it is selected from the choice box, it seems to work fine.
It happens with all sorts of escape characters, not just new line characters, e.g., \a gets replaced with a bell character.

Steps to Reproduce the Issue

  1. Open a new document.
  2. Write Listing~\ref.
  3. Somewhere else in the document (e.g., a new line), write List.
  4. Press Ctrl+Enter (or the equivalent hotkey) to autocomplete.

Expected Behavior

I expected the autocompletion to insert the text verbatim, not treating backslashes as escape sequences, e.g., Listing~\ref.

Actual Behavior

Notepad++ treats backslashes as escape sequences, for instance replacing \r and \n in autocompletion with new line characters.

Debug Information

Notepad++ v7.8.6 (64-bit)
Build time : Apr 21 2020 - 15:23:03
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 7 Home Premium (64-bit)
OS Build : 7601.0
Plugins : mimeTools.dll NppConverter.dll NppExport.dll

Screenshot

Capture

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions