It was broken at least since caret support was introduced and it was only
available for QtWebKit anyways, so let's just drop it. This also makes the tab
API a bit simpler.
It looks like getting the selection via the widget has issues even with Qt 5.10.
On Windows, we always get wrong results.
On Linux, it seems to be flaky. I first thought this was because of a race
between JavaScript setting the selection and Qt getting it, as now we don't use
JS to get the selection anymore, so it's possible that we get it before the
older JS code finished running. However, even calling selectedText() from a JS
callback didn't seem to help...
Since has_selection also is flawed and it taking a callback would make code more
complex as well, let's just assume there is a selection if the text is not
empty. In fact, that is exactly what QtWebEngine does for hasSelection anyways!
Fixes#3523
Scope down the new trigger-on-save behavior to only open-editor and
config-edit. Other uses of the editor such as edit-url and edit-command
will behave as before.
These are passing locally but failing in travis. This fixes two possible
timing issues:
- Ensure the signals are set up befor the pidfile is written. The
function that sends the signal waits for the pidfile to exist, so this
ensures we don't miss a signal.
- Wait for the log message indicating that the editor file was read
back, so the test doesn't run through before we get a chance to read
from the editor.
With the previous code, the editor could miss the final signal on a
save-and-exit. This is avoided by always running the file changed
handler on a successful exit, but only firing the signal if the content
actually changed (to avoid double-signalling).