Expected output:
Code: Select all
{----------------------------------------------------- Some text -------------------------------------------------------
}
Code: Select all
#NoEnv
#Warn
SetWorkingDir %A_ScriptDir%
#SingleInstance Force
#Persistent
Errmsg = This hotkey was disabled in SciTE4AutoHotkey by`n"Block built in hotkeys in SciTE" in the %A_Scriptname% file.
Errmsg2 = 0
keydelay_standard := 50
SetKeyDelay keydelay_standard
center_func_np(){
Global keydelay_standard
SetKeyDelay -1
temp := ClipboardAll
Sleep 100
Send ^c
desired_width := 120
line_center := desired_width/2
Sleep 100
Clipboard_length := StrLen(Clipboard)
L_side := line_center-Ceil(StrLen(Clipboard)/2)-2
R_side := line_center-Floor(StrLen(Clipboard)/2)-1
Send, {{}{- %L_side%} %Clipboard% {- %R_side%}{Enter 2}{}}{Up}
Clipboard := temp
temp := ""
SetKeyDelay keydelay_standard
Return
}
<^>!c::center_func_np()