CodeMirror is putting tabs in my editor instead of spaces!

RESOLVED WORKSFORME

Status

P2
normal
RESOLVED WORKSFORME
5 years ago
2 months ago

People

(Reporter: rcampbell, Assigned: anton)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
enter some JS with a few levels of nesting in a Scratchpad. Copy and paste code from Scratchpad to Pastebin.

Look at all the tabs!
(Assignee)

Updated

5 years ago
Assignee: nobody → anton
Blocks: 816756
Priority: -- → P2

Comment 1

5 years ago
I can't reproduce this (Linux, 28.0a1 (2013-11-06))—I'm getting only spaces. The `indentWithTabs` option to CodeMirror appears to be off, and `Tab` is bound to something that inserts spaces. Are you doing anything special? Do the tabs also appear as tabs (cursor skipping over them) in the editor itself?
(Assignee)

Comment 2

5 years ago
I cannot reproduce it as well on Mac. I wrote some code, pasted in Pastebin and it is all spaces. Rob, we need more info about your setup and stuff.
Flags: needinfo?(rcampbell)
(Reporter)

Comment 3

5 years ago
I just jotted this into the scratchpad:

function say(hello) {
	function output(str) {
		console.log("message: " + str);
	}
	output(hello);
}

say("hi");

definitely tabs.

Prefs:

accessibility.typeaheadfind.autostart	false
accessibility.typeaheadfind.flashBar	0
accessibility.warn_on_browsewithcaret	false
browser.cache.disk.capacity	1048576
browser.cache.disk.smart_size_cached_value	358400
browser.cache.disk.smart_size.first_run	false
browser.cache.disk.smart_size.use_old_max	false
browser.display.background_color	#CCCCCC
browser.display.foreground_color	#333333
browser.display.screen_resolution	72
browser.display.use_system_colors	true
browser.history_expire_days_min	300
browser.history_expire_days.mirror	180
browser.link.open_newwindow.restriction	0
browser.places.createdDefaultQueries	true
browser.places.createdSmartBookmarks	true
browser.places.importBookmarksHTML	false
browser.places.importDefaults	false
browser.places.leftPaneFolderId	13585
browser.places.migratePostDataAnnotations	false
browser.places.smartBookmarksVersion	4
browser.places.updateRecentTagsUri	false
browser.privatebrowsing.dont_prompt_on_enter	true
browser.search.useDBForOrder	true
browser.sessionstore.restore_on_demand	false
browser.sessionstore.upgradeBackup.latestBuildID	20131107030200
browser.startup.homepage_override.buildID	20131107030200
browser.startup.homepage_override.mstone	28.0a1
browser.tabs.insertRelatedAfterCurrent	false
browser.tabs.insertRelatedAfterCurrent.backup	true
browser.tabs.loadFolderAndReplace	false
browser.tabs.loadInBackground	false
browser.tabs.tabMaxWidth	250
browser.tabs.tabMinWidth	100
browser.tabs.warnOnClose	false
dom.mozApps.maxLocalId	1002
dom.mozApps.runUpdate	false
dom.mozApps.used	true
dom.MozApps.whitelist	https://persona.org
dom.popup_allowed_events	change click dblclick mouseup reset submit keypress
dom.send_after_paint_to_content	true
dom.w3c_touch_events.expose	false
extensions.checkCompatibility	false
extensions.checkCompatibility.3.6b	false
extensions.checkCompatibility.4.0b	false
extensions.checkCompatibility.nightly	false
extensions.lastAppVersion	28.0a1
font.default.x-western	sans-serif
font.internaluseonly.changed	false
font.minimum-size.x-western	11
font.name.monospace.x-western	Menlo
font.name.serif.x-western	Century
font.size.variable.x-western	14
gfx.blacklist.webgl.msaa	4
gfx.color_management.mode	1
network.cookie.maxNumber	10000
network.cookie.prefsMigrated	true
network.http.pipelining	true
network.http.pipelining.aggressive	true
network.http.pipelining.maxrequests	24
network.http.pipelining.ssl	true
network.http.proxy.pipelining	true
network.protocol-handler.warn-external.adiumxtra	false
network.protocol-handler.warn-external.ecto	false
network.protocol-handler.warn-external.itms	false
network.protocol-handler.warn-external.itpc	false
network.protocol-handler.warn-external.xmpp	false
places.database.lastMaintenance	1383844908
places.history.expiration.transient_current_max_pages	104858
places.history.expiration.transient_optimal_database_size	167772160
places.last_vacuum	1275915103
plugin.disable_full_page_plugin_for_types	application/pdf
plugin.importedState	true
plugin.state.java	0
print.macosx.pagesetup	PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0IFBVQkxJQyAiLS8vQXBwbGUgQ29tcHV0ZXIvL0RURCBQTElT
print.macosx.pagesetup-2	PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0IFBVQkxJQyAiLS8vQXBwbGUvL0RURCBQTElTVCAxLjAvL0VO
print.print_bgcolor	false
print.print_bgimages	false
print.print_colorspace	
print.print_command	
print.print_downloadfonts	true
print.print_duplex	0
print.print_evenpages	true
print.print_footerleft	
print.print_footerright	
print.print_headerleft	
print.print_headerright	
print.print_in_color	true
print.print_margin_bottom	0.5
print.print_margin_left	0.5
print.print_margin_right	0.5
print.print_margin_top	0.5
print.print_oddpages	true
print.print_orientation	0
print.print_page_delay	50
print.print_pagedelay	500
print.print_paper_data	0
print.print_paper_height	11.00
print.print_paper_name	
print.print_paper_size	19
print.print_paper_size_type	1
print.print_paper_size_unit	0
print.print_paper_width	8.50
print.print_plex_name	
print.print_printer	
print.print_resolution	0
print.print_resolution_name	
print.print_reversed	false
print.print_scaling	1.00
print.print_shrink_to_fit	true
print.print_to_file	false
print.print_unwriteable_margin_bottom	56
print.print_unwriteable_margin_left	25
print.print_unwriteable_margin_right	25
print.print_unwriteable_margin_top	25
privacy.donottrackheader.enabled	true
privacy.popups.showBrowserMessage	false
privacy.sanitize.migrateFx3Prefs	true
security.disable_button.openCertManager	false
security.disable_button.openDeviceManager	false
security.enable_java	true
security.OCSP.signingCA	Builtin Object Token:Verisign Class 1 Public Primary OCSP Responder
security.OCSP.URL	
security.warn_viewing_mixed	false
storage.vacuum.last.index	1
storage.vacuum.last.places.sqlite	1381854567

Extensions:

Adblock Plus	2.4	true	{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}
Copy ShortURL	2.0	true	jid0-ODIKJS9b4IT3H1NYlPKr0NDtLuE@jetpack
Firefox OS Simulator	4.0	true	r2d2b2g@mozilla.org
FxIF	0.4.7.1	true	{11483926-db67-4190-91b1-ef20fcec5f33}
Mass Password Reset	1.05	true	masspasswordreset@johnathan.nightingale
Pocket	3.0.4	true	isreaditlater@ideashower.com
Socialite	1.5.1	true	socialite@chromakode
Sort Tabs	1.1	true	sort-tabs@erikvold.com
TabCloser	1.07	true	tabcloser@gavinsharp.com
Tumblr	1.1	true	jid0-505z9sfBXZaQjzjmiUDpPsTKvHo@jetpack
TweetRight	0.43.1	true	jid1-SmvuJ9Cq3Cx13w@jetpack
Twitter Address Bar Search	1	true	twitter.address.bar.search@firefox.twitter
User Agent Switcher	0.7.3	true	{e968fc70-8f95-4ab9-9e79-304de2a71ee1}
WikifyTabs	1.1	true	wikifytabs@antennasoft.net
Adobe Acrobat - Create PDF	1.2	false	web2pdfextension@web2pdf.adobedotcom
DOM Inspector	2.0.14	false	inspector@mozilla.org
RESTClient	2.0.3	false	{ad0d925d-88f8-47f1-85ea-8463569e756e}
Tabs for me too.
(Assignee)

Comment 5

5 years ago
Same in the Private Browsing mode?
(Reporter)

Comment 6

5 years ago
er...

function a() {
    function b() {
        return 2;
    }
}

inserting spaces on my desktop machine at home.

function a() {
  function b() {
    return 2;
  }
}

that's with tabsize: 2.

expandtabs is true.

I'm going to verify on my laptop that expandtabs is also true there. Will report back.
Flags: needinfo?(rcampbell)
(Reporter)

Comment 7

5 years ago
sigh. expandtabs was false. My bad. 

function a() {
  function b() {
    return 2;
  }
}

thanks Anton and Marijn (and Optimizer).
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → WORKSFORME
I have expandTabs as true. I still get tabs in scratchpad while pasting the function from comment 3 .
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
(Assignee)

Comment 9

5 years ago
It doesn't *convert* tabs into spaces when you paste code. If you press [tab] it will insert spaces. But if you paste code with tabs, tabs will stay there.
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → WORKSFORME
Okies.

Updated

2 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.