Mercurial > vim
comparison src/eval.c @ 9240:636cfa97200e v7.4.1903
commit https://github.com/vim/vim/commit/45d2eeaad66939348893b9254171067b0457cd9d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 6 21:07:52 2016 +0200
patch 7.4.1903
Problem: When writing viminfo merging current history with history in
viminfo may drop recent history entries.
Solution: Add new format for viminfo lines, use it for history entries. Use
a timestamp for ordering the entries. Add test_settime().
Add the viminfo version. Does not do merging on timestamp yet.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 06 Jun 2016 21:15:07 +0200 |
parents | 6c4d610fce0a |
children | f094d4085014 |
comparison
equal
deleted
inserted
replaced
9239:a744b63c4ed0 | 9240:636cfa97200e |
---|---|
818 static void f_test_null_job(typval_T *argvars, typval_T *rettv); | 818 static void f_test_null_job(typval_T *argvars, typval_T *rettv); |
819 #endif | 819 #endif |
820 static void f_test_null_list(typval_T *argvars, typval_T *rettv); | 820 static void f_test_null_list(typval_T *argvars, typval_T *rettv); |
821 static void f_test_null_partial(typval_T *argvars, typval_T *rettv); | 821 static void f_test_null_partial(typval_T *argvars, typval_T *rettv); |
822 static void f_test_null_string(typval_T *argvars, typval_T *rettv); | 822 static void f_test_null_string(typval_T *argvars, typval_T *rettv); |
823 static void f_test_settime(typval_T *argvars, typval_T *rettv); | |
823 #ifdef FEAT_FLOAT | 824 #ifdef FEAT_FLOAT |
824 static void f_tan(typval_T *argvars, typval_T *rettv); | 825 static void f_tan(typval_T *argvars, typval_T *rettv); |
825 static void f_tanh(typval_T *argvars, typval_T *rettv); | 826 static void f_tanh(typval_T *argvars, typval_T *rettv); |
826 #endif | 827 #endif |
827 #ifdef FEAT_TIMERS | 828 #ifdef FEAT_TIMERS |
8807 {"test_disable_char_avail", 1, 1, f_test_disable_char_avail}, | 8808 {"test_disable_char_avail", 1, 1, f_test_disable_char_avail}, |
8808 {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now}, | 8809 {"test_garbagecollect_now", 0, 0, f_test_garbagecollect_now}, |
8809 #ifdef FEAT_JOB_CHANNEL | 8810 #ifdef FEAT_JOB_CHANNEL |
8810 {"test_null_channel", 0, 0, f_test_null_channel}, | 8811 {"test_null_channel", 0, 0, f_test_null_channel}, |
8811 #endif | 8812 #endif |
8812 {"test_null_dict", 0, 0, f_test_null_dict}, | 8813 {"test_null_dict", 0, 0, f_test_null_dict}, |
8813 #ifdef FEAT_JOB_CHANNEL | 8814 #ifdef FEAT_JOB_CHANNEL |
8814 {"test_null_job", 0, 0, f_test_null_job}, | 8815 {"test_null_job", 0, 0, f_test_null_job}, |
8815 #endif | 8816 #endif |
8816 {"test_null_list", 0, 0, f_test_null_list}, | 8817 {"test_null_list", 0, 0, f_test_null_list}, |
8817 {"test_null_partial", 0, 0, f_test_null_partial}, | 8818 {"test_null_partial", 0, 0, f_test_null_partial}, |
8818 {"test_null_string", 0, 0, f_test_null_string}, | 8819 {"test_null_string", 0, 0, f_test_null_string}, |
8820 {"test_settime", 1, 1, f_test_settime}, | |
8819 #ifdef FEAT_TIMERS | 8821 #ifdef FEAT_TIMERS |
8820 {"timer_start", 2, 3, f_timer_start}, | 8822 {"timer_start", 2, 3, f_timer_start}, |
8821 {"timer_stop", 1, 1, f_timer_stop}, | 8823 {"timer_stop", 1, 1, f_timer_stop}, |
8822 #endif | 8824 #endif |
8823 {"tolower", 1, 1, f_tolower}, | 8825 {"tolower", 1, 1, f_tolower}, |
20847 garbage_collect(TRUE); | 20849 garbage_collect(TRUE); |
20848 } | 20850 } |
20849 | 20851 |
20850 #ifdef FEAT_JOB_CHANNEL | 20852 #ifdef FEAT_JOB_CHANNEL |
20851 static void | 20853 static void |
20852 f_test_null_channel(typval_T *argvars UNUSED, typval_T *rettv UNUSED) | 20854 f_test_null_channel(typval_T *argvars UNUSED, typval_T *rettv) |
20853 { | 20855 { |
20854 rettv->v_type = VAR_CHANNEL; | 20856 rettv->v_type = VAR_CHANNEL; |
20855 rettv->vval.v_channel = NULL; | 20857 rettv->vval.v_channel = NULL; |
20856 } | 20858 } |
20857 #endif | 20859 #endif |
20858 | 20860 |
20859 static void | 20861 static void |
20860 f_test_null_dict(typval_T *argvars UNUSED, typval_T *rettv UNUSED) | 20862 f_test_null_dict(typval_T *argvars UNUSED, typval_T *rettv) |
20861 { | 20863 { |
20862 rettv->v_type = VAR_DICT; | 20864 rettv->v_type = VAR_DICT; |
20863 rettv->vval.v_dict = NULL; | 20865 rettv->vval.v_dict = NULL; |
20864 } | 20866 } |
20865 | 20867 |
20866 #ifdef FEAT_JOB_CHANNEL | 20868 #ifdef FEAT_JOB_CHANNEL |
20867 static void | 20869 static void |
20868 f_test_null_job(typval_T *argvars UNUSED, typval_T *rettv UNUSED) | 20870 f_test_null_job(typval_T *argvars UNUSED, typval_T *rettv) |
20869 { | 20871 { |
20870 rettv->v_type = VAR_JOB; | 20872 rettv->v_type = VAR_JOB; |
20871 rettv->vval.v_job = NULL; | 20873 rettv->vval.v_job = NULL; |
20872 } | 20874 } |
20873 #endif | 20875 #endif |
20874 | 20876 |
20875 static void | 20877 static void |
20876 f_test_null_list(typval_T *argvars UNUSED, typval_T *rettv UNUSED) | 20878 f_test_null_list(typval_T *argvars UNUSED, typval_T *rettv) |
20877 { | 20879 { |
20878 rettv->v_type = VAR_LIST; | 20880 rettv->v_type = VAR_LIST; |
20879 rettv->vval.v_list = NULL; | 20881 rettv->vval.v_list = NULL; |
20880 } | 20882 } |
20881 | 20883 |
20882 static void | 20884 static void |
20883 f_test_null_partial(typval_T *argvars UNUSED, typval_T *rettv UNUSED) | 20885 f_test_null_partial(typval_T *argvars UNUSED, typval_T *rettv) |
20884 { | 20886 { |
20885 rettv->v_type = VAR_PARTIAL; | 20887 rettv->v_type = VAR_PARTIAL; |
20886 rettv->vval.v_partial = NULL; | 20888 rettv->vval.v_partial = NULL; |
20887 } | 20889 } |
20888 | 20890 |
20889 static void | 20891 static void |
20890 f_test_null_string(typval_T *argvars UNUSED, typval_T *rettv UNUSED) | 20892 f_test_null_string(typval_T *argvars UNUSED, typval_T *rettv) |
20891 { | 20893 { |
20892 rettv->v_type = VAR_STRING; | 20894 rettv->v_type = VAR_STRING; |
20893 rettv->vval.v_string = NULL; | 20895 rettv->vval.v_string = NULL; |
20896 } | |
20897 | |
20898 static void | |
20899 f_test_settime(typval_T *argvars, typval_T *rettv UNUSED) | |
20900 { | |
20901 time_for_testing = (time_t)get_tv_number(&argvars[0]); | |
20894 } | 20902 } |
20895 | 20903 |
20896 #if defined(FEAT_JOB_CHANNEL) || defined(FEAT_TIMERS) || defined(PROTO) | 20904 #if defined(FEAT_JOB_CHANNEL) || defined(FEAT_TIMERS) || defined(PROTO) |
20897 /* | 20905 /* |
20898 * Get a callback from "arg". It can be a Funcref or a function name. | 20906 * Get a callback from "arg". It can be a Funcref or a function name. |