comparison autoload/lawrencium/record.vim @ 141:4d5f4233b04e

Only set `v:errmsg` for real errors, not exceptions.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 07 Dec 2016 21:33:18 -0800
parents 652a6f5df0f3
children
comparison
equal deleted inserted replaced
140:652a6f5df0f3 141:4d5f4233b04e
68 call lawrencium#error("abort: User requested aborting the record operation.") 68 call lawrencium#error("abort: User requested aborting the record operation.")
69 return 69 return
70 endif 70 endif
71 71
72 if !exists('b:lawrencium_record_for') 72 if !exists('b:lawrencium_record_for')
73 call lawrencium#throw("This doesn't seem like a record buffer, something's wrong!") 73 call lawrencium#throwerr("This doesn't seem like a record buffer, something's wrong!")
74 endif 74 endif
75 if b:lawrencium_record_for == '%' 75 if b:lawrencium_record_for == '%'
76 " Switch to the 'recording' buffer's window. 76 " Switch to the 'recording' buffer's window.
77 let l:buf_obj = lawrencium#buffer_obj(b:lawrencium_record_other_nr) 77 let l:buf_obj = lawrencium#buffer_obj(b:lawrencium_record_other_nr)
78 call l:buf_obj.MoveToFirstWindow() 78 call l:buf_obj.MoveToFirstWindow()
147 function! lawrencium#record#HgRecord_CleanUp(buf_nr) abort 147 function! lawrencium#record#HgRecord_CleanUp(buf_nr) abort
148 " Get in the original buffer and clean the local commands/variables. 148 " Get in the original buffer and clean the local commands/variables.
149 let l:buf_obj = lawrencium#buffer_obj(a:buf_nr) 149 let l:buf_obj = lawrencium#buffer_obj(a:buf_nr)
150 call l:buf_obj.MoveToFirstWindow() 150 call l:buf_obj.MoveToFirstWindow()
151 if !exists('b:lawrencium_record_for') || b:lawrencium_record_for != '%' 151 if !exists('b:lawrencium_record_for') || b:lawrencium_record_for != '%'
152 call lawrencium#throw("Cleaning up something else than the original buffer ". 152 call lawrencium#throwerr("Cleaning up something else than the original buffer ".
153 \"for a record operation. That's suspiciously incorrect! ". 153 \"for a record operation. That's suspiciously incorrect! ".
154 \"Aborting.") 154 \"Aborting.")
155 endif 155 endif
156 call l:buf_obj.DeleteCommand('Hgrecordabort') 156 call l:buf_obj.DeleteCommand('Hgrecordabort')
157 call l:buf_obj.DeleteCommand('Hgrecordcommit') 157 call l:buf_obj.DeleteCommand('Hgrecordcommit')