How to adjust the placement of the popup for editcomptext plugin

Hi everyone

The edit-comptext plugin is great. But one pet peeve I have with it is that when I start typing a link with [[, the popup covers what I am typing. I would like to know how to adjust that popup so it appears slightly to the right and below what I am typing. Have any of you who use it encountered this, and have a solution? A few days ago I inspected the CSS of the popup and tried to add a css rule, but it rendered my file useless, and I had to open it in a text editor to extract the offending tiddler to fix the file. The link to the plugin is Edit-CompText Demo — a demo of the Edit-CompText plugin for TiddlyWiki5

2 Likes

There’s some discussion about this in this post that may be helpful:

Thanks for the link, Boris!

David,

Thanks for linking to the plugin, we can all use it, if naming a plugin in a discussion providing a link when named to the demo or source of that plugin (if available) this will help four ways;

  • We can go to the demo site and test a solution we think we have for you
  • We can source the plugin without going anywhere else to help solve your question, eg install it on tiddlywiki.com
  • If someone likes the idea of the plugin they can find it
  • If someone searches for the plugin eg they will not get discussion’s that don’t tell them where it is.

Hello,

As writer of this plugin, I’ll try to give some answer from the top of my head (no time to dive in the code right now).

the placement of the popup is the most delicate issue in editcomptext to my opinion. Because it is difficult to get the position of the cursor (x,y) relative to, say, the corner of the textarea.
In the code, I use a trick (do not remember who came up with it) to compute it by using an invisible oneline textarea filled with the same text and font than the current edited textarea. The width and height of this invisible oneline textarea give me enough information to try to locate the cursor in the original textarea. Then, I position the popup window according to this position plus some hard-coded offset.

If there is some problem, that most likely means the estimation of the cursor using that “trick” is not correct. And without more information (browser or application, does it happen all the time, in all positions (1st or 10th line, ?) it is difficult to help.

If the “offset error” between cursor and popup is constant, I could make that offset an adjustable value somewhere in the configuration file…

Snow.

Thanks snowgoon, when I see a pattern, I will make a short video and post here. Of course when I just try typing it in to experiment, it works fine.