Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003523 [JEDI VCL] 00 JVCL Components minor always 2006-02-20 00:35 2006-03-10 04:43
Reporter Raid View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version 3.10
Summary 0003523: TJvHLEditor: Templates don't position Caret right if on another line using '~' as the CRLF.
Description Well I traced it down to JvEditor.pas, in TJvCompletion.ReplaceWord:
You weren't expecting a 'one' char CRLF (or more than 2), because the reason it works with default "/n" is because it's 2 chars (0000013#10 = 2 chars), short story short, here's the fix:

            cmTemplates:
              begin
                S := ReplaceString(NewString, FCRLF, sLineBreak + SpacesW(CaretX -
                  Length(W)));
                S := ReplaceString(S, FCaretChar, '');
                W := ReplaceString(NewString, FCRLF, sLineBreak);
                NewCaret := Pos(FCaretChar, W) - 1;
              end;

Sorry I used W string variable which wasn't used anymore in that function. Anyway, I didn't know if I should post the whole new JvEditor.pas in a zip file, or just this? I'm not sure, what do I do for next time?
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0008575)
AHUser (developer)
2006-02-20 06:14

Fixed in CVS.

If you attach the complete JvEditor.pas, I would have to do a diff to find your changes, because the CVS version meight have changed. So for small changes it is better to post them directly.
(0008578)
Raid (reporter)
2006-02-20 19:16

Sorry it appears 'W' WAS in use, so I just changed it so it doesn't use any Temp strings at all.

            cmTemplates:
              begin
                S := ReplaceString(NewString, FCRLF, sLineBreak + SpacesW(CaretX -
                  Length(W)));
                S := ReplaceString(S, FCaretChar, '');
                NewCaret := Pos(FCaretChar, ReplaceString(NewString, FCRLF,
                  sLineBreak) ) - 1;
              end;

Sorry about that, it shouldn't cause problems now.
I'll keep using other components and if I have bugs in them I'll fix em myself and submit em (Didn't know you guys liked that lol)
(0008579)
AHUser (developer)
2006-02-21 04:19

Fixed in CVS.
(0008627)
Raid (reporter)
2006-03-04 19:36

Hehe, sorry to bother you again about this, but it doesn't seem it was updated with my last fix, if you could please update it it'd be great! =)

Thank you! =)
(0008636)
AHUser (developer)
2006-03-09 17:01

That's the code in JvEditor.pas:

              begin
                S := ReplaceString(NewString, FCRLF, sLineBreak + Spaces(CaretX -
                  Length(W)));
                S := ReplaceString(S, FCaretChar, '');
                NewCaret := Pos(FCaretChar, ReplaceString(NewString, FCRLF, sLineBreak)) - 1;
              end;

And that's the code in JvUnicodeEditor.pas:

              begin
                S := ReplaceString(NewString, FCRLF, sLineBreak + SpacesW(CaretX -
                  Length(W)));
                S := ReplaceString(S, FCaretChar, '');
                NewCaret := Pos(FCaretChar, ReplaceString(NewString, FCRLF, sLineBreak)) - 1;
              end;


Where is the difference to your code?
(0008638)
Raid (reporter)
2006-03-09 19:03

Everytime I do CVS update I get:

cmTemplates:
              begin
                S := ReplaceString(NewString, FCRLF, sLineBreak + SpacesW(CaretX -
                  Length(W)));
                S := ReplaceString(S, FCaretChar, '');
                W := ReplaceString(NewString, FCRLF, sLineBreak);
                NewCaret := Pos(FCaretChar, W) - 1;
              end;

And I know it's from CVS 'cause I deleted JvEditor.pas, and did a CVS update (using tortoise CVS), and that's the file that comes up.

That is the file from dev\JVCL3\run, right?
Am I doing something wrong? I could be, when I don't have Coffee in a day I'm like this =/

lol
(0008639)
AHUser (developer)
2006-03-10 02:13

Are using HEAD or a special CVS tag? The file is in the HEAD tag. Maybe you have a CVS sticky JvEditor.pas.

http://cvs.sourceforge.net/viewcvs.py/jvcl/dev/JVCL3/run/JvEditor.pas?rev=1.79&view=markup [^]
(0008644)
Raid (reporter)
2006-03-10 02:51

Sorry it might be possible I didn't think about that, I'll update all from HEAD sorry about the newbishness of CVS.. Kinda still new with it. :)
(0008649)
Raid (reporter)
2006-03-10 03:37

Yep, I wasn't updating from HEAD, terribly sorry, thanks AHUser for your patience. =)

- Issue History
Date Modified Username Field Change
2006-02-20 00:35 Raid New Issue
2006-02-20 00:37 Raid Issue Monitored: Raid
2006-02-20 06:14 AHUser Status new => resolved
2006-02-20 06:14 AHUser Resolution open => fixed
2006-02-20 06:14 AHUser Assigned To => AHUser
2006-02-20 06:14 AHUser Note Added: 0008575
2006-02-20 19:16 Raid Status resolved => feedback
2006-02-20 19:16 Raid Resolution fixed => reopened
2006-02-20 19:16 Raid Note Added: 0008578
2006-02-21 04:19 AHUser Status feedback => resolved
2006-02-21 04:19 AHUser Resolution reopened => fixed
2006-02-21 04:19 AHUser Note Added: 0008579
2006-03-04 19:36 Raid Status resolved => feedback
2006-03-04 19:36 Raid Resolution fixed => reopened
2006-03-04 19:36 Raid Note Added: 0008627
2006-03-09 17:01 AHUser Note Added: 0008636
2006-03-09 19:03 Raid Note Added: 0008638
2006-03-10 02:13 AHUser Note Added: 0008639
2006-03-10 02:51 Raid Note Added: 0008644
2006-03-10 03:37 Raid Note Added: 0008649
2006-03-10 04:43 AHUser Status feedback => resolved
2006-03-10 04:43 AHUser Resolution reopened => fixed
2006-04-07 16:19 Raid Issue End Monitor: Raid


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker