boxer-project / boxer-sunrise

Sunrise on the Boxer Reconstruction Project
BSD 3-Clause "New" or "Revised" License
39 stars 2 forks source link

Consider adding `cursor-box` API (cursor equivalent of `mouse-box`) #90

Closed rigdern closed 1 day ago

rigdern commented 3 days ago

cursor-box would return the box that the cursor is within (similar to how mouse-box returns the box that the mouse is over).

Without such an API, I'm not sure how to implement features similar to the builtin help feature that annotates the procedure name under the cursor with the procedure's input names. Here's an example of that builtin help feature. If I type the procedure name item:

image

and then hit ctrl+?, then the procedure name gets annotated with the names of its parameters: N and BOX:

image

I don't think that could be implemented without knowing which box the cursor is in.

rigdern commented 1 day ago

I think that self plays this role for the cases that I care about. When you begin executing some code (e.g. by hitting a keyboard shortcut you've registered), self refers to the box where execution began which is probably also where your cursor is.