From 4c0fbaf84c0de6c96cb100779fade82c4a547096 Mon Sep 17 00:00:00 2001 From: ohtorii Date: Sun, 3 Apr 2022 15:15:57 +0900 Subject: [PATCH] =?UTF-8?q?openfile/newfile=E7=AD=89=E3=81=AE=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ver 9.15 b1で追加されたgetresultex(25)を利用 --- README.md | 2 +- internal/main.mac | 6 +++--- internal/source.mac | 2 +- kinds/file_base.mac | 5 +++-- kinds/jump_list.mac | 7 +++++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4fbec23..4771af1 100644 --- a/README.md +++ b/README.md @@ -342,7 +342,7 @@ hidemaru-editor-script-directory # 動作環境 -- 秀丸エディタ ver 8.91 以降 +- 秀丸エディタ ver 9.15 以降 秀丸マクロの**新命令**を利用しているため**必ず上記バージョン以降**をお使いください。 diff --git a/internal/main.mac b/internal/main.mac index 7297a16..2ee0339 100644 --- a/internal/main.mac +++ b/internal/main.mac @@ -30,7 +30,7 @@ usage: sources_args : arg1\targ2\narg3 */ -if(version<891){ +if(version<915){ message "秀丸エディタのバージョンが古いためマクロを実行できません。\n" + "本マクロのドキュメントに記載されたバージョン以降の秀丸エディタをお使いください。"; @@ -936,8 +936,8 @@ TrimString: //#region 秀丸の編集画面 NewFile: newfile; - if(result==0){ - #g_open_newfile=false; + if(getresultex(25)){ + #g_open_newfile=false; return false; } diff --git a/internal/source.mac b/internal/source.mac index 43d6857..3dd38c9 100644 --- a/internal/source.mac +++ b/internal/source.mac @@ -211,7 +211,7 @@ LoadFileImage: */ ##current_hidemaru=hidemaruhandle(0); openfile "/h /n " + $$1; - if(! result){ + if(getresultex(25)){ return false; } ##new_hidemaru=hidemaruhandle(0); diff --git a/kinds/file_base.mac b/kinds/file_base.mac index 4dc5aaa..5c2bcd1 100644 --- a/kinds/file_base.mac +++ b/kinds/file_base.mac @@ -82,9 +82,10 @@ open: call check_file_exists $$text; if(##return){ openfile $$text; - if(result){ + if(getresultex(25)==false){ + //openfileに成功 ##new_hidemaru_handle = hidemaruhandle(0); - } + } }else{ $$message="ファイルを見付けることが出来ませんでした。\nもしかしたら既に削除されているのかもしれません。\n\n(ファイル名)\n" + $$text; execmacro $$macro_path, "error", $$message; diff --git a/kinds/jump_list.mac b/kinds/jump_list.mac index b419a7b..ca7ae10 100644 --- a/kinds/jump_list.mac +++ b/kinds/jump_list.mac @@ -36,8 +36,11 @@ open: ##line =dllfuncw(#g_dll_ohtorii_tools,"GetSelectionActionLine",##i); openfile $$filename; - moveto2 ##column,##line; - ##new_hidemaru_handle=hidemaruhandle(0); + if(getresultex(25)==false){ + //openfileに成功 + moveto2 ##column,##line; + ##new_hidemaru_handle=hidemaruhandle(0); + } setactivehidemaru ##current_hidemaru_handle; }else{