Forum > Editor

Lazarus editor feature request/suggestion

<< < (2/3) > >>

Martin_fr:
1) About the list of url types. I think ultimately to be configurable, possible including user specified. Or retrieved from OS.
But for starters, hardcoded, just http https is ok

2) underline => bound to the modifier key configured for the click (see existing code for code jumping)>
But can have config to underline either:
- modifier key + hover only
- hover
- always

Maybe / or maybe not, bound to highlighter and comment/string only???

3) click config
For advanced option must be own mouse command
But mouse commands can have fallbacks, so it can use same key as code jump
 
For normal config can be in the drop down as "code jump AND url", and as 2 entries, one for each.


Bonus
configurable pattern to match issue numbers
E.g.: Issue *\#(\d+)

And link(s) what page to open.
Challenge: Allow user to select fpc or Lazarus bugs.

JuhaManninen:

--- Quote from: hukka on February 08, 2025, 12:30:16 am ---The basic functionality is basically just a simple API call on most platforms, but the implementation requires certain decisions:

--- End quote ---
A cross-platform function already exists, namely OpenURL().


--- Quote from: Tony Stone on February 08, 2025, 01:31:57 am ---First I need to get the latest trunk to build properly, my last bright idea seems to be the source of a failed build now.  It is probably time for me to stop using FPCUpDeluxe as my crutch anyway.
--- End quote ---
Exactly! FPCUpDeluxe is not needed for building Lazarus trunk for the native system. It only complicates things. FPCUpDeluxe is good for other things.


--- Quote from: TRon on February 08, 2025, 08:11:36 am ---fwiw: most editors that I use and also the terminal 'lights up by underlining sometimes changing the colour of" the url when hovering over it with the mouse to indicate that an action can be performed and a right mouse click when active a popup-menu that has an action listed as "open url" as (first) item. Some use/allow also to use the ctrl-mouse-click (as fast action).

--- End quote ---
+1
A right mouse click or ctrl-click must be required. We are dealing with a text editor. Just clicking somewhere must move the cursor, nothing else.

Tony Stone:
I think a Ctrl+Click being required makes the most sense as well.  But I think it should also at least underline or maybe use italics and possibly show a hint whenever hovering over a URL WHILE CTRL key is down.. 

If you require a Ctrl+Click do we still want the cursor to change the the system cursor you see on hyperlinks (the hand cursor). 

I feel JuhaManninen is 100% correct though and it must require a key+click and the existing key we use to jump in the code is most logical.

So in my opinion it should only appear different when a control key is Down.

It should offer a hint when mouse is over it "Ctrl+Click to open URL" WITHOUT control key down.

Mouse cursor should change to hand when hovering with control key is down.

Beyond that I think a normal click in a URL must set the caret in that positions as normal.

A right click over a URL that offers an Open URL menu item is very logical to me as well.  But if that is implemented I think it is important to make sure a right click ANYWHERE in the URL will give the Open URL option.  I have another program I use and you have to perfectly highlight a URL then it gives you the Open URL menu item.  Actually they recently improved it so now you can right click anywhere in a URL and get the menu so that was a nice improvement.

440bx:
I tend to favor a solution that places as little burden on the editor as possible.

This means that normally, when the mouse is not on the url or the caret is not somewhere in the url string then the url should be treated just like a normal comment.  However, when either one of those conditions are true (mouse or caret on the url) then underlining the url as feedback that something is afoot would be nice.

Martin_fr:
Well, it should be doable 100% as add-on (though the code of the addon can (partly) reside in the SynEdit package.

The code-link is not implemented in the core of SynEdit, nor does the core know about it (except for a forwarder to set the colors/events / because of backward compatibility for when it was in the core).

There is a "Markup" that can be added to SynEdit and handles the highlight.
It also registers mouse actions (though that should be done in a plugin, not in the markup). So when click occurs an event can be triggered.

The rest of course would go into the IDE, if the event is triggered calling the open url API of the OS must be IDE.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version