From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Moving point around empty overlays with 'after-text Date: Sat, 08 Apr 2023 13:06:04 +0300 Message-ID: <83wn2mn0xf.fsf@gnu.org> References: <9b1654ec-1ac6-4936-860b-2d77dcc4dac7@app.fastmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40889"; 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 Sat Apr 08 12:05:54 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 1pl5SE-000AQy-9R for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 08 Apr 2023 12:05:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pl5Rv-00050l-5b; Sat, 08 Apr 2023 06:05:35 -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 1pl5Rt-00050O-0i for help-gnu-emacs@gnu.org; Sat, 08 Apr 2023 06:05:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pl5Rs-00088R-II for help-gnu-emacs@gnu.org; Sat, 08 Apr 2023 06:05:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1GYB+4MqyWTss8D0dzBmUuOW3smm2Lvqo8VZP10xgm4=; b=oYcSasskcUzb hcoKyZ+8xF+WfrPZtmpxoDHq2AjdsXJ3xRHUTWiEeel86s5PC8W6hk1KqsSrHOzZjhlgkVl0z68+Z NMWxepSaL4x2REyjxWTkVjmB/0AxfJSrkNWKKBCXaMaxLXn8ivl3Mt+9TM9B/6kPPDHqMgGRYadaH KR2Rs4xwtjYjG/gnyL5Qa7rIeUFTGvjhBs4gsR+SAqO0wZZOn2w6sJMShC+253fcoKPl6G86L8jkQ 59+tWJhDPDFnLsffatds9+XrbAjRUJ8PDzG5zfN+XMn9jh474VKfUHAIMyIsy1oHLnOKK3zMllpAf 2QHQVjSwTFtrFxcUT4XrnQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pl5Ro-0004O3-Uv for help-gnu-emacs@gnu.org; Sat, 08 Apr 2023 06:05:30 -0400 In-Reply-To: <9b1654ec-1ac6-4936-860b-2d77dcc4dac7@app.fastmail.com> (message from Ash on Fri, 07 Apr 2023 22:46:19 -0700) 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:143226 Archived-At: > Date: Fri, 07 Apr 2023 22:46:19 -0700 > From: Ash > > https://github.com/emacs-lsp/lsp-mode/issues/3263 is a bug in lsp-mode (emacs's > own eglot has the same bug as far as I can tell) that appears to boil down to > the behavior of emacs overlays and after-string. That is, if your buffer looks > like > > let my_value{: Vec} = vec![0, 1, 2]; > > (where the curly braces indicate the after-string property of an > overlay), you need to put your cursor *after* the overlay to > insert text at the end of the variable name, which comes *before* > it, and it's impossible to put your cursor immediately between > the overlay and the preceding text. I assume the behavior the > user desires is that you can put your cursor either immediately > before or immediately after the overlay and insert text, and that > pressing the left/right arrow would move you over the overlay but > leave the actual position of point unchahnged. > > My suspicion is that this isn't fixable just by setting the right text/overlay > properties, since both the cursor locations immediately before and after the > overlay actually correspond to the same location in the underlying string. But > I'm not good at text property arcana. Any advice? Did you try to use on the overlay string the 'cursor' text property whose value is zero?