Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy and pasting text between files causes leading whitespace to be trimmed in Xcode

Tags:

xcode

xcode4

In Xcode 4, I'm having a problem with leading white space (it's being trimmed), when copy and pasting between files. In the hex dump, I see 0x20s in the source, but not in the copy; this means the text is being changed on paste.

In preferences > text editing > indentation, I have prefer indent using: spaces and tab key: indents in leading white space set.

This doesn't happen on trailing whitespace. How can I fix this problem?

like image 337
timpone Avatar asked Sep 06 '11 16:09

timpone


People also ask

How do you paste in pages without formatting?

Use Keyboard Shortcuts On Windows, you can use the combination Ctrl + Shift + V to paste without formatting in several major programs, such as Google Chrome.

How do you copy and paste and use the same font?

Method 1: Add a shiftEvery time. On some — but not all — apps, when you press Ctrl-V (Win)/Cmd-V (Mac), you can press Shift too. This activates “Paste and Match Style”, which converts the text to the same style as the destination document. This is usually what you want.


2 Answers

In that same Preferences > Text Editing > Indentation screen, try unchecking the Syntax-aware indenting option.

like image 99
jjs Avatar answered Sep 24 '22 08:09

jjs


You can try to use Edit > Paste and Preserve Formatting in Xcode. I can see it in version 5.1 but can't tell if it was there before. There is a keyboard combination for it, too: Alt+Caps+Command+C.

like image 40
enreas Avatar answered Sep 22 '22 08:09

enreas