all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: HaiJun Zhang <netjune@outlook.com>, 38731@debbugs.gnu.org
Subject: bug#38731: 27.0.50; Unexpected redisplay behaviour. Cursor can’t be moved to end of line.
Date: Thu, 26 Dec 2019 12:59:17 +0000	[thread overview]
Message-ID: <20191226125917.GA71460@breton.holly.idiocy.org> (raw)
In-Reply-To: <835zi5wwmr.fsf@gnu.org>

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 <netjune@outlook.com>
> > 
> > 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





  parent reply	other threads:[~2019-12-26 12:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a0dc5800-db7e-4091-b385-e2c888f9472b@Spark>
2019-12-24 10:43 ` bug#38731: 27.0.50; Unexpected redisplay behaviour. Cursor can’t be moved to end of line HaiJun Zhang
2019-12-24 15:50   ` Eli Zaretskii
2019-12-24 16:42     ` HaiJun Zhang
2019-12-26 12:59     ` Alan Third [this message]
2019-12-26 13:24       ` HaiJun Zhang
2019-12-26 17:29       ` Eli Zaretskii
2019-12-27 14:35         ` Alan Third
2019-12-27 16:26           ` bug#38731: [PATCH] Calculate first glyph to be redrawn when exposing (bug#38731) Alan Third
2019-12-27 17:17             ` Eli Zaretskii
2019-12-27 19:06               ` Alan Third
2019-12-28  8:54                 ` Eli Zaretskii
2019-12-28 11:20                   ` Alan Third
2019-12-28 18:27                     ` Eli Zaretskii
2019-12-29 10:46                       ` Alan Third
2019-12-30  4:55                         ` HaiJun Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191226125917.GA71460@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=38731@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=netjune@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.