techee / geany-lsp

LSP plugin for the Geany editor
GNU General Public License v2.0
11 stars 1 forks source link

Right click in editor does not move the caret to position clicked #22

Closed elextr closed 9 months ago

elextr commented 9 months ago

Geany 2.0 does, Scite does, Vscode does.

As a result the right click menu applies to the wrong thing.

techee commented 9 months ago

Geany 2.0 does

Does it? It doesn't seem so.

That said, yes, I should use the position of the click and not the position of the caret.

elextr commented 9 months ago

Actually both do, right click on something it can't "goto symbol definition" on, like while and the caret moves there. Probably be good if the caret move happened first, since the LSP needs the location.

techee commented 9 months ago

Ah, alright, you mean "after clicking goto" and not "right click alone" because the latter doesn't move anything.

elextr commented 9 months ago

Hmmmm, none of the right click menu actions seem to care about the click position, they all seem to only care about caret, thats really nasty, right click and move lines up, and the line with the caret moves, not the line clicked on.

Think thats a Geany one, will raise there.

elextr commented 9 months ago

Ah, alright, you mean "after clicking goto" and not "right click alone" because the latter doesn't move anything.

Yes, Geany 2.0 uses the correct symbol (the one clicked on) but geany-lsp doesn't.

techee commented 9 months ago

OK, now thinking about it, it would really have to be Geany to move the caret when right-clicking - when the menu entry is clicked, it has no way of learning where the click event happened and there's nothing it could do.

But it's actually a bit questionable whether Geany should do that - the current state meets my expectations that the menu is relative to the caret position and not the click event position.

Anyway, closing here, not the plugin problem.

techee commented 9 months ago

Yes, Geany 2.0 uses the correct symbol (the one clicked on) but geany-lsp doesn't.

Ah, really, reopening then. I have to check what Geany does exactly.

elextr commented 9 months ago

Ahhh, its only the LSP items at the top of the right click menu, the item that existed in 2.0 "goto symbol definition" still uses the clicked position in -lsp.

(If I havn't confused myself, I have 1.38, 2.0 and -lsp all open at the same time on the same files ;-)

techee commented 9 months ago

It should be fixed now. I had to modify the Geany LSP interface to provide the position for goto definition/declaration. For other features invoked from the context menu I used the "update-editor-menu" signal to get the position.

elextr commented 9 months ago

Seems fixed.