開発


コーディング関連のマクロ

カーソル行の末尾のセミコロンを追加、削除

(2010-11-22 (月) 09:02:09)

togglesemicolon {
	title: カーソル行の末尾のセミコロンを追加、削除する
	HTEXT text = getfocus();
	IFILE adr = getadr(text);
	
	BOOL eol = getcurchar(text) == '\n';
	jumpparaend(text);
	int c = getprevchar(text);
	if(c == ';')
		leftchar(text) && delchar(text);
	else
		addchar(text, ';');
	if(!eol) jumpadr(text, adr);
}