Skip to content

Commit

Permalink
improv(api): <Plug>(leap-cross-window) -> <Plug>(leap-from-window)
Browse files Browse the repository at this point in the history
The former is deprecated, as the name is imprecise/misleading.
  • Loading branch information
ggandor committed Feb 2, 2023
1 parent 9610e70 commit 6068651
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,11 @@ the target labeled, first with blue, and then, after one more `<space>`, green.

### Cross-window motions

`gs` searches in all the other windows on the tab page. In this case, the
matches are sorted by their screen distance from the cursor, advancing in
concentric circles.
In this case, the matches are sorted by their screen distance from the cursor,
advancing in concentric circles. The one default motion that works this way is
`gs` (`<Plug>(leap-from-window)`), searching in all other windows on the tab
page. To create custom motions like this, e.g. bidirectional search in the
current window, see [Extending Leap](#extending-leap).

### Visual and Operator-pending mode

Expand Down
7 changes: 1 addition & 6 deletions doc/leap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ USAGE *leap-usage*
- Else: select a label. In case of multiple groups, first switch to the desired
one, using `<space>` (step back with `<tab>`, if needed).

*leap-cross-window*
`gs` searches in all the other windows on the tab page. In this case, the
matches are sorted by their screen distance from the cursor, advancing in
concentric circles.

*leap-visual-mode* *leap-operator-pending-mode*
In Visual and Operator-pending mode, there are two different pairs of
directional motions available, providing the necessary additional comfort and
Expand Down Expand Up @@ -334,7 +329,7 @@ default mapping: `S`
arguments: `{ backward = true, offset = 2 }`
default mapping: `X` (Visual and Operator-pending mode only)

*<Plug>(leap-cross-window)*
*<Plug>(leap-from-window)*
arguments: `{ target_windows = require('leap.util').get_enterable_windows() }`
default mapping: `gs`

Expand Down
4 changes: 3 additions & 1 deletion fnl/leap/user.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
[[:n :x :o] "S" "<Plug>(leap-backward-to)" "Leap backward to"]
[ [:x :o] "x" "<Plug>(leap-forward-till)" "Leap forward till"]
[ [:x :o] "X" "<Plug>(leap-backward-till)" "Leap backward till"]
[[:n :x :o] "gs" "<Plug>(leap-cross-window)" "Leap cross window"]])]
[[:n :x :o] "gs" "<Plug>(leap-from-window)" "Leap from window"]
[[:n :x :o] "gs" "<Plug>(leap-cross-window)" "Leap from window"] ; deprecated
])]
(each [_ mode (ipairs modes)]
(when (or force?
; Otherwise only set the keymaps if:
Expand Down
2 changes: 1 addition & 1 deletion lua/leap/user.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6068651

Please sign in to comment.