From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#21468: 24.5; When next-line (visual) crosses overlay with before-string="\n" point goes to column 0 Date: Mon, 14 Sep 2015 08:46:57 -0400 Message-ID: References: <834miybogz.fsf@gnu.org> <83zj0q9k0m.fsf@gnu.org> <83twqxa5is.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1442234868 17334 80.91.229.3 (14 Sep 2015 12:47:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2015 12:47:48 +0000 (UTC) Cc: 21468@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 14 14:47:39 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZbTAX-00037J-JK for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2015 14:47:37 +0200 Original-Received: from localhost ([::1]:40488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbTAW-0004sN-Ud for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Sep 2015 08:47:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbTA2-0004B4-BO for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2015 08:47:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbT9y-0000Lf-BS for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2015 08:47:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbT9y-0000La-94 for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2015 08:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZbT9x-0005IB-OV for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2015 08:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Sep 2015 12:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21468 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21468-submit@debbugs.gnu.org id=B21468.144223482120340 (code B ref 21468); Mon, 14 Sep 2015 12:47:01 +0000 Original-Received: (at 21468) by debbugs.gnu.org; 14 Sep 2015 12:47:01 +0000 Original-Received: from localhost ([127.0.0.1]:59735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbT9w-0005Hw-L5 for submit@debbugs.gnu.org; Mon, 14 Sep 2015 08:47:01 -0400 Original-Received: from mail-wi0-f180.google.com ([209.85.212.180]:36004) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZbT9u-0005Ho-QK for 21468@debbugs.gnu.org; Mon, 14 Sep 2015 08:46:59 -0400 Original-Received: by wicgb1 with SMTP id gb1so140242986wic.1 for <21468@debbugs.gnu.org>; Mon, 14 Sep 2015 05:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=x/xJsn5ciF89CWkcElO+dJaxJwMsVay+1sQ9Kmq7vps=; b=dQojxwPQ0aZvNQXu7Xkv8/A4xkWEQ/aB4epGu8NnBcvRX1apG4hDtPkuwsFl7NDzz6 gcoqdAsFR8b+HJqnnMJDZUynvr9N2WW0imAaBthIEEmIdbEfwRthNyxgLeNJ2l1GXcCL RN66edbsLi3GZkVsjHZZ9pEDiBA/EKqFNOQ1KZ/z79iO65S3t0LeTXU00zGS49JBjfgw +uubBPuk1/TZc8iyBXcptRFkCdUBwMTmKXYoPCU1HxhXCCpT1rbCdMwN9r04L8I6nUze JuPOjclt1AzF8gwmuV4TU9XZX72635f7x5slbDwiRQJBUImf75bXLGUdQigZoFLL0Ifh 4ZYQ== X-Received: by 10.194.20.161 with SMTP id o1mr29445628wje.32.1442234817874; Mon, 14 Sep 2015 05:46:57 -0700 (PDT) Original-Received: by 10.28.210.82 with HTTP; Mon, 14 Sep 2015 05:46:57 -0700 (PDT) In-Reply-To: <83twqxa5is.fsf@gnu.org> X-Google-Sender-Auth: UCMDDoC9RBobFy_25yncNODGT0k X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106521 Archived-At: On Mon, Sep 14, 2015 at 2:17 AM, Eli Zaretskii wrote: > > Of course: that's a line of text. Why is that a problem? (I have no > idea what role is that thin line serving in Magit.) In this particular case, the overlays are delimiting a "magit region" (consisting of whole logical lines touched by Emacs' region). This means the thin line has to move with point, staying just ahead of it. Here is a demo, eval this in a buffer, then do set-mark-command and move around a bit: (require 'cl-lib) (defvar-local magit-region-overlays nil) (defun 21468-update-hunk-region (start end window rol) (mapc #'delete-overlay magit-region-overlays) (let ((rbeg (save-excursion (goto-char (region-beginning)) (line-beginning-position))) (rend (save-excursion (goto-char (region-end)) (line-end-position)))) (cl-flet ((ov (start end &rest args) (let ((ov (make-overlay start end nil t))) (overlay-put ov 'evaporate t) (while args (overlay-put ov (pop args) (pop args))) (push ov magit-region-overlays) ov))) (ov rbeg (1+ rbeg) 'before-string (propertize (concat (propertize "\s" 'display '(space :height (1))) (propertize "\n" 'line-height t)) 'face 'highlight)) (ov rend (1+ rend) 'after-string (propertize (concat (propertize "\s" 'display '(space :height (1))) (propertize "\n" 'line-height t)) 'face 'highlight))))) (setq-local redisplay-highlight-region-function '21468-update-hunk-region) (setq-local redisplay-unhighlight-region-function (lambda (rol) (mapc #'delete-overlay magit-region-overlays)))