From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Moving point around empty overlays with 'after-text Date: Sun, 9 Apr 2023 16:49:28 +0200 Message-ID: References: <9b1654ec-1ac6-4936-860b-2d77dcc4dac7@app.fastmail.com> <28954f0d-205d-b322-4a43-cf4481d1266e@gmail.com> <3a1bb709-d00f-49b8-a2c5-d0ac5b6a82c4@app.fastmail.com> <22b315db-39eb-80b6-1a7c-127f5e703dc1@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3QzIIpb14nmOKg9E" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27763"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 09 16:50:24 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1plWN5-0006xQ-8b for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 09 Apr 2023 16:50:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plWMM-0000B0-1t; Sun, 09 Apr 2023 10:49:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plWMJ-0000Ar-A9 for help-gnu-emacs@gnu.org; Sun, 09 Apr 2023 10:49:35 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1plWMH-0001vS-0g for help-gnu-emacs@gnu.org; Sun, 09 Apr 2023 10:49:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6MwqIVTjhHaZSteqpB3CSE1xuvnWb4J9VpEaDY9NJck=; b=YqxdiM6Di2+cD55LARLaNrq6B+ K1BUwK24+cuFbTP0sCCyupkdAwM4cdBaom8aK/EbYJi+KlUAXUPdh+1EBsLoMWyRAt+88+482OSoW FH+yp23N3NqWFlvBIuW8vff0ejLjaz2W5Ym73QIGzYxpl81+qvH9zK17FSKRgbrjnTrcC6FT3d5sd HNEQBPo0kOMiCeOhwEjz6Hx3O511WHI83A6HTleycJe3cz6aiIdTDqwtBAgooZVAOPO53++bYg+f0 j4yY2eSvQ9hXIuVdrqDMPPNczJOoty5y/dtdVCaTiPFng4mav1MMgA2VI+MUFUkj2+ptIpKLl3jEd M9Uld+3w==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1plWMC-0005q1-22 for help-gnu-emacs@gnu.org; Sun, 09 Apr 2023 16:49:28 +0200 Content-Disposition: inline In-Reply-To: <22b315db-39eb-80b6-1a7c-127f5e703dc1@gmail.com> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143234 Archived-At: --3QzIIpb14nmOKg9E Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 09, 2023 at 08:15:31PM +0800, Platon Pronko wrote: > On 2023-04-09 07:06, Ash wrote: > > Yeah, that's my message, hence why I was asking if I was missing someth= ing :) > >=20 > > In some cases it makes sense to put the cursor after the overlay; for e= xample, when invoking a function, the overlay can look like > >=20 > > some_function({argument_name: }some_value) > >=20 > > in which case you'd expect to be able to put the cursor after the overl= ay (to edit the value) and before (to add another argument to the list). Bo= th cursor positions would correspond to the same location, but you're doing= something different semantically. So I would expect to be able to type 'an= other_value, ' before the overlay and 'foo' after and get > >=20 > > some_function(another_value, {argument_name: }foosome_value) > >=20 > > and not > >=20 > > some_function({argument_name: }another_value, foosome_value) > >=20 > > In practice, I think for the existing overlays in rust-analyzer's inlay= hints there's a 'preferred' cursor position (start for type annotations, e= nd for param name annotations) where the user will want it 80% of the time,= so it could set things up based on that. Might also investigate the nasty = solution and see how clean I can get it and see if it's expensive CPU-wise. > >=20 >=20 > I looked at what other IDE is doing (IDEA in my case). They indeed allow = the cursor to be positioned both before and after the inlay, with added tex= t appearing exactly as you described. >=20 > I still think that doing this hack with "detect if the cursor moved exact= ly one position forward, tweak overlay, move it back" is horrible. It feels= like it might be much better if this was handled at much lower level, not = at the level of lsp-mode. What I don't understand is why the overlay doesn't cover the whole argument value instead of sticking before it. Perhaps this would ease some of the problems? Cheers --=20 t --3QzIIpb14nmOKg9E Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZDLQbQAKCRAFyCz1etHa Ru0OAJ96RnfSBa08fPvGmLG5mEFuCCW7bgCbBV9J0fVSUzVX+uN9OahpUOQY/w8= =+XLI -----END PGP SIGNATURE----- --3QzIIpb14nmOKg9E--