From ed012e60b6021683b2b66c837a6c35d9c3e9ea93 Mon Sep 17 00:00:00 2001 From: Travis Heppe <heppe@heppe-macbookpro4.roam.corp.google.com> Date: Wed, 14 Jun 2017 09:01:12 -0700 Subject: [PATCH] [vim bindings] Remove special handling for blank line from linewise delete. --- keymap/vim.js | 3 --- test/vim_test.js | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/keymap/vim.js b/keymap/vim.js index 2763b5134..0310baded 100644 --- a/keymap/vim.js +++ b/keymap/vim.js @@ -986,9 +986,6 @@ } RegisterController.prototype = { pushText: function(registerName, operator, text, linewise, blockwise) { - if (linewise && text.charAt(0) == '\n') { - text = text.slice(1) + '\n'; - } if (linewise && text.charAt(text.length - 1) !== '\n'){ text += '\n'; } diff --git a/test/vim_test.js b/test/vim_test.js index d107e82ca..86a544756 100644 --- a/test/vim_test.js +++ b/test/vim_test.js @@ -955,6 +955,10 @@ testVim('yy_multiply_repeat', function(cm, vim, helpers) { is(register.linewise); eqCursorPos(curStart, cm.getCursor()); }); +testVim('2dd_blank_P', function(cm, vim, helpers) { + helpers.doKeys('2', 'd', 'd', 'P'); + eq('\na\n\n', cm.getValue()); +}, { value: '\na\n\n' }); // Change commands behave like d commands except that it also enters insert // mode. In addition, when the change is linewise, an additional newline is // inserted so that insert mode starts on that line. -- GitLab