Patch 8.2.0108
Problem:    When sign text is changed a manual redraw is needed. (Pontus
            Lietzler)
Solution:   Redraw automatically. (closes #5455)
Files:      src/testdir/test_signs.vim, src/sign.c,
            src/testdir/dumps/Test_sign_cursor_1.dump,
            src/testdir/dumps/Test_sign_cursor_2.dump,
            src/testdir/dumps/Test_sign_cursor_3.dump,
            src/testdir/dumps/Test_sign_cursor_01.dump,
            src/testdir/dumps/Test_sign_cursor_02.dump


*** ../vim-8.2.0107/src/testdir/test_signs.vim  2019-09-06 22:00:14.000000000 
+0200
--- src/testdir/test_signs.vim  2020-01-09 20:17:52.305515314 +0100
***************
*** 1747,1758 ****
    END
    call writefile(lines, 'XtestSigncolumn')
    let buf = RunVimInTerminal('-S XtestSigncolumn', {'rows': 6})
!   call VerifyScreenDump(buf, 'Test_sign_cursor_01', {})
  
    " update cursor position calculation
    call term_sendkeys(buf, "lh")
    call term_sendkeys(buf, ":sign unplace 10\<CR>")
!   call VerifyScreenDump(buf, 'Test_sign_cursor_02', {})
  
  
    " clean up
--- 1747,1762 ----
    END
    call writefile(lines, 'XtestSigncolumn')
    let buf = RunVimInTerminal('-S XtestSigncolumn', {'rows': 6})
!   call VerifyScreenDump(buf, 'Test_sign_cursor_1', {})
! 
!   " Change the sign text
!   call term_sendkeys(buf, ":sign define s1 text=-)\<CR>")
!   call VerifyScreenDump(buf, 'Test_sign_cursor_2', {})
  
    " update cursor position calculation
    call term_sendkeys(buf, "lh")
    call term_sendkeys(buf, ":sign unplace 10\<CR>")
!   call VerifyScreenDump(buf, 'Test_sign_cursor_3', {})
  
  
    " clean up
*** ../vim-8.2.0107/src/sign.c  2019-12-05 21:08:29.000000000 +0100
--- src/sign.c  2020-01-09 20:27:17.212293477 +0100
***************
*** 1025,1030 ****
--- 1025,1040 ----
        else
            sp_prev->sn_next = sp;
      }
+     else
+     {
+       win_T *wp;
+ 
+       // Signs may already exist, a redraw is needed in windows with a
+       // non-empty sign list.
+       FOR_ALL_WINDOWS(wp)
+           if (wp->w_buffer->b_signlist != NULL)
+               redraw_buf_later(wp->w_buffer, NOT_VALID);
+     }
  
      // set values for a defined sign.
      if (icon != NULL)
***************
*** 1781,1790 ****
      else
      {
        FOR_ALL_BUFFERS(buf)
-       {
            if (buf->b_signlist != NULL)
                sign_get_placed_in_buf(buf, 0, sign_id, sign_group, retlist);
-       }
      }
  }
  
--- 1791,1798 ----
*** ../vim-8.2.0107/src/testdir/dumps/Test_sign_cursor_1.dump   2020-01-09 
21:00:52.888985845 +0100
--- src/testdir/dumps/Test_sign_cursor_1.dump   2019-06-16 13:41:18.000000000 
+0200
***************
*** 0 ****
--- 1,6 ----
+ | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@72
+ | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| @70
+ |=+0&#ffff4012|>>m+0&#ffffff0@3| @68
+ | +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0@3| @68
+ |~+0#4040ff13&| @73
+ | +0#0000000&@56|2|,|1| @10|A|l@1| 
*** ../vim-8.2.0107/src/testdir/dumps/Test_sign_cursor_2.dump   2020-01-09 
21:00:52.892985829 +0100
--- src/testdir/dumps/Test_sign_cursor_2.dump   2020-01-09 20:27:26.032269686 
+0100
***************
*** 0 ****
--- 1,6 ----
+ | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@72
+ | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| @70
+ |-+0&#ffff4012|)>m+0&#ffffff0@3| @68
+ | +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0@3| @68
+ |~+0#4040ff13&| @73
+ |:+0#0000000&|s|i|g|n| |d|e|f|i|n|e| |s|1| |t|e|x|t|=|-|)| @33|2|,|1| 
@10|A|l@1| 
*** ../vim-8.2.0107/src/testdir/dumps/Test_sign_cursor_3.dump   2020-01-09 
21:00:52.896985813 +0100
--- src/testdir/dumps/Test_sign_cursor_3.dump   2019-06-16 13:45:31.000000000 
+0200
***************
*** 0 ****
--- 1,6 ----
+ |x+0&#ffffff0@74
+ >m@3| @70
+ |y@3| @70
+ |~+0#4040ff13&| @73
+ |~| @73
+ |:+0#0000000&|s|i|g|n| |u|n|p|l|a|c|e| |1|0| @40|2|,|1| @10|A|l@1| 
*** ../vim-8.2.0107/src/testdir/dumps/Test_sign_cursor_01.dump  2019-06-16 
13:41:18.000000000 +0200
--- src/testdir/dumps/Test_sign_cursor_01.dump  1970-01-01 01:00:00.000000000 
+0100
***************
*** 1,6 ****
- | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@72
- | +0#0000e05#a8a8a8255@1|x+0#0000000#ffffff0@1| @70
- |=+0&#ffff4012|>>m+0&#ffffff0@3| @68
- | +0#0000e05#a8a8a8255@1|y+0#0000000#ffffff0@3| @68
- |~+0#4040ff13&| @73
- | +0#0000000&@56|2|,|1| @10|A|l@1| 
--- 0 ----
*** ../vim-8.2.0107/src/testdir/dumps/Test_sign_cursor_02.dump  2019-06-16 
13:45:31.000000000 +0200
--- src/testdir/dumps/Test_sign_cursor_02.dump  1970-01-01 01:00:00.000000000 
+0100
***************
*** 1,6 ****
- |x+0&#ffffff0@74
- >m@3| @70
- |y@3| @70
- |~+0#4040ff13&| @73
- |~| @73
- |:+0#0000000&|s|i|g|n| |u|n|p|l|a|c|e| |1|0| @40|2|,|1| @10|A|l@1| 
--- 0 ----

-- 
My Go, this amn keyboar oesn't have a .

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202001092003.009K3gPo000946%40masaka.moolenaar.net.

Raspunde prin e-mail lui