Community
Participate
Working Groups
I20071113-0800. Escape on paste does not work for single character. This is due to a hack: the org.eclipse.jdt.internal.ui.text.java.JavaStringAutoIndentStrategy which kicks in when tpying also handles the escape on paste functionality and hence it cannot act/escpae on a single character. The escape on paste code should be moved out of the JavaStringAutoIndentStrategy into its own IAutoEditStrategy strategy which is only registered when pasting.
Other cases to test: 1. With - 'Wrap automatically' disabled and - 'Escape when pasting' enabled, pressing the 'Enter' key inside "|" results in "\r\n" + "|" if the document has Windows-style line delimiters (works fine with Unix or old Mac delimiters, since there's a special case for entering a single character) Expected: should result in " |" (regardless of the 'Escape when pasting' option). When 'Wrap automatically' is enabled, pressing 'Enter' should always result in "" + "|" 2. On paste of a line delimiter (or text with line delimiters) with 'Escape when pasting' enabled, the result should be: - if 'Wrap automatically' is enabled: "\r\n" + "|" - if 'Wrap automatically' is disabled: "\r\n|" Also, the doc needs to be updated: - Wrap automatically: If enabled, string literals are split into two lines and concatenated with a '+' when a line delimiter is inserted. -Escape text when pasting into a string literal: If enabled, special characters in the clipboard are escaped when they are pasted into an existing string literal.
I've fixed case 1.
The Photon release notes contain this new feature: https://www.eclipse.org/eclipse/news/4.8/M3/#escape-non-ascii-when-pasting But it does not work when pasting single characters. Even with this setting enabled, pasting a single unicode character results in no escaping. I figured this bug has the same root cause.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.