edwood icon indicating copy to clipboard operation
edwood copied to clipboard

Context aware Look

Open Superpat opened this issue 6 years ago • 8 comments

I first saw this in https://github.com/as/a, but the idea is that Look (and maybe even Edit) would operate differently depending on the context it is executed in, so using Look in a window tag searches that window, doing a Look inside a column searches all windows in the column and finally doing a Look in the main tag bar searches every opened window.

Edit could do this as well, editing all windows in the context by default, with the possibility to filter with the X command.

Superpat avatar Jan 31 '19 19:01 Superpat

Can this be implemented with plumb?

rjkroege avatar Jan 31 '19 19:01 rjkroege

Maybe for Look? Does the plumb message know that it's being sent from a column or row?

Superpat avatar Jan 31 '19 20:01 Superpat

In the row/column tag, $winid is always set to the last active window, so wouldn't Look and Edit operate on that window?

fhs avatar Jan 31 '19 21:01 fhs

As it is right now, I think that's how it works, though in practice it can be pretty easy to forget what the last active window was.

But I dont think we would want to change the behaviour for other commands, if I click on |fmt in a column / row I only want it to affect the last active window. If I did want it to affect many windows I'd call it through Edit.

Superpat avatar Jan 31 '19 21:01 Superpat

Switched my newa script to use edwood, seems to be working fine for now. How does one read every plumb message sent to the plumber?

Superpat avatar Feb 01 '19 14:02 Superpat

@Superpat 9p read plumb/edit? Row/column information is not sent to the plumber, and even if it did, I don't see how it would help you.

fhs avatar Feb 01 '19 15:02 fhs

I was wondering if there was a way to read plumber messages on their way out, but if none of that information is sent out anyways, it's moot.

If row / column info was sent alongside, then a context aware Look could be implemented through plumb rules. But I'm not sure that's the best way to go.

Superpat avatar Feb 01 '19 18:02 Superpat

Regarding the active window: it seems reasonable to show the active window in a slightly different colour.

rjkroege avatar Feb 02 '19 21:02 rjkroege