Skip to content

Commit

Permalink
Normalise omnisharplog newlines between OS types
Browse files Browse the repository at this point in the history
  • Loading branch information
nickspoons committed Jun 21, 2020
1 parent 657f2bc commit 4ec6ce7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions autoload/OmniSharp/log.vim
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ function! OmniSharp#log#LogServer(job, raw, msg) abort
if !has_key(a:msg, 'Body') || type(a:msg.Body) != type({})
call writefile(['RAW: ' . a:raw], a:job.logfile, 'a')
elseif get(a:msg, 'Event', '') ==? 'log'
" let lines = [
" \ printf('[%s]: %s', s:LogLevelPrefix(a:msg.Body.LogLevel), a:msg.Body.Name),
" \ ' ' . substitute(a:msg.Body.Message, '\%uD\%u0', "\r", 'g')
" \]
let lines = split(a:msg.Body.Message, '\%uD\%u0', 1)
" Attempt to normalise newlines, which can be \%uD\%u0 in Windows and \%u0
" in linux
let message = substitute(a:msg.Body.Message, '\%uD\ze\%u0', '', 'g')
let lines = split(message, '\%u0', 1)
let lines[0] = ' ' . lines[0]
let prefix = s:LogLevelPrefix(a:msg.Body.LogLevel)
call insert(lines, printf('[%s]: %s', prefix, a:msg.Body.Name))
Expand Down

0 comments on commit 4ec6ce7

Please sign in to comment.