Patch 9.0.0453

2022-09-12 Fir de Conversatie Bram Moolenaar


Patch 9.0.0453
Problem:On an AZERTY keyboard digit keys get the shift modifier.
Solution:   Remove the shift modifier from digit keys. (closes #11109)
Files:  src/misc2.c


diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim
index 604cd333c93e..0d1f934a03ab 100644
--- a/runtime/indent/lua.vim
+++ b/runtime/indent/lua.vim
@@ -3,6 +3,7 @@
 " Maintainer:  Marcus Aurelius Farias 
 " First Author:Max Ischenko 
 " Last Change: 2017 Jun 13
+"  2022 Sep 07: b:undo_indent added by Doug Kearns
 
 " Only load this indent file when no other was loaded.
 if exists("b:did_indent")
@@ -18,6 +19,8 @@ setlocal indentkeys+=0=end,0=until
 
 setlocal autoindent
 
+let b:undo_indent = "setlocal autoindent< indentexpr< indentkeys<"
+
 " Only define the function once.
 if exists("*GetLuaIndent")
   finish
diff --git a/runtime/syntax/lua.vim b/runtime/syntax/lua.vim
index 437a1ff11338..9c5a49058264 100644
--- a/runtime/syntax/lua.vim
+++ b/runtime/syntax/lua.vim
@@ -1,11 +1,12 @@
 " Vim syntax file
-" Language: Lua 4.0, Lua 5.0, Lua 5.1 and Lua 5.2
+" Language: Lua 4.0, Lua 5.0, Lua 5.1, Lua 5.2 and Lua 5.3
 " Maintainer:   Marcus Aurelius Farias 
 " First Author: Carlos Augusto Teixeira Mendes 
-" Last Change:  2022 Mar 31
+" Last Change:  2022 Sep 07
 " Options:  lua_version = 4 or 5
-"   lua_subversion = 0 (4.0, 5.0) or 1 (5.1) or 2 (5.2)
-"   default 5.2
+"   lua_subversion = 0 (for 4.0 or 5.0)
+"   or 1, 2, 3 (for 5.1, 5.2 or 5.3)
+"   the default is 5.3
 
 " quit when a syntax file was already loaded
 if exists("b:current_syntax")
@@ -16,70 +17,78 @@ let s:cpo_save = &cpo
 set cpo&vim
 
 if !exists("lua_version")
-  " Default is lua 5.2
+  " Default is lua 5.3
   let lua_version = 5
-  let lua_subversion = 2
+  let lua_subversion = 3
 elseif !exists("lua_subversion")
-  " lua_version exists, but lua_subversion doesn't. So, set it to 0
+  " lua_version exists, but lua_subversion doesn't. In this case set it to 0
   let lua_subversion = 0
 endif
 
 syn case match
 
 " syncing method
-syn sync minlines=100
+syn sync minlines=1000
 
-" Comments
-syn keyword luaTodocontained TODO FIXME XXX
-syn match   luaComment "--.*$" contains=luaTodo,@Spell
-if lua_version == 5 && lua_subversion == 0
-  syn region luaCommentmatchgroup=luaCommentDelimiter start="--\[\[" 
end="\]\]" contains=luaTodo,luaInnerComment,@Spell
-  syn region luaInnerComment   contained transparent start="\[\[" end="\]\]"
-elseif lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
-  " Comments in Lua 5.1: --[[ ... ]], [=[ ... ]=], [===[ ... ]===], etc.
-  syn region luaCommentmatchgroup=luaCommentDelimiter 
start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaTodo,@Spell
+if lua_version >= 5
+  syn keyword luaMetaMethod __add __sub __mul __div __pow __unm __concat
+  syn keyword luaMetaMethod __eq __lt __le
+  syn keyword luaMetaMethod __index __newindex __call
+  syn keyword luaMetaMethod __metatable __mode __gc __tostring
 endif
 
-" First line may start with #!
-syn match luaComment "\%^#!.*"
+if lua_version > 5 || (lua_version == 5 && lua_subversion >= 1)
+  syn keyword luaMetaMethod __mod __len
+endif
+
+if lua_version > 5 || (lua_version == 5 && lua_subversion >= 2)
+  syn keyword luaMetaMethod __pairs
+endif
+
+if lua_version > 5 || (lua_version == 5 && lua_subversion >= 3)
+  syn keyword luaMetaMethod __idiv __name
+  syn keyword luaMetaMethod __band __bor __bxor __bnot __shl __shr
+endif
+
+if lua_version > 5 || (lua_version == 5 && lua_subversion >= 4)
+  syn keyword luaMetaMethod __close
+endif
 
 " catch errors caused by wrong parenthesis and wrong curly brackets or
 " keywords placed outside their respective blocks
-syn region luaParen  transparent start='(' end=')' 
contains=ALLBUT,luaParenError,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaBlock,luaLoopBlock,luaIn,luaStatement
-syn region luaTableBlock transparent matchgroup=luaTable start="{" end="}" 
contains=ALLBUT,luaBraceError,luaTodo,luaSpecial,luaIfThen,luaElseifThen,luaElse,luaThenEnd,luaBlock,luaLoopBlock,luaIn,luaStatement
 
+syn region luaParen transparent start='(' end=')' contains=TOP,luaParenError
 syn match  luaParenError ")"
-syn match  luaBraceError "}"
+syn match  luaError "}"
 syn match  luaError "\<\%(end\|else\|elseif\|then\|until\|in\)\>"
 
-" function ... end
-syn region luaFunctionBlock transparent matchgroup=luaFunction 
start="\" end="\" 
contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaThenEnd,luaIn
+" Function declaration
+syn region luaFunctionBlock transparent matchgroup=luaFunction 
start="\" end="\" contains=TOP
 
-" if ... then
-syn region luaIfThen transparent matchgroup=luaCond start="\" 
end="\"me=e-4   
contains=ALLBUT,luaTodo,luaSpecial,luaElseifThen,luaElse,luaIn 
nextgroup=luaThenEnd skipwhite skipempty
+" else
+syn keyword luaCondElse m

Patch 9.0.0452

2022-09-12 Fir de Conversatie Bram Moolenaar


Patch 9.0.0452
Problem:Visual highlighting extends into virtual text prop.
Solution:   Do not highlight what isn't actually selected.  Fix ordering of
stored text props.
Files:  src/drawline.c, src/textprop.c, src/testdir/test_textprop.vim,
src/testdir/dumps/Test_prop_with_text_above_6.dump,
src/testdir/dumps/Test_prop_with_text_above_7.dump


*** ../vim-9.0.0451/src/drawline.c  2022-09-12 17:50:42.778378272 +0100
--- src/drawline.c  2022-09-12 18:22:55.070293258 +0100
***
*** 670,675 
--- 670,676 
  int   text_prop_follows = FALSE;  // another text prop to 
display
  int   saved_search_attr = 0;  // search_attr to be used when 
n_extra
// goes to zero
+ int   saved_area_attr = 0;// idem for area_attr
  #endif
  #ifdef FEAT_SPELL
  int   has_spell = FALSE;  // this buffer has spell 
checking
***
*** 1846,1853 
extra_for_textprop = TRUE;
extra_attr = used_attr;
n_attr = mb_charlen(p);
saved_search_attr = search_attr;
!   search_attr = 0;// restore when n_extra is zero
text_prop_attr = 0;
text_prop_attr_comb = 0;
if (*ptr == NUL)
--- 1847,1858 
extra_for_textprop = TRUE;
extra_attr = used_attr;
n_attr = mb_charlen(p);
+   // restore search_attr and area_attr when n_extra
+   // is down to zero
saved_search_attr = search_attr;
!   saved_area_attr = area_attr;
!   search_attr = 0;
!   area_attr = 0;
text_prop_attr = 0;
text_prop_attr_comb = 0;
if (*ptr == NUL)
***
*** 2203,2208 
--- 2208,2215 
in_linebreak = FALSE;
if (search_attr == 0)
search_attr = saved_search_attr;
+   if (area_attr == 0 && *ptr != NUL)
+   area_attr = saved_area_attr;
}
  #endif
}
*** ../vim-9.0.0451/src/textprop.c  2022-09-12 17:50:42.782378262 +0100
--- src/textprop.c  2022-09-12 19:19:22.148921298 +0100
***
*** 232,239 
  
  for (lnum = start_lnum; lnum <= end_lnum; ++lnum)
  {
!   colnr_T col;// start column
!   longlength; // in bytes
  
// Fetch the line to get the ml_line_len field updated.
proplen = get_text_props(buf, lnum, &props, TRUE);
--- 232,240 
  
  for (lnum = start_lnum; lnum <= end_lnum; ++lnum)
  {
!   colnr_T col;// start column use in tp_col
!   colnr_T sort_col;   // column where it appears
!   longlength; // in bytes
  
// Fetch the line to get the ml_line_len field updated.
proplen = get_text_props(buf, lnum, &props, TRUE);
***
*** 248,253 
--- 249,255 
semsg(_(e_invalid_column_number_nr), (long)start_col);
goto theend;
}
+   sort_col = col;
  
if (lnum == end_lnum)
length = end_col - col;
***
*** 263,269 
length = 1; // text is placed on one character
if (col == 0)
{
!   col = MAXCOL;   // after the line
length += text_padding_left;
}
}
--- 265,273 
length = 1; // text is placed on one character
if (col == 0)
{
!   col = MAXCOL;   // before or after the line
!   if ((text_flags & TP_FLAG_ALIGN_ABOVE) == 0)
!   sort_col = MAXCOL;
length += text_padding_left;
}
}
***
*** 280,288 
// the text, we need to copy them as bytes before using it as a struct.
for (i = 0; i < proplen; ++i)
{
mch_memmove(&tmp_prop, props + i * sizeof(textprop_T),
   sizeof(textprop_T));
!   if (tmp_prop.tp_col >= col)
break;
}
newprops = newtext + textlen;
--- 284,298 
// the text, we need to copy them as bytes before using it as a struct.
for (i = 0; i < proplen; ++i)
{
+   colnr_T prop_col;
+ 
mch_memmove(&tmp_prop, props + i * sizeof(textprop_T),
   sizeof(textprop_T));
!   // col is MAXCOL when the text goes above or after the line, when
!   // above we should use column zero for sorting
!   prop_co

Patch 9.0.0451

2022-09-12 Fir de Conversatie Bram Moolenaar


Patch 9.0.0451
Problem:Virtual text "above" does not work with 'nowrap'.
Solution:   Do wrap the line after. (closes #11084)
Files:  src/drawline.c, src/move.c, src/misc1.c, src/textprop.c,
src/proto/textprop.pro, src/testdir/test_textprop.vim,
src/testdir/dumps/Test_prop_with_text_above_5.dump


*** ../vim-9.0.0450/src/drawline.c  2022-09-11 13:30:21.925587357 +0100
--- src/drawline.c  2022-09-12 17:45:20.095311681 +0100
***
*** 666,671 
--- 666,672 
  // syntax_attr
  int   text_prop_id = 0;   // active property ID
  int   text_prop_flags = 0;
+ int   text_prop_above = FALSE;  // first doing virtual text 
above
  int   text_prop_follows = FALSE;  // another text prop to 
display
  int   saved_search_attr = 0;  // search_attr to be used when 
n_extra
// goes to zero
***
*** 1784,1789 
--- 1785,1791 
  
// Sort the properties on priority and/or starting last.
// Then combine the attributes, highest priority last.
+   text_prop_above = FALSE;
text_prop_follows = FALSE;
sort_text_props(wp->w_buffer, text_props,
text_prop_idxs, text_props_active);
***
*** 1817,1822 
--- 1819,1826 
char_u  *p = ((char_u **)wp->w_buffer
   ->b_textprop_text.ga_data)[
   -text_prop_id - 1];
+   int above = (tp->tp_flags
+   & TP_FLAG_ALIGN_ABOVE);
  
// reset the ID in the copy to avoid it being used
// again
***
*** 1826,1833 
{
int right = (tp->tp_flags
& TP_FLAG_ALIGN_RIGHT);
-   int above = (tp->tp_flags
-   & TP_FLAG_ALIGN_ABOVE);
int below = (tp->tp_flags
& TP_FLAG_ALIGN_BELOW);
int wrap = (tp->tp_flags & TP_FLAG_WRAP);
--- 1830,1835 
***
*** 1902,1907 
--- 1904,1912 
  
// If another text prop follows the condition below at
// the last window column must know.
+   // If this is an "above" text prop and 'nowrap' the we
+   // must wrap anyway.
+   text_prop_above = above;
text_prop_follows = other_tpi != -1;
}
}
***
*** 3581,3587 
|| filler_todo > 0
  #endif
  #ifdef FEAT_PROP_POPUP
!   || text_prop_follows
  #endif
|| (wp->w_p_list && wp->w_lcs_chars.eol != NUL
&& wlv.p_extra != at_end_str)
--- 3586,3592 
|| filler_todo > 0
  #endif
  #ifdef FEAT_PROP_POPUP
!   || text_prop_above || text_prop_follows
  #endif
|| (wp->w_p_list && wp->w_lcs_chars.eol != NUL
&& wlv.p_extra != at_end_str)
***
*** 3608,3619 
&& filler_todo <= 0
  #endif
  #ifdef FEAT_PROP_POPUP
!   && !text_prop_follows
  #endif
) || lcs_eol_one == -1)
break;
  #ifdef FEAT_PROP_POPUP
!   if (!wp->w_p_wrap && text_prop_follows)
{
// do not output more of the line, only the "below" prop
ptr += STRLEN(ptr);
--- 3613,3624 
&& filler_todo <= 0
  #endif
  #ifdef FEAT_PROP_POPUP
!   && !text_prop_above && !text_prop_follows
  #endif
) || lcs_eol_one == -1)
break;
  #ifdef FEAT_PROP_POPUP
!   if (!wp->w_p_wrap && text_prop_follows && !text_prop_above)
{
// do not output more of the line, only the "below" prop
ptr += STRLEN(ptr);
***
*** 3647,3653 
 && filler_todo <= 0
  #endif
  #ifdef FEAT_PROP_POPUP
!&& !text_prop_follows
  #endif
 && wp->w_width == Columns)
{
--- 3652,3658 
 && filler_todo <= 0
  #endif
  #ifdef FEAT_PROP_POPUP
!&& !text_prop_above && !text_prop_follows
  #endif
 && wp->w_width == Columns)
{
*** ../vim-9.0.0450/src/move.c 

Re: [vim/vim] No closures for the for loop [var1, var2] variables? (Issue #11094)

2022-09-12 Fir de Conversatie Doug Kearns
On Mon, 12 Sept 2022 at 05:14, Bram Moolenaar  wrote:
> Let's try to summarize:



This sounds good to me.

Thanks,
Doug

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAJ1uvoBXz2KXN5wN%3Dmm%2B%3DpRpNr%3DfBbkcrLs8d%3DDk%3DL-64PzEMQ%40mail.gmail.com.


Patch 9.0.0450

2022-09-12 Fir de Conversatie Bram Moolenaar


Patch 9.0.0450
Problem:Return value of argument check functions is inconsistent.
Solution:   Return OK/FAIL instead of TRUE/FALSE. (closes #2)
Files:  src/typval.c


*** ../vim-9.0.0449/src/typval.c2022-09-09 18:46:41.558660414 +0100
--- src/typval.c2022-09-12 14:08:05.362207543 +0100
***
*** 410,416 
  check_for_opt_string_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_string_arg(args, idx) != FAIL);
  }
  
  /*
--- 410,416 
  check_for_opt_string_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_string_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  
  /*
***
*** 434,440 
  check_for_opt_number_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_number_arg(args, idx) != FAIL);
  }
  
  /*
--- 434,440 
  check_for_opt_number_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_number_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  
  /*
***
*** 532,538 
  check_for_opt_list_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_list_arg(args, idx) != FAIL);
  }
  
  /*
--- 532,538 
  check_for_opt_list_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_list_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  
  /*
***
*** 573,579 
  check_for_opt_dict_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_dict_arg(args, idx) != FAIL);
  }
  
  #if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
--- 573,579 
  check_for_opt_dict_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_dict_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  
  #if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
***
*** 599,605 
  check_for_opt_chan_or_job_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_chan_or_job_arg(args, idx) != FAIL);
  }
  
  /*
--- 599,605 
  check_for_opt_chan_or_job_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_chan_or_job_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  
  /*
***
*** 623,629 
  check_for_opt_job_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_job_arg(args, idx) != FAIL);
  }
  #endif
  
--- 623,629 
  check_for_opt_job_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_job_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  #endif
  
***
*** 649,655 
  check_for_opt_string_or_number_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_string_or_number_arg(args, idx) != FAIL);
  }
  
  /*
--- 649,655 
  check_for_opt_string_or_number_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_string_or_number_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  
  /*
***
*** 669,675 
  check_for_opt_buffer_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_buffer_arg(args, idx));
  }
  
  /*
--- 669,675 
  check_for_opt_buffer_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_buffer_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  
  /*
***
*** 689,695 
  check_for_opt_lnum_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_lnum_arg(args, idx));
  }
  
  #if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
--- 689,695 
  check_for_opt_lnum_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_lnum_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  
  #if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
***
*** 746,752 
  check_for_opt_string_or_list_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_string_or_list_arg(args, idx));
  }
  
  /*
--- 746,752 
  check_for_opt_string_or_list_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_string_or_list_arg(args, idx) != FAIL) ? OK : FAIL;
  }
  
  /*
***
*** 788,794 
  check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_string_or_number_or_list_arg(args, idx) != FAIL);
  }
  
  /*
--- 788,795 
  check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx)
  {
  return (args[idx].v_type == VAR_UNKNOWN
!   || check_for_string_or_number_or_l

Patch 9.0.0449

2022-09-12 Fir de Conversatie Bram Moolenaar


Patch 9.0.0449
Problem:There is no easy way to translate a string with a key code into a
readable string.
Solution:   Add the keytrans() function. (closes #4)
Files:  runtime/doc/builtin.txt, runtime/doc/usr_41.txt, src/evalfunc.c,
src/map.c, src/menu.c, src/message.c, src/option.c,
src/proto/message.pro, src/testdir/test_functions.vim


*** ../vim-9.0.0448/runtime/doc/builtin.txt 2022-09-09 18:46:41.558660414 
+0100
--- runtime/doc/builtin.txt 2022-09-12 13:28:33.439747660 +0100
***
*** 325,330 
--- 325,332 
  json_decode({string}) any decode JSON
  json_encode({expr})   String  encode JSON
  keys({dict})  Listkeys in {dict}
+ keytrans({string})String  translate internal keycodes to a form
+   that can be used by |:map|
  len({expr})   Number  the length of {expr}
  libcall({lib}, {func}, {arg}) String  call {func} in library {lib} with {arg}
  libcallnr({lib}, {func}, {arg})   Number  idem, but return a Number
***
*** 5195,5200 
--- 5207,5222 
Can also be used as a |method|: >
mydict->keys()
  
+ keytrans({string})*keytrans()*
+   Turn the internal byte representation of keys into a form that
+   can be used for |:map|.  E.g. >
+   :let xx = "\"
+   :echo keytrans(xx)
+ < 
+ 
+   Can also be used as a |method|: >
+   "\"->keytrans()
+ 
  < *len()* *E701*
  len({expr})   The result is a Number, which is the length of the argument.
When {expr} is a String or a Number the length in bytes is
*** ../vim-9.0.0448/runtime/doc/usr_41.txt  2022-08-27 12:22:19.975008573 
+0100
--- runtime/doc/usr_41.txt  2022-09-12 13:28:33.439747660 +0100
***
*** 736,741 
--- 737,744 
fnameescape()   escape a file name for use with a Vim command
tr()translate characters from one set to another
strtrans()  translate a string to make it printable
+   keytrans()  translate internal keycodes to a form that
+   can be used by |:map|
tolower()   turn a string to lowercase
toupper()   turn a string to uppercase
charclass() class of a character
***
*** 1349,1355 
did_filetype()  check if a FileType autocommand was used
eventhandler()  check if invoked by an event handler
getpid()get process ID of Vim
!   getscriptinfo() get list of sourced vim scripts
getimstatus()   check if IME status is active
interrupt() interrupt script execution
windowsversion()get MS-Windows version
--- 1352,1358 
did_filetype()  check if a FileType autocommand was used
eventhandler()  check if invoked by an event handler
getpid()get process ID of Vim
!   getscriptinfo() get list of sourced vim scripts
getimstatus()   check if IME status is active
interrupt() interrupt script execution
windowsversion()get MS-Windows version
*** ../vim-9.0.0448/src/evalfunc.c  2022-09-09 18:46:41.558660414 +0100
--- src/evalfunc.c  2022-09-12 13:28:33.439747660 +0100
***
*** 89,94 
--- 89,95 
  static void f_interrupt(typval_T *argvars, typval_T *rettv);
  static void f_invert(typval_T *argvars, typval_T *rettv);
  static void f_islocked(typval_T *argvars, typval_T *rettv);
+ static void f_keytrans(typval_T *argvars, typval_T *rettv);
  static void f_last_buffer_nr(typval_T *argvars, typval_T *rettv);
  static void f_libcall(typval_T *argvars, typval_T *rettv);
  static void f_libcallnr(typval_T *argvars, typval_T *rettv);
***
*** 2058,2063 
--- 2059,2066 
ret_string, f_json_encode},
  {"keys",  1, 1, FEARG_1,  arg1_dict_any,
ret_list_string,f_keys},
+ {"keytrans",  1, 1, FEARG_1,  arg1_string,
+   ret_string, f_keytrans},
  {"last_buffer_nr",0, 0, 0,NULL,   // obsolete
ret_number, f_last_buffer_nr},
  {"len",   1, 1, FEARG_1,  arg1_len,
***
*** 7136,7141 
--- 7139,7162 
  }
  
  /*
+  * "keytrans()" function
+  */
+ static void
+ f_keytrans(typval_T *argvars, typval_T *rettv)
+ {
+ char_u *escaped;
+ 
+ rettv->v_type = VAR_STRING;
+ if (check_for_string_arg(argvars, 0) == FAIL
+   || argvars[0].vval.v_stri

Patch 9.0.0448

2022-09-12 Fir de Conversatie Bram Moolenaar


Patch 9.0.0448
Problem:SubRip files are not recognized.
Solution:   Add a pattern for SubRip. (closes #3)
Files:  runtime/filetype.vim, src/testdir/test_filetype.vim


*** ../vim-9.0.0447/runtime/filetype.vim2022-09-11 13:37:31.797170405 
+0100
--- runtime/filetype.vim2022-09-12 12:39:35.393644825 +0100
***
*** 1723,1728 
--- 1723,1731 
  " sed
  au BufNewFile,BufRead *.sed   setf sed
  
+ " SubRip
+ au BufNewFile,BufRead *.srt   setf srt
+ 
  " svelte
  au BufNewFile,BufRead *.sveltesetf svelte
  
*** ../vim-9.0.0447/src/testdir/test_filetype.vim   2022-09-11 
13:37:31.797170405 +0100
--- src/testdir/test_filetype.vim   2022-09-12 12:39:35.393644825 +0100
***
*** 531,536 
--- 531,537 
  \ 'squid': ['squid.conf'],
  \ 'squirrel': ['file.nut'],
  \ 'srec': ['file.s19', 'file.s28', 'file.s37', 'file.mot', 'file.srec'],
+ \ 'srt': ['file.srt'],
  \ 'sshconfig': ['ssh_config', '/.ssh/config', 
'/etc/ssh/ssh_config.d/file.conf', 'any/etc/ssh/ssh_config.d/file.conf', 
'any/.ssh/config', 'any/.ssh/file.conf'],
  \ 'sshdconfig': ['sshd_config', '/etc/ssh/sshd_config.d/file.conf', 
'any/etc/ssh/sshd_config.d/file.conf'],
  \ 'st': ['file.st'],
*** ../vim-9.0.0447/src/version.c   2022-09-11 21:35:47.558255161 +0100
--- src/version.c   2022-09-12 12:42:59.001159262 +0100
***
*** 705,706 
--- 705,708 
  {   /* Add new patch number below this line */
+ /**/
+ 448,
  /**/

-- 
The real
trick is
this: to
keep the
lines as
short as
possible
and keep
the size
the same
yet free
from the
need for
hyphena-
Dammit!!  (Matthew Winn)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220912114449.7FF521C0CFD%40moolenaar.net.