Hi all,/*test áéíóú*/íóú is not a Pascal comment but a C style comment and needs termination with */ because it is multiline.
I have many instances of default SynEdit class. So, I make a simple procedure (below) to comment (SQL highlighter).
The problem is, if the single line to be commented has Latin characters, the final comment symbol is not positioned correctly. For example:
test áéíóú
/*test áéíóú*/íóú
How can I fix this?
:-[
procedure pSyn_Comentar(synEdt: TSynEdit); var sTMP: string; i : integer; begin with synEdt do begin BeginUpdate; if (SelText = '') then begin // Will comment the line where the cursor is sTMP:= LineText; i:= CaretX; CaretX:= 0; ExecuteCommand(ecDeleteEOL, #0, nil); SelText:= '/*' + sTMP + '*/'; CaretX:= i + 2; // Return the cursor to the original position end else // Comment on the selection SelText:= '/*' + SelText + '*/'; EndUpdate; end; end;