Source Insight裏的漢字問題

聲明:此文屬於轉載,由於不知道最原始地址,故沒有給出原文章連接!

 

【問題】
Source Insight裏輸入中文,字間距相當的大。
【答案】
1.Options->Style Properties
2. 在左邊Style Name下找到Comment Multi Line和Comment.在其右邊對應的Font屬性框下的Font Name中選“Pick...” 設置爲宋體、常規、小四。確定,退回Style Properties界面,Size設爲10。最後設置Clolors框下Foreground,點“Pick...”選擇一種自己喜歡的顏色就OK了。
3.Done

【問題】
刪除半個漢字
【答案】
① 複製入SourceInsight安裝目錄;
② Project→Open Project,打開Base項目;
③ 將複製過去的SuperBackspace.em添加入Base項目;
④ 重啓SourceInsight;
⑤ Options→Key Assignments,將Marco: SuperBackspace綁定到BackSpace鍵;
⑥ Enjoy!!

【問題】

字體大小

【答案】

在Option裏的Document Option(ALT+T)
左邊有個Screen Font,點進去就可以設置了

===================SuperBackspace.em============================================

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))) {
        // sth. was selected, del selection
        SetBufSelText(hbuf, " ");  // stupid & buggy sourceinsight :(
        // del the " "
        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;
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章