Disable git for vscode to move to jujutsu

This commit is contained in:
Arthur Beck 2025-05-05 07:45:06 -05:00
parent c790b42e93
commit 268b1ecc65
5 changed files with 77 additions and 28 deletions

48
.vscode/settings.json vendored
View file

@ -1,4 +1,50 @@
{ {
"rust-analyzer.check.command": "clippy", "rust-analyzer.check.command": "clippy",
"git.enabled": false "git.enabled": false,
"gitlens.showWhatsNewAfterUpgrades": false,
"gitlens.plusFeatures.enabled": false,
"gitlens.virtualRepositories.enabled": false,
"gitlens.currentLine.enabled": true,
"gitlens.currentLine.pullRequests.enabled": false,
"gitlens.codeLens.enabled": false,
"gitlens.codeLens.authors.enabled": false,
"gitlens.codeLens.recentChange.enabled": false,
"gitlens.statusBar.enabled": false,
"gitlens.statusBar.pullRequests.enabled": false,
"gitlens.hovers.enabled": true,
"gitlens.hovers.pullRequests.enabled": false,
"gitlens.hovers.autolinks.enabled": false,
"gitlens.hovers.currentLine.enabled": true,
"gitlens.hovers.annotations.enabled": true,
"gitlens.blame.heatmap.enabled": false,
"gitlens.blame.highlight.enabled": false,
"gitlens.graph.minimap.enabled": false,
"gitlens.graph.scrollMarkers.enabled": false,
"gitlens.graph.sidebar.enabled": false,
"gitlens.graph.issues.enabled": false,
"gitlens.graph.pullRequests.enabled": false,
"gitlens.graph.statusBar.enabled": false,
"gitlens.home.preview.enabled": false,
"gitlens.launchpad.indicator.enabled": false,
"gitlens.launchpad.indicator.polling.enabled": false,
"gitlens.cloudPatches.enabled": false,
"gitlens.views.commits.pullRequests.enabled": false,
"gitlens.views.commitDetails.pullRequests.enabled": false,
"gitlens.views.commitDetails.autolinks.enabled": false,
"gitlens.views.repositories.pullRequests.enabled": false,
"gitlens.views.fileHistory.pullRequests.enabled": false,
"gitlens.views.branches.pullRequests.enabled": false,
"gitlens.views.remotes.pullRequests.enabled": false,
"gitlens.views.worktrees.pullRequests.enabled": false,
"gitlens.views.contributors.pullRequests.enabled": false,
"gitlens.views.searchAndCompare.pullRequests.enabled": false,
"gitlens.views.workspaces.pullRequests.enabled": false,
"gitlens.integrations.enabled": false,
"gitlens.cloudIntegrations.enabled": false,
"gitlens.liveshare.enabled": false,
"gitlens.terminalLinks.enabled": false,
"gitlens.ai.generateCommitMessage.enabled": false,
"gitlens.mode.statusBar.enabled": false,
"gitlens.telemetry.enabled": false,
"telemetry.feedback.enabled": false
} }

View file

@ -7,7 +7,7 @@ fn main() {
"cargo:rustc-env=TARGET={}", "cargo:rustc-env=TARGET={}",
std::env::var("TARGET").unwrap() std::env::var("TARGET").unwrap()
); );
let page = Roff::new() let page = Roff::new()
.control("TH", ["SESH", "1"]) .control("TH", ["SESH", "1"])
.control("SH", ["NAME"]) .control("SH", ["NAME"])

View file

@ -263,10 +263,12 @@ pub fn unset(args: Vec<String>, _: String, state: &mut super::State) -> i32 {
/// Copy the focus to the clipboard. /// Copy the focus to the clipboard.
pub fn copyf(_: Vec<String>, _: String, state: &mut super::State) -> i32 { pub fn copyf(_: Vec<String>, _: String, state: &mut super::State) -> i32 {
let mut clipboard = arboard::Clipboard::new().unwrap(); let mut clipboard = arboard::Clipboard::new().unwrap();
clipboard.set_text(match &state.focus { clipboard
super::Focus::Str(s) => s.clone(), .set_text(match &state.focus {
super::Focus::Vec(_) => format!("{}", state.focus) super::Focus::Str(s) => s.clone(),
}).unwrap(); super::Focus::Vec(_) => format!("{}", state.focus),
})
.unwrap();
0 0
} }
@ -281,7 +283,9 @@ pub fn pastef(args: Vec<String>, _: String, state: &mut super::State) -> i32 {
state.focus = super::Focus::Str(text); state.focus = super::Focus::Str(text);
0 0
} else { } else {
unsafe { unreachable_unchecked(); } unsafe {
unreachable_unchecked();
}
} }
} }
@ -297,7 +301,7 @@ pub fn setf(args: Vec<String>, _: String, state: &mut super::State) -> i32 {
name: var.to_string(), name: var.to_string(),
value: match &state.focus { value: match &state.focus {
super::Focus::Str(s) => s.clone(), super::Focus::Str(s) => s.clone(),
super::Focus::Vec(_) => format!("{}", state.focus) super::Focus::Vec(_) => format!("{}", state.focus),
}, },
}); });
} }

View file

@ -1,7 +1,7 @@
//! Escape sequences //! Escape sequences
//! //!
//! Thanks, stack overflow! //! Thanks, stack overflow!
//! //!
//! (modifications were made) //! (modifications were made)
use std::fmt::Display; use std::fmt::Display;
@ -14,18 +14,17 @@ pub enum EscapeError {
/// unknown unicode character in a \u escape /// unknown unicode character in a \u escape
InvalidUnicodeChar(char), InvalidUnicodeChar(char),
/// invalid unicode codepoint /// invalid unicode codepoint
InvalidUnicodeCodepoint(u32) InvalidUnicodeCodepoint(u32),
} }
impl Display for EscapeError { impl Display for EscapeError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self { match self {
EscapeError::EscapeAtEndOfString => { EscapeError::EscapeAtEndOfString => f.write_str("escape at end of statement"),
f.write_str("escape at end of statement") EscapeError::InvalidUnicodeChar(c) => f.write_fmt(format_args!(
}, "invalid character in a unicode escape: {}",
EscapeError::InvalidUnicodeChar(c) => { *c
f.write_fmt(format_args!("invalid character in a unicode escape: {}", *c)) )),
},
EscapeError::InvalidUnicodeCodepoint(c) => { EscapeError::InvalidUnicodeCodepoint(c) => {
f.write_fmt(format_args!("invalid unicode codepoint in escape: {}", *c)) f.write_fmt(format_args!("invalid unicode codepoint in escape: {}", *c))
} }
@ -56,20 +55,22 @@ impl<'a> Iterator for InterpretEscapedString<'a> {
Some('\n') => { Some('\n') => {
ret_next = true; ret_next = true;
Err(EscapeError::EscapeAtEndOfString) Err(EscapeError::EscapeAtEndOfString)
}, }
Some('u') | Some('U') | Some('x') => { Some('u') | Some('U') | Some('x') => {
let code = [self.s.next(), self.s.next(), self.s.next(), self.s.next()]; let code = [self.s.next(), self.s.next(), self.s.next(), self.s.next()];
if code.iter().any(|val| val.is_none()) { if code.iter().any(|val| val.is_none()) {
return Err(EscapeError::EscapeAtEndOfString); return Err(EscapeError::EscapeAtEndOfString);
} }
let code = TryInto::<[char; 4]>::try_into( let code = TryInto::<[char; 4]>::try_into(
code.iter().map(|ch| ch.unwrap().to_ascii_lowercase()).collect::<Vec<char>>(), code.iter()
.map(|ch| ch.unwrap().to_ascii_lowercase())
.collect::<Vec<char>>(),
) )
.unwrap(); .unwrap();
for c in code { for c in code {
if !(c.is_numeric() || ['a', 'b', 'c', 'd', 'e', 'f'].contains(&c)) { if !(c.is_numeric() || ['a', 'b', 'c', 'd', 'e', 'f'].contains(&c)) {
return Err(EscapeError::InvalidUnicodeChar(c)) return Err(EscapeError::InvalidUnicodeChar(c));
} }
} }
@ -79,16 +80,12 @@ impl<'a> Iterator for InterpretEscapedString<'a> {
return Err(EscapeError::InvalidUnicodeCodepoint(code)); return Err(EscapeError::InvalidUnicodeCodepoint(code));
} }
Ok(out.unwrap()) Ok(out.unwrap())
}, }
Some(c) => Ok(c), Some(c) => Ok(c),
}, },
c => Ok(c), c => Ok(c),
}); });
if ret_next { if ret_next { self.next() } else { out }
self.next()
} else {
out
}
} }
} }

View file

@ -280,7 +280,9 @@ fn eval(statement: &str, state: &mut State) {
let _ = writer.suspend_raw_mode(); let _ = writer.suspend_raw_mode();
} }
for env in &state.shell_env { for env in &state.shell_env {
unsafe { std::env::set_var(env.name.clone(), env.value.clone()); } unsafe {
std::env::set_var(env.name.clone(), env.value.clone());
}
} }
match std::process::Command::new(program_name.clone()) match std::process::Command::new(program_name.clone())
.args(&statement_split[1..]) .args(&statement_split[1..])
@ -311,7 +313,7 @@ fn eval(statement: &str, state: &mut State) {
state.shell_env.swap_remove(i); state.shell_env.swap_remove(i);
} }
} }
state.shell_env.push(ShellVar { state.shell_env.push(ShellVar {
name: "STATUS".to_string(), name: "STATUS".to_string(),
value: "127".to_string(), value: "127".to_string(),