Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
# https://github.com/open-contracting/cardinal-rs/blob/main/.github/workflows/release.yml

name: Test & Release
# The name is either "Release vX.X.X" on tag push or the commit message
run-name: ${{ github.ref_name != 'main' && format('Release - {0}', github.ref_name) || github.event.head_commit.message }}
# The name is the PR title, "Release vX.X.X" on tag push, or the commit message
run-name: ${{ github.event_name == 'pull_request' && format('PR {0} - {1}', github.event.pull_request.number, github.event.pull_request.title) || github.ref_type == 'tag' && format('Release - {0}', github.ref_name) || github.event.head_commit.message }}
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
tags: [ "v[0-9]+.[0-9]+.[0-9]+" ]
Expand All @@ -25,7 +27,7 @@ jobs:

- name: Setup Cache
uses: Swatinem/rust-cache@v2
if: github.ref_name == 'main' # Caching doesn't work on tags, so skip it
if: github.ref_type != 'tag' # Caching doesn't work on tags, so skip it
with:
cache-targets: "true"
cache-on-failure: "true"
Expand All @@ -41,7 +43,7 @@ jobs:
name: Setup
needs: test
runs-on: ubuntu-latest
if: github.ref_name != 'main' # Only run on tag push
if: startsWith(github.ref, 'refs/tags/v') # Only run on tag push
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -54,7 +56,7 @@ jobs:
name: Build
needs: setup
runs-on: ${{ matrix.runner }}
if: github.ref_name != 'main' # Only run on tag push
if: startsWith(github.ref, 'refs/tags/v') # Only run on tag push
strategy:
matrix:
include:
Expand Down Expand Up @@ -110,7 +112,7 @@ jobs:
name: Release
needs: build
runs-on: ubuntu-latest
if: github.ref_name != 'main' # Only run on tag push
if: startsWith(github.ref, 'refs/tags/v') # Only run on tag push
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
38 changes: 19 additions & 19 deletions src/commands/search/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,27 +195,27 @@ pub fn handle_mouse_events(event: MouseEvent, app: &mut UIState) -> Result<()> {
// Select a template with left-click
MouseEventKind::Down(MouseButton::Left) => app.list_select(),
// Scrolling on the collection templates list
MouseEventKind::ScrollUp => {
if now.duration_since(app.last_scroll_time) > Duration::from_millis(15) {
app.list_previous(if is_shift || is_alt {
Some(10)
} else {
Some(1)
});
app.last_scroll_time = now;
}
MouseEventKind::ScrollUp
if now.duration_since(app.last_scroll_time) > Duration::from_millis(15) =>
{
app.list_previous(if is_shift || is_alt {
Some(10)
} else {
Some(1)
});
app.last_scroll_time = now;
}
// Scrolling on the collection templates list
MouseEventKind::ScrollDown => {
if now.duration_since(app.last_scroll_time) > Duration::from_millis(15) {
app.list_next(if is_shift || is_alt {
println!("Scrolling {is_shift} {is_alt}");
Some(10)
} else {
Some(1)
});
app.last_scroll_time = now;
}
MouseEventKind::ScrollDown
if now.duration_since(app.last_scroll_time) > Duration::from_millis(15) =>
{
app.list_next(if is_shift || is_alt {
println!("Scrolling {is_shift} {is_alt}");
Some(10)
} else {
Some(1)
});
app.last_scroll_time = now;
}
_ => {}
}
Expand Down
Loading