Source Insight3 中文顯示修正及鍵盤困擾_第1頁
Source Insight3 中文顯示修正及鍵盤困擾_第2頁
Source Insight3 中文顯示修正及鍵盤困擾_第3頁
Source Insight3 中文顯示修正及鍵盤困擾_第4頁
Source Insight3 中文顯示修正及鍵盤困擾_第5頁
已閱讀5頁,還剩10頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

本文格式為Word版,下載可任意編輯——SourceInsight3中文顯示修正及鍵盤困擾

SourceInsight3中文顯示修正及鍵盤困擾

stop;

}

num=1;//delonechar

if(ipos0){

//processChinesecharacter

i=ipos;

count=0;

while(AsciiFromChar(text[i-1])=160){

i=i-1;

count=count+1;

if(i==0)

break;

}

if(count0){

//Ithinkitmightbeatwo-bytecharacter

num=2;

//Thisidiotdoesnotsupportmodandbitwiseoperators

if(((count/2*2!=count)||count==0)(iposlen-1))

ipos=ipos+1;//adjustcursorposition

}

//keepingsafe

if(ipos-num0)

num=ipos;

}

else{

i=ipos;

count=0;

while(AsciiFromChar(text)=160){

i=i+1;

count=count+1;

if(i==len-1)

break;

}

if(count0){

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、左移鍵——SuperCursorLeft.em

======================================================================*/

macroIsComplexCharacter()

{

hwnd=GetCurrentWnd();

hbuf=GetCurrentBuf();

if(hbuf==0)

return0;

//當前位置

pos=GetWndSelIchFirst(hwnd);

//當前行數(shù)

ln=GetBufLnCur(hbuf);

//得到當前行

text=GetBufLine(hbuf,ln);

//得到當前行長度

len=strlen(text);

//從頭計算漢字字符的個數(shù)

if(pos0)

{

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)

return0;

else

return1;

}

return0;

}

macromoveleft()

{

hwnd=GetCurrentWnd();

hbuf=GetCurrentBuf();

if(hbuf==0)

stop;//emptybuffer

ln=GetBufLnCur(hbuf);

ipos=GetWndSelIchFirst(hwnd);

if(GetBufSelText(hbuf)!=||(ipos==0ln==0))//第0行或者是選中文字,則不移動

{

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);

}

}

macroSuperCursorLeft()

{

moveleft();

if(IsComplexCharacter())

moveleft();

}

/*======================================================================

4、右移鍵——SuperCursorRight.em

======================================================================*/

macromoveRight()

{

hwnd=GetCurrentWnd();

hbuf=GetCurrentBuf();

if(hbuf==0)

stop;//emptybuffer

ln=GetBufLnCur(hbuf);

ipos=GetWndSelIchFirst(hwnd);

totalLn=GetBufLineCount(hbuf);

text=GetBu

fLine(hbuf,ln);

if(GetBufSelText(hbuf)!=)//選中文字

{

ipos=GetWndSelIchLim(hwnd);

ln=GetWndSelLnLast(hwnd);

SetBufIns(hb

SourceInsight3中文顯示修正及鍵盤困擾

uf,ln,ipos);

stop;

}

if(ipos==strlen(text)-1ln==totalLn-1)//末行

stop;

if(ipos==strlen(text))

{

SetBufIns(hBuf,ln+1,0);

}

else

{

SetBufIns(hBuf,ln,ipos+1);

}

}

macroSuperCursorRight()

{

moveRight();

if(IsComplexCharacter())//definedinSuperCursorLeft.em

moveRight();

}

/*======================================================================

5、shift+右移鍵——ShiftCursorRight.em

======================================================================*/

macroIsShiftRightComplexCharacter()

{

hwnd=GetCurrentWnd();

hbuf=GetCurrentBuf();

if(hbuf==0)

return0;

selRec=GetWndSel(hwnd);

pos=selRec.ichLim;

ln=selRec.lnLast;

text=GetBufLine(hbuf,ln);

len=strlen(text);

if(len==0||lenpos)

return1;

//Msg(@len@;@pos@;);

if(pos0)

{

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)

return0;

else

return1;

}

return0;

}

macroshiftMoveRight()

{

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);

}

macroSuperShiftCursorRight()

{

if(IsComplexCharacter())

SuperCursorRight();

shiftMoveRight();

if(IsShiftRightComplexCharacter())

shiftMoveRight();

}

/*======================================================================

6、shift+左移鍵——ShiftCursorLeft.em

======================================================================*/

macroIsShiftLeftComplexCharacter()

{

hwnd=GetCurrentWnd();

hbuf=GetCurrentBuf();

if(hbuf==0)

return0;

selRec=GetWndSel(hwnd);

pos=selRec.ichFirst;

ln=selRec.lnFirst;

text=GetBufLine(hbuf,ln);

len=strlen(text);

if(len==0||lenpos)

return1;

//Msg(@len@;@pos@;);

if(pos0)

{

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)

return0;

else

return1;

}

return0;

}

macroshiftMoveLeft()

{

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.lnFir

SourceInsight3中文顯示修正及鍵盤困擾

st);

//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(I

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論