Skip to content
gpdoc
Playground

Node range

Select whole sibling blocks with the keyboard or a modifier drag.

node_range() selects whole blocks that share a parent.

Click “Draft the outline” and press Shift + Down Arrow to select the whole paragraph. Press it again to include “Review the draft”. Press Shift + Up Arrow to shrink the selection back to the first paragraph.

You can also hold Command on macOS or Control on Windows and Linux while dragging across two paragraphs. Release the mouse button while holding the key to select both blocks.

Terminal window
cargo add gpdoc-plugin-node-range
use gpdoc_plugin_node_range::node_range;
let config = gpdoc::EditorConfig::builder()
.plugin(gpdoc_plugin_paragraph::paragraph())
.plugin(node_range())
.build()
.expect("configure editor");

With a drag handle installed, dragging a handle inside the selected range moves the blocks together.

node-range/src/lib.rs