Re: [ace] Spaces acting as tabs and strange backspace behavior

1,972 views
Skip to first unread message

Harutyun Amirjanyan

unread,
Aug 6, 2012, 2:20:42 AM8/6/12
to ace-d...@googlegroups.com
Hi
to not convert tabs to spaces use editor.session.setUseSoftTabs(false)
also editor.setShowInvisibles(true) to see the tabs

but i didn't quite understand what the problem is
do you press tab key after "<tag" and it is converted to a single space?

"actual cursor is not where it's displayed" usually happens if
editors' font isn't monospace
could you give a link to the page with this bug
or maybe create quick example on http://jsbin.com/?

thanks

bergonzzi

unread,
Aug 6, 2012, 4:52:40 AM8/6/12
to ace-d...@googlegroups.com
Hi,

After posting I got that part working using editor.session.setUseSoftTabs(false) as you suggested, so no more real tabs and the actual "strange behavior" is also gone.

Now the issue remains in that pressing tab creates an actual space (and a space acts normally).
It looks like something is misaligned, maybe related to fonts as you mentioned but the editor has the default font enabled which is monospace.
There seems to be an issue with tabs somehow. I also tried pasting some xml code with tabbed indentation and even though it displays well, as soon as I try to edit like deleting a few characters, the "misalignment" immediately shows.

Here's my code: http://jsbin.com/oterar/2/edit

Sorry if I'm missing something obvious, I'm a javascript newbie.

Thanks!

Harutyun Amirjanyan

unread,
Aug 6, 2012, 5:33:48 AM8/6/12
to ace-d...@googlegroups.com
hmm, strange i don't see any misalignment
http://jsbin.com/oterar/3/edit
is there misalignment on
http://ajaxorg.github.com/ace-builds/kitchen-sink.html too?

bergonzzi

unread,
Aug 6, 2012, 6:32:01 AM8/6/12
to ace-d...@googlegroups.com
No misalignment for me on the kitchen sink demo, works perfectly there.

Ahhh... your example works perfectly. I think it has to do with the build that I downloaded, I think I got it from "src-min-noconflict". If I use the ones from "src" then it works just perfectly.

Thanks!

Matthias Götzke

unread,
Sep 11, 2014, 1:25:20 AM9/11/14
to ace-d...@googlegroups.com, berg...@gmail.com
Well its not working for me in the kitchen sink either... When enabling Soft Tabs the cursor moves more than 1 character (jumping 4 in the kitchen sink demo). It is obviously a mode where the arrow keys act as if the spaces where tabs. When disabling that it actually inserts tabs.

There seems to be no way to emulate the mode every normal editor i know works with softtabs. That is it just inserts spaces when pressing tab. Arrow movement is left alone.

Or is there ?

Harutyun Amirjanyan

unread,
Sep 12, 2014, 1:14:54 PM9/12/14
to ace-d...@googlegroups.com, berg...@gmail.com
This is the mode sublime text and textmate work.
The way other editors work isn't hard to implement we just didn't have
many requests for that yet
see https://github.com/ajaxorg/ace/issues/1721

mgt...@gmail.com

unread,
Sep 13, 2014, 1:30:26 AM9/13/14
to ace-d...@googlegroups.com
Thanks for the feedback but I am using only sublime text and do use spaces as tabs  and this is not how it works for me at least.. And neither for my colleagues ..

I can always go to the beginning of any line (indented) and use the arrow keys to skip ahead a single space as it should be..

I will comment on the issue..


From: Harutyun Amirjanyan
Sent: ‎12.‎09.‎2014 19:14
To: ace-d...@googlegroups.com
Cc: berg...@gmail.com
Subject: Re: [ace] Spaces acting as tabs and strange backspace behavior

--
You received this message because you are subscribed to a topic in the Google Groups "Ajax.org Cloud9 Editor (Ace)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ace-discuss/d4iO1I-kfis/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ace-discuss...@googlegroups.com.
To post to this group, send email to ace-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/ace-discuss.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages