Currently a quickfix jump that triggers SwapExistsEvent always has the
v:swapcommand '1G'. The following patch sets it to the jump destination.
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -1519,6 +1519,20 @@ qf_jump(qi, dir, errornr, forceit)
}
}
+ /*
+ * Set the v:swapcommand to have the possibility to direct a remote
vim-server
+ * that owns the buffer, to the right location within the file
+ */
+
+ if ( qf_ptr ) {
+ const int long_enough_to_hold_two_numbers = 100 ;
+ char_u swap_command_buffer[ long_enough_to_hold_two_numbers ] ;
+
+ snprintf( swap_command_buffer ,
long_enough_to_hold_two_numbers , "%ldG%i|" , qf_ptr->qf_lnum ,
qf_ptr->qf_col ) ;
+
+ set_vim_var_string(VV_SWAPCOMMAND, swap_command_buffer , -1);
+ }
+
#ifdef FEAT_WINDOWS
qi->qf_lists[qi->qf_curlist].qf_index = qf_index;
if (qf_win_pos_update(qi, old_qf_index))
This patch is against version 7.2.238
As it appears v:swapcommand is a somewhat unused mechanism, as only ':tag'
seems to set it. Well, together with quickfix it would cover the majority of
my use-cases.
The script is strongly related but not that important, so I place it in an
answer to this post.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---