Jump to content
  • 0

Pasting from sublime text editor removes spaces


The Qodesmith

Idea

Hello everyone,

 

I use sublime text editor as my coding editor of choice. When I copy/paste from sublime into Evernote, all the indenting spacing is removed. This is terrible for trying to preserve the formatting of the code. I've tried command + shift + V as well with no success. Any thoughts? Is this a Mac EN bug?

Link to comment

5 replies to this idea

Recommended Posts

  • Level 5*

Hi - search for 'code' / 'coding' in the forums.  This is an EN everything 'bug' in that the format for that type of layout won't be saved.  Current options are:  screen shot / PDF / attach your sublime file to the note and edit it from there...

Link to comment

Tell your editor to use spaces instead of tabs, which as far as I am concerned, is a huge debate that need not be debated.  Most all editors can tab through spaces as though they were tabs, and if they can't do that, you can set them to convert spaces to tabs and tabs to spaces.

 

If you work in spaces for tabs, copy and paste of code will maintain it's formatting.

Link to comment

Thanks for the reply gentlemen.

Tell your editor to use spaces instead of tabs, which as far as I am concerned, is a huge debate that need not be debated.  Most all editors can tab through spaces as though they were tabs, and if they can't do that, you can set them to convert spaces to tabs and tabs to spaces.

 

If you work in spaces for tabs, copy and paste of code will maintain it's formatting.

 

@GreyGary: In Sublime, I've both set the user and default settings for translate_tabs_to_spaces as true. This still has no effect. Any thoughts?

Link to comment

Thanks for the reply gentlemen.

Tell your editor to use spaces instead of tabs, which as far as I am concerned, is a huge debate that need not be debated.  Most all editors can tab through spaces as though they were tabs, and if they can't do that, you can set them to convert spaces to tabs and tabs to spaces.

 

If you work in spaces for tabs, copy and paste of code will maintain it's formatting.

 

@GreyGary: In Sublime, I've both set the user and default settings for translate_tabs_to_spaces as true. This still has no effect. Any thoughts?

 

That is strange.  If you copy and paste to another text editor, does it maintain the tabs/spaces?  What if you manually replace a sample little if/else and hand key in spaces and see if that pastes into EN with success. If it does, then you know to start asking the Sublime people how come a copy does not copy the text as spaces but instead as tabs.

Link to comment

Hand-keying spaces still results in the same thing. Here's a curve ball though... I copied from sublime into the Notes app, then copied that text from Notes into EN and it worked! The paces were maintained. The only thing is the font was carried over from Notes as well. If I did CMD + SHIFT + V from notes to EN, then we're back at square one - the spaces don't translate.

 

That got me thinking. If EN senses that a font is present, then it will paste the correct format. When copying from Sublime to EN, apparently there is no font present. I wonder if there's a way to force a font to be present? Looks like Sublime has no formatting when copying.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...