t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 112 forks source link

linewise-bounded-operator works linwise in occurrence #879

Closed t9md closed 7 years ago

t9md commented 7 years ago

Fix #870

Before this PR, occurrence operation(via o modifier or preset-occurrence by g o) was always works as characterwise. This PR make linewise-bounded-operator works as linewise even in occurrence operation.

As like D works in linewise even in visual.characterwise mode, As like D works in linewise even in occurrence operation.(select occurrence then re-select linewise).

This is great improvement I haven't noticed this idea until recently.

Example

beforeEach

set text

text = addIndent(text, indentString)
console.log("6 HEY!", inspect([1, 2, 3]))
console.log("8 HEY!", inspect([1, 2, 3]))
console.log("9 HEY!", inspect([1, 2, 3]))
text = addIndent(text, indentString)
console.log("11 HEY!", inspect([1, 2, 3]))
text = addIndent(text, indentString)

Place cursor at console(whichever is OK).

toggle line-comment for console containing lines.

g / o p

text = addIndent(text, indentString)
// console.log("6 HEY!", inspect([1, 2, 3]))
// console.log("8 HEY!", inspect([1, 2, 3]))
// console.log("9 HEY!", inspect([1, 2, 3]))
text = addIndent(text, indentString)
// console.log("11 HEY!", inspect([1, 2, 3]))
text = addIndent(text, indentString)

Delete console containing lines

Select paragraph by v i p then D(delete-line)

text = addIndent(text, indentString)
text = addIndent(text, indentString)
text = addIndent(text, indentString)

Indent console containing lines

g o > p(mark console, then indent inner-paragraph).

text = addIndent(text, indentString)
  console.log("6 HEY!", inspect([1, 2, 3]))
  console.log("8 HEY!", inspect([1, 2, 3]))
  console.log("9 HEY!", inspect([1, 2, 3]))
text = addIndent(text, indentString)
  console.log("11 HEY!", inspect([1, 2, 3]))
text = addIndent(text, indentString)
t9md commented 7 years ago

linwise-bound-occurr