0
< copying selective display에 대한 매크로를로드했습니다. 매크로 이름은 copy_shown()입니다. 일부 키에 바인딩하여 명령을 실행할 수 있습니다. 하지만 키에 바인딩하지 않고 어떻게 실행합니까? 사용하려는 매크로는 Mathew입니다. < Slickedit forum thread>을 참조하십시오.(키에 바인딩하지 않고) slickedit 매크로를 실행하는 방법
////////////////////////////////////////////////////////////////////////////////////////////
#include "slick.sh"
/*
Copy the lines currently shown in the current buffer to the clipboard. This
should ignore lines that are hidden because of selective display settings.
*/
_command void copy_shown()
{
int lines_copied = 0;
// Create a new buffer to hold the displayed lines.
int tempWID;
int prevWID = _create_temp_view(tempWID);
// Switch back to the previous buffer to find the lines to copy.
p_window_id = prevWID;
// Place cursor on line 0 before first line of the buffer.
top(); up();
// Iterate across the lines in the buffer, copying those that are not hidden.
for (j=1; j<=p_Noflines; j++) {
// Go down and get the next line.
if (down()) break;
get_line(line);
// If this line is not hidden, copy it to the new buffer.
if (!(_lineflags() & HIDDEN_LF)) {
// Copy the line.
lines_copied++;
tempWID.insert_line(line);
}
}
if (lines_copied == 0) {
message('No displayed lines found!');
}
else {
// Activate the temp view to copy the lines
p_window_id = tempWID;
select_all();
copy_to_clipboard();
// Switch back to original view
p_window_id = prevWID;
s = lines_copied==1 ? '' : 's';
message(lines_copied ' line's ' copied to this buffer.');
}
// Clean up the temp view
_delete_temp_view(tempWID);
}
////////////////////////////////////////////////////////////////////////////////////////////
참고 : 내 Slickedit은 기본 CUA 에뮬레이션으로 구성되어 있습니다. – Eden
CUA 정보도 함께 업데이트했습니다. – nhed
감사합니다. @nhed, 나는 명령 행에서 성공적으로 실행했습니다. 그러나 매크로는 'Macro-> List USer-loaded modules'에로드되어 있어도 'Macro-> List Macros'에 ** ** 표시되지 않습니다. – Eden