Loading ...
Sorry, an error occurred while loading the content.
 

global command slow when clipboard=unnamed

Expand Messages
  • Praful Kapadia
    I have had an annoying issue with gvim 7.4, with patches 1-307. If I open a large file (e.g. containing 200,000 lines) and use the global command to delete
    Message 1 of 40 , May 29, 2014
      I have had an annoying issue with gvim 7.4, with patches 1-307. If I open a large file (e.g. containing 200,000 lines) and use the global command to delete lines, the operation takes a very long time on Windows if clipboard has been set to unnamed. I'm assuming it's the constant copying of deleted lines to the Windows clipboard that's slowing gvim down.

      I use Windows 7 64-bit. I have compiled gvim 64-bit using ming. The issue occurs on gvim 64-bit, 32-bit and, to a lesser extent, on MacVim.

      On Windows, it takes several minutes to carry out the operation. During this time, Windows becomes unusable, which is poor but that's another issue.

      On OS X, in MacVim, the same operation takes 30 seconds. With clipboard="", it takes two seconds.

      Here are the steps to reproduce the issue:

      1. Open gvim with no plugins and no vimrc.
      2. :set clipboard=unnamed
      3. Open a text file with about 200,000 lines.
      4. Enter :g/string/d The "string" should match about 150,000 lines i.e. you want to delete lots of rows!
      5. Go for a coffee break (Windows!) or wait 30 seconds (OS X)

      In practice, if I issue the command on Windows, I kill the process then open the file again, this time setting clipboard="" before I issue the command.

      The workaround (:set clipboard="") is fine if you remember it! It would be nice if gvim did this e.g. (pseudo-code):

      old_clipboard = clipboard
      try
      clipboard = ""
      execute global command
      finally
      clipboard = old_clipboard
      end

      One consideration for side effects: currently, if clipboard=unnamed, the only text that ends up on the system clipboard is the final deleted line, not all deleted lines. If anything, you might want all deleted text to be on the clipboard but that is not what currently happens. I suspect neither the last line nor all lines is generally required. I don't care (others might) what ends up on the clipboard and would be happy if there was no speed penalty when the command was issued!

      It would be great if someone could look at this!

      Thanks

      Praful

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/d/optout.
    • Christian Brabandt
      ... My guess is, its in Brams todo list and will take some time until Bram comes to include this patch. Best, Christian -- Die Arznei macht Kranke, die
      Message 40 of 40 , Jul 17, 2014
        On Do, 17 Jul 2014, Praful wrote:

        > On Thursday, 26 June 2014 14:42:29 UTC+1, Praful wrote:
        >
        > >
        > > Hi Christian
        > >
        > >
        > >
        > > Excellent news: it is now working! I can confirm that the item that remains on the clipboard after issuing g/<pattern/d is the last row that was deleted.
        > >
        > >
        > >
        > > Thank you for persevering with this issue!
        > >
        > >
        > >
        > > Praful
        >
        > I've lost track of this issue. Given that it's fixed, when will this be included in the official patches? When I now patch vim, I have to undo Christian's patch then apply the official patches then redo Christian's patch.

        My guess is, its in Brams todo list and will take some time until
        Bram comes to include this patch.

        Best,
        Christian
        --
        Die Arznei macht Kranke, die Mathematik traurige, die Theologie
        s├╝ndhafte Menschen.
        -- Martin Luther

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      Your message has been successfully submitted and would be delivered to recipients shortly.