getActiveTextEditor

獲取當前激活的編輯器,如果沒有打開的編輯器返回undefined

參數說明

返回值

返回類型 描述
Promise<TextEditor> 返回當前激活的編輯器

示例

  1. let activeEditor = hx.window.getActiveTextEditor();
  2. activeEditor.then(function(editor){
  3. console.log(editor.document.fileName);
  4. });