Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletion interprets backslashes as escape sequences #8397

Closed
git-afsantos opened this issue Jun 10, 2020 · 9 comments
Closed

Autocompletion interprets backslashes as escape sequences #8397

git-afsantos opened this issue Jun 10, 2020 · 9 comments
Labels

Comments

@git-afsantos
Copy link

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

@Ekopalypse
Copy link
Contributor

Can confirm this happens with 7.8.7 as well.
Side note, when having enabled "autocompletion on each input" it does NOT happen if using
TAB or ENTER key to auto complete the word.

@donho
Copy link
Member

donho commented Jun 22, 2020

I cannot reproduce it.
With Listing~\ref and Something\new, I can both on auto-completion.
Am I missing somethings?

@sasumner
Copy link
Contributor

@donho
Very reproducible on a fresh extract of 7.8.7 portable.
Following @git-afsantos 's steps # 1 to # 4 yields:
image
Not only a bad completion but a file with mismatching line-endings!

@donho
Copy link
Member

donho commented Jun 22, 2020

@sasumner here my screenshot:
image

@Ekopalypse
Copy link
Contributor

@donho, disable auto completion, then type so and press CTRL+ENTER

@sasumner
Copy link
Contributor

@donho My Preferences for this test are set the same as yours.
@Ekopalypse It manifests for me without disabling auto completion

@donho Are you missing the Ctrl+Enter step?

@Ekopalypse
Copy link
Contributor

@sasumner, yes happens with auto completion enabled as well but as you wrote and OP, CTRL+ENTER is the crucial step.

@donho
Copy link
Member

donho commented Jun 22, 2020

@donho Are you missing the Ctrl+Enter step?

Yes. I didn't hit Ctrl+Enter for triggering auto-completion.
Now I can reproduce it. Thank you.

@donho donho closed this as completed in d13795a Jun 22, 2020
@chcg chcg added the bug label Jun 24, 2020
@sasumner
Copy link
Contributor

Released in N++ version 7.8.8

alef162 pushed a commit to alef162/notepad-plus-plus that referenced this issue Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants