title: Capturing break/interrupt command
body: <p>I'm trying to interrupt a <code>for</code> loop such as in code below,</p>
  
  <pre><code>for num in buffer_number_list
      " Select the buffer
      exe 'buffer' num
      " Run the command that's passed as an argument
      exe a:command
      " Save if necessary
      update
  endfor
  </code></pre>
  
  <p>instead of interrupting only line <code>exe a:command</code>, when <code>a:command</code> is a
  <code>:s/// command</code>.</p>
  
  <p>The purpose is to change code on response to <a href="https://stackoverflow.com/questions/4792561/how-to-do-search-replace-with-ack-in-vim/4793316#4793316">How to do search &amp; replace with ack in vim?</a></p>
  
  <p>I've tried surrounding the line <code>exe a:command</code> with a <code>try</code>/<code>catch</code> block,
  but it doesn't worked, probably because the command handled the interrupt
  signal without re-throwing it.</p>
  
  <p>Tried remapping <code>CTRL-c</code> to change some variable (which would be checked inside of the loop), but it didn't worked:</p>
  
  <pre><code>let original_Ctrl_c = maparg('&lt;c-c&gt;', 'n')
  exe 'nnoremap &lt;c-c&gt; :call &lt;SID&gt;BreakLoop()&lt;CR&gt;' . original_Ctrl_c
  </code></pre>
  
  <p>It seems that the mapping didn't trigger when the interrupt signal is
  caught.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT:</p>
  
  <p>It seems that this problem only occurs in gVim (thanks @ib.)</p>