fork-dev / Tracker

Bug and issue tracker for Fork for Mac
495 stars 12 forks source link

Add BBEdit to 'Reveal Line in…' #2029

Closed tflo closed 2 weeks ago

tflo commented 7 months ago

BBEdit comes with a command line tool, which should make this easy. The syntax is:

bbedit +<line number> <file path>

Thanks for considering,

– Tom

tflo commented 2 weeks ago

Any progress – or thoughts – on this?

In the meantime, I could help myself a little bit by creating a "Go to Line in BBEdit…" custom command in the file contextual menu:

bbedit +$1{text} "${file}"

This is a bit clumsy, since I have to enter the line number manually in the prompt ($1{text}).

But it points to another possible solution:

Give us a variable ${file:line}. The content of the variable would be the line number of the first selected line, or, if nothing is selected, the number of the line where the cursor is in[^fn1].

This would have the advantage that you wouldn't have to hardcode in additional editors.

[^fn1]: There is no visible cursor in the GUI, but the cursor position must be known internally, since I can click at any location in the text and then make a selection via Shift-ArrowKey.

DanPristupov commented 2 weeks ago

Can you try this build? https://cdn.fork.dev/prerelease/Fork-2.43.10.dmg

Screenshot 2024-06-26 at 15 46 17
tflo commented 2 weeks ago

The Reveal works great, thank you! 😍

image

However, the File Tree view is completely empty with this version:

image

(no File Tree issues with the regular Fork version, 2.43.1)

DanPristupov commented 2 weeks ago

Great!

Can you send me the log file to support@fork.dev please? The log file is located at %localappdata%\fork\logs\fork.log

tflo commented 2 weeks ago

Sent.

Thanks again for the BBEdit addition!

DanPristupov commented 2 weeks ago

Thank you for the log. Can you try this one, please? https://cdn.fork.dev/prerelease/Fork-2.43.11.dmg

tflo commented 2 weeks ago

2.43.11:

File Tree is back, but the Fork context menu with the "Reveal in…" is gone (just the standard text context menu instead).

image

The other views (Changes, Commit) still have the good context menu.

Fork.log

DanPristupov commented 2 weeks ago

I think it always worked this way. The 'Reveal' context menu was never in the FileTree tab. It's only in Changes.

tflo commented 2 weeks ago

Oh, you are right. Somehow I thought it was in all views, but that's probably because I didn't use it that often without BBEdit in there 😉.

But if it's an easy thing to implement, it would be nice to have it there too 🙄. Or is there a specific reason why it's not there (or shouldn't be there)?

tflo commented 2 weeks ago

I guess I mixed it up with my above mentioned "Go to Line in BBEdit..." custom command in the file context menu, which also works in the Tree view, and I used it regularly there.

DanPristupov commented 1 week ago

But if it's an easy thing to implement, it would be nice to have it there too 🙄. Or is there a specific reason why it's not there (or shouldn't be there)?

Yes, there is a reason. The File Tree tab doesn't show diff and it uses a basic text control. It even has default text context menu.

The other places (Summary and Changes tabs, History, Working directory) use the diff control which has customized menu which includes 'Reveal in ' option.

DanPristupov commented 1 week ago

We just released Fork 2.44 with the ability to reveal changed line in BBEdit

tflo commented 1 week ago

The File Tree tab doesn't show diff and it uses a basic text control. It even has default text context menu. The other places […] use the diff control which has customized menu which includes 'Reveal in ' option.

Yes, that is what I was referring to.

Is there a reason why you don't use the diff control in the Tree view? The only useless menu item for the Tree view would be "Copy as Patch" (and I think that could be conditionally suppressed without writing an extra custom menu).

And even if you don't suppress it, the default text menu has more "dead" menus anyway (e.g. why would I want a "Font" submenu in a context where I can't change the font?)

But the "Reveal in" items are (almost) as useful in the Tree view as they are in the Diff view, and in any case more useful than the standard text menu. At least for me, since I often used my custom "Go to line in BBEdit" file command in the Tree view as well.

But of course this is just a small side thing that came to mind in the given context.


We just released Fork 2.44 with the ability to reveal changed line in BBEdit

Just installed it! Many thanks again for adding BBEdit (and also Xcode!).