2014-03-12 2 views
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); 
} 

//////////////////////////////////////////////////////////////////////////////////////////// 
+0

참고 : 내 Slickedit은 기본 CUA 에뮬레이션으로 구성되어 있습니다. – Eden

+0

CUA 정보도 함께 업데이트했습니다. – nhed

+0

감사합니다. @nhed, 나는 명령 행에서 성공적으로 실행했습니다. 그러나 매크로는 'Macro-> List USer-loaded modules'에로드되어 있어도 'Macro-> List Macros'에 ** ** 표시되지 않습니다. – Eden

답변

1

[업데이트] 당신은 그냥 esc입니다 EMACS 모드에서 esc

  • 을 눌러 사용자가 명령 줄에 도착 CUA 모드에서 명령 프롬프트

    • 에서 이름을 실행할 수 있습니다 + x

    다음 명령을 copy_shown 또는입력하십시오.. 이 또한입니다 그런 다음 매크로를 선택>List Macrosrun

    클릭 - Macros :

    또한 메뉴를 사용할 수 있습니다 (다른 에뮬레이션은 "명령 줄"을 얻을 수있는 다른 시퀀스가있을 수 있습니다) 좋은 방법은 정말로드되었는지 확인


    편집

    매크로가 Macros에 나열된 것으로 다음과 같이 name_info을 위해 dd ->List Macros

    _command void copy_shown() name_info(',' VSARG2_MACRO) 
    
  • 관련 문제