Mercurial > vim
comparison src/time.c @ 26476:7426c2657710 v8.2.3768
patch 8.2.3768: timer_info() has the wrong repeat value in a timer callback
Commit: https://github.com/vim/vim/commit/95b2dd0c008f0977ebb3cbe233a5064001a332e1
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 9 18:42:57 2021 +0000
patch 8.2.3768: timer_info() has the wrong repeat value in a timer callback
Problem: timer_info() has the wrong repeat value in a timer callback.
Solution: Do not add one to the repeat value when in the callback.
(closes #9294)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 09 Dec 2021 19:45:03 +0100 |
parents | d413104a94c8 |
children | bce848ec8b1b |
comparison
equal
deleted
inserted
replaced
26475:9f535da74f6f | 26476:7426c2657710 |
---|---|
694 profile_start(&now); | 694 profile_start(&now); |
695 remaining = proftime_time_left(&timer->tr_due, &now); | 695 remaining = proftime_time_left(&timer->tr_due, &now); |
696 dict_add_number(dict, "remaining", (long)remaining); | 696 dict_add_number(dict, "remaining", (long)remaining); |
697 | 697 |
698 dict_add_number(dict, "repeat", | 698 dict_add_number(dict, "repeat", |
699 (long)(timer->tr_repeat < 0 ? -1 : timer->tr_repeat + 1)); | 699 (long)(timer->tr_repeat < 0 ? -1 |
700 : timer->tr_repeat + (timer->tr_firing ? 0 : 1))); | |
700 dict_add_number(dict, "paused", (long)(timer->tr_paused)); | 701 dict_add_number(dict, "paused", (long)(timer->tr_paused)); |
701 | 702 |
702 di = dictitem_alloc((char_u *)"callback"); | 703 di = dictitem_alloc((char_u *)"callback"); |
703 if (di != NULL) | 704 if (di != NULL) |
704 { | 705 { |