paste TAB in editor misplaces cursor

kofolamaster

Member²
This seems to be a minor bug: when pasting text from clipboard which contains TABs (chr(9)) into editor window, developer places the cursor not right after the last character pasted, but few chars before.

when pasting text (\t means the TAB character, | is the cursor representation):
cursor is placed between 'e' and 'f':
instead of after 'f':
 
I cannot reproduce this. Can you let me know the editor preference settings from the "Tabs & Wrapping" section?
 
The settings are:
Step (chars): 2
Smart tab: [x]
Smart fill: [ ]
Use tab character: [ ]
Wrap lines: [ ]
Allow cursor after end of line: [ ]
Visible margin: 80
 
I still have no luck reproducing this. As a test, can you modify the shortcut and add the NoPlugIns parameter? For example:

"C:\Program Files\PLSQL Developer\plsqldev.exe" NoPlugIns

 
Pasting should be made on the first line, first character of the editor (the editor may contain text) - which is the usual case when pasting scripts/parts from external editors.
 
Last edited:
I can reproduce this using the settings provided above when pasting into an empty editor window. "noplugins" does not help.

Checking/unchecking "smart tab" does not appear to affect it.
Increasing "tab size" increases the effect of the bug. Setting it to 8 causes the result "abc | def" (position is off by 7).
Checking "use tab character" makes the problem go away.

Looks like when positioning the cursor the editor uses the original number of characters (including the single tab) rather than the new count (including the multiple spaces), causing an incorrect cursor position.
 
Still present in 8.0.4.1514

I have widened the test case:
0. enter into Notepad abc\tdef (\t being TAB character) and copy it into clipboard
1. open new SQL window
2a. do not type anything into SQL window
2b. type following into SQL window: x
2c. type following into SQL window: xx
2d. type following into SQL window: xxx
2e. type following into SQL window: xxxx
3. paste clipboard

The result is:
4a. abc de|f (this is wrong)
4b. xabc de|f (this is wrong)
4c. xxabc de|f (this is wrong)
4d. xxxabc de|f (this is wrong)
4e. xxxxabc def| (this is correct)

The bug manifests itself even in the undo-stack:
in clean SQL window type:
1. zzzzzzzzzzzz
2. now clean the window with: CTRL-a; DELETE
3. paste the clipboard (abc\tdef)
4. CTRL-z
The result should be clean window (as before paste), but instead, there's following:
abc def

 
Last edited:
Back
Top