Skip to content

Add new scripts: Duplicate selection, Go to Next / Previous Paragraph

Henri K requested to merge henrik/k-text-editor-fork:new-scripts into master

"Duplicate selection" duplicates the selected text at cursor point. This functionality is same as in VS Code among others.

Under menu: Scipts/Edititing, shortcut: Alt + Shift + d

Most common for this feature in other editors is Ctrl+D or Ctrl+Shift+D but they're used already.


Go to Next / Previous Paragraph: makes similar cursor movement as "{" and "}" commands in vi-mode / Vim. Small difference to vi-mode / Vim is that lines with only white space are also regarded as separators between paragraphs but it makes more sense IMO.

Under menu: Scripts / Navigation
Don't know what would be good default shortcuts for these so they don't have one for now.

I suggest placing these in this new "navigation.js" file if it's ok? These are placed in different sub-menu than scripts in utils.js and that file is about 750 lines already. There's two other scripts that already go under Navigation but they are in "jumpMatchingIndent.js".

Merge request reports

Loading