Neil Hodgson:
I find it difficult to understand your point of view from your
writing. Quite often I'm thinking, "but that's completely obvious:
what does he really mean"? If you search for indent on the SciTE
documentation page it has "Indent Block | Tab". Its also common
behaviour for editors. I was thinking that you may have really meant
automatic language sensitive indentation and mentioning SCI_TAB would
at least clear that up.
Neil
Sorry for the confusion, but i really try to make my concerns coherent...
To the block-indent-problem: i've read over the section "Keybindings"
because i expected not, there are special bindings with no Menu-Item
like block-identation. I think this must be obvious in caption of paragrah.
a indentation-coversion-function will be also useful, i think...but i'm
not able to write this completely in c++.
simply: the function must convert the indention-chars (whitespace on
beginning of line) to tabs if use.tabs is set and to spaces if use.tabs
not set...
here my previos code with some comments
void SciTEBase::ConvertIndents()
{
int FirstLine = 1; //possibly 0
int LastLine = SendEditor(SCI_GETLINECOUNT, 0, 0);;
SendEditor(SCI_BEGINUNDOACTION);
for (int j = FirstLine; j <= LastLine; j++)
{
int lineStart = SendEditor(SCI_POSITIONFROMLINE, j);
SendEditor(SCI_SETCURRENTPOS, lineStart);
//getting text from line j
s=GetLine(j);
p=0;
//loop chars in line
while (isSpaceChar(s[p]) || (p==strlen(s))
{
//here must be a checking for tab if props.GetInt("use.tabs")=0
//or props.GetInt("indent.size") *
//Space if props.GetInt("use.tabs")=1
//and replace for the other
//till the first non-whitespace is came
if (props.GetInt("use.tabs")==0)
{
if (s[p]=='\t')
{
//deleting char p+linestart and insert
//StringOfChar(' ',);
p=p+props.GetInt("indent.size");
}
} else
{
//checking if props.GetInt("indent.size") * chars are
// all spaces and replacing them with 1 tab
//(comparison-code in delphi, don't know the c++-functions)
if ((copy(s,p,props.GetInt("indent.size"))) ==
(StringOfChar(' ',props.GetInt("indent.size"))))
{
//deleting chars p - p+props.GetInt("indent.size") and insert
//a tab
}
}
p++;
}
}
SendEditor(SCI_ENDUNDOACTION);
}
i hope with parts of the code you understand what i mean ;>
_______________________________________________
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest