Re: [scite] [lua] removing empty lines

2007-08-03 Thread steve donovan
Hi Frank,

You are passing a table to editor:ReplaceSel(); I did a little test:

editor:ReplaceSel ({'one','two'})

and the selection disappears. So you would have to make your table
into a string using table.concat(buf,'\n').

BTW, removing stuff using your method should work:

for i = 1,#t do
if t[i] == '' then
table.remove(t,i)
end
end

t = {'one','','two','three'}

for i,v in pairs(t) do print(i,v) end

gives us what one would expect.

steve d.



On 8/3/07, Frank Wunderlich [EMAIL PROTECTED] wrote:
 Hi
 i want to write a funktion to remove empty lines in a selection
 this is my code:

 function removeEmptyLines()
local buf={}
local sel = editor:GetSelText()
buf = lines(sel)
for i=table.getn(buf),1,-1 do
  _ALERT(i.. - ..buf[i])
  if buf[i]=='' then
table.remove(buf,i)
  end
end
editor:ReplaceSel(buf)
 end

 it seems that the last entry of the table contains the full seletion, al
 others the exact line.

 the following selection:
 123

 456

 789

 gives me in the output pane:
 5 - 123

 456

 789
 4 -
 3 - 456
 2 -
 1 - 123

 if the remove is called, the complete selection is deleted.

 what have i done wrong?

 regards Frank
 ___
 Scite-interest mailing list
 Scite-interest@lyra.org
 http://mailman.lyra.org/mailman/listinfo/scite-interest

___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] Re: SciTE and Win32 - regex to replace tabs and how to insert tab

2007-08-03 Thread Philippe Lhoste

On 02/08/2007 21:31, Mark Leddy wrote:

1) How can I inset a tab character \t ?


This is a hard one... :D
Just put \t!

Tested (just in case) by replacing \d+ by \t, it worked for me.

2) How to do a search and repace so that all \t tab characters get 
replaced with \r\t  (a windows carrage return line feed)?


Well, put \t in the Search field, and \r\n in the Replace field...
For this, no need for RE, just use the \xx option (might be faster, work 
on the reverse operation, unlike RE which just search per line).


--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Regex search/replace: ? does not work

2007-08-03 Thread Alexander Kriegisch
 Searching for ob? in regex mode should yield two results, but it
 yields zero. There seems to be a problem with ?.
 
 You'll find the answer here:
 http://scintilla.sourceforge.net/SciTERegEx.html

Would you mind quoting the paragraph where I can find the answer? On the
whole page there is not a single occurrence of ?. This is not an
answer (I do know how to work with REs), but leaves room for speculation
at best.
--
Alexander Kriegisch
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Regex search/replace: ? does not work

2007-08-03 Thread Istvan

Alexander Kriegisch wrote:


Searching for ob? in regex mode should yield two results, but it
yields zero. There seems to be a problem with ?.


You'll find the answer here:
http://scintilla.sourceforge.net/SciTERegEx.html

Istvan
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Folding of second-level blocks

2007-08-03 Thread Ivan Kolev

http://mailman.lyra.org/pipermail/scite-interest/2007-June/009240.html


I didn't find how to manipulate folding points from Lua, but I found the 
documentation about Ctrl/Shift+click on the fold points. Hitting Ctrl-click on 
the top fold when it is open will close it along with all sub-folds. Then just 
clicking the top fold will open it, and all sub-folds will remain closed. 
That's what I needed.

Thanks,
Ivan
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] Regex search/replace: ? does not work

2007-08-03 Thread Alexander Kriegisch
In regex mode SciTE does not find characters followed by the ? meta
character. Example:

Text in editor pane:
foo
foobar
fubar
baz
foobaz

Searching for ob? in regex mode should yield two results, but it
yields zero. There seems to be a problem with ?.
-- 
Alexander Kriegisch
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] [lua] removing empty lines

2007-08-03 Thread Frank Wunderlich

steve donovan, 03.08.2007 08:10:

Hi Frank,

You are passing a table to editor:ReplaceSel(); I did a little test:

editor:ReplaceSel ({'one','two'})

and the selection disappears. So you would have to make your table
into a string using table.concat(buf,'\n').

ok, i'll try it


BTW, removing stuff using your method should work:

for i = 1,#t do
if t[i] == '' then
table.remove(t,i)
end
end


you make a forward-loop, this is no good idea when removing items from a 
list (skipping next entry after deletion,maybe accessing item out of 
list-bounds at the end). the loop should go backwards. and there i get 
this strange behaviour.

is #t the same as table.getn(t)?

regards Frank
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] Re: Regex search/replace: ? does not work

2007-08-03 Thread Philippe Lhoste

On 03/08/2007 15:18, Alexander Kriegisch wrote:

Searching for ob? in regex mode should yield two results, but it
yields zero. There seems to be a problem with ?.

You'll find the answer here:
http://scintilla.sourceforge.net/SciTERegEx.html


Would you mind quoting the paragraph where I can find the answer? On the
whole page there is not a single occurrence of ?. This is not an
answer (I do know how to work with REs), but leaves room for speculation
at best.


Well, if you don't find ?, that mean it isn't supported... REs in 
Scintilla are pretty primitive...


Note that with a more complete RE library, and the text you gave:

foo
foobar
fubar
baz
foobaz

you should find 6 occurences: 6 with o and 2 with ob.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] Re: [lua] removing empty lines

2007-08-03 Thread mitchell

Frank Wunderlich wrote:

steve donovan, 03.08.2007 13:04:

On 8/3/07, Frank Wunderlich [EMAIL PROTECTED] wrote:

you make a forward-loop, this is no good idea when removing items from a
list (skipping next entry after deletion,maybe accessing item out of
list-bounds at the end). the loop should go backwards. and there i get
this strange behaviour.
is #t the same as table.getn(t)?


Yes, you are right about the order.


but how to get the decreasing loop, without this strange last item?

Frank


You could create another table and add elements that don't match to it.

local new = {}
for i = 1, #t do
  if t[i] ~= '' then table.insert(new, t[i]) end
end

-Mitchell;

___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] [lua] removing empty lines

2007-08-03 Thread Frank Wunderlich

steve donovan, 03.08.2007 13:04:

On 8/3/07, Frank Wunderlich [EMAIL PROTECTED] wrote:

you make a forward-loop, this is no good idea when removing items from a
list (skipping next entry after deletion,maybe accessing item out of
list-bounds at the end). the loop should go backwards. and there i get
this strange behaviour.
is #t the same as table.getn(t)?


Yes, you are right about the order.


but how to get the decreasing loop, without this strange last item?

Frank
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] [lua] removing empty lines

2007-08-03 Thread steve donovan
On 8/3/07, Frank Wunderlich [EMAIL PROTECTED] wrote:
 you make a forward-loop, this is no good idea when removing items from a
 list (skipping next entry after deletion,maybe accessing item out of
 list-bounds at the end). the loop should go backwards. and there i get
 this strange behaviour.
 is #t the same as table.getn(t)?

Yes, you are right about the order.

#t is a nice shortcut for table.getn() in Lua 5.1 - assuming you're
running SciTE 1.74 !

steve d.
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Re: Regex search/replace: ? does not work

2007-08-03 Thread Alexander Kriegisch
 Would you mind quoting the paragraph where I can find the answer? On the
 whole page there is not a single occurrence of ?. This is not an
 answer (I do know how to work with REs), but leaves room for speculation
 at best.
 
 Well, if you don't find ?, that mean it isn't supported... REs in 
 Scintilla are pretty primitive...

Thanks for this information. As I said: It not being mentioned left room
for speculation. I have read hundreds of manuals in the last 20 years,
and from my experience the fact alone that something is not mentioned
does not necessarily mean that it is unsupported. Often it just means
that the documentation is incomplete. So forgive me if I asked, I wanted
to be sure. If your initial answer would have been just the tiniest bit
more explicit, this to-and-fro would have been avoided.

 Note that with a more complete RE library, and the text you gave:
 
 foo
 foobar
 fubar
 baz
 foobaz
 
 you should find 6 occurences: 6 with o and 2 with ob.

Correct. I was just focusing on the two I was testing on, my fault.

Talking about REs, I would like to ask the developers if there is any
chance for a more extensive RE library being implemented or adapted
(there are several free candidates which might fit in, I can imagine) in
the near future? I do not want to push, just know, so I have a basis to
decide if I can plan on making SciTE my default editor or still stay
with another product, even though there are many features I like very
much about SciTE. But I do need basic RE support (? is pretty basic, I
guess) and also often need multi-line REs, in rare cases even things
like lazy matching (nice to have). As I said, just asking, explaining
and suggesting, not pushing. Who am I to force you anyway? ;-)

Regards
--
Alexander Kriegisch
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] Re: Regex search/replace: ? does not work

2007-08-03 Thread Philippe Lhoste

On 03/08/2007 18:38, Alexander Kriegisch wrote:

If your initial answer would have been just the tiniest bit
more explicit, this to-and-fro would have been avoided.


I am not Istvan...


Talking about REs, I would like to ask the developers if there is any
chance for a more extensive RE library being implemented or adapted
(there are several free candidates which might fit in, I can imagine) in
the near future?


Asked several times, little chance to happen in SciTE. Some work can be 
done in Lua, either with the base native RE library (primitive too) or 
with the lpeg library.


--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Compiler error

2007-08-03 Thread Robert Roessler

Roger Sondermann wrote:

I do get the following error when compiling the current CVS-
Version, maybe one of the usual Borland things. Is there a way to 
fix it?


Borland Resource Compiler  Version 5.40
Copyright (c) 1990, 1999 Inprise Corporation.  All rights 
reserved.
ilink32 -Gn -x -c -Tpe -aa c0w32 SciTEBase.obj   

 ...

Fatal: Command arguments too long


Not using the Borland tools or whatever build system you are using 
myself, just a general observation and a question:


Most linkers have a way of specifying lengthy link args by stuffing 
all the filenames and switches into a file, and then just mentioning 
that on the command line, e.g., link @files.txt.


Also, why does this tool announce itself as the ... Resource 
Compiler - those usually are not involved in the link process?


Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Re: Regex search/replace: ? does not work

2007-08-03 Thread Neil Hodgson
Alexander Kriegisch:

 Talking about REs, I would like to ask the developers if there is any
 chance for a more extensive RE library being implemented or adapted

   No.

   Neil
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Compiler error

2007-08-03 Thread Neil Hodgson
   Building with Borland 5.5 currently fails. I tried to use the
current version of Borland's compiler to build and couldn't get that
to work. Unless someone wants to contribute a fix to get 5.5 working,
its time to say that Borland is no longer supported.

   Neil
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] no syntax highlighting in scite

2007-08-03 Thread Rahul Garg
(I sent this mail to scintilla-interest initially .. should have sent it
here .. sorry for duplicate mail)

Hi.
I downloaded scite source distribution and did a make (on kubuntu 7.04). The
resulting executable of scite did no syntax highlighting after I opened a
test file test.c
Moreover the Languages menu is empty.
I downloaded the prebuilt executable for linux and it has the same behavior.

Any ideas?

thanks,
rahul
___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


[scite] Re: no syntax highlighting in scite

2007-08-03 Thread mitchell

Hi,

(I sent this mail to scintilla-interest initially .. should have sent it 
here .. sorry for duplicate mail)


Hi.
I downloaded scite source distribution and did a make (on kubuntu 7.04). 
The resulting executable of scite did no syntax highlighting after I 
opened a test file test.c

Moreover the Languages menu is empty.
I downloaded the prebuilt executable for linux and it has the same 
behavior.

Any ideas?


Did you put everything in /usr/share/scite?

-Mitchell;



thanks,
rahul




___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest


Re: [scite] Re: no syntax highlighting in scite

2007-08-03 Thread Rahul Garg
yeah works now .. thanks for the info .. i responded just now on
scintilla-interest too .. sorry for the duplicate mails :(

On 8/4/07, mitchell [EMAIL PROTECTED] wrote:

 Hi,

  (I sent this mail to scintilla-interest initially .. should have sent it
  here .. sorry for duplicate mail)
 
  Hi.
  I downloaded scite source distribution and did a make (on kubuntu 7.04).
  The resulting executable of scite did no syntax highlighting after I
  opened a test file test.c
  Moreover the Languages menu is empty.
  I downloaded the prebuilt executable for linux and it has the same
  behavior.
  Any ideas?

 Did you put everything in /usr/share/scite?

 -Mitchell;

 
  thanks,
  rahul
 
 
  
 
  ___
  Scite-interest mailing list
  Scite-interest@lyra.org
  http://mailman.lyra.org/mailman/listinfo/scite-interest

 ___
 Scite-interest mailing list
 Scite-interest@lyra.org
 http://mailman.lyra.org/mailman/listinfo/scite-interest

___
Scite-interest mailing list
Scite-interest@lyra.org
http://mailman.lyra.org/mailman/listinfo/scite-interest