> --- Ursprüngliche Nachricht ---
> Von: Neil Hodgson <[EMAIL PROTECTED]>
> An: Discussion of the SciTE editor <[email protected]>
> Betreff: Re: [scite] catching errormessages and open file, goto line
> Datum: Mon, 14 Nov 2005 23:34:53 +1100
> 
> Frank Wunderlich:
> 
> > Is there a macro which returns current line/col?
> 
>    macrocommand is a generic way to execute Scintilla commands through
> the director interface but can only be understood through reading
> SciTE's (or Filerx's) source code.
> 
> > Do You implement the indent-Function/Menu-Item?
> 
>    SCI_TAB / SCI_BACKTAB are available to indent / dedent.
> 
ok, i have tried to implement it... here is the code

SciTEIO.cxx:
void SciTEBase::IndentLines()
{
  CharacterRange crange = GetSelection();
  int selFirstLine = SendEditor(SCI_LINEFROMPOSITION, crange.cpMin);
  int selLastLine = SendEditor(SCI_LINEFROMPOSITION, crange.cpMax);
  SendEditor(SCI_BEGINUNDOACTION);
  for (int j = selFirstLine; j <= selLastLine; j++) 
  {
    int lineStart = SendEditor(SCI_POSITIONFROMLINE, j);
    SendEditor(SCI_SETCURRENTPOS, lineStart);
    SendEditor(SCI_TAB);                
  }
  SendEditor(SCI_ENDUNDOACTION);        
}

SciTE.h:
#define IDM_INDENTSELLINES                      257

SciTEProps.cxx:
{"IDM_INDENTSELLINES", IDM_INDENTSELLINES},

SciTERes.rc:
MENUITEM "Indent Selection",    IDM_INDENTSELLINES

so, i can say, the function works depending on my bad c++knowledge very good
;>
it edits the right lines and inserts tabs at the beginning, but the thing
that is not as it should see below (lines 3 and 4 are selected, no
starting,ending linebreak):

test
test2
test3
test4
test5

and my function makes:

test
test2
  test3
    test4
test5

on second selected line it inserts 2 tabs...on further tests i noticed that
a similar function is already implemented but not in menu (selecting and
press tab)=> all lines will be indented (why have nobody say this to me?)
with this knowledge my function has no more the urgency...but for the users
who haven't this knowledge i let my function exist and cut it to the
following lines:
  SendEditor(SCI_BEGINUNDOACTION);
  SendEditor(SCI_TAB);
  SendEditor(SCI_ENDUNDOACTION);
thats all...a detend-function analog to it...with SCI_BACKTAB

is there a function in Scite that converts all tabs into spaces (count by
tabwidth)?

Greets Frank

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to