File emergency-configuration-fix.patch of Package ox
From 08a2ecdbd817b661b7c21fad51e17cde6dfc50c7 Mon Sep 17 00:00:00 2001
From: Curly <11898833+curlpipe@users.noreply.github.com>
Date: Sun, 8 Nov 2020 10:51:23 +0000
Subject: [PATCH] Emergency configuration fix
---
src/config.rs | 402 +++++++++++++++++++++++++++++++++++++++++++++++-
src/document.rs | 4 +-
src/editor.rs | 2 +-
3 files changed, 401 insertions(+), 7 deletions(-)
diff --git a/src/config.rs b/src/config.rs
index 86684a1..de3b35c 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -157,8 +157,402 @@ pub struct Language {
}
// Default configuration format
-// Minify using:
-// (| )//[a-zA-Z0-9 ]+ on https://www.regextester.com/
-// https://codebeautify.org/text-minifier
-const DEFAULT: &str = r#"(general:General(line_number_padding_right:2,line_number_padding_left:1,tab_width:4,undo_period:5,),theme:Theme(editor_bg:(41,41,61),editor_fg:(255,255,255),status_bg:(59,59,84),status_fg:(35,240,144),line_number_fg:(65,65,98),active_tab_fg:(255,255,255),active_tab_bg:(41,41,61),inactive_tab_fg:(255,255,255),inactive_tab_bg:(59,59,84),),highlights:{"comments":(113,113,169),"keywords":(134,76,232),"references":(134,76,232),"strings":(39,222,145),"characters":(40,198,232),"digits":(40,198,232),"booleans":(86,217,178),"functions":(47,141,252),"structs":(47,141,252),"macros":(223,52,249),"attributes":(40,198,232),"headers":(47,141,252),"symbols":(47,141,252),"global":(86,217,178),},languages:[Language(name:"Rust",icon:"\u{e7a8}",extensions:["rs"],keywords:["as","break","const","continue","crate","else","enum","extern","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","static","struct","super","trait","type","unsafe","use","where","while","async","await","dyn","abstract","become","box","do","final","macro","override","priv","typeof","unsized","virtual","yield","try","'static","u8","u16","u32","u64","u128","usize","i8","i16","i32","i64","i128","isize","f32","f64","String","Vec","str","Some","bool","None","Box","Result","Option","Ok","Err",],definitions:{"comments":["(?m)(//.*)$","(?ms)(/\\*.*?\\*/)",],"strings":["(\".*?\")",],"characters":["('.')","('\\\\.')",],"digits":["\\b(\\d+.\\d+|\\d+)","\\b(\\d+.\\d+(?:f32|f64))",],"booleans":["\\b(true)\\b","\\b(false)\\b",],"functions":["fn\\s+([a-z_][A-Za-z0-9_]*)\\s*\\(",],"structs":["(?:trait|enum|struct|impl)\\s+([A-Z][A-Za-z0-9_]*)\\s*","impl(?:<.*?>|)\\s+([A-Z][A-Za-z0-9_]*)","([A-Z][A-Za-z0-9_]*)::","impl.*for\\s+([A-Z][A-Za-z0-9_]*)",],"macros":["\\b([a-z_][a-zA-Z0-9_]*!)",],"attributes":["(?ms)^\\s*(#(?:!|)\\[.*?\\])",],"references":["&str","&mut","&self","&i8","&i16","&i32","&i64","&i128","&isize","&u8","&u16","&u32","&u64","&u128","&usize","&f32","&f64",]}),Language(name:"Ruby",icon:"\u{e739}",extensions:["rb"],keywords:["__ENCODING__","__LINE__","__FILE__","BEGIN","END","alias","and","begin","break","case","class","def","defined?","do","else","elsif","end","ensure","print","for","if","in","module","next","nil","not","or","puts","redo","rescue","retry","return","self","super","then","undef","unless","until","when","while","yield","raise","include","extend",],definitions:{"comments":["(?m)(#.*)$","(?ms)(=begin.*=end)",],"strings":["((?:f|r|)\".*?\")","(\'.*?\')",],"digits":[r"\b(\d+.\d+|\d+)",],"booleans":[r"\b(true)\b",r"\b(false)\b",],"structs":[r"class(\s+[A-Za-z0-9_]*)",],"functions":[r"def\s+([a-z_][A-Za-z0-9_]*)",],"symbols":[r"(:[^,\)\.\s=]+)",],"global":[r"(\$[a-z_][A-Za-z0-9_]*)\s",]}),Language(name:"Crystal",icon:"\u{e7a3}",extensions:["cr"],keywords:["__ENCODING__","__LINE__","__FILE__","BEGIN","END","alias","and","begin","break","case","class","def","defined?","do","else","elsif","end","ensure","print","for","if","in","module","next","nil","not","or","puts","redo","rescue","retry","return","self","super","then","undef","unless","until","when","while","yield","raise","include","extend","Int32","String","getter","setter","property",],definitions:{"comments":["(?m)(#.*)$","(?ms)(=begin.*=end)",],"strings":["(?ms)(\".*?\")","((?:f|r|)\".*?\")","(\'.*?\')",],"digits":[r"\b(\d+.\d+|\d+)",],"booleans":[r"\b(true)\b",r"\b(false)\b",],"structs":[r"class(\s+[A-Za-z0-9_]*)",],"functions":[r"def\s+([a-z_][A-Za-z0-9_]*)",],"symbols":[r"(:[^,\}\)\.\s=]+)",],"global":[r"(\$[a-z_][A-Za-z0-9_]*)\s",]}),Language(name:"Python",icon:"\u{e73c}",extensions:["py","pyw"],keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","not","or","pass","print","raise","return","try","while","with","yield","str","bool","int","tuple","list","dict","tuple","len","None","input","type","set","range","enumerate","open","iter","min","max","dir","self","isinstance","help","next","super",],definitions:{"comments":["(?m)(#.*)$",],"strings":["(?ms)(\"\"\".*?\"\"\")","(?ms)(\'\'\'.*?\'\'\')","((?:f|r|)\".*?\")","(\'.*?\')",],"digits":["\\b(\\d+.\\d+|\\d+)",],"booleans":["\\b(True)\\b","\\b(False)\\b",],"structs":["class\\s+([A-Za-z0-9_]*)",],"functions":["def\\s+([a-z_][A-Za-z0-9_]*)",],"attributes":["@.*$",]}),Language(name:"Javascript",icon:"\u{e74e}",extensions:["js"],keywords:["abstract","arguments","await","boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","eval","export","extends","final","finally","float","for","of","function","goto","if","implements","import","in","instanceof","int","interface","let","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","try","typeof","var","void","volatile","console","while","with","yield","undefined","NaN","-Infinity","Infinity",],definitions:{"comments":["(?m)(//.*)$","(?ms)(/\\*.*\\*/)$",],"strings":["(?ms)(\"\"\".*?\"\"\")","(?ms)(\'\'\'.*?\'\'\')","((?:f|r|)\".*?\")","(\'.*?\')",],"digits":["\\b(\\d+.\\d+|\\d+)",],"booleans":["\\b(true)\\b","\\b(false)\\b",],"structs":["class\\s+([A-Za-z0-9_]*)",],"functions":["function\\s+([a-z_][A-Za-z0-9_]*)","\\b([a-z_][A-Za-z0-9_]*)\\s*\\("],}),Language(name:"C",icon:"\u{e61e}",extensions:["c","h"],keywords:["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","printf","fscanf","scanf","fputsf","exit","stderr","malloc","calloc","bool","realloc","free","strlen","size_t",],definitions:{"comments":["(?m)(//.*)$","(?ms)(/\\*.*?\\*/)",],"strings":["(\".*?\")",],"characters":["('.')","('\\\\.')",],"digits":["\\b(\\d+.\\d+|\\d+)","\\b(\\d+.\\d+(?:f|))",],"booleans":["\\b(true)\\b","\\b(false)\\b",],"functions":["(int|bool|void|char|double|long|short|size_t)\\s+([a-z_][A-Za-z0-9_]*)\\s*\\(",],"structs":["struct\\s+([A-Za-z0-9_]*)\\s*",],"attributes":["^\\s*(#.*?)\\s",],"headers":["(<.*?>)",],}),],)
+const DEFAULT: &str = r#"
+// General settings for Ox
+(
+ general: General(
+ line_number_padding_right: 2, // Line number padding on the right
+ line_number_padding_left: 1, // Line number padding on the left
+ tab_width: 4, // The amount of spaces for a tab
+ undo_period: 5, // Seconds of inactivity for undo
+ status_left: " %f%d %D \u{2502} %n %i", // Left part of status line
+ status_right: "\u{4e26} %l / %L \u{2502} \u{fae6}(%x, %y) ", // Right part of status line
+ tab: "%I%f%d", // Tab formatting
+ ),
+ // Custom defined macros
+ macros: {
+ // Macro to move a line up
+ "move line up": [
+ "store line 1", // Store current line in bank #1
+ "delete 0", // Delete current line
+ "move 1 up", // Move cursor up by 1
+ "line above", // Insert an empty line above
+ "move 1 up", // Move cursor up to the empty line
+ "load line 1", // Load line in bank #1 over the empty line
+ ],
+ // Macro to move a line down
+ "move line down": [
+ "store line 1", // Store the current line in bank #1
+ "delete 0", // Delete the current line
+ "line below", // Create an empty line below
+ "move 1 down", // Move cursor down to empty line
+ "load line 1", // Overwrite empty line with line in bank #1
+ ],
+ },
+ // RGB values for the colours of Ox
+ theme: Theme(
+ editor_bg: (41, 41, 61), // The main background color
+ editor_fg: (255, 255, 255), // The default text color
+ status_bg: (59, 59, 84), // The background color of the status line
+ status_fg: (35, 240, 144), // The text color of the status line
+ line_number_fg: (65, 65, 98), // The text color of the line numbers
+ active_tab_fg: (255, 255, 255), // The text color of the active tab
+ active_tab_bg: (41, 41, 61), // The background color of the active tab
+ inactive_tab_fg: (255, 255, 255), // The text color of the inactive tab(s)
+ inactive_tab_bg: (59, 59, 84), // The text color of the inactive tab(s)
+ default_theme: "default", // The default syntax highlights to use
+ ),
+ // Colours for the syntax highlighting
+ highlights: {
+ "default": {
+ "comments": (113, 113, 169),
+ "keywords": (134, 76, 232),
+ "references": (134, 76, 232),
+ "strings": (39, 222, 145),
+ "characters": (40, 198, 232),
+ "digits": (40, 198, 232),
+ "booleans": (86, 217, 178),
+ "functions": (47, 141, 252),
+ "structs": (47, 141, 252),
+ "macros": (223, 52, 249),
+ "attributes": (40, 198, 232),
+ "headers": (47, 141, 252),
+ "symbols": (47, 141, 252),
+ "global": (86, 217, 178),
+ },
+ "alternative": {
+ "comments": (113, 113, 169),
+ "keywords": (64, 86, 244),
+ "references": (64, 86, 244),
+ "strings": (76, 224, 179),
+ "characters": (110, 94, 206),
+ "digits": (4, 95, 204),
+ "booleans": (76, 224, 179),
+ "functions": (4, 95, 204),
+ "structs": (4, 95, 204),
+ "macros": (110, 94, 206),
+ "attributes": (4, 95, 204),
+ "headers": (141, 129, 217),
+ "symbols": (249, 233, 0),
+ "global": (76, 224, 179),
+ },
+ },
+ // Key bindings
+ keys: {
+ // Keybinding: [Oxa commands]
+ Ctrl('q'): ["quit"], // Quit current document
+ Ctrl('s'): ["save"], // Save current document
+ Ctrl('w'): ["save ?"], // Save current document as
+ Ctrl('p'): ["save *"], // Save all open documents
+ Ctrl('n'): ["new"], // Create new document
+ Ctrl('o'): ["open"], // Open document
+ Ctrl('d'): ["prev"], // Move to previous tab
+ Ctrl('h'): ["next"], // Move to next tab
+ Ctrl('z'): ["undo"], // Undo last edit
+ Ctrl('y'): ["redo"], // Redo last edit
+ Ctrl('f'): ["search"], // Trigger search command
+ Ctrl('r'): ["replace"], // Trigger replace command
+ Ctrl('a'): ["replace *"], // Trigger replace all command
+ Ctrl('v'): ["move line up"], // Move line up
+ Ctrl('k'): ["move line down"], // Move line down
+ Alt('a'): ["cmd"], // Open the command line
+ },
+ // Language specific settings
+ languages: [
+ Language(
+ name: "Rust", // Name of the language
+ icon: "\u{e7a8} ", // Icon for the language
+ extensions: ["rs"], // Extensions of the language
+ // Keywords of the language
+ keywords: [
+ "as", "break", "const", "continue", "crate", "else",
+ "enum", "extern", "fn", "for", "if", "impl", "in",
+ "let", "loop", "match", "mod", "move", "mut", "pub",
+ "ref", "return", "self", "static", "struct", "super",
+ "trait", "type", "unsafe", "use", "where", "while",
+ "async", "await", "dyn", "abstract", "become", "box",
+ "do", "final", "macro", "override", "priv", "typeof",
+ "unsized", "virtual", "yield", "try", "'static",
+ "u8", "u16", "u32", "u64", "u128", "usize",
+ "i8", "i16", "i32", "i64", "i128", "isize",
+ "f32", "f64", "String", "Vec", "str", "Some", "bool",
+ "None", "Box", "Result", "Option", "Ok", "Err",
+ ],
+ // Syntax definitions
+ definitions: {
+ "comments": [
+ "(?m)(//.*)$",
+ "(?ms)(/\\*.*?\\*/)",
+ ],
+ "strings": [
+ "(\".*?\")",
+ ],
+ "characters": [
+ "('.')",
+ "('\\\\.')",
+ ],
+ "digits": [
+ "\\b(\\d+.\\d+|\\d+)",
+ "\\b(\\d+.\\d+(?:f32|f64))",
+ ],
+ "booleans": [
+ "\\b(true)\\b",
+ "\\b(false)\\b",
+ ],
+ "functions": [
+ "fn\\s+([a-z_][A-Za-z0-9_]*)\\s*\\(",
+ ],
+ "structs": [
+ "(?:trait|enum|struct|impl)\\s+([A-Z][A-Za-z0-9_]*)\\s*",
+ "impl(?:<.*?>|)\\s+([A-Z][A-Za-z0-9_]*)",
+ "([A-Z][A-Za-z0-9_]*)::",
+ "impl.*for\\s+([A-Z][A-Za-z0-9_]*)",
+ ],
+ "macros": [
+ "\\b([a-z_][a-zA-Z0-9_]*!)",
+ ],
+ "attributes": [
+ "(?ms)^\\s*(#(?:!|)\\[.*?\\])",
+ ],
+ "references": [
+ "&str", "&mut", "&self",
+ "&i8", "&i16", "&i32", "&i64", "&i128", "&isize",
+ "&u8", "&u16", "&u32", "&u64", "&u128", "&usize",
+ "&f32", "&f64",
+ ]
+ }
+ ),
+ Language(
+ name: "Ruby", // Name of the language
+ icon: "\u{e739} ", // Icon for the language
+ extensions: ["rb"], // Extensions of the language
+ // Keywords of the language
+ keywords: [
+ "__ENCODING__", "__LINE__", "__FILE__", "BEGIN", "END",
+ "alias", "and", "begin", "break", "case", "class", "def",
+ "defined?", "do", "else", "elsif", "end", "ensure", "print",
+ "for", "if", "in", "module", "next", "nil", "not", "or", "puts",
+ "redo", "rescue", "retry", "return", "self", "super", "then",
+ "undef", "unless", "until", "when", "while", "yield", "raise",
+ "include", "extend",
+ ],
+ // Syntax definitions
+ definitions: {
+ "comments": [
+ "(?m)(#.*)$",
+ "(?ms)(=begin.*=end)",
+ ],
+ "strings": [
+ "((?:f|r|)\".*?\")",
+ "(\'.*?\')",
+ ],
+ "digits": [
+ r"\b(\d+.\d+|\d+)",
+ ],
+ "booleans": [
+ r"\b(true)\b",
+ r"\b(false)\b",
+ ],
+ "structs": [
+ r"class(\s+[A-Za-z0-9_]*)",
+ ],
+ "functions": [
+ r"def\s+([a-z_][A-Za-z0-9_]*)",
+ ],
+ "symbols": [
+ r"(:[^,\)\.\s=]+)",
+ ],
+ "global": [
+ r"(\$[a-z_][A-Za-z0-9_]*)\s",
+ ]
+ }
+ ),
+ Language(
+ name: "Crystal", // Name of the language
+ icon: "\u{e7a3} ", // Icon for the language
+ extensions: ["cr"], // Extensions of the language
+ // Keywords of the language
+ keywords: [
+ "__ENCODING__", "__LINE__", "__FILE__", "BEGIN", "END",
+ "alias", "and", "begin", "break", "case", "class", "def",
+ "defined?", "do", "else", "elsif", "end", "ensure", "print",
+ "for", "if", "in", "module", "next", "nil", "not", "or", "puts",
+ "redo", "rescue", "retry", "return", "self", "super", "then",
+ "undef", "unless", "until", "when", "while", "yield", "raise",
+ "include", "extend", "Int32", "String", "getter", "setter",
+ "property",
+ ],
+ // Syntax definitions
+ definitions: {
+ "comments": [
+ "(?m)(#.*)$",
+ "(?ms)(=begin.*=end)",
+ ],
+ "strings": [
+ "(?ms)(\".*?\")",
+ "((?:f|r|)\".*?\")",
+ "(\'.*?\')",
+ ],
+ "digits": [
+ r"\b(\d+.\d+|\d+)",
+ ],
+ "booleans": [
+ r"\b(true)\b",
+ r"\b(false)\b",
+ ],
+ "structs": [
+ r"class(\s+[A-Za-z0-9_]*)",
+ ],
+ "functions": [
+ r"def\s+([a-z_][A-Za-z0-9_]*)",
+ ],
+ "symbols": [
+ r"(:[^,\}\)\.\s=]+)",
+ ],
+ "global": [
+ r"(\$[a-z_][A-Za-z0-9_]*)\s",
+ ]
+ }
+ ),
+ Language(
+ name: "Python", // Name of the language
+ icon: "\u{e73c} ", // Icon for the language
+ extensions: ["py", "pyw"], // Extensions of the language
+ // Keywords of the language
+ keywords: [
+ "and", "as", "assert", "break", "class", "continue",
+ "def", "del", "elif", "else", "except", "exec",
+ "finally", "for", "from", "global", "if", "import",
+ "in", "is", "lambda", "not", "or", "pass", "print",
+ "raise", "return", "try", "while", "with", "yield",
+ "str", "bool", "int", "tuple", "list", "dict", "tuple",
+ "len", "None", "input", "type", "set", "range", "enumerate",
+ "open", "iter", "min", "max", "dir", "self", "isinstance",
+ "help", "next", "super",
+ ],
+ // Syntax definitions
+ definitions: {
+ "comments": [
+ "(?m)(#.*)$",
+ ],
+ "strings": [
+ "(?ms)(\"\"\".*?\"\"\")",
+ "(?ms)(\'\'\'.*?\'\'\')",
+ "((?:f|r|)\".*?\")",
+ "(\'.*?\')",
+ ],
+ "digits": [
+ "\\b(\\d+.\\d+|\\d+)",
+ ],
+ "booleans": [
+ "\\b(True)\\b",
+ "\\b(False)\\b",
+ ],
+ "structs": [
+ "class\\s+([A-Za-z0-9_]*)",
+ ],
+ "functions": [
+ "def\\s+([a-z_][A-Za-z0-9_]*)",
+ ],
+ "attributes": [
+ "@.*$",
+ ]
+ }
+ ),
+ Language(
+ name: "Javascript", // Name of the language
+ icon: "\u{e74e} ", // Icon for the language
+ extensions: ["js"], // Extensions of the language
+ // Keywords of the language
+ keywords: [
+ "abstract", "arguments", "await", "boolean", "break", "byte",
+ "case", "catch", "char", "class", "const", "continue", "debugger",
+ "default", "delete", "do", "double", "else", "enum", "eval",
+ "export", "extends", "final", "finally", "float", "for", "of",
+ "function", "goto", "if", "implements", "import", "in", "instanceof",
+ "int", "interface", "let", "long", "native", "new", "null", "package",
+ "private", "protected", "public", "return", "short", "static",
+ "super", "switch", "synchronized", "this", "throw", "throws",
+ "transient", "try", "typeof", "var", "void", "volatile", "console",
+ "while", "with", "yield", "undefined", "NaN", "-Infinity", "Infinity",
+ ],
+ // Syntax definitions
+ definitions: {
+ "comments": [
+ "(?m)(//.*)$",
+ "(?ms)(/\\*.*\\*/)$",
+ ],
+ "strings": [
+ "(?ms)(\"\"\".*?\"\"\")",
+ "(?ms)(\'\'\'.*?\'\'\')",
+ "((?:f|r|)\".*?\")",
+ "(\'.*?\')",
+ ],
+ "digits": [
+ "\\b(\\d+.\\d+|\\d+)",
+ ],
+ "booleans": [
+ "\\b(true)\\b",
+ "\\b(false)\\b",
+ ],
+ "structs": [
+ "class\\s+([A-Za-z0-9_]*)",
+ ],
+ "functions": [
+ "function\\s+([a-z_][A-Za-z0-9_]*)",
+ "\\b([a-z_][A-Za-z0-9_]*)\\s*\\("
+ ],
+ }
+ ),
+ Language(
+ name: "C", // Name of the language
+ icon: "\u{e61e} ", // Icon for the language
+ extensions: ["c", "h"], // Extensions of the language
+ // Keywords of the language
+ keywords: [
+ "auto", "break", "case", "char", "const", "continue", "default",
+ "do", "double", "else", "enum", "extern", "float", "for", "goto",
+ "if", "int", "long", "register", "return", "short", "signed",
+ "sizeof", "static", "struct", "switch", "typedef", "union",
+ "unsigned", "void", "volatile", "while", "printf", "fscanf",
+ "scanf", "fputsf", "exit", "stderr", "malloc", "calloc", "bool",
+ "realloc", "free", "strlen", "size_t",
+ ],
+ // Syntax definitions
+ definitions: {
+ "comments": [
+ "(?m)(//.*)$",
+ "(?ms)(/\\*.*?\\*/)",
+ ],
+ "strings": [
+ "(\".*?\")",
+ ],
+ "characters": [
+ "('.')",
+ "('\\\\.')",
+ ],
+ "digits": [
+ "\\b(\\d+.\\d+|\\d+)",
+ "\\b(\\d+.\\d+(?:f|))",
+ ],
+ "booleans": [
+ "\\b(true)\\b",
+ "\\b(false)\\b",
+ ],
+ "functions": [
+ "(int|bool|void|char|double|long|short|size_t)\\s+([a-z_][A-Za-z0-9_]*)\\s*\\(",
+ ],
+ "structs": [
+ "struct\\s+([A-Za-z0-9_]*)\\s*",
+ ],
+ "attributes": [
+ "^\\s*(#.*?)\\s",
+ ],
+ "headers": [
+ "(<.*?>)",
+ ],
+ }
+ ),
+ ],
+)
"#;
diff --git a/src/document.rs b/src/document.rs
index a867d93..2bcae76 100644
--- a/src/document.rs
+++ b/src/document.rs
@@ -161,7 +161,7 @@ impl Document {
}
pub fn format(&self, template: &str) -> String {
// Form data from a template
- return template
+ template
.replace("%f", &self.name)
.replace("%F", &self.path)
.replace("%i", &self.icon)
@@ -183,7 +183,7 @@ impl Document {
.replace("%y", &format!("{}", self.cursor.y + self.offset.y))
.replace("%v", VERSION)
.replace("%d", if self.dirty { "[+]" } else { "" })
- .replace("%D", if self.dirty { "\u{fb12} " } else { "\u{f723} " });
+ .replace("%D", if self.dirty { "\u{fb12} " } else { "\u{f723} " })
}
pub fn move_cursor(&mut self, direction: Key, term: &Size) {
// Move the cursor around the editor
diff --git a/src/editor.rs b/src/editor.rs
index a7ff56f..67d3e9d 100644
--- a/src/editor.rs
+++ b/src/editor.rs
@@ -369,7 +369,7 @@ impl Editor {
Event::MoveWord(direction) => match direction {
Direction::Left => self.doc[self.tab].word_left(&self.term.size),
Direction::Right => self.doc[self.tab].word_right(&self.term.size),
- _ => return,
+ _ => {},
},
Event::GotoCursor(pos) => {
let rows = &self.doc[self.tab].rows;