Frank Wunderlich | 1 May 2006 22:05
Picon
Picon

Re: Re: parsing file using lua

Roman Hubacek, 27.04.2006 08:44:
>> Roman Hubacek, 26.04.2006 17:23:
>>> function openPasFromDpr2()
>>>   local path = props['FileDir']  --without trailing /\
>>>   local file = editor:textrange(0, editor.Length)
>>>   for uses in string.gfind(file, "uses.*;") do
>>>     for c in string.gfind(uses, "\'([^\']*)\'") do
>>>       scite.Open(path .. '\\' .. c)
>>>     end
>>>   end
>>> end
> Prevent changing buffer is AFAIK not possible. You can change back by 
> scite.Open original file (props['FilePath']). When file is opened, it 
> just does buffer change.

Hi Roman,
the script works perfect except files that be commented out...

is there a possibility to exclude values that have // before '..' or (* 
and *) or { and } around '..'?

e.g. following files must not be opened:

...//...'Test.pas'...
...{...'Test.pas'...}...
...(*...'Test.pas'...*)...

Frank
Alexander Anderson | 1 May 2006 23:49
Picon

Newbie User: Printing in Black & White

Dear SciTE interest,

    I recently discovered SciTE (1.68) as a programming editor, and I
find it just beautiful.  Small, fast, elegant and beautiful.  I
particularly like syntax highlighting features -- not simply different
colours, but styles and fonts too.

    I don't know whether this is the right place to ask this type of
question, but...

    ...I like to study large files of (hobby) code on paper.  I have a
black and white bubble-jet printer.  However, my (Win NT4) screen
syntax-highlighting setup has a couple of problems when it comes to
doing print-outs.  

    The _chief_ problem is that my on-screen background colour is not
bright white -- it's an off-white cream, which is so much easier on my
eyes:

SciTEGlobal.properties...

...
# Global default styles for all languages
# Default
style.*.32=$(font.base),back:#EDE1D5,fore:#000000
...

    However, each page of printout appears as black (or darkish)
characters, on top of a filled rectangle of light texture, as the above
"background".
(Continue reading)

Yousef Raffah | 1 May 2006 18:30

SciTE is crashing on FreeBSD 6.1-RC

Hello,

I just installed SciTE on FreeBSD 6.1-RC but unfortunately it is
crashing every time I run the application giving me the following error:

(SciTE:50104): GLib-GObject-WARNING **: specified class size for type
`Scintilla' is smaller than the parent type's `GtkContainer' class size

(SciTE:50104): Gtk-CRITICAL **: gtk_type_new: assertion
`GTK_TYPE_IS_OBJECT (type)' failed

(SciTE:50104): Gtk-WARNING **: invalid cast from (NULL) pointer to
`(unknown)'

(SciTE:50104): GLib-GObject-WARNING **: specified class size for type
`Scintilla' is smaller than the parent type's `GtkContainer' class size
Segmentation fault: 11 (core dumped)

my gcc version is:

[yraffah <at> redevil ~]$ gcc --version
gcc (GCC) 3.4.4 [FreeBSD] 20050518
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

I would be happy to provide more information in order to use SciTE

(Continue reading)

Philippe Lhoste | 2 May 2006 06:57
Picon

Re: Newbie User: Printing in Black & White

Alexander Anderson wrote:

> Dear SciTE interest,
>     I don't know whether this is the right place to ask this type of
> question, but...

Perfectly fine!

>     ...I like to study large files of (hobby) code on paper.  I have a
> black and white bubble-jet printer.  However, my (Win NT4) screen
> syntax-highlighting setup has a couple of problems when it comes to
> doing print-outs.  

Old hardware and related software, isn't it? :-) I write this on my 
Pentium II 300MHz, running Win98SE, but I have a color printer! ;-)

[...]
>     Ideally, I'd like to be able to configure SciTE printouts with a
> different highlighting style from the appearance on the screen.  Instead
> of colour variations, I'd use combinations of bold, underlined, and
> italics, and different font faces -- all in plain black print -- for
> printouts on my b&w printer.

Aaah, that's an old wish I have. I believe we should be able to 
configure printing styles indenpendently of display styles, so we can 
change the size (done with a global factor), the colors (back colors may 
be unwanted on paper, as may be eolfilled), perhaps the fonts. And, like 
you wrote, we may want to print in black & white, even on a color 
printer (but also on a laser printer like I have at work), and thus play 
more with fonts, italics/bold/underlined, etc.
(Continue reading)

Roman Hubacek | 2 May 2006 09:38
Picon
Favicon

Re: parsing file using lua

Frank Wunderlich:
> Hi Roman,
> the script works perfect except files that be commented out...
> 
> is there a possibility to exclude values that have // before '..' or (* 
> and *) or { and } around '..'?
> 
> 
> e.g. following files must not be opened:
> 
> ...//...'Test.pas'...
> ...{...'Test.pas'...}...
> ...(*...'Test.pas'...*)...

Hi,

   I think the easiest solution is to replace out such items. I've added 
three string.gsub lines in the script and it seems to work fine:

function openPasFromDpr2()
   local dfm  = props['FilePath']
   local path = props['FileDir']  --without trailing /\
   local file = editor:textrange(0, editor.Length)
   for uses in string.gfind(file, "uses.-;") do
     uses = string.gsub(uses,"//.-\n","")
     uses = string.gsub(uses,"{.-}","")
     uses = string.gsub(uses,"%(%*.-%*%)","")
     for c in string.gfind(uses, "\'([^\']*)\'") do
       scite.Open(path .. '\\' .. c)
     end
(Continue reading)

Roman Hubacek | 2 May 2006 09:51
Picon
Favicon

Re: LUA not active in new files

Frank Wunderlich:
> ok, i see the error must in this function:
> 
> function OnChar(c)
>   function char_at(p)
>     return string.char(editor.CharAt[p])
>   end
>   local toClose = { ['('] = ')', ['['] = ']', ['"'] = '"', ["'"] = "'" }
> 
>   if (toClose[c] ~= nil) then
>     local pos = editor.CurrentPos
>     local nextchar=char_at(pos+1)
>     if ((nextchar == "\n") or (nextchar == "\r")) then
>       editor:ReplaceSel(toClose[c])
>       editor:SetSel(pos, pos)
>     end
>   end
>   return false
> end
> 

Hello, this works for me:

function OnChar(c)
   local toClose = { ['('] = ')', ['['] = ']', ['"'] = '"', ["'"] = "'" }
   if(toClose[c]) then
     local pos = editor.CurrentPos
     editor:SetSel(pos,pos)
     editor:ReplaceSel(toClose[c])
     editor:SetSel(pos,pos)
(Continue reading)

Frank Wunderlich | 2 May 2006 11:57
Picon
Picon

Re: Re: parsing file using lua

Roman Hubacek, 02.05.2006 09:38:
> Hi,
> 
>   I think the easiest solution is to replace out such items. I've added 
> three string.gsub lines in the script and it seems to work fine:
> 
> function openPasFromDpr2()
>   local dfm  = props['FilePath']
>   local path = props['FileDir']  --without trailing /\
>   local file = editor:textrange(0, editor.Length)
>   for uses in string.gfind(file, "uses.-;") do
>     uses = string.gsub(uses,"//.-\n","")
>     uses = string.gsub(uses,"{.-}","")
>     uses = string.gsub(uses,"%(%*.-%*%)","")
>     for c in string.gfind(uses, "\'([^\']*)\'") do
>       scite.Open(path .. '\\' .. c)
>     end
>   end
>   scite.Open(dfm)
> end
> 
> -- regards Roman

Thank you very much roman. Now it works perfect ;)
for those who are interested i've changed this function to allow 
absolute paths:

function openPasFromDpr()
   local path = props['FileDir']  --without trailing /\
   local file = props['FilePath']  --the projectfile used for changing 
(Continue reading)

Frank Wunderlich | 2 May 2006 12:04
Picon
Picon

Re: Re: LUA not active in new files

Roman Hubacek, 02.05.2006 09:51:
> Frank Wunderlich:
>> ok, i see the error must in this function:
>>
>> function OnChar(c)
>>   function char_at(p)
>>     return string.char(editor.CharAt[p])
>>   end
>>   local toClose = { ['('] = ')', ['['] = ']', ['"'] = '"', ["'"] = "'" }
>>
>>   if (toClose[c] ~= nil) then
>>     local pos = editor.CurrentPos
>>     local nextchar=char_at(pos+1)
>>     if ((nextchar == "\n") or (nextchar == "\r")) then
>>       editor:ReplaceSel(toClose[c])
>>       editor:SetSel(pos, pos)
>>     end
>>   end
>>   return false
>> end
>>
> 
> Hello, this works for me:
> 
> function OnChar(c)
>   local toClose = { ['('] = ')', ['['] = ']', ['"'] = '"', ["'"] = "'" }
>   if(toClose[c]) then
>     local pos = editor.CurrentPos
>     editor:SetSel(pos,pos)
>     editor:ReplaceSel(toClose[c])
(Continue reading)

Roman Hubacek | 2 May 2006 14:31
Picon
Favicon

Re: LUA not active in new files

Frank Wunderlich:
> Roman Hubacek, 02.05.2006 09:51:
>> Frank Wunderlich:
>>> ok, i see the error must in this function:
>>>
>>> function OnChar(c)
>>>   function char_at(p)
>>>     return string.char(editor.CharAt[p])
>>>   end
>>>   local toClose = { ['('] = ')', ['['] = ']', ['"'] = '"', ["'"] = "'" }
>>>
>>>   if (toClose[c] ~= nil) then
>>>     local pos = editor.CurrentPos
>>>     local nextchar=char_at(pos+1)
>>>     if ((nextchar == "\n") or (nextchar == "\r")) then
>>>       editor:ReplaceSel(toClose[c])
>>>       editor:SetSel(pos, pos)
>>>     end
>>>   end
>>>   return false
>>> end
>>>
>>
>> Hello, this works for me:
>>
>> function OnChar(c)
>>   local toClose = { ['('] = ')', ['['] = ']', ['"'] = '"', ["'"] = "'" }
>>   if(toClose[c]) then
>>     local pos = editor.CurrentPos
>>     editor:SetSel(pos,pos)
(Continue reading)

Neil Hodgson | 2 May 2006 15:50
Picon

Re: Newbie User: Printing in Black & White

Alexander Anderson:

>     ...I like to study large files of (hobby) code on paper.  I have a
> black and white bubble-jet printer.  However, my (Win NT4) screen
> syntax-highlighting setup has a couple of problems when it comes to
> doing print-outs.
>
>     The _chief_ problem is that my on-screen background colour is not
> bright white -- it's an off-white cream, which is so much easier on my
> eyes:

   There are several properties that tweak printing listed in the
documentation. Perhaps you want print.colour.mode=2.

   Neil

Gmane