{"action":"created","issue":{"url":"https://api.github.com/repos/neovim/neovim/issues/2623","labels_url":"https://api.github.com/repos/neovim/neovim/issues/2623/labels{/name}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/2623/comments","events_url":"https://api.github.com/repos/neovim/neovim/issues/2623/events","html_url":"https://github.com/neovim/neovim/pull/2623","id":74738172,"number":2623,"title":"[RFC] vim-patch:7.4.577","user":{"login":"glts","id":1483271,"avatar_url":"https://avatars.githubusercontent.com/u/1483271?v=3","gravatar_id":"","url":"https://api.github.com/users/glts","html_url":"https://github.com/glts","followers_url":"https://api.github.com/users/glts/followers","following_url":"https://api.github.com/users/glts/following{/other_user}","gists_url":"https://api.github.com/users/glts/gists{/gist_id}","starred_url":"https://api.github.com/users/glts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glts/subscriptions","organizations_url":"https://api.github.com/users/glts/orgs","repos_url":"https://api.github.com/users/glts/repos","events_url":"https://api.github.com/users/glts/events{/privacy}","received_events_url":"https://api.github.com/users/glts/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/neovim/neovim/labels/RFC","name":"RFC","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-09T19:15:51Z","updated_at":"2015-05-10T01:16:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/2623","html_url":"https://github.com/neovim/neovim/pull/2623","diff_url":"https://github.com/neovim/neovim/pull/2623.diff","patch_url":"https://github.com/neovim/neovim/pull/2623.patch"},"body":"```\r\nProblem:    Matching with a virtual column has a lot of overhead on very long\r\n            lines. (Issue 310)\r\nSolution:   Bail out early if there can't be a match. (Christian Brabandt)\r\n            Also check for CTRL-C at every position.\r\n```\r\n\r\nhttps://github.com/vim/vim/commit/v7-4-577\r\n\r\nOriginal patch:\r\n\r\n```diff\r\ndiff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c\r\n--- a/src/nvim/regexp_nfa.c\r\n+++ b/src/nvim/regexp_nfa.c\r\n@@ -6438,14 +6438,24 @@ nfa_regmatch(prog, start, submatch, m)\r\n \t    case NFA_VCOL:\r\n \t    case NFA_VCOL_GT:\r\n \t    case NFA_VCOL_LT:\r\n-\t\tresult = nfa_re_num_cmp(t->state->val, t->state->c - NFA_VCOL,\r\n-\t\t    (long_u)win_linetabsize(\r\n-\t\t\t    reg_win == NULL ? curwin : reg_win,\r\n-\t\t\t    regline, (colnr_T)(reginput - regline)) + 1);\r\n-\t\tif (result)\r\n \t\t{\r\n-\t\t    add_here = TRUE;\r\n-\t\t    add_state = t->state->out;\r\n+\t\t    int     op = t->state->c - NFA_VCOL;\r\n+\t\t    colnr_T col = (colnr_T)(reginput - regline);\r\n+\r\n+\t\t    /* Bail out quickly when there can't be a match, avoid the\r\n+\t\t     * overhead of win_linetabsize() on long lines. */\r\n+\t\t    if ((col > t->state->val && op != 1)\r\n+\t\t\t    || (col - 1 > t->state->val && op == 1))\r\n+\t\t\tbreak;\r\n+\t\t    result = nfa_re_num_cmp(t->state->val, op,\r\n+\t\t\t(long_u)win_linetabsize(\r\n+\t\t\t\treg_win == NULL ? curwin : reg_win,\r\n+\t\t\t\t\t\t\t   regline, col) + 1);\r\n+\t\t    if (result)\r\n+\t\t    {\r\n+\t\t\tadd_here = TRUE;\r\n+\t\t\tadd_state = t->state->out;\r\n+\t\t    }\r\n \t\t}\r\n \t\tbreak;\r\n \r\n@@ -6744,6 +6754,11 @@ nextchar:\r\n \t    reg_nextline();\r\n \telse\r\n \t    break;\r\n+\r\n+\t/* Allow interrupting with CTRL-C. */\r\n+\tfast_breakcheck();\r\n+\tif (got_int)\r\n+\t    break;\r\n     }\r\n \r\n #ifdef ENABLE_LOG\r\ndiff --git a/src/nvim/version.c b/src/nvim/version.c\r\n--- a/src/nvim/version.c\r\n+++ b/src/nvim/version.c\r\n@@ -742,6 +742,8 @@ static char *(features[]) =\r\n static int included_patches[] =\r\n {   /* Add new patch number below this line */\r\n /**/\r\n+    577,\r\n+/**/\r\n     576,\r\n /**/\r\n     575,\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/neovim/neovim/issues/comments/100568759","html_url":"https://github.com/neovim/neovim/pull/2623#issuecomment-100568759","issue_url":"https://api.github.com/repos/neovim/neovim/issues/2623","id":100568759,"user":{"login":"justinmk","id":1359421,"avatar_url":"https://avatars.githubusercontent.com/u/1359421?v=3","gravatar_id":"","url":"https://api.github.com/users/justinmk","html_url":"https://github.com/justinmk","followers_url":"https://api.github.com/users/justinmk/followers","following_url":"https://api.github.com/users/justinmk/following{/other_user}","gists_url":"https://api.github.com/users/justinmk/gists{/gist_id}","starred_url":"https://api.github.com/users/justinmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinmk/subscriptions","organizations_url":"https://api.github.com/users/justinmk/orgs","repos_url":"https://api.github.com/users/justinmk/repos","events_url":"https://api.github.com/users/justinmk/events{/privacy}","received_events_url":"https://api.github.com/users/justinmk/received_events","type":"User","site_admin":false},"created_at":"2015-05-10T01:16:52Z","updated_at":"2015-05-10T01:16:52Z","body":"LGTM"}}