GhostText icon indicating copy to clipboard operation
GhostText copied to clipboard

Expose position of textarea

Open kevinhwang91 opened this issue 4 years ago • 2 comments

Description

Comparing with firenvim, I prefer GhostText, which is not conflicted my shortcuts in chromium and doesn't slow me down in neovim.

I have tried GhostText with raghur/vim-ghost. I wanna make the position of nvim cover the textarea so I need the position of textarea. After enabling the log, the position of the textarea isn't passed to websocket server.

recd on websocket: ('127.0.0.1', 53718) message:
{"text":"","selections":[{"start":0,"end":0}],"title":"xxxxxxxxx","url":"github.com","syntax":""}

kevinhwang91 avatar Dec 05 '20 19:12 kevinhwang91

Well, I don't think it's possible to access the absolute position of the text area relative to your monitor....


Since you use neovim, check out nvim-ghost.nvim. It's awesome as it only focuses on neovim support.

subnut avatar Dec 19 '20 15:12 subnut

Well, I don't think it's possible to access the absolute position of the text area relative to your monitor....

It its via getBoundingClientRect + window.screenTop/Left - (window.outerHeight - window.innerHeight)

I thought about this in the past but I figured that most of the times the textarea is too small for this to make sense. The good part of using your editor is that it's a bigger window, so sizing it to the textarea would be counterproductive.

fregante avatar Jan 25 '21 23:01 fregante