




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
本文格式為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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 臨沭租房合同范本
- 2025年梧州貨運從業(yè)資格考題
- 2025年景德鎮(zhèn)貨運從業(yè)資格仿真考題
- 醫(yī)院食堂押金合同范本
- 個人和工廠合作合同范本
- 保健品定購合同范本
- 加工類工程合同范本
- 農業(yè)倉庫出租合同范本
- 債務繼承協(xié)議合同范例
- 單位對個人合同范例
- 初中物理競賽及自主招生講義:第7講 密度、壓強與浮力(共5節(jié))含解析
- 高中主題班會 梁文鋒和他的DeepSeek-由DeepSeek爆火開啟高中第一課-高中主題班會課件
- 三年級體育下冊全冊教案
- 2024年八年級語文下冊《經典常談》第一章《說文解字》練習題卷附答案
- 人教版數(shù)學六年級下冊全冊核心素養(yǎng)目標教學設計
- 華為基建項目管理手冊
- (研究生)商業(yè)倫理與會計職業(yè)道德ppt教學課件(完整版)
- QTD01鋼質無縫氣瓶檢驗工藝指導書課件
- 投資入股協(xié)議書樣本通用版
- 中學部春季學期升旗主題、班會課安排
- 論自然(美)愛默生
評論
0/150
提交評論