/*
*@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);
}
Source Insight 宏实现移动光标到行首或行尾
最新推荐文章于 2022-03-02 10:23:39 发布