Page 82 of 104

Posted: Wed Jul 15, 2009 10:00 am
by RichardL
Good morning Gnozal,

In the lab we have been discussing backup policy and a colleague pointed out that a user might compile several times to review a trivial cosmetic change and cause a major change to drop of the end of the chain.

We could not see a perfect answer to this problem. Some primitive ideas..., 'keep the last file from yesterday' or 'do not count today's files when removing files'.

My network manager said 'Why not provide a courteous message warning to the user that 'Your backup directory is exceeding ten times the most recent source file size, please review contents of <Path>'

As I said... no perfect solution :(

Best regards,
RichardL

Posted: Wed Jul 15, 2009 11:45 am
by gnozal
RichardL wrote:We could not see a perfect answer to this problem. Some primitive ideas..., 'keep the last file from yesterday' or 'do not count today's files when removing files'.
Sure, there is no such thing as a perfect solution.
In my opinion, if you have a daily server backup (assuming your sources are on the server), this should not be a problem.
Anyway, I fixed the ‘Maximum Count of Backups’ bug for the next build.

Posted: Sun Jul 19, 2009 2:45 am
by klaver
Are there plans of support for the " : " operator (merge lines)?

When I make such line of code: "If a = 1 : b = 2 : EndIf"
And press enter to make new line, jaPBe adds "EndIf" because it thinks the IF statement is not closed :/

Second: if there's a commented-out piece of code, and I copy-paste it somewhere all indent gets destroyed - what's the purpose of this?

Posted: Sun Jul 19, 2009 9:45 am
by blueznl
There's no perfect backup mechanism, I struggled with this with CodeCaddy as well. In the end I decided on a compromise: I create a numbered backup every 'n' compile / runs. I was fooling around with a 'smart' feature that would look at the actual changes but found it slowing down the whole process.

Perhaps I'll add a feature to CodeCaddy to write backups more often if more than 'n' bytes have changed (just checking file sizes) but that begs the question: what's the right number of bytes?

Posted: Sun Jul 19, 2009 4:22 pm
by #NULL
@blueznl
but a different size in bytes doesn't say anything about the extent of changes in the file. in the worst case you have a completely different file of same size.

Posted: Mon Jul 20, 2009 7:50 am
by gnozal
klaver wrote:Are there plans of support for the " : " operator (merge lines)?
Not really. But now that you mention it, I will add an additional check for the next release.
klaver wrote:When I make such line of code: "If a = 1 : b = 2 : EndIf"
And press enter to make new line, jaPBe adds "EndIf" because it thinks the IF statement is not closed :/
Meanwhile, you can disable this feature in Preferences (Editor 2 -> 'Autocomplete for If/Select/For...' checkbox) if it annoys you.
Personally, I don't like code blocks on the same line (it's much clearer with indentation).
klaver wrote:Second: if there's a commented-out piece of code, and I copy-paste it somewhere all indent gets destroyed - what's the purpose of this?
I can't reproduce this (or I don't understand).
If I copy/paste this code

Code: Select all

; Repeat
  ; UndentedStuff()
; Until
I get this

Code: Select all

; Repeat
  ; UndentedStuff()
; Until


; Repeat
  ; UndentedStuff()
; Until
No indent is destroyed.

Posted: Wed Jul 22, 2009 2:31 am
by klaver
gnozal wrote:No indent is destroyed.

Code: Select all

; Repeat
  ; UndentedStuff()
; Until

Repeat
  Event = WaitWindowEvent()
  If Event = #PB_Event_CloseWindow
    ;PASTE HERE
  EndIf
ForEver
How about this?

I also don't like the ":" operator very much, but sometimes it's used (and it's ok if the line is not too long). And as it's part of the PB language, jaPBe should support it - otherwise it's not a really PB editor.

Posted: Wed Jul 22, 2009 7:40 am
by gnozal
klaver wrote:How about this?
Ok, I get it now.
By design, text in comments is not indented.
For example, how should jaPBe know if the line '; If etc...' is a standard comment ['If' is not a keyword] or a commented-out code block ['If' is (was) a keyword] ?
klaver wrote:I also don't like the ":" operator very much, but sometimes it's used (and it's ok if the line is not too long). And as it's part of the PB language, jaPBe should support it - otherwise it's not a really PB edito.r
I have added an additional check for the next release.

bug in autocomple

Posted: Mon Jul 27, 2009 7:46 pm
by denise_amiga
hi gnozal

autocomplete with structures is "buggy"

Code: Select all

Structure aa
    a.s  ;<- Indentation with real tab
    b.l
EndStructure

bb.aa

bb\         <--- window show chr(9)

Re: bug in autocomple

Posted: Tue Jul 28, 2009 8:40 am
by gnozal
denise_amiga wrote:autocomplete with structures is "buggy"
Thanks for the report.
It's already fixed in my 'work in progress' version.
I expect the next build to be released sometime in August.

Scintilla Highlighting

Posted: Mon Aug 10, 2009 3:36 pm
by Xombie
Good morning!

Does anyone have a simple example of setting up highlighting within Scintilla? I've got the following so far and it works but I'm not sure how to turn on bracket highlighting or to bold the keywords.

Code: Select all

      ScintillaSendMessage(#StringSQL, #SCI_SETLEXER, #SCLEX_SQL, 0)
      ScintillaSendMessage(#StringSQL, #SCI_SETKEYWORDS, 0, @"select from where insert into update inner join outer left begin end")
      ScintillaSendMessage(#StringSQL, #SCI_STYLESETFORE, #SCE_C_WORD, $FF0000)

Posted: Mon Aug 10, 2009 4:45 pm
by gnozal
Hi Xombie,

jaPBe doesn't use a predefined lexer nor SCI_SETKEYWORDS so I have no experience with these.
To support coloring of keywords, identifiers etc, it uses SCLEX_CONTAINER with SCN_STYLENEEDED notifications.

Here are some examples that may help :
http://www.purebasic.fr/german/viewtopic.php?t=13234
http://www.purebasic.fr/english/viewtopic.php?t=19418
http://www.purebasic.fr/english/viewtopic.php?t=31731
One big example is the jaPBe source, mostly Editor-Core.pbi and WindowCallback.pbi (for the scintilla notifications).

Posted: Tue Aug 11, 2009 5:27 pm
by Xombie
Thanks, gnozal! I'll dig around at those examples and post something if I can get a solution that I like.

Posted: Fri Aug 14, 2009 8:52 am
by gnozal
Update ( V3.9.8 )

Changes :
- added PB4.40 keywords : Map, NewMap, Threaded.
- smart structure autocompletion now should also work within a With/EndWith block.
- added a spinbox in preferences [Editor 2 tab] to set the minimum characters needed before showing the autocompletion
  drop down list (default setting is 1).
- new dialog for macro errors [now that PB4.40 reports the correct error line].
- compiler messages are now localized (PBCompiler started with /LANGUAGE) [PB4.30+].
  If you want to keep english error messages, add 'LocalizeCompilerLanguage = 0' in '[Editor]' section in jaPBe.pref.
- structure viewer : 'Insert Variable' now generates a With/EndWith block.
- added command block highlighting.
  Example : if you leave the mouse pointer for a while over 'WHILE', jaPBe highlights it as well as the matching 'WEND'.
  Needs to be enabled in preferences [Preferences -> General 2 -> Highlight blocks].
- added 'Goto matching keyword' in 'Find' menu [shortcut = CTRL+K].
  Example : if the carret is over 'WHILE', jaPBe jumps to the matching 'WEND'.
- labels are now highlighted in ASM style.
- removed CPU monitor (wasn't working well with newer CPU's anyway).
- jaPBe no longer uses my custom Tailbite but the 'official' one.
- some miscellaneous fixes.
- manual updated.
- added on-line manual.

Posted: Sat Aug 15, 2009 4:08 pm
by LCD
Sorry, but the folding after loading of files is screwed up again:
Example: "Line 314 in 'scanner_wrapper.pb': folding keyword /stored line mismatch ; folding canceled"
And this in all files!
It points to Procedure, ProcedureDll and ;{.
No custom folding keywords are used. Custom folding list is empty.