-- edit by kinn --[[ scite_Command { 'Shell tools |ShowShellTools|Ctrl+F7' } ]]-- --print('test========='..lua_LoadPath()) local my_path=lua_LoadPath() local len = string.len local dis_cmd_content={} local begcpyPos, endcpyPos, cmdStartcpyPos, cmdendcpyPos local cmd_name={} local cmd_count=0 local cmd_position={} local cmd_action={} local function updateCpyContent() if begcpyPos and endcpyPos then outputRemove(output,begcpyPos, endcpyPos) end begcpyPos = output.Length print() print('=====================================') cmdStartcpyPos=output.CurrentPos cmd_position[0]=output.CurrentPos local indx=1 while cmd_name[indx] do print(cmd_name[indx]) cmd_position[indx]=output.CurrentPos indx=indx+1 end cmd_count=indx cmdendcpyPos=output.CurrentPos print('-------------------------------') for k, t in pairs(dis_cmd_content) do if t then print(t) end end print('-------------------------------') endcpyPos = output.CurrentPos end local function makeVariable() local startPos=editor.SelectionStart local endPos=editor.SelectionEnd local sel = editor:textrange(startPos,endPos) editor:ReplaceSel('${'..sel..'}') end local function makeVariable2() local startPos=editor.SelectionStart local endPos=editor.SelectionEnd local sel = editor:textrange(startPos,endPos) editor:ReplaceSel('$('..sel..')') end local function init_command_tabl() cmd_name[1]='${XXX} ' cmd_name[2]='$(XXX) ' cmd_name[3]=' ' -- cmd_action[1]= makeVariable cmd_action[2]= makeVariable2 -- cmd_action[3]=updateCpyContent end scite_OnInit(function(order1,order2) init_command_tabl() return false end) local function clearMaintainParam() begcpyPos=-1 endcpyPos=-1 end local function PosMaintainAdjust(diff) begcpyPos = begcpyPos+diff endcpyPos = endcpyPos+diff cmdStartcpyPos = cmdStartcpyPos+diff cmdendcpyPos = cmdendcpyPos+diff local indx=1 while indx cmdStartcpyPos and output.CurrentPos < cmdendcpyPos then local indx=1 while indxoutput.CurrentPos and cmd_action[indx] then exe_command(cmd_action[indx],dis_cmd_content) break end indx=indx+1 end updateCpyContent() end return true end)