[Editor] CodeQuickTester - Write and run code without saving to a temporary file

Post your working scripts, libraries and tools
GeekDude
Posts: 887
Joined: 02 Oct 2013, 22:13

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

24 Nov 2018, 14:23

hotkeyguy wrote:
09 Nov 2018, 15:42
Hello GeekDude,

many thanks for CodeQuickTester v2.8, especially Save/Save As and rename. I just wanted to ask. And OutputDebug works now (not in v2.7). Yep, I got v2.7 compiled meanwhile. No problems starting v2.8.

Greetings and thanks for that early St. Nicholas' Day gift :xmas:
hotkeyguy
You're welcome! I'm not sure what you are trying to do with OutputDebug but if it's working now then great! I'm not aware of any changes I've made that would influence this, other than I updated the version of AHK_H being used in the compiled script.
CyL0N wrote: Sweet :thumbup: , but RIBBONS,where be the RIBBONS :shifty: .... i guess i Can wait :cookie: . But really though,much needed update so thanks. :salute:

A suggestion for the next patch, for status bar instead of , I think |, is a bit more poignant,comma just looks a little weird.
Something like this,

Code: Select all

 SB_SetText("Len " Len " | Line " Row " | Col " Col
 . (Sel > 0 ? " | Sel " Sel : "") " " this.SyntaxTip)
You may have confused ribbon design with the Windows 10 window manager. I haven't done any significant theming changes other than reducing/removing margins in the main GUI. It may be possible to grab one of those window theming dlls that are basically drop-in addons for the script but I can't do that while maintaining the "all functionality should be available when using just one file" requirement I've been trying to uphold.

As far as the status bar, I was mostly trying to copy how they handle the status bar in the popular new editor Visual Studio Code. A vertical pipe might be better, but maybe not. Microsoft has a reasonable design team and I would bet they've done UX testing on this topic and found people preferred the commas. Status bar design is definitely a point to revisit in the future.
SpecialGuest wrote: Keep it comin' GeekDude 8-)
By the way: I would love to see this get tabs some day
I'm glad you like what I've been cooking up! I would also like to see it get tabs some day, but I think there might need to be some rethinking first. The more parts in a single script, the more likely that script is to hang or crash. If I am going to increase the propensity for crashing, I should consider what the script should do in the event of a crash: Should I introduce auto-saving to a temporary file for unsaved script panes? That's a little antithetical to one of the goals of the script (don't create temporary files). Is that goal still a good thing to shoot for?

Should I attempt to go for a browser-like approach where each tab has its own process, so that if one crashes it won't take down the whole editor? If so, how should I perform process management? There's an API in Windows to designate some processes as children to be killed when the parent dies but when I was testing it I couldn't get it to work.

So many options :shock:
r2997790 wrote: Geekdude, thank you for your continuing hard work on CodeQuickTester. It's a wonderful tool.

I'm glad you haven't overloaded it with functionality. It remains a joy to use for testing code snippets and short routines.
Thank you for the nice comment!

I'm not sure what the threshold is for overloaded haha, I've been slowly adding more things to it over a long time. Working in it before there was a right click menu or a find and replace dialog just felt kind of... incomplete. I'm probably going to keep adding things until you change your mind :lol:.
SpecialGuest wrote:Desperate attempt at fixing integration (to be ignored lol) :
*snip*
ozzii wrote: @SpecialGuest
Thanks for the update but I have this when I click to open on your code:
*snip*
SpecialGuest wrote: Thanks for letting me know. Hadn't really had the chance to look at it very long last night.
Just saw the regular integration wasn't doing anything and attempted to fix the link.
It seems I didn't look at it long enough to notice the result being the whole page instead of the codebox' content :shh: lol
Consider this to be broken for now as we require the download link, which isn't available anymore on the current codebox..
With the download link you can retrieve the codebox' content but I don't see a way to do it with the forum being as it is atm.
ozzii wrote:OK, I will wait for a fix, I hope....
I've been thinking of a way to make this work, and I'm wondering now if there's a way for me to jam the code into something like a Base64 string that I pass to the script instead of an http(s) link. Of course, this will depend on how much data is supported in one of those links but people use similar links to embed images into html so hey maybe it'll work :)
kiwichick wrote: Hi there, this is such a nifty little script. So helpful! I have a couple of requests. First, will you please make it possible to open it maximised, or at least remember the last window setting? And second, will you please change the wording for "Open Help File" to specify that it's the AutoHotkey help file that's opened, not a CodeQuickTester help file? Keep up the good work. Cheers.
I'm glad you like it! Configuring the window size and having it remember the last window size is on the roadmap already, so you can expect to see it in the future.

The help file link could be a little more descriptive, though I don't think it's especially misleading as it is. I can definitely update it to say something like "Open AHK Help File" instead if you'd like.
CyL0N wrote: Bug: Line Numbering Gets Messed Up With Ctrl+Home, Ctrl+End., given a script with more than 200lines...
Yeah that's a known issue. I have no idea why it does that but if you figure it out let me know :lol:. If not, it's on my list of things to look at in the future.
CyL0N
Posts: 211
Joined: 27 Sep 2018, 09:58

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

24 Nov 2018, 21:15

GeekDude wrote:
24 Nov 2018, 14:23
By ribbon I really only meant, https://i.imgur.com/VvDa2jx.png ,looking at it closer it looks so much like a ribbon GUI,though not so much now I know its not.

Can I possibly get an example GUI to get that effect?

I didn't know you could do that with margins... though I recall removing button styles removed button borders...hmm...
live ? long & prosper : regards
CyL0N
Posts: 211
Joined: 27 Sep 2018, 09:58

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

25 Nov 2018, 22:07

GeekDude wrote:
24 Nov 2018, 14:23
CyL0N wrote: Bug: Line Numbering Gets Messed Up With Ctrl+Home, Ctrl+End., given a script with more than 200lines...
Yeah that's a known issue. I have no idea why it does that but if you figure it out let me know :lol:. If not, it's on my list of things to look at in the future.
It seems to be an issue with desynchronised controls,here's my fix:

Code: Select all

#IfWinActive CodeQuickTester
^End::
ControlGet, lnID, Hwnd,, RICHEDIT50W2, A	;ln = lineNumbering control ID
ControlGet, ecID, Hwnd,, RICHEDIT50W1, A	;main edit control ID
lastLine := GetLineCount(lnID), ScrollLines(lastLine,lnID), ScrollLines(lastLine,ecID)
ControlClick, RICHEDIT50W1
ControlSend, RICHEDIT50W1, {PgUp}{PgDn}, A
Return
;======================================================================================
#IfWinActive
ScrollLines(lines,hWnd="") {
	static EM_LINESCROLL := 0xB6
	PostMessage, EM_LINESCROLL, 0, lines-1, , ahk_id %hWnd%   ; 'lines-1' makes the line you wish to jump to visible
}
GetLineCount(ctrlHwnd){
	static EM_GETLINECOUNT = 0xBA
	SendMessage, EM_GETLINECOUNT,,,, ahk_id %ctrlHwnd%
	Return ErrorLevel
}
Last edited by CyL0N on 26 Nov 2018, 22:30, edited 2 times in total.
live ? long & prosper : regards
User avatar
kczx3
Posts: 1188
Joined: 06 Oct 2015, 21:39

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

26 Nov 2018, 19:28

I bet there is a way to directly he the number of lines in the control instead of looping over them
CyL0N
Posts: 211
Joined: 27 Sep 2018, 09:58

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

26 Nov 2018, 20:23

kczx3 wrote:
26 Nov 2018, 19:28
I bet there is a way to directly he the number of lines in the control instead of looping over them
Perhaps,but even internally looping is how the line number is retrieved. Search for this.Settings.Gutter.Width.
live ? long & prosper : regards
CyL0N
Posts: 211
Joined: 27 Sep 2018, 09:58

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

26 Nov 2018, 20:50

kczx3 wrote:
26 Nov 2018, 20:36
https://docs.microsoft.com/en-us/window ... tlinecount

Though maybe word wrap messes it up for this tool?
Works well,updated my post accordingly.

Cheers.
live ? long & prosper : regards
0x00
Posts: 87
Joined: 22 Jan 2019, 13:12

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

01 Feb 2019, 08:02

Bug Report: Cancelling Rename discards filename.




Love this little thing,been so long since I actually used anything else. Cheers Dude.
hotkeyguy
Posts: 149
Joined: 11 Oct 2014, 12:22

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

31 May 2019, 07:57

Hello again,

great would be
  1. some global variables, with prefix e. g. cqt_x/y/w/h, for positioning own GUIs in relation to the CQT GUI.
    Especially when AlwaysOnTop, own GUIs are hidden,
  2. Run [F5] should toggle between the two modes Run and Kill.
    Don't know whether that is possible but when the own GUI is closed mode should be Run again,
  3. a special folder for templates and an corresponing Open Template... menu item,
  4. a MRU (most recently used) file list,
  5. all menu items should have mnemonics (the [Alt+_] combinations) or much better shortcuts.

Many thanks for all your efforts and greetings
hotkeyguy
User avatar
Hellbent
Posts: 1061
Joined: 23 Sep 2017, 13:34

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

10 Dec 2019, 11:22

Apologies if this has been asked / answered before.

How can I go about changing the default text in the script

e.g.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
I want to change it to something like this:

Code: Select all

#SingleInstance, Force
#NoEnv
SetBatchLines, -1



return
GuiClose:
GuiContextMenu:
*ESC::
	ExitApp

***Edit***
Where are my manners....
Thanks for sharing this script GeekDude :thumbup:
Last edited by Hellbent on 12 Dec 2019, 09:34, edited 1 time in total.
gregster
Posts: 5355
Joined: 30 Sep 2013, 06:48

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

10 Dec 2019, 12:05

@Hellbent, have a look into Settings.ini. There, quite at the top, you can define a path to the template file you want to use.

Code: Select all

; Path to a file containing the starting contents of the editor. By default
; this is set to the path used by Explorer when you right click in a folder
; and select "New > AutoHotkey Script". This path can be relative to the
; working directory, which is useful when running in a portable environment.
DefaultPath = C:\Windows\ShellNew\Template.ahk
I personally use no template at all in CQT (I paste one via hotkey, if necessary - via the clipboard, because recent versions of CQT - with autocomplete - don't respond well to sending) and just commented that file path out, but you could change it to another template file, I guess.
User avatar
Hellbent
Posts: 1061
Joined: 23 Sep 2017, 13:34

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

10 Dec 2019, 12:48

@gregster

I was actually thinking of adding something like what you have as a hotkey to my quick run script when I was posting.
I might still do that (Scite has always just created blank new scripts and I'm used to that but the option for a simple template like this is nice.), but in regards to this script, because I'll only be using it for stuff that I will toss out as soon as I'm done with it I would like to have that template in place for every instance. I often find it very annoying when trying someones code and they don't have #singleInstance or a exit hotkey etc. This script is just so I can stop having a million "temp forum help" or "temp yt help" etc. scripts littered throughout my folders, doubtfully anything else.

Thank you for the assist, I was able to get it all sorted. :salute:
User avatar
boiler
Posts: 6584
Joined: 21 Dec 2014, 02:44

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

10 Dec 2019, 13:14

Hellbent wrote:
10 Dec 2019, 12:48
...or a exit hotkey etc.
That's one thing I like about CQT. It has a built-in exit hotkey.
GeekDude
Posts: 887
Joined: 02 Oct 2013, 22:13

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

27 May 2020, 11:08

Made a few changes to continuation sections, to allow users to specify the language/highlighter to be used inside. Supported languages include AHK, CSS, JS, and HTML. If an appropriate language-specifying comment is omitted, it defaults to "string" formatting, which is that desaturated reddish color by default.

No updates have been pushed yet, though.

Image
Nixcalo
Posts: 72
Joined: 06 Feb 2018, 04:24

Re: [Editor] CodeQuickTester - Write and run code without saving to a temporary file

26 Jul 2020, 07:53

HI GeekDude!

I saw that your script now supported Unicode charactes. However, I have the EXE version and when I copy a script from Notepad++ ans paste it into CodeQuickTester, all Unicode characters are lost. Do you know why and whether there is a workaround/fix for it?
Believe it or not, I use the character "╚" in my script (in order to split arrays)...

Return to “Scripts and Functions”

Who is online

Users browsing this forum: mcl and 28 guests