From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Platon Pronko Newsgroups: gmane.emacs.help Subject: Re: Moving point around empty overlays with 'after-text Date: Sat, 8 Apr 2023 18:14:13 +0800 Message-ID: References: <9b1654ec-1ac6-4936-860b-2d77dcc4dac7@app.fastmail.com> <83wn2mn0xf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="763"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 To: Eli Zaretskii , 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:14:43 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 1pl5al-000Aa0-AT for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 08 Apr 2023 12:14:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pl5aQ-0007EI-Jk; Sat, 08 Apr 2023 06:14:22 -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 1pl5aO-0007DR-VK for help-gnu-emacs@gnu.org; Sat, 08 Apr 2023 06:14:20 -0400 Original-Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pl5aN-0002JI-At; Sat, 08 Apr 2023 06:14:20 -0400 Original-Received: by mail-pj1-x102a.google.com with SMTP id 60-20020a17090a09c200b0023fcc8ce113so3172560pjo.4; Sat, 08 Apr 2023 03:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680948857; x=1683540857; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=b+vr/bJvmnkyOG1U5BU/7VpfWaKnsJ6CbX+VlD+LQSo=; b=YHXjzE9N0tlobBeL5GwP9LWebjxKWn2IMfh4lowi1k8uS5lZS+O+kMx6ciL+Y6sYMF LmPa56kkMuL204e+FnnHHBG9pK0YeQ0OwEZ1ytfdkOkjiiVs560uTaKxNW7iikJW48Nf aL5MwushOLFEgLOJ22eZ/AwbkyA6QgHlcQbGAjPaBEdwZPC6BzjIQa5S+1fxswfIwcHy BJweQhh8CyCzM3xJ5JimVGWOURTvBexDaCjoR1wNPjNLcpy9TZ5IOwYe4Z6/YqXw4rz6 W73Gv2UBZouIztA1BtWVWcElw4Sv6JFdPgyqjuVnxTtKRUrR3rcpl29v9R2PJLLUUayq /kAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680948857; x=1683540857; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=b+vr/bJvmnkyOG1U5BU/7VpfWaKnsJ6CbX+VlD+LQSo=; b=XkdL+/cYYAlcpVcJ4OWPwgBDixvR3d4cP873uVRcH5GqluynxiVcO9A3QU/bwCJ1Jo S8jNk9TYtilCJZu9Wc8afFn73NN/5BnOf5c37hSoj/OTzXHvLn9A35PjeDlueLSQuD7G 7vVOFc1Z1bKAvq/wwbWNvgH7tFwHd4B/zmzX4IH02A/6dsikBOpw3kpsa7BFemmem9lJ qj1H7dVzAqotRo4BHsJQ85DlsE0CoFOBinFaHgxz+0E/uvG04Hf7NE+aPbRutfGca/4n AboBEYBGbiyKD2dutrKrSPAHmWErci4cTDICk2IZcpEWg4MWVYCe6OJUeptaMsWV75B3 pjqw== X-Gm-Message-State: AAQBX9dlFLB4ppOsPhFe4tdY3uip+r2L1W0VWKlloRDQWe0cBjTBgRWy HgSZRIOZsVTTg9iv85pQRMb7qLZP4Z+F6A== X-Google-Smtp-Source: AKy350ZDl+T9cECAQTsPB5jPDAR7kkdTDiOWE+UJkASNHI0/Ru4EXJ7IOj7znbu/n0Khfd65GQmf7Q== X-Received: by 2002:a17:902:f0cb:b0:1a5:20d3:eca5 with SMTP id v11-20020a170902f0cb00b001a520d3eca5mr2803162pla.9.1680948857093; Sat, 08 Apr 2023 03:14:17 -0700 (PDT) Original-Received: from [192.170.1.133] ([103.24.106.35]) by smtp.gmail.com with ESMTPSA id t13-20020a1709028c8d00b001a19196af48sm4206497plo.64.2023.04.08.03.14.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Apr 2023 03:14:16 -0700 (PDT) Content-Language: en-US In-Reply-To: <83wn2mn0xf.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=platon7pronko@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-2.03, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:143228 Archived-At: On 2023-04-08 18:06, Eli Zaretskii wrote: >> 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? > As I understand that it won't help, because they have to use zero-width overlays here, and the behavior of 'cursor property in such cases is not to be relied upon (as you previously suggested in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62540). -- Best regards, Platon Pronko PGP 2A62D77A7A2CB94E