spaces and tabs

7 views
Skip to first unread message

albert

unread,
Feb 22, 2008, 12:01:20 PM2/22/08
to cke, text editor for pocket pc
I've noticed the following:when I start a line with a couple of spaces
equal or larger than my tab setting, and I press return for a new
line, the new line starts with as many tabs as needed followed by as
many spaces as needed to make the indent.
I like using tab to quickly skip a few positions, but I'm used to
having one tab turned into an appropriate number of spaces, so is it
possible to have a setting for this? Now my Python code gets messed up
and I find myself turning to Total Commander's builtin editor despite
the lack of syntax colouring and other nifty features that cke has.

Albert

Esteban

unread,
Feb 23, 2008, 3:35:42 AM2/23/08
to cke, text editor for pocket pc
I don't know very well how to handle this issue, several non exclusive
possibilities include:
1. do not be so clever when making enter, simply reproduce the same
sequence of spaces and tabs that begins the current line.
2. An option that transforms tabs to spaces, either in saving or
immediately
3. An option that makes tab navigate instead of insert
I'm making a wish list page in this group so please let me know your
opinion on the best way to handle this

For your current problem you have several partial solutions:
1. Uncheck the "Indent new paragraphs" in your Python class. Then you
will need to indent manually, but you can do it as you wish.
2. set the tab size in your python class equal to the one used in your
desktop pc.

btw. Do you know of a python interpreter for PPC?

albert

unread,
Feb 23, 2008, 4:27:08 AM2/23/08
to cke, text editor for pocket pc

In my desktop editors, I always have a setting "use spaces instead of
tabs" turned on. So my preferred behaviour would be to use tabs only
for inserting multiple spaces (to be turned on or off at will of
course).
I mostly use Scite, what it does is the following:
I set my tab widt to, say, 4.That means that when I use tab, the caret
get moved to the next position that is a multiple of 4 away from the
left margin, and an appropriate number of spaces is inserted between
the previous and the new caret position.
So when I'm on position 1 and I press tab, the caret moves to 4 and 4
spaces are inserted. When I'm on position 2, the caret also moves to 4
and 3 spaces are inserted.
Additionally, when I'm on position 2 and I press tab twice, the caret
moves to 8 and 7 spaces are inserted.

Having a wish list for this kind of thing is a good idea, just don't
let it get in the way of your own decisions too much (so you don't put
things on hold becase you want to know what everybody thinks).

> btw. Do you know of a python interpreter for PPC?

I use the one mentioned here: http://wxpyce.wikispaces.com/

albert

unread,
Feb 23, 2008, 4:31:41 AM2/23/08
to cke, text editor for pocket pc
Oops sorry, wrong wiki, I meant this one: http://pythonce.sourceforge.net/Wikka/HomePage

Beverly Howard

unread,
Feb 23, 2008, 11:08:27 AM2/23/08
to cke...@googlegroups.com
I would respectfully suggest simply using your desktop app to convert
the tabs to spaces when convenient.

fwiw, in the long term I have found that using tabs and tab settings to
control the indents far superior to using spaces... gives much more
flexibility in display and indent control, plus, in most code, the only
place where tabs would be used would be for indents offering search options.

Beverly Howard [MS MVP-Mobile Devices]

albert

unread,
Feb 23, 2008, 12:03:50 PM2/23/08
to cke, text editor for pocket pc

> I would respectfully suggest simply using your desktop app to convert
> the tabs to spaces when convenient.

why? If I want to be able to run my Python code from the CKE tools
menu I simply need tabs converted to spaces within CKE

> fwiw, in the long term I have found that using tabs and tab settings to
> control the indents far superior to using spaces... gives much more
> flexibility in display and indent control, plus, in most code, the only
> place where tabs would be used would be for indents offering search options.

I do not want to ditch tabs or tab settings, I simply want to be able
to press tab and have an appropiate number of spaces inserted
depending on my settings.
In most languages, indentation just provides for better readability
(and there too, having to deal with different tab settings in
different editors or on different machines is a pain). But in Python,
it's (sort of) part of the syntax.
Btw could you please explain the bit about search options? I couldn't
quite place that.

Albert

Beverly Howard

unread,
Feb 23, 2008, 1:02:59 PM2/23/08
to cke...@googlegroups.com
Sorry, but I am not familiar with Python and it's inability to handle
tabs within code which would negate my suggestion, so I withdraw it.

If there was any way to search and replace tabs within cke (if there is
a way, I couldn't find it) that might offer an immediate solution, but a
keyboard macro tool might meet the need as well... i.e. hit a macro for
three spaces instead of a tab.

>> searching tabs <<

Can't give a specific, but over the years, there have been a number of
cases where searching for a tab or string of tabs has been extremely
useful compared to problems dealing with space indented code, for
example, code indented in 8 <space> increments, especially when it
contains text with multiple spaces.

Esteban

unread,
Mar 5, 2008, 10:16:12 AM3/5/08
to cke, text editor for pocket pc
You can actually search for tabs and replace by spaces and viceversa,
but it's a little tricky since you can't enter directly the tab
character in the search box, you can however copy a tab from the text
and paste it in the search or replace boxes and then it works fine.
For some unknown reason you have to use the Tap-and-hold "paste" to
paste any text in the search and replace boxes, the toolbar / menu
"copy/cut/paste" doesn't work on the search and replace boxes.

btw, there is a bug there and in replace all it skips one every two
consecutive matches ie if you replace A by B in
AAAA then "Replace ALl produces BABA the first time and BBBB the
second. I will try to solve this issues in next version.

Beverly Howard

unread,
Mar 5, 2008, 12:45:29 PM3/5/08
to cke...@googlegroups.com
>> search for tabs <<

Great tip, thanks...

Reply all
Reply to author
Forward
0 new messages