Skip to content
Open
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
4 changes: 2 additions & 2 deletions config/.oxrc
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,10 @@ syntax:set("macro", {223, 52, 249}) -- Macro names in various programming langua
syntax:set("namespace", {47, 141, 252}) -- Namespaces in various programming languages
syntax:set("struct", {47, 141, 252}) -- The names of structs, classes, enums in various programming languages
syntax:set("operator", {113, 113, 169}) -- Operators in various programming languages e.g. +, -, * etc
syntax:set("boolean", {86, 217, 178}) -- Booleans in various programming langauges e.g. true / false
syntax:set("boolean", {86, 217, 178}) -- Booleans in various programming languages e.g. true / false
syntax:set("table", {47, 141, 252}) -- Tables in various programming languages
syntax:set("reference", {134, 76, 232}) -- References in various programming languages
syntax:set("tag", {40, 198, 232}) -- Tags in various markup langauges e.g. HTML <p> tags
syntax:set("tag", {40, 198, 232}) -- Tags in various markup languages e.g. HTML <p> tags
syntax:set("heading", {47, 141, 252}) -- Headings in various markup languages e.g. # in markdown
syntax:set("link", {223, 52, 249}) -- Links in various markup languages e.g. URLs
syntax:set("key", {223, 52, 249}) -- Keys in various markup languages
Expand Down
4 changes: 2 additions & 2 deletions kaolinite/src/document/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl Document {
self.file.line_to_char(loc.y) + loc.x
}

/// Function to search the document to find the next occurance of a regex
/// Function to search the document to find the next occurrence of a regex
pub fn next_match(&mut self, regex: &str, inc: usize) -> Option<Match> {
// Prepare
let mut srch = Searcher::new(regex);
Expand Down Expand Up @@ -161,7 +161,7 @@ impl Document {
None
}

/// Function to search the document to find the previous occurance of a regex
/// Function to search the document to find the previous occurrence of a regex
pub fn prev_match(&mut self, regex: &str) -> Option<Match> {
// Prepare
let mut srch = Searcher::new(regex);
Expand Down
2 changes: 1 addition & 1 deletion kaolinite/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn regex() {
assert_eq!(reg.captures("aaac").as_slice().len(), 1);
let reg = regex!(r"\\{\{\{{}");
assert_eq!(reg.as_str(), "a^");
assert_eq!(reg.captures("abd").as_slice().len(), 0);
assert_eq!(reg.captures("and").as_slice().len(), 0);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion plugins/ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function ai:send_to_chatgpt(prompt)
:gsub("([$`!])", "\\%1")
local url = "https://api.openai.com/v1/chat/completions"
local headers = '-H "Content-Type: application/json" -H "Authorization: Bearer ' .. self.key .. '"'
local cmd = 'curl -s ' .. headers .. ' -d "{\'model\': \'gpt-4\', \'messages\':[{\'role\':\'user\', \'content\':\'' .. prompt .. '\'}], \'temprature\':0.7}" "' .. url .. '"'
local cmd = 'curl -s ' .. headers .. ' -d "{\'model\': \'gpt-4\', \'messages\':[{\'role\':\'user\', \'content\':\'' .. prompt .. '\'}], \'temperature\':0.7}" "' .. url .. '"'
local json = shell:output(cmd)

-- Find the `content` field within the JSON string
Expand Down
2 changes: 1 addition & 1 deletion plugins/autoindent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function autoindent:get_indent(y)
return #(line:match("^\t+") or "") + #(line:match("^ +") or "") / document.tab_width
end

-- Utilties for when moving lines around
-- Utilities for when moving lines around
function autoindent:fix_indent()
-- Check the indentation of the line above this one (and match the line the cursor is currently on)
local indents_above = autoindent:get_indent(editor.cursor.y - 1)
Expand Down
2 changes: 1 addition & 1 deletion plugins/themes/default16.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

-- Pallette --
-- Palette --
black = 'black'
darkgrey = 'darkgrey'
red = 'red'
Expand Down
2 changes: 1 addition & 1 deletion plugins/themes/galaxy.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

-- Pallette --
-- Palette --
black = '#1e1e2e'
grey1 = '#24273a'
grey2 = '#303446'
Expand Down
2 changes: 1 addition & 1 deletion plugins/themes/tropical.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

-- Pallette --
-- Palette --
black = '#232336'
grey1 = '#353552'
grey2 = '#484863'
Expand Down
2 changes: 1 addition & 1 deletion src/config/highlighting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl LuaUserData for SyntaxHighlighting {
for rule_idx in 1..=(rules.len()?) {
// Get rule
let rule = rules.get::<HashMap<String, String>>(rule_idx)?;
// Find type of rule and attatch it to the highlighter
// Find type of rule and attach it to the highlighter
match rule["kind"].as_str() {
"keyword" => {
highlighter.keyword(rule["name"].clone(), &rule["pattern"]);
Expand Down
2 changes: 1 addition & 1 deletion src/config/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ impl TabLine {
result = result.replace(&m.text, r.to_string_lossy().as_str());
}
Err(e) => {
*fb = Feedback::Error(format!("Error occured in tab line: {e:?}"));
*fb = Feedback::Error(format!("Error occurred in tab line: {e:?}"));
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl Config {
if let Some(idx) = plugins.iter().position(|p| p.ends_with(name)) {
// User wants the plug-in
let path = &plugins[idx];
// true if plug-in isn't avilable
// true if plug-in isn't available
!std::path::Path::new(path).exists()
} else {
// User doesn't want the plug-in
Expand Down
2 changes: 1 addition & 1 deletion src/editor/documents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl FileLayout {

/// Remove any empty atoms
pub fn clean_up(&mut self) {
// Continue checking for obselete nodes until none are remaining
// Continue checking for obsolete nodes until none are remaining
while let Some(empty_idx) = self.empty_atoms(vec![]) {
// Delete the empty node
self.remove(empty_idx.clone());
Expand Down
2 changes: 1 addition & 1 deletion src/editor/editing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Editor {
self.try_doc_mut().unwrap().commit();
}
} else if self.try_doc().unwrap().event_mgmt.history.is_empty() {
// If there is no initial commit and a plug-in changes things without commiting
// If there is no initial commit and a plug-in changes things without committing
// It can cause the initial state of the document to be lost
// This condition makes sure there is a copy to go back to if this is the case
self.try_doc_mut().unwrap().commit();
Expand Down
8 changes: 4 additions & 4 deletions src/editor/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,14 +891,14 @@ impl Editor {

/// Update highlighter of a certain document
pub fn update_highlighter_for(&mut self, ptr: &[usize], doc: usize) {
let percieved = self.highlighter_for(ptr.to_owned(), doc).line_ref.len();
let perceived = self.highlighter_for(ptr.to_owned(), doc).line_ref.len();
if self.active {
if let Some((ref mut fcs, _)) = self.files.get_atom_mut(ptr.to_owned()) {
let actual = fcs[doc].doc.info.loaded_to;
if percieved < actual {
let diff = actual.saturating_sub(percieved);
if perceived < actual {
let diff = actual.saturating_sub(perceived);
for i in 0..diff {
let line = fcs[doc].doc.lines[percieved + i].clone();
let line = fcs[doc].doc.lines[perceived + i].clone();
fcs[doc].highlighter.append(&line);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ fn handle_event(editor: &AnyUserData, event: &CEvent, lua: &Lua) -> Result<()> {
}
}

// Handle plug-in after key press mappings (if no errors occured)
// Handle plug-in after key press mappings (if no errors occurred)
if let CEvent::Key(key) = event {
let key_str = key_to_string(key.modifiers, key.code);
let code = run_key(&key_str);
Expand Down Expand Up @@ -384,7 +384,7 @@ fn handle_file_opening(editor: &AnyUserData, result: Result<()>, name: &str) {
ErrorKind::ReadOnlyFilesystem => fatal_error("You are on a read only file system"),
ErrorKind::ResourceBusy => fatal_error(&format!("The resource '{name}' is busy")),
ErrorKind::OutOfMemory => fatal_error("You are out of memory"),
kind => fatal_error(&format!("I/O error occured: {kind:?}")),
kind => fatal_error(&format!("I/O error occurred: {kind:?}")),
},
_ => fatal_error(&format!("Backend error opening '{name}': {kerr:?}")),
},
Expand Down