I found a lot of information on the Internet. After some modifications, I took this note to prevent myself from forgetting it later.
First, I got a green version on the Internet (which contains "@ green. Reg" and "@ Delete Si green. Reg" files and can change the font size ).
Then I found that there was still a problem with the Chinese operation. I tried to change it myself and finally solved the problem. The following are the steps for self-modification.
Windows XP operating system.
Thanks to a lot of friends.
/* ===================================================== ======================================
* ------- Source insight3 supports macro -------
*
1. Uninstall the original sourceinsight. (skip this step if it has not been installed before)
A. If sourceinsight is installed, uninstall sourceinsight in "Control Panel" --> "add or delete programs ".
(If it is not the installation version (green version), this step can also be omitted)
B. Delete the "source insight" folder in "My Documents"
C. Open the Registry: Find \ HKEY_CURRENT_USER \ Software \ source dynamics \ and delete "Source insight"
Find \ HKEY_LOCAL_MACHINE \ SOFTWARE \ source dynamics \ and delete "Source insight"
2. change the Chinese name "My document" to the English name "mydocument" (mydocument, without double quotation marks, and the English name is random ), to solve the problem of opening the base project crash in the following steps (the path contains Chinese characters)
The procedure is as follows:
Right-click "My Documents" --> "properties" --> "General", and enter mydocument in the editing column.
* 3 Project → open project, open the base project, copy the following functions in this article to the end of the utils. Em File
* 4 restart sourceinsight (close and then enable souceinsight );
* 5 Options → key assignments: bind the following macro to the corresponding key:
MARCO: bind superbackspace to the backspace key;
MARCO: supercursorleft bound to <key (direction key left ),
MARCO: bind supercursorright to> key,
MARCO: supershiftcursorleft bound to Shift + <,
MACRO: supershiftcursorright is bound to Shift +>,
MACRO: superdelete is bound to Del.
The procedure is as follows:
A. Options → key assignments, Enter Marco: superbackspace in the Command edit bar,
Click assign new key... in the middle, and a dialog box will pop up waiting for you to press the key, then press the backspace key on the disk, click OK, and then click OK.
B. perform the same operation as the other five.
------------ Solution to the Chinese spacing of source insight :-----------------
By default, you can enter Chinese Characters in source insight. The spacing is quite large. To solve this problem, the specific settings are as follows:
1. Options-> style Properties
2. Find comment multi line and comment in the style name on the left. Under the font attribute box on the right
Select "Pick..." in the font name and set it to, General, and S4. OK. Return to the style properties interface,
Set the size to 10. Finally, set foreground in the clolors box and click "Pick..." to select a color you like.
3. Done
========================================================== ===================================== */
/*
* Several functions following the boundary are copied to the end of the utils. Em file.
*/
/*************************************** ********************************** *************************/
/* ===================================================== ======================================
1. backspace backkey
========================================================== ===================================== */
Macro superbackspace ()
{
Hwnd = getcurrentwnd ();
Hbuf = getcurrentbuf ();
If (hbuf = 0)
Stop; // empty Buffer
// Get current cursor postion
IPOs = getwndselichfirst (hwnd );
// Get current line number
Ln = getbuflncur (hbuf );
If (getbufseltext (hbuf )! = "") | (Getwndsellnfirst (hwnd )! = Getwndsellnlast (hwnd ))){
// Something. was selected, del Selection
Setbufseltext (hbuf, ""); // stupid & buggy sourceinsight
// Del ""
Superbackspace (1 );
Stop;
}
// Copy current line
TEXT = getbufline (hbuf, LN );
// Get String Length
Len = strlen (text );
// If the cursor is at the start of line, combine with Prev line
If (IPOs = 0 | Len = 0 ){
If (LN <= 0)
Stop; // top of File
Ln = ln-1; // do not use "ln --" for compatibility with older versions
Prevline = getbufline (hbuf, LN );
Prevlen = strlen (prevline );
// Combine two lines
TEXT = CAT (prevline, text );
// Del two lines
Delbufline (hbuf, LN );
Delbufline (hbuf, LN );
// Insert the combined one
Insbufline (hbuf, LN, text );
// Set the cursor position
Setbufins (hbuf, LN, prevlen );
Stop;
}
Num = 1; // del one char
If (IPOs> = 1 ){
// Process Chinese Character
I = IPOs;
Count = 0;
While (asciifromchar (Text [I-1]) >=160 ){
I = I-1;
Count = count + 1;
If (I = 0)
Break;
}
If (count> 0 ){
// I think it might be a two-Byte Character
Num = 2;
// This idiot does not support mod and bitwise operators
If (count/2*2! = Count) & (IPOs <Len ))
IPOs = IPOs + 1; // adjust cursor position
}
}
// Keeping safe
If (IPOs-num <0)
Num = IPOs;
// Del char (s)
TEXT = CAT (strmid (text, 0, IPOs-num), strmid (text, IPOs, Len ));
Delbufline (hbuf, LN );
Insbufline (hbuf, LN, text );
Setbufins (hbuf, LN, IPOs-num );
Stop;
}
/* ===================================================== ======================================
2. delete key -- superdelete. Em
========================================================== ===================================== */
Macro superdelete ()
{
Hwnd = getcurrentwnd ();
Hbuf = getcurrentbuf ();
If (hbuf = 0)
Stop; // empty Buffer
// Get current cursor postion
IPOs = getwndselichfirst (hwnd );
// Get current line number
Ln = getbuflncur (hbuf );
If (getbufseltext (hbuf )! = "") | (Getwndsellnfirst (hwnd )! = Getwndsellnlast (hwnd ))){
// Something. was selected, del Selection
Setbufseltext (hbuf, ""); // stupid & buggy sourceinsight
// Del ""
Superdelete (1 );
Stop;
}
// Copy current line
TEXT = getbufline (hbuf, LN );
// Get String Length
Len = strlen (text );
If (IPOs = Len | Len = 0 ){
Totalln = getbuflinecount (hbuf );
Lasttext = getbufline (hbuf, totalLn-1 );
Lastlen = strlen (lasttext );
If (IPOs = lastlen) // end of File
Stop;
Ln = ln + 1; // do not use "ln --" for compatibility with older versions
Nextline = getbufline (hbuf, LN );
Nextlen = strlen (nextline );
// Combine two lines
TEXT = CAT (text, nextline );
// Del two lines
Delbufline (hbuf, ln-1 );
Delbufline (hbuf, ln-1 );
// Insert the combined one
Insbufline (hbuf, ln-1, text );
// Set the cursor position
Setbufins (hbuf, ln-1, Len );
Stop;
}
Num = 1; // del one char
If (IPOs> 0 ){
// Process Chinese Character
I = IPOs;
Count = 0;
While (asciifromchar (Text [I-1])> = 160 ){
I = I-1;
Count = count + 1;
If (I = 0)
Break;
}
If (count> 0 ){
// I think it might be a two-Byte Character
Num = 2;
// This idiot does not support mod and bitwise operators
If (count/2*2! = Count) | COUNT = 0) & (IPOs <len-1 ))
IPOs = IPOs + 1; // adjust cursor position
}
// Keeping safe
If (IPOs-num <0)
Num = IPOs;
}
Else {
I = IPOs;
Count = 0;
While (asciifromchar (text) & gt; = 160 ){
I = I + 1;
Count = count + 1;
If (I = len-1)
Break;
}
If (count> 0 ){
Num = 2;
}
}
TEXT = CAT (strmid (text, 0, IPOs), strmid (text, IPOs + num, Len ));
Delbufline (hbuf, LN );
Insbufline (hbuf, LN, text );
Setbufins (hbuf, LN, IPOs );
Stop;
}
/* ===================================================== ======================================
3. Shift left key -- supercursorleft. Em
========================================================== ===================================== */
Macro iscomplexcharacter ()
{
Hwnd = getcurrentwnd ();
Hbuf = getcurrentbuf ();
If (hbuf = 0)
Return 0;
// Current location
Pos = getwndselichfirst (hwnd );
// Current number of rows
Ln = getbuflncur (hbuf );
// Obtain the current row
TEXT = getbufline (hbuf, LN );
// Obtain the length of the current row
Len = strlen (text );
// Calculate the number of Chinese characters from the beginning
If (Pos> 0)
{
I = Pos;
Count = 0;
While (asciifromchar (Text [I-1])> = 160)
{
I = I-1;
Count = count + 1;
If (I = 0)
Break;
}
If (count/2) * 2 = count | COUNT = 0)
Return 0;
Else
Return 1;
}
Return 0;
}
Macro moveleft ()
{
Hwnd = getcurrentwnd ();
Hbuf = getcurrentbuf ();
If (hbuf = 0)
Stop; // empty Buffer
Ln = getbuflncur (hbuf );
IPOs = getwndselichfirst (hwnd );
If (getbufseltext (hbuf )! = "" | (IPOs = 0 & Ln = 0) // if there are 0th rows or lines of selected text, do not move
{
Setbufins (hbuf, LN, IPOs );
Stop;
}
If (IPOs = 0)
{
Preline = getbufline (hbuf, ln-1 );
Setbufins (hbuf, ln-1, strlen (preline)-1 );
}
Else
{
Setbufins (hbuf, LN, ipos-1 );
}
}
Macro supercursorleft ()
{
Moveleft ();
If (iscomplexcharacter ())
Moveleft ();
}
/* ===================================================== ======================================
4. Right Shift key -- supercursorright. Em
========================================================== ===================================== */
Macro moveright ()
{
Hwnd = getcurrentwnd ();
Hbuf = getcurrentbuf ();
If (hbuf = 0)
Stop; // empty Buffer
Ln = getbuflncur (hbuf );
IPOs = getwndselichfirst (hwnd );
Totalln = getbuflinecount (hbuf );
TEXT = getbufline (hbuf, LN );
If (getbufseltext (hbuf )! = "") // Select text
{
IPOs = getwndselichlim (hwnd );
Ln = getwndsellnlast (hwnd );
Setbufins (hbuf, LN, IPOs );
Stop;
}
If (IPOs = strlen (text)-1 & Ln = totalLn-1) // last line
Stop;
If (IPOs = strlen (text ))
{
Setbufins (hbuf, LN + 1, 0 );
}
Else
{
Setbufins (hbuf, LN, IPOs + 1 );
}
}
Macro supercursorright ()
{
Moveright ();
If (iscomplexcharacter () // defined in supercursorleft. Em
Moveright ();
}
/* ===================================================== ======================================
5. Shift + Right Shift key -- shiftcursorright. Em
========================================================== ===================================== */
Macro isshiftrightcomplexcharacter ()
{
Hwnd = getcurrentwnd ();
Hbuf = getcurrentbuf ();
If (hbuf = 0)
Return 0;
Selrec = getwndsel (hwnd );
Pos = selrec. ichlim;
Ln = selrec. lnlast;
TEXT = getbufline (hbuf, LN );
Len = strlen (text );
If (LEN = 0 | Len <POS)
Return 1;
// MSG ("@ Len @; @ POS @;");
If (Pos> 0)
{
I = Pos;
Count = 0;
While (asciifromchar (Text [I-1])> = 160)
{
I = I-1;
Count = count + 1;
If (I = 0)
Break;
}
If (count/2) * 2 = count | COUNT = 0)
Return 0;
Else
Return 1;
}
Return 0;
}
Macro shiftmoveright ()
{
Hwnd = getcurrentwnd ();
Hbuf = getcurrentbuf ();
If (hbuf = 0)
Stop;
Ln = getbuflncur (hbuf );
IPOs = getwndselichfirst (hwnd );
Totalln = getbuflinecount (hbuf );
TEXT = getbufline (hbuf, LN );
Selrec = getwndsel (hwnd );
Curlen = getbuflinelength (hbuf, selrec. lnlast );
If (selrec. ichlim = curlen + 1 | curlen = 0)
{
If (selrec. lnlast = totalln-1)
Stop;
Selrec. lnlast = selrec. lnlast + 1;
Selrec. ichlim = 1;
Setwndsel (hwnd, selrec );
If (isshiftrightcomplexcharacter ())
Shiftmoveright ();
Stop;
}
Selrec. ichlim = selrec. ichlim + 1;
Setwndsel (hwnd, selrec );
}
Macro supershiftcursorright ()
{
If (iscomplexcharacter ())
Supercursorright ();
Shiftmoveright ();
If (isshiftrightcomplexcharacter ())
Shiftmoveright ();
}
/* ===================================================== ======================================
6. Shift + Left Shift key -- shiftcursorleft. Em
========================================================== ===================================== */
Macro isshiftleftcomplexcharacter ()
{
Hwnd = getcurrentwnd ();
Hbuf = getcurrentbuf ();
If (hbuf = 0)
Return 0;
Selrec = getwndsel (hwnd );
Pos = selrec. ichfirst;
Ln = selrec. lnfirst;
TEXT = getbufline (hbuf, LN );
Len = strlen (text );
If (LEN = 0 | Len <POS)
Return 1;
// MSG ("@ Len @; @ POS @;");
If (Pos> 0)
{
I = Pos;
Count = 0;
While (asciifromchar (Text [I-1])> = 160)
{
I = I-1;
Count = count + 1;
If (I = 0)
Break;
}
If (count/2) * 2 = count | COUNT = 0)
Return 0;
Else
Return 1;
}
Return 0;
}
Macro shiftmoveleft ()
{
Hwnd = getcurrentwnd ();
Hbuf = getcurrentbuf ();
If (hbuf = 0)
Stop;
Ln = getbuflncur (hbuf );
IPOs = getwndselichfirst (hwnd );
Totalln = getbuflinecount (hbuf );
TEXT = getbufline (hbuf, LN );
Selrec = getwndsel (hwnd );
// Curlen = getbuflinelength (hbuf, selrec. lnfirst );
// MSG ("@ curlen @; @ selrec @");
If (selrec. ichfirst = 0)
{
If (selrec. lnfirst = 0)
Stop;
Selrec. lnfirst = selrec. lnfirst-1;
Selrec. ichfirst = getbuflinelength (hbuf, selrec. lnfirst)-1;
Setwndsel (hwnd, selrec );
If (isshiftleftcomplexcharacter ())
Shiftmoveleft ();
Stop;
}
Selrec. ichfirst = selrec. ichFirst-1;
Setwndsel (hwnd, selrec );
}
Macro supershiftcursorleft ()
{
If (iscomplexcharacter ())
Supercursorleft ();
Shiftmoveleft ();
If (isshiftleftcomplexcharacter ())
Shiftmoveleft ();
}
/* --- End ---*/