home.em
来自「source insight的EM文件 可以扩展SI的宏功能」· EM 代码 · 共 38 行
EM
38 行
/* S H I F T H O M E */
/*-------------------------------------------------------------------------
Extends the selection back to the first non-white space on the
current line.
-------------------------------------------------------------------------*/
macro ShiftHome()
{
hwnd = GetCurrentWnd()
if (hwnd == 0)
stop
sel = GetWndSel(hwnd)
hbuf = GetWndBuf(hwnd)
// if selection is extended, collapse it first
if (sel.fExtended)
{
SetBufIns(hbuf, sel.lnFirst, sel.ichFirst)
sel = GetWndSel(hwnd)
}
// if the first character on the line is white space,
// then move forward to the first word on the line
szLine = GetBufLine(hbuf, sel.lnFirst)
chTab = CharFromAscii(9)
ich = 0
while (szLine[ich] == " " || szLine[ich] == chTab)
ich = ich + 1
if (ich < sel.ichLim)
{
sel.ichFirst = ich;
SetWndSel(hwnd, sel);
}
else
Beginning_of_Line
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?