Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ggandor/leap.nvim
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b7ed1ecce222e9551c4e479757b090aafe7405fc
Choose a base ref
..
head repository: ggandor/leap.nvim
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6b1cab690c13be83d3f2a4279a0880cff8c7f9b2
Choose a head ref
Showing with 123 additions and 109 deletions.
  1. +7 −7 fnl/leap/main.fnl
  2. +116 −102 lua/leap/main.lua
14 changes: 7 additions & 7 deletions fnl/leap/main.fnl
Original file line number Diff line number Diff line change
@@ -357,11 +357,11 @@ is either labeled (C) or not (B).
(when aot?
(resolve-conflicts targets)))))

(fn with-highlight-chores [opts ...]
(fn with-highlight-chores [opts task]
(do (local opts (or opts {}))
(hl:cleanup opts.hl-affected-windows)
(hl:apply-backdrop (or opts.backdrop-ranges []))
(do ...)
(task)
(hl:highlight-cursor)
(vim.cmd :redraw)))

@@ -668,7 +668,7 @@ is either labeled (C) or not (B).
(values start end))))

(fn get-first-pattern-input []
(with-highlight-chores {: backdrop-ranges : hl-affected-windows} (echo "")) ; clean up the command line
(with-highlight-chores {: backdrop-ranges : hl-affected-windows} (fn [] (echo ""))) ; clean up the command line
(case (get-input-by-keymap prompt)
; Here we can handle any other modifier key as "zeroth" input,
; if the need arises.
@@ -687,7 +687,7 @@ is either labeled (C) or not (B).
; char<enter> partial input (but it implies not needing
; to show beacons).
(not count))
(with-highlight-chores {: backdrop-ranges : hl-affected-windows} (light-up-beacons targets)))
(with-highlight-chores {: backdrop-ranges : hl-affected-windows} (fn [] (light-up-beacons targets))))
(get-input-by-keymap prompt))

(fn get-full-pattern-input []
@@ -710,7 +710,7 @@ is either labeled (C) or not (B).
(set-label-states targets {: group-offset}))
(set-beacons targets {:aot? vars.aot? : no-labels? : user-given-targets?})
(local (start end) (get-highlighted-idx-range targets no-labels?))
(with-highlight-chores {: backdrop-ranges : hl-affected-windows} (light-up-beacons targets {: start : end})))
(with-highlight-chores {: backdrop-ranges : hl-affected-windows} (fn [] (light-up-beacons targets {: start : end}))))
; ---
(fn loop [group-offset first-invoc?]
(display group-offset)
@@ -775,7 +775,7 @@ is either labeled (C) or not (B).
(fn display []
(set-beacons targets {: no-labels? :aot? vars.aot? : user-given-targets?})
(local (start end) (get-highlighted-idx-range targets no-labels?))
(with-highlight-chores {: backdrop-ranges : hl-affected-windows} (light-up-beacons targets {: start : end})))
(with-highlight-chores {: backdrop-ranges : hl-affected-windows} (fn [] (light-up-beacons targets {: start : end}))))
; ---
(fn get-new-idx [idx in]
(if (contains? spec-keys.next_target in) (min (inc idx) (length targets))
@@ -887,7 +887,7 @@ is either labeled (C) or not (B).
targets**
; The action callback should expect a list in this case.
; It might also get user input, so keep the beacons highlighted.
(do (with-highlight-chores {: backdrop-ranges : hl-affected-windows} (light-up-beacons targets**))
(do (with-highlight-chores {: backdrop-ranges : hl-affected-windows} (fn [] (light-up-beacons targets**)))
(do-action targets**)))
(exit))

Loading