KristofferC / OhMyREPL.jl

Syntax highlighting and other enhancements for the Julia REPL
https://kristofferc.github.io/OhMyREPL.jl/latest/
Other
749 stars 56 forks source link

Add OneLight/TommorowDay themes, update bracket colours #304

Closed tecosaur closed 1 year ago

tecosaur commented 1 year ago

Three things (which can be split up, if needed)

Sample screenshot:

image

KristofferC commented 1 year ago

Thanks, good idea with the matching of brackets to the theme.

tecosaur commented 1 year ago

Thanks for merging this :slightly_smiling_face:.

I will admit though, after diving into some of the internals here I've become afflicted with a growing temptation to try to make a from-scratch-but-copying-a-few-things-from-OhMyREPL fancy REPL package that's put together a bit differently.

KristofferC commented 1 year ago

Go for it, it's fun :)

tecosaur commented 1 year ago

Gah! Encouragement was the last thing I needed :stuck_out_tongue_closed_eyes:

If anything nice seems to happen I'll let you know.

For a while I've thought it's a pity that julia doesn't come with OhMyREPL, so I might see if I can make something that only depends on JuliaSyntax — which might at least allow this to be more seriously considered :crossed_fingers:.

KristofferC commented 1 year ago

I've been meaning for a long time to allow the Julia REPL to take a "highlighter" that would take the current buffer of the REPL and return a set of bytes and color "tokens" and the REPL would display that colored output. That would allow packages like OhMyREPL to avoid having to do any method overwrites or adding all these awkward keybindings that we do here.

tecosaur commented 1 year ago

On a similar note, for a while I've felt Julia could benefit from a "string + text properties" type, which would allow one to say "this word is red" etc. without having to mess around with printstyled or manually dealing with shell escape codes etc., and also have the advantage of being able to easily fall back to plaintext or even be represented in other formats, e.g. HTML.

tecosaur commented 1 year ago

Kristoffer, let me know if you'd be interested in hearing more from me about this. I've just been able to do an evening's work on this, but so far I have an (incremental) history filtering system working which only depends on Base + REPL. Over the weekend I might see how much further I can take this.

https://user-images.githubusercontent.com/20903656/225418755-1fbca2e9-3ae7-4083-a8ca-78598c48bf05.mp4