To: vim_dev@googlegroups.com Subject: Patch 9.0.1663 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1663 Problem: Termdebug on MS-Windows: some file names are not recognized. Solution: Do not always change \t and \n. (Christian Brabandt, closes #12565, closes #12560, closes #12550) Files: runtime/pack/dist/opt/termdebug/plugin/termdebug.vim *** ../vim-9.0.1662/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim 2023-06-24 14:19:49.879867855 +0100 --- runtime/pack/dist/opt/termdebug/plugin/termdebug.vim 2023-06-24 19:53:55.006790301 +0100 *************** *** 602,615 **** return endif if a:text =~ '^\^error,msg=' ! let text = s:DecodeMessage(a:text[11:]) if exists('s:evalexpr') && text =~ 'A syntax error in expression, near\|No symbol .* in current context' " Silently drop evaluation errors. unlet s:evalexpr return endif elseif a:text[0] == '~' ! let text = s:DecodeMessage(a:text[1:]) else call s:CommOutput(a:channel, a:text) return --- 602,615 ---- return endif if a:text =~ '^\^error,msg=' ! let text = s:DecodeMessage(a:text[11:], v:false) if exists('s:evalexpr') && text =~ 'A syntax error in expression, near\|No symbol .* in current context' " Silently drop evaluation errors. unlet s:evalexpr return endif elseif a:text[0] == '~' ! let text = s:DecodeMessage(a:text[1:], v:false) else call s:CommOutput(a:channel, a:text) return *************** *** 625,645 **** call win_gotoid(curwinid) endfunc ! " Decode a message from gdb. quotedText starts with a ", return the text up " to the next ", unescaping characters: ! " - remove line breaks ! " - change \\t to \t " - change \0xhh to \xhh (disabled for now) " - change \ooo to octal " - change \\ to \ ! func s:DecodeMessage(quotedText) if a:quotedText[0] != '"' echoerr 'DecodeMessage(): missing quote in ' . a:quotedText return endif ! return a:quotedText ! \ ->substitute('^"\|".*\|\\n', '', 'g') ! \ ->substitute('\\t', "\t", 'g') " multi-byte characters arrive in octal form " NULL-values must be kept encoded as those break the string otherwise \ ->substitute('\\000', s:NullRepl, 'g') --- 625,644 ---- call win_gotoid(curwinid) endfunc ! " Decode a message from gdb. "quotedText" starts with a ", return the text up " to the next ", unescaping characters: ! " - remove line breaks (unless "literal" is v:true) ! " - change \\t to \t (unless "literal" is v:true) " - change \0xhh to \xhh (disabled for now) " - change \ooo to octal " - change \\ to \ ! func s:DecodeMessage(quotedText, literal) if a:quotedText[0] != '"' echoerr 'DecodeMessage(): missing quote in ' . a:quotedText return endif ! let msg = a:quotedText ! \ ->substitute('^"\|".*', '', 'g') " multi-byte characters arrive in octal form " NULL-values must be kept encoded as those break the string otherwise \ ->substitute('\\000', s:NullRepl, 'g') *************** *** 651,656 **** --- 650,662 ---- " \ ->substitute('\\0x00', s:NullRepl, 'g') \ ->substitute('\\\\', '\', 'g') \ ->substitute(s:NullRepl, '\\000', 'g') + if !a:literal + return msg + \ ->substitute('\\t', "\t", 'g') + \ ->substitute('\\n', '', 'g') + else + return msg + endif endfunc const s:NullRepl = 'XXXNULLXXX' *************** *** 659,665 **** if a:msg !~ 'fullname' return '' endif ! let name = s:DecodeMessage(substitute(a:msg, '.*fullname=', '', '')) if has('win32') && name =~ ':\\\\' " sometimes the name arrives double-escaped let name = substitute(name, '\\\\', '\\', 'g') --- 665,671 ---- if a:msg !~ 'fullname' return '' endif ! let name = s:DecodeMessage(substitute(a:msg, '.*fullname=', '', ''), v:true) if has('win32') && name =~ ':\\\\' " sometimes the name arrives double-escaped let name = substitute(name, '\\\\', '\\', 'g') *************** *** 672,678 **** if a:msg !~ 'addr=' return '' endif ! let addr = s:DecodeMessage(substitute(a:msg, '.*addr=', '', '')) return addr endfunc --- 678,684 ---- if a:msg !~ 'addr=' return '' endif ! let addr = s:DecodeMessage(substitute(a:msg, '.*addr=', '', ''), v:false) return addr endfunc *** ../vim-9.0.1662/src/version.c 2023-06-24 19:22:16.529495168 +0100 --- src/version.c 2023-06-24 19:56:52.646875216 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1663, /**/ -- hundred-and-one symptoms of being an internet addict: 232. You start conversations with, "Have you gotten a fiber connection?" /// Bram Moolenaar -- Bram@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 ///