阅读背景:

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

来源:互联网 

/*
 *@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);
}/*
 *@author: citongke1
 *@brief 移动光标到行首
 */



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: