Compare commits

..

No commits in common. "07a58afaff73f025bd4a027b78e9a8215716e8c8" and "66ca973686cd6c7e6037cfbe120abc2c44d91970" have entirely different histories.

4 changed files with 18 additions and 15 deletions

View file

@ -8,7 +8,6 @@
./dm.nix ./dm.nix
./tlp.nix ./tlp.nix
./locale.nix ./locale.nix
./printing.nix
]; ];
services.flatpak.enable = true; services.flatpak.enable = true;
security.polkit.enable = true; security.polkit.enable = true;

View file

@ -11,9 +11,10 @@
ptouch-driver ptouch-driver
epsonscan2 epsonscan2
epson-escpr epson-escpr
epson-escpr2 epson-inkjet-printer-escpr2
epson_201207w epson_201207w
epson-alc1100 epson-alc1100
epson
]; ];
}; };
} }

View file

@ -102,7 +102,7 @@
d = "@<C-w>vgd"; d = "@<C-w>vgd";
f = "@<C-w>vgy"; f = "@<C-w>vgy";
h = ":toggle-option lsp.display-inlay-hints"; h = ":toggle-option lsp.display-inlay-hints";
t = ":pipe flip-bool"; t = "@|flip-bool<ret>";
}; };
}; };
insert = { insert = {

View file

@ -4,6 +4,7 @@
#![feature(pattern)] #![feature(pattern)]
use std::{ use std::{
hint::black_box,
io::{Read, Write}, io::{Read, Write},
str::pattern::Pattern, str::pattern::Pattern,
}; };
@ -85,27 +86,29 @@ fn find_bools(input: &str) -> [[Vec<usize>; 2]; BOOL_COUNT] {
input input
.match_indices(it) .match_indices(it)
.filter_map(|it| { .filter_map(|it| {
fn char_guard(c: char) -> bool { let char_guard = |c: char| !(c.is_alphanumeric() || c.is_contained_in("-_"));
!(c.is_alphanumeric() || c.is_contained_in("-_")) let mut allow = true;
}
let last_idx = it.0 + it.1.len(); if it.0 > 0 {
allow &= char_guard(
(it.0 > 0
&& last_idx < input.len()
&& char_guard(
input[it.1.floor_char_boundary(it.0 - 1)..it.0] input[it.1.floor_char_boundary(it.0 - 1)..it.0]
.chars() .chars()
.last() .last()
.unwrap(), .unwrap(),
) );
&& char_guard( }
let last_idx = it.0 + it.1.len();
if last_idx < input.len() {
allow &= char_guard(
input[(last_idx)..(input.ceil_char_boundary(last_idx + 1))] input[(last_idx)..(input.ceil_char_boundary(last_idx + 1))]
.chars() .chars()
.last() .last()
.unwrap(), .unwrap(),
)) );
.then_some(it.0) }
allow.then_some(it.0)
}) })
.collect() .collect()
}) })