mirror of
https://github.com/neovim/neovim.git
synced 2025-12-03 07:23:05 +00:00
vim-patch:7.4.1042
Problem: g-CTRL-G shows the word count, but there is no way to get the word
count in a script.
Solution: Add the wordcount() function. (Christian Brabandt)
ed767a2073
This commit is contained in:
@@ -6949,6 +6949,7 @@ static struct fst {
|
||||
{ "winrestview", 1, 1, f_winrestview },
|
||||
{ "winsaveview", 0, 0, f_winsaveview },
|
||||
{ "winwidth", 1, 1, f_winwidth },
|
||||
{ "wordcount", 0, 0, f_wordcount },
|
||||
{ "writefile", 2, 3, f_writefile },
|
||||
{ "xor", 2, 2, f_xor },
|
||||
};
|
||||
@@ -16910,6 +16911,13 @@ static void f_winwidth(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_number = wp->w_width;
|
||||
}
|
||||
|
||||
/// "wordcount()" function
|
||||
static void f_wordcount(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
rettv_dict_alloc(rettv);
|
||||
cursor_pos_info(rettv->vval.v_dict);
|
||||
}
|
||||
|
||||
/// "writefile()" function
|
||||
static void f_writefile(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user