Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b872fe3
replace monolithic setup.py with pyproject.toml + scripts
samizdatco Jul 9, 2026
19809d0
bump minimum python version to 3.9
samizdatco Jul 9, 2026
3256a87
publish wheels containing the native extension
samizdatco Jul 9, 2026
18f985c
reflect test results in exit code
samizdatco Jul 9, 2026
d486a29
test for presence of pyobjc+extension, not just paths
samizdatco Jul 9, 2026
cafc691
fix regex escape
samizdatco Jul 10, 2026
62e9ca2
fix objc.super use in ConsoleScript
samizdatco Jul 10, 2026
665bc57
fix `ordered()` crash on grobs and silent dotted-path failures
samizdatco Jul 10, 2026
3f69b4c
add python 3.14 support by bumping pyobjc to 11.1
samizdatco Jul 10, 2026
3639d49
ignore rsrc files resulting from in-place build
samizdatco Jul 10, 2026
dc2ac7f
generate MANIFEST.in only when needed for sdist
samizdatco Jul 10, 2026
cb696af
rename build.py to make.py (to prevent `-m build` shadowing)
samizdatco Jul 10, 2026
46052ee
opt into secure restorable state
samizdatco Jul 10, 2026
ddab30c
update embedded python to 3.14.6
samizdatco Jul 10, 2026
f8ca3c8
update python version compat
samizdatco Jul 10, 2026
7df6d3b
update 1.0.1 docs
samizdatco Jul 11, 2026
ef7093a
bump copyright year
samizdatco Jul 11, 2026
2f58879
fix typos
samizdatco Jul 11, 2026
e0e6d59
add missing 3.14 classifier
samizdatco Jul 11, 2026
00d7e22
use system fonts in typography tests
samizdatco Jul 11, 2026
6363a2a
fixed Text.flow() when invoked w/ callback
samizdatco Jul 11, 2026
30f574f
fix the test for blend-only effects
samizdatco Jul 11, 2026
e4b666a
fix MagicNumber's numeric-protocol implementation
samizdatco Jul 11, 2026
41556e2
fix rasterization of clipping masks based on vector images
samizdatco Jul 13, 2026
318b8d9
add clip() test cases that use canvas transforms
samizdatco Jul 13, 2026
e5b8d1b
replace deprecated WebView with WKWebView
samizdatco Jul 13, 2026
79b7051
update document contents after each edit
samizdatco Jul 13, 2026
bbff6e9
fix license format
samizdatco Jul 13, 2026
74fc923
rename `sync_edits` and `flash_menu` methods
samizdatco Jul 13, 2026
293f85a
add new default editor theme
samizdatco Jul 13, 2026
5280134
add `Assets.car` for macOS 26+ icon
samizdatco Jul 14, 2026
43e2599
Replace setup.py with direct call to tests
samizdatco Jul 14, 2026
cf15d6e
handle quadratic curves in `path_to_polygon`
samizdatco Jul 14, 2026
8315113
Add logo banner to readme
samizdatco Jul 14, 2026
0226c2b
Fix deprecation warning from pyobjc
samizdatco Jul 14, 2026
2e5635e
update module providing UTType*
samizdatco Jul 14, 2026
a119caf
set exit code on script errors when running `plotdevice` headless
samizdatco Jul 14, 2026
8338229
replace `xrange` with `range` in code samples
samizdatco Jul 14, 2026
1773ce0
update markdown docs
samizdatco Jul 14, 2026
ac940c6
fix crash when canvas is zoomed before script has rendered
samizdatco Jul 15, 2026
73471c5
upgrade vendored ace.js to 1.44.0
samizdatco Jul 13, 2026
40164de
local ace modification: filter autocompletions
samizdatco Jul 14, 2026
3846f3a
local ace modification: fix snippet formatting
samizdatco Jul 15, 2026
8ca98b3
rough draft: add command-click documentation lookups
samizdatco Jul 14, 2026
f68126d
Add links to the documentation for all known symbols
samizdatco Jul 14, 2026
81318c4
add usage samples
samizdatco Jul 14, 2026
41ca645
reformat
samizdatco Jul 14, 2026
4daf9a3
ensure only actual function tokens have clickable docs
samizdatco Jul 14, 2026
87f9178
Add tooltips with syntax reference for plotdevice symbols
samizdatco Jul 15, 2026
b22781b
remove command-click docs (but keep tooltip links)
samizdatco Jul 15, 2026
a94fec7
add context menu for opening docs
samizdatco Jul 15, 2026
97474d7
add () to token name in View Docs context menu
samizdatco Jul 15, 2026
e53ec91
clean up usage strings
samizdatco Jul 15, 2026
86cedbf
fix refreshdoc command mishandling an empty source string
samizdatco Jul 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove command-click docs (but keep tooltip links)
  • Loading branch information
samizdatco committed Jul 15, 2026
commit b22781bc25abb58966a13477cdc313dccc8d7e11
18 changes: 0 additions & 18 deletions app/Resources/ui/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,6 @@
/* italicize kwarg names */
.ace_variable.ace_parameter { font-style: italic; }

.ace_symbol-doc-link {
/* ace's "text" markers are empty overlay divs, not text nodes, so
text-decoration has nothing to draw under -- border-bottom works
since these divs are already sized to the token's line height.
position:absolute is required -- ace's built-in marker classes
(ace_selection, ace_bracket, etc.) each declare this themselves
in the stylesheet; the top/left set inline by the renderer are
otherwise ignored and the div renders in normal static flow.
z-index must beat the other .ace_marker-layer classes (active-line:2,
step/stack:3, selected-word:4, selection:5, bracket:6) or this gets
painted underneath them since it otherwise stacks in DOM order */
position: absolute;
z-index: 7;
border-bottom: 1px solid currentColor;
cursor: pointer;
}

/* allow the max tooltip width to be a little bigger than default */
#editor .ace_tooltip {
max-width: min(48em, 66vw);
Expand Down Expand Up @@ -96,7 +79,6 @@
</style>
<script src="js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/ext-linking.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ace/ext-static_highlight.js" type="text/javascript" charset="utf-8"></script>
<script src="js/keybindings.js" type="text/javascript" charset="utf-8"></script>
<script src="js/symbols.js" type="text/javascript" charset="utf-8"></script>
Expand Down
91 changes: 3 additions & 88 deletions app/Resources/ui/js/editor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// the language-tools extension provides snippets and autocomplete
ace.require("ace/ext/language_tools");
// the linking extension provides accel-hover/click token events (used for cmd-click docs links)
ace.require("ace/ext/linking");
// used to render usage-sample tooltips with the same tokenizer+theme as the live editor
var staticHighlight = ace.require("ace/ext/static_highlight");
var Range = ace.require("ace/range").Range;
Expand Down Expand Up @@ -33,9 +31,6 @@ var Editor = function(elt){
"Python":[]
}
var _htimer = null, _vtimer = null, _hmin=0, _vmin=0;
var _linkMarker = null;
var _altHeld = false;
var _lastMouseEvent = null;
var that = {
init:function(){

Expand All @@ -59,26 +54,6 @@ var Editor = function(elt){
ed.hoverTooltip.setDataProvider(that._sampleHover)
ed.hoverTooltip.addToEditor(ed)

// cmd-hover/cmd-click a mapped symbol to underline/open its docs.
// $enableJumpToDef frees up plain cmd-click for this (multi-cursor-add
// moves to cmd-option-click instead). registered before enableLinking so
// it runs first and _altHeld is current by the time linkHover/linkClick
// fire (ext-linking.js doesn't pass the alt-key state through itself)
ed.on("mousemove", that._trackMouse)
ed.on("click", that._trackMouse)
ed.setOption("enableLinking", true)
ed.$mouseHandler.$enableJumpToDef = true
ed.on("linkHover", that._linkHover)
ed.on("linkHoverOut", that._linkHoverOut)
ed.on("linkClick", that._linkClick)

// mousemove-driven hover only fires on actual pointer movement, so
// pressing/releasing cmd while stationary over a symbol wouldn't
// otherwise show/hide the underline -- re-check the last known
// mouse position directly against cmd's/option's keydown/keyup instead
document.addEventListener('keydown', that._trackModifiers, true)
document.addEventListener('keyup', that._trackModifiers, true)

// configure the buffer
sess = ed.getSession()
sess.setMode("ace/mode/plotdevice");
Expand Down Expand Up @@ -136,65 +111,12 @@ var Editor = function(elt){
_blur:function(){
ed.setHighlightActiveLine(false)
ed.setHighlightGutterLine(false)
that._linkHoverOut()
},

_trackMouse:function(e){
// ext-linking.js's linkHover/linkClick events don't carry the raw dom
// event, so track option/alt ourselves to know whether it's held
// alongside cmd (in which case ace's own cmd-option-click add-cursor
// gesture should win instead of the docs link) -- also cache the
// event itself so _trackModifiers can re-derive hover state against
// the last known mouse position when cmd/option change while stationary
_altHeld = !!(e.domEvent && e.domEvent.altKey)
_lastMouseEvent = e
},
_trackModifiers:function(e){
// pressing/releasing cmd or option alone doesn't fire a mousemove, so
// ext-linking.js never re-evaluates the token under a stationary pointer
// -- do it ourselves. modifier flags on the event reflect live state
// (including for the key's own keyup), so no keydown/keyup branching
// is needed -- just recompute from current state each time
if ((e.key !== 'Meta' && e.key !== 'Alt') || !_lastMouseEvent) return
_altHeld = !!e.altKey
if (!e.metaKey || _altHeld){
that._linkHoverOut()
return
}
var docPos = _lastMouseEvent.getDocumentPosition()
that._linkHover({position:docPos, token:sess.getTokenAt(docPos.row, docPos.column)})
},
_linkHover:function(e){
var word = e.token && e.token.value
if (_altHeld || that._isBindingTarget(e.token) || !PLOTDEVICE_SYMBOL_DOCS.hasOwnProperty(word)){
that._linkHoverOut()
return
}
that._linkHoverOut()
ed.renderer.setCursorStyle("pointer") // .ace_layer has pointer-events:none, so css :hover/cursor on the marker itself has no effect
var row = e.position.row
var range = Range.fromPoints({row:row, column:e.token.start}, {row:row, column:e.token.start+e.token.value.length})
// addMarker(..., "text") goes through drawTextMarker, which is built for
// multi-row wrapped spans (wrong width + rounded corners for a single-row
// range) -- draw a plain single-line underline via the same primitive
// ace uses for selection/highlight markers instead. a dynamic marker must
// NOT have a .range property or ace routes it through the static-marker
// path (using its .clazz, which we don't set) instead of calling .update()
_linkMarker = sess.addDynamicMarker({
update: function(html, markerLayer, session, config){
markerLayer.drawSingleLineMarker(html, range, "ace_symbol-doc-link", config)
}
})
},
_linkHoverOut:function(){
if (_linkMarker!=null) sess.removeMarker(_linkMarker.id)
_linkMarker = null
ed.renderer.setCursorStyle("")
},
_isBindingTarget:function(token){
// spot locations where a term is being used as a kwarg (or other assignment), so we can
// exclude it from the command-click-for-docs behavior (since it would only coincidentally
// share the name of a documented function in that case)
// spot locations where a term is being used as a kwarg (or other assignment), so we can
// exclude it from the usage-sample tooltip (since it would only coincidentally share
// the name of a documented function in that case)
return !!token && (token.type === "variable.parameter" || token.type === "variable.assignment")
},
_sampleHover:function(e, editor){
Expand Down Expand Up @@ -230,13 +152,6 @@ var Editor = function(elt){
ed.hoverTooltip.showForRange(editor, range, tooltip, e)
})
},
_linkClick:function(e){
if (_altHeld) return // let ace's own cmd-option-click add-cursor gesture proceed instead
if (that._isBindingTarget(e.token)) return // kwargs/assignments never have cmd-clickable docs
var word = e.token && e.token.value
var url = PLOTDEVICE_SYMBOL_DOCS[word]
if (url) app.openDoc(url)
},

focus:function(){
ed.focus()
Expand Down