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
44 changes: 44 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PR Check

on:
pull_request:
branches:
- main

env:
CARGO_TERM_COLOR: always

jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
# The Windows runners have autocrlf enabled by default.
- name: Disable git autocrlf
run: git config --global core.autocrlf false
if: matrix.os == 'windows-latest'
- name: Checkout
uses: actions/checkout@v4
# https://github.com/actions/cache/blob/main/examples.md#rust---cargo
# Depends on `Cargo.lock` --> Has to be after checkout.
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
run: rustup toolchain install nightly --no-self-update --profile minimal --component rust-src,rustfmt,clippy
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run tests
run: cargo test --all-features --all-targets
- name: Run clippy
run: cargo clippy --all-features --all-targets -- --deny warnings
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ name = "lib"
harness = false

[features]
debug-layout = []
debug-latency = []

# We use `opt-level = "s"` as it significantly reduces binary size.
Expand Down
2 changes: 1 addition & 1 deletion src/bin/edit/draw_statusbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pub fn draw_statusbar(ctx: &mut Context, state: &mut State) {
),
);

#[cfg(any(feature = "debug-layout", feature = "debug-latency"))]
#[cfg(feature = "debug-latency")]
ctx.label(
"stats",
&arena_format!(ctx.arena(), "{}/{}", tb.logical_line_count(), tb.visual_line_count(),),
Expand Down
6 changes: 0 additions & 6 deletions src/bin/edit/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ fn run() -> apperr::Result<()> {

draw(&mut ctx, &mut state);

#[cfg(feature = "debug-layout")]
{
drop(ctx);
state.buffer.buffer.copy_from_str(&tui.debug_layout());
}

#[cfg(feature = "debug-latency")]
{
passes += 1;
Expand Down