From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#38731: 27.0.50; Unexpected redisplay behaviour. Cursor =?UTF-8?Q?can=E2=80=99t?= be moved to end of line. Date: Thu, 26 Dec 2019 12:59:17 +0000 Message-ID: <20191226125917.GA71460@breton.holly.idiocy.org> References: <835zi5wwmr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="132420"; mail-complaints-to="usenet@blaine.gmane.org" Cc: HaiJun Zhang , 38731@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 26 14:00:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ikSkP-000YJ4-2M for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Dec 2019 14:00:13 +0100 Original-Received: from localhost ([::1]:53388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikSkN-0004OE-QK for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Dec 2019 08:00:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44409) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikSkG-0004M5-94 for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 08:00:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ikSkF-0008EZ-5d for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 08:00:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ikSkF-0008Dv-20 for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 08:00:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ikSkE-0007tc-VV for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 08:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Dec 2019 13:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38731 X-GNU-PR-Package: emacs Original-Received: via spool by 38731-submit@debbugs.gnu.org id=B38731.157736517030278 (code B ref 38731); Thu, 26 Dec 2019 13:00:02 +0000 Original-Received: (at 38731) by debbugs.gnu.org; 26 Dec 2019 12:59:30 +0000 Original-Received: from localhost ([127.0.0.1]:55007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikSji-0007sI-6c for submit@debbugs.gnu.org; Thu, 26 Dec 2019 07:59:30 -0500 Original-Received: from mail-wm1-f45.google.com ([209.85.128.45]:55162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikSje-0007s3-RU for 38731@debbugs.gnu.org; Thu, 26 Dec 2019 07:59:28 -0500 Original-Received: by mail-wm1-f45.google.com with SMTP id b19so5830510wmj.4 for <38731@debbugs.gnu.org>; Thu, 26 Dec 2019 04:59:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=wP/fb2cMHlbXy5AVkMKR1NAq+Dzpwz1E2vQ0wXT8BFw=; b=N+mePD6hkm4SeIVSvwSxuGUq7xrkJrcusWubQqObN+1alrYaNnZJqavTTDIIs1W3L1 LI0fdB87vITIuLp/uqrjDWC6DC7g5ryAH6ewOZCv5Wp8SzPKuR60Aw9o3Olmw5A2Q9Fa 9X9Evvhj+Sbsy85fUAkxwqRkykofd7DoR+ErT+GweiX0YQxSbD90dStR8JmHFVYLw7TK 9ug8dcYvpQnOpMX/O9o1gFgKH+sBa4BALT/aYvbRSDMOoCcMLEAezjH53NN8arP3vMEG xt2ps/TiW1OsDQni1HWLvVRjXGBdqN+z80xE27rMISlYO8WFyRLSPBbUfpQKmrimAWXG Vc0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=wP/fb2cMHlbXy5AVkMKR1NAq+Dzpwz1E2vQ0wXT8BFw=; b=q3ZvIhOg33SiT+mDhWfKdx2c8G5byj/8GMb9zYvT0HphryagE1cO0jiHetdl4CcJOk tZ5nB01OtCX7FtSVFloHYjy9qOI4at8GNUQhId6CNqrhL4IvfHcDzNNUKagUWR2BOICc 2dcOhnoWNG65uNBo+lYaSRMqPqDiklmem4d5LZEgJCEqbhsjp2AZK2wSshpI/AVI+XGa CocpMxvlncVpCoKcjWLcVK0mGLgkFd3U/TmGg4Rc0wCOlFxDzQ4pDOgUW9e8m8v3i3fw iUlIMnVxnTBk1weO4bF8vJOiNw2/gUiJxKP+QwcPYYI0XpuJYaByWWMf2EqTcGZ6muwm zgpQ== X-Gm-Message-State: APjAAAWlCKjPmdrluGgQHEWLjEGYVJHIbEOkSRwK9WjMHDiKHcK4zR3c iTmiZt6a69IIRQ/e48SuxDU= X-Google-Smtp-Source: APXvYqxh2Y5pHtwjU0lsELXO19BCGEUOTUGOCu4v60/CcWqWJdTNXUQmEe408gKqpsl3jcyCfu+cAQ== X-Received: by 2002:a05:600c:2488:: with SMTP id 8mr13775301wms.152.1577365160768; Thu, 26 Dec 2019 04:59:20 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-5065-467f-7969-bf01.holly.idiocy.org. [2001:8b0:3f8:8129:5065:467f:7969:bf01]) by smtp.gmail.com with ESMTPSA id b68sm8316739wme.6.2019.12.26.04.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2019 04:59:19 -0800 (PST) Content-Disposition: inline In-Reply-To: <835zi5wwmr.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173779 Archived-At: On Tue, Dec 24, 2019 at 05:50:36PM +0200, Eli Zaretskii wrote: > > Date: Tue, 24 Dec 2019 18:43:34 +0800 > > From: HaiJun Zhang > > > > 1. emacs -Q > > 2. open the test file in attachment(a.cpp) > > 3. M-x toggle-truncate-lines > > 4. M-x global-hl-line > > 5. shrink the width of the emacs window so that the longest line(#12) can’t be fully visible > > 6. go to line 12 and press C-e to goto end of line > > 7. the cursor is not at the end of line and you can’t move the cursor to end of line > > I cannot reproduce this. > > Note how in the video you produced, moving cursor across the > right-most part of the line after C-e shows characters from the end of > the line. IOW, Emacs does know it is at EOL, it's just that the > window display somehow was not updated. > > I think this is Darwin-specific display problem. I may be entirely wrong but after looking into this I think the NS code is being passed bad information. It may be because we only ever draw from expose_frame: I have a test branch that draws directly into an offscreen bitmap, not relying on expose_frame, and it draws correctly despite using almost the same logic. In ns_draw_glyph_string I can see that s->x is correctly set to 136 when the backtrace doesn’t contain expose_frame, but 178 when it does. The issue seems to rely on the combination of truncate lines mode, global hl mode and tabs on the left. The number of tabs seems to make no difference, the offset remains the same, and replacing tabs with spaces displays correctly. Any thoughts on how to debug this further? -- Alan Third