G1: Alt-drag an existing ruler guide to swap its orientation

Match the public shortcut reference: Alt while dragging converts horizontal and vertical, with snapping on the new axis; guide.move accepts vertical on the index form.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
nrq6993-a11y
2026-10-19 01:46:38 +03:00
co-authored by Cursor
parent a466625c89
commit 73eaa84d34
3 changed files with 75 additions and 37 deletions
+4 -1
View File
@@ -207,7 +207,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Move Guide",
[],
None,
"{index, pos: pt} | {dx?, dy?: pt, copy?: bool} put ruler guide `index` at `pos`, or move the selected guides (vertical ones by dx, horizontal ones by dy); copy leaves them and selects the moved copies",
"{index, pos: pt, vertical?: bool} | {dx?, dy?: pt, copy?: bool} put ruler guide `index` at `pos` (and swap its orientation when `vertical` is given), or move the selected guides (vertical ones by dx, horizontal ones by dy); copy leaves them and selects the moved copies",
guides_unlocked,
guide_move
),
@@ -769,6 +769,9 @@ pub(crate) fn guide_move(s: &mut Session, p: &Value) -> Result<Value> {
s.edit("Move Guide", |d, _| {
if let Some(g) = d.guides.get_mut(i) {
g.pos = pos;
if p.get("vertical").is_some() {
g.vertical = bool_or(p, "vertical", false);
}
}
Ok(())
})?;