您的位置:首页 > 其它

Source Insight 宏实现移动光标到行首或行尾

2014-04-19 13:00 267 查看
/*
*@author: citongke1
*@brief 移动光标到行首
*/
macro MoveHome()
{
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)
stop;   // empty buffer
ln = GetBufLnCur(hbuf);
ipos = 0;
SetBufIns(hbuf, ln, ipos);
}

/*
*@author: citongke1
*@brief 移动光标到行尾
*/
macro MoveEnd()
{
hwnd = GetCurrentWnd();
hbuf = GetCurrentBuf();
if (hbuf == 0)
stop;   // empty buffer
ln = GetBufLnCur(hbuf);
//ipos = GetWndSelIchFirst(hwnd);//获取当前光标位置
text = GetBufLine(hbuf, ln);
ipos = strlen(text);
SetBufIns(hbuf, ln, ipos);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: