Toad World® Forums

Tabs being replaced by spaces on copy and paste

When you copy and paste a chunk of text that includes tabs, they are usually replaced with spaces. The number of spaces matching the value of the “Tab Size” or “Indent Size” setting (both are the same for me). It does this despite “Use Tab Characters” being turned on under indent size.

Fixing that requires searching and replacing four spaces with the tab character.

It’s a relatively minor but annoying issue.

I think this is a known error, at least I’m pretty sure we reported it before, since it’s been in all 6.x versions. If so I just want to check if this is going to be fixed in this release. If not, then hopefully there is still time to fix it, or at least to get it on the list for the first post 7.0 patch.

The latest several betas of 7.x finally fixed the search and replace so that you could replace with tabs, so that helps. But it would be better not to have to do that.

Thanks,
Peter S

Hi Peter,

Firstly I would like to say sorry that we missed your replies after migrating to new community, here I will attache them.


Hi Peter,

Thank you for reporting this issue again.

May I ask if you have set option “Use TAB Characters” ON in preference? (View | Pref | Code Editor | Use TAB Characters) Because it will be off automatically if you set option “Smart Tab” on, and if “Smart Tab” is ON, all the tabs will be converted to space when click Tab or paste as you described.

So could you please have a check about these options first Peter: Use TAB Characters & Smart Tab & Smart Fill.

For you situation I would suggest:

Use TAB Characters -> ON

Smart Tab -> OFF (it will be OFF automatically if you set Use TAB Characters -> ON)

Smart Fill -> ON

Please let me know if the options work well for you, we would like to give help anytime.

Thanks,

Shirly



Those are exactly the settings I already have. I don’t like smart tab, and I much prefer tab characters so after any install I make sure that Smart Tab is of and3Use Tab Characters is on.

Smart Fill I never change, but it is on if that matters.

That’s why it’s frustrating that the tabs get converted to spaces on copy and paste.

Peter S


Thanks,

Shirly

Hi Peter,

So far I haven’t reproduced your issue with option Use tab character ON, tabs can be pasted well for me, if you could provide some more detials that would be great. Anyway I will keep an eye on it and thanks for letting us know.

By the way, we have an option Leading space to tabs, it’s under Right click in Code Editor | Edit | Tabs/Spaces | Leading space to tabs. This option will help user to convert leading spaces to tabs, hope it could help.

Any issues please feel free to let us know, thanks.

Thanks and regards,

Shirly

I may not have made this clear, so maybe it’s happening and you just aren’t seeing it. But a single tab is repalced with 4 spaces. So unless you arrow or click into the middle of a tab, it can look ok. Since that matchs the indent size, at least for me.

Other than that, I really don’t have any other details. It doesn’t happen on every copy and paste, but it does happen about half the time on average I would say. It’s hard to be sure since my routine now is to just ignore it until for a while and then do a global search and replace on four spaces to replace all such instances with a tab.

Every time I think I see a pattern, it turns out I’m wrong. Though it does seem to happen more often the more lines you copy and paste at once.

If it will help I could send you copy of a file I’ve been working on today. It’s got a number of instances of four spaces, and all of those have been created in the last hour or two, since I’ve already done the search and replace at least once today. I’d prefer to send that direct rather than as an attachment however.

I know that probably doesn’t help much, but maybe it will at least confirm that I’m not seeing things.

Peter S

Hi Peter,

Thank you for your kindly details.

I truely believe this might be an issue bothered you, and I am trying hard to finding it out too.

So could you send the file you have been working with this issue to me please? I would like to have a check with it and give you feedback, thanks.

You can just send it to me directly via email if you like: Shirly.Nie@quest.com.

Best regards,

Shirly

As discussed on e-mail this now seems to have been caused by the smart fill option being turned off.

If I see a recurrence now that it has been turned on I’ll let you know.

Thanks for looking into this.

Peter S