Krasimir Angelov | 1 Apr 08:34 2011
Picon

Properties file for SciTE for Haskell

Hi,

I would like to contribute the attached properties file which is the
styling setup for Haskell. Scintilla already has a lexer for Haskell
but the configuration for SciTE was missing. To get it working I also
had to change the following in SciTEGlobal.properties:

1. I added *.hs to the end of source.files

2. I added $(filter.hs) to the end of open.filter

3. I added Haskell|hs|| to menu.language

4. finaly add 'import haskell' at the end of the file.

I hope that this changes will be accepted. Let me know if you need
something more.

Best Regards,
  Krasimir Angelov

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

Attachment (haskell.properties): application/octet-stream, 1365 bytes
Neil Hodgson | 1 Apr 11:38 2011
Picon

Re: Properties file for SciTE for Haskell

Krasimir Angelov:

> I would like to contribute the attached properties file which is the
> styling setup for Haskell.

   OK, added.

> To get it working I also
> had to change the following in SciTEGlobal.properties:

   To limit the size of UI elements like menus and filter selection
lists, new languages are added to SciTEGlobal.properties but disabled
by being commented out.

> 1. I added *.hs to the end of source.files

   source.files is limited in length by platform issues so only the
most popular languages are in the default distribution. Users should
update source.files in their user options file to suit their preferred
set of languages.

> 2. I added $(filter.hs) to the end of open.filter
>
> 3. I added Haskell|hs|| to menu.language
>
> 4. finaly add 'import haskell' at the end of the file.

   Added but, as described above, disabled.

   Neil
(Continue reading)

Vishal_K89 | 1 Apr 16:33 2011
Picon

Repeated Undo turns the screen blank in Scintilla Editor

 0.00 / 5, No votes
If unintended recipient pls., redirect the below message to appropriate forum/provide the necessary URL
 

Hi All,
I am using scintilla editor in my project, I have used the mfc wrapper from codeproject. I have issues during undo/redo operations in the scintilla editor,
1.During open of file, and display of contents and subsequent undo operations done, would make entire contents to clear from editor.
Normally, only the undo would be possible upto the last edited character, but, any file loaded will not be cleared from the undo operation.
As per the documentation, SCI_SETSAVEPOINT and SCI_CANUNDO/UNDO/REDO/CANREDO options have been implemented in the CScintillaWnd::Init() and CMyView::OnInitialUpdate()
Could you please suggest workaround for implementing Undo, without clear of entire text.
 
Steps to reproduce:
 
                    Cause: . Open the file. press <Alt + Z>
                        Effect : No Undo
 
                    2.Cause:  Edit/Add Characters in the editor
                       Effect: repeated  Undo  erases entire text.
I want to know how we can resolve the screen going blank by repeated undo.
 
 
Regards,
 
 
 
 
 

 

 
 

Thanks in advance.
Regards,

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.
Randy Kramer | 1 Apr 18:20 2011
Picon

C++ Help: Static function, Method, Returns

I'm about to write my first ever C/C++ function almost from scratch.  
(I've borrowed code or the framework or whatever else I could from 
various sources.)

Here's what I've written (but not tested):

[static] bool DigitSpace (int &pos, LexAccessor &styler) {
int count = 0;
ch = styler.SafeGetCharAt(++pos)
while ((ch >= '0') && (ch <= '9')) {
   ch = styler.SafeGetCharAt(++pos);
   count += 1;
}
if (styler.SafeGetCharAt(pos) != ' ') return false;
if (count > 0) return true
else return false;
}

I don't have questions about the logic, syntax, or layout--I may have 
some mistakes in any of those in what I have so far, but I would like 
input on the following questions.

BTW, the intent of the function is to recognize a variable number of 
digits followed by a space, for my RML lexer (in "object style").

I guess I could ask questions like this on a "pure" C/C++ list or forum, 
but I'm also asking for advice based on the context, i.e., is one or 
the other of these approaches better in the context of a lexer for 
Scintilla?

Would it be an advantage to specify the function as static?  I see some 
existing functions in some lexers are specified as static.  I've tried 
reading up on what this would do, and I sort of have an idea (it would 
sort of make the function persistent, it could be run from other places 
in the code even if LexRML was not instantiated--maybe there are other 
advantages).

Would there be advantages to making this a method of my lexer object / 
class instead of a function?  (If so, I may eventually need some 
coaching on how to do that, but I can probably find examples to 
follow.)

Instead of the three returns, I could create a variable and make 
assignments to it at three places, then return the variable.  I don't 
find the three returns all that confusing, especially in a function 
this small.  (I know there are rules that say I should limit myself to 
one return.)  Aside from aesthetics (by which I mean to include the 
ease of reading / understanding the code), I wouldn't think there is 
any difference in anything like processor time or memory use.

I guess this question I should ask of Neil--does he have a strong 
preference for one way or the other with respect to the three returns?

Thanks,
Randy Kramer

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

Philippe Lhoste | 1 Apr 18:46 2011
Picon
Picon

Re: C++ Help: Static function, Method, Returns

On 01/04/2011 18:20, Randy Kramer wrote:
> Here's what I've written (but not tested):
>
> [static] bool DigitSpace (int&pos, LexAccessor&styler) {
> int count = 0;
> ch = styler.SafeGetCharAt(++pos)
> while ((ch>= '0')&&  (ch<= '9')) {
>     ch = styler.SafeGetCharAt(++pos);
>     count += 1;
> }
> if (styler.SafeGetCharAt(pos) != ' ') return false;
> if (count>  0) return true
> else return false;
> }

Minor changes:

bool DigitSpace(int &pos, LexAccessor &styler) {
   // Indent!
   int count = 0;
   // Added 'char' and semi-colon
   char ch = styler.SafeGetCharAt(++pos); // Is it intended to skip first pos?
   // Less parentheses looks more readable to my eye...
   while (ch >= '0' && ch <= '9') {
     ch = styler.SafeGetCharAt(++pos);
     count++;
   }
   if (styler.SafeGetCharAt(pos) != ' ') return false;
   // Simpler while remaining readable / understandable
   return count > 0;
}

> Would there be advantages to making this a method of my lexer object /
> class instead of a function?  (If so, I may eventually need some
> coaching on how to do that, but I can probably find examples to
> follow.)

I don't think so, as you don't use the members of the class.

> Instead of the three returns, I could create a variable and make
> assignments to it at three places, then return the variable.  I don't
> find the three returns all that confusing, especially in a function
> this small.  (I know there are rules that say I should limit myself to
> one return.)  Aside from aesthetics (by which I mean to include the
> ease of reading / understanding the code), I wouldn't think there is
> any difference in anything like processor time or memory use.

There are strong opinions on each style... Personally, I prefer early exits to deeply 
nested ifs...

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

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

Neil Hodgson | 1 Apr 23:24 2011
Picon

Re: C++ Help: Static function, Method, Returns

Randy Kramer:

> [static] bool DigitSpace (int &pos, LexAccessor &styler) {

> Would it be an advantage to specify the function as static?  I see some
> existing functions in some lexers are specified as static.  I've tried
> reading up on what this would do, and I sort of have an idea (it would
> sort of make the function persistent, it could be run from other places
> in the code even if LexRML was not instantiated--maybe there are other
> advantages).

   static means its private to LexRML and there will not be a clash if
another lexer defines a function called DigitSpace. All functions
defined in object lexers should be static.

   Neil

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

Lex Trotman | 2 Apr 02:02 2011
Picon

Re: C++ Help: Static function, Method, Returns

Hi Randy,

Agree with all Philippe said plus some additional comments that might?
be helpful.

> Would it be an advantage to specify the function as static?  I see some
> existing functions in some lexers are specified as static.  I've tried
> reading up on what this would do, and I sort of have an idea (it would
> sort of make the function persistent, it could be run from other places
> in the code even if LexRML was not instantiated--maybe there are other
> advantages).

Never pollute the global namespace unless absolutely necessary, so
static or a method.

>
> Would there be advantages to making this a method of my lexer object /
> class instead of a function?  (If so, I may eventually need some
> coaching on how to do that, but I can probably find examples to
> follow.)

Depends, where do pos and styler come from? If they are in the object
then yes there is an advantage, else doesn't matter.

>
> Instead of the three returns, I could create a variable and make
> assignments to it at three places, then return the variable.  I don't
> find the three returns all that confusing, especially in a function
> this small.  (I know there are rules that say I should limit myself to
> one return.)  Aside from aesthetics (by which I mean to include the
> ease of reading / understanding the code), I wouldn't think there is
> any difference in anything like processor time or memory use.

Personal preference is early returns, but its immaterial in this small
a function.

But one comment on coding idioms I would make, is that you modify pos
even if you return false, that means that the caller has to remember
where it was before the call so it can try recognizing something else.
 The more usual idiom is to only modify pos if you recognize the
token.  That way the caller can call several recognizer functions like
DigitSpace until one returns true, without having to keep restoring
pos, and after it finds true then pos is ready for recognizing the
next token.
>

Cheers
Lex

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

AsmWarrior | 2 Apr 05:13 2011
Picon

Can I receive a hover kind message if the mouse hover a marker?

Once I found a feature request in Codeblocks, the user want to show the current build error when he hover a build error marker.

see:
https://developer.berlios.de/feature/?func=detailfeature&feature_id=5236&group_id=5358

So, my question is:

Is it possible to easily implement it? sorry if scintilla already has this feature.

thanks.

asmwarrior
ollydbg from Codeblocks' forum

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.
Lex Trotman | 2 Apr 07:21 2011
Picon

Re: Can I receive a hover kind message if the mouse hover a marker?

On 2 April 2011 14:13, AsmWarrior <asmwarrior <at> gmail.com> wrote:
> Once I found a feature request in Codeblocks, the user want to show the
> current build error when he hover a build error marker.
>
> see:
> https://developer.berlios.de/feature/?func=detailfeature&feature_id=5236&group_id=5358
>
> So, my question is:
>
> Is it possible to easily implement it? sorry if scintilla already has this
> feature.

I think the SCN_DWELLSTART and calltip functionality provides the
backbone for what you need.  But you will still need to associate the
buffer position with the error, decide how to handle multiple errors
in the line etc.

Cheers
Lex

>
> thanks.
>
> asmwarrior
> ollydbg from Codeblocks' forum
>
> --
> You received this message because you are subscribed to the Google Groups
> "scintilla-interest" group.
> To post to this group, send email to scintilla-interest <at> googlegroups.com.
> To unsubscribe from this group, send email to
> scintilla-interest+unsubscribe <at> googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/scintilla-interest?hl=en.
>

--

-- 
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

AsmWarrior | 2 Apr 07:54 2011
Picon

Re: Can I receive a hover kind message if the mouse hover a marker?

I think the SCN_DWELLSTART and calltip functionality provides the
backbone for what you need.  But you will still need to associate the
buffer position with the error, decide how to handle multiple errors
in the line etc.
thank you for the info.
I can get the SCN_DWELLSTART event, and the current position of the mouse.

But how do I know my mouse is on the margin? which is not on the code text string?
Can I use this:
SCI_POSITIONFROMPOINTCLOSE(int x, int y)
SCI_POSITIONFROMPOINT finds the closest character position to a point and SCI_POSITIONFROMPOINTCLOSE is similar but returns -1 if the point is outside the window or not close to any characters.
if it return a -1, which means the mouse is hover the margin?

thanks.

asmwarrior
ollydbg from codeblocks' forum
 

--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To post to this group, send email to scintilla-interest <at> googlegroups.com.
To unsubscribe from this group, send email to scintilla-interest+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scintilla-interest?hl=en.

Gmane