Module: VER
- Defined in:
- lib/ver.rb,
lib/ver/font.rb,
lib/ver/help.rb,
lib/ver/text.rb,
lib/ver/undo.rb,
lib/ver/entry.rb,
lib/ver/event.rb,
lib/ver/plist.rb,
lib/ver/theme.rb,
lib/ver/action.rb,
lib/ver/buffer.rb,
lib/ver/keymap.rb,
lib/ver/status.rb,
lib/ver/struct.rb,
lib/ver/syntax.rb,
lib/ver/options.rb,
lib/ver/version.rb,
lib/ver/digraphs.rb,
lib/ver/executor.rb,
lib/ver/platform.rb,
lib/ver/register.rb,
lib/ver/text/end.rb,
lib/ver/text/tag.rb,
lib/ver/treeview.rb,
lib/ver/clipboard.rb,
lib/ver/text/mark.rb,
lib/ver/major_mode.rb,
lib/ver/minibuffer.rb,
lib/ver/minor_mode.rb,
lib/ver/text/index.rb,
lib/ver/text/range.rb,
lib/ver/status/mode.rb,
lib/ver/text/insert.rb,
lib/ver/buffer/frame.rb,
lib/ver/layout/paned.rb,
lib/ver/methods/help.rb,
lib/ver/methods/move.rb,
lib/ver/methods/nano.rb,
lib/ver/methods/open.rb,
lib/ver/methods/save.rb,
lib/ver/methods/undo.rb,
lib/ver/status/label.rb,
lib/ver/widget_event.rb,
lib/ver/executor/grep.rb,
lib/ver/executor/path.rb,
lib/ver/layout/tiling.rb,
lib/ver/methods/basic.rb,
lib/ver/methods/ctags.rb,
lib/ver/methods/macro.rb,
lib/ver/status/syntax.rb,
lib/ver/text/position.rb,
lib/ver/buffer/console.rb,
lib/ver/exception_view.rb,
lib/ver/executor/entry.rb,
lib/ver/executor/label.rb,
lib/ver/executor/theme.rb,
lib/ver/methods/delete.rb,
lib/ver/methods/insert.rb,
lib/ver/methods/layout.rb,
lib/ver/methods/search.rb,
lib/ver/mode_resolving.rb,
lib/ver/status/battery.rb,
lib/ver/status/percent.rb,
lib/ver/executor/buffer.rb,
lib/ver/executor/locate.rb,
lib/ver/executor/method.rb,
lib/ver/executor/syntax.rb,
lib/ver/layout/notebook.rb,
lib/ver/layout/toplevel.rb,
lib/ver/methods/control.rb,
lib/ver/methods/preview.rb,
lib/ver/methods/snippet.rb,
lib/ver/status/encoding.rb,
lib/ver/status/filename.rb,
lib/ver/status/position.rb,
lib/ver/syntax/detector.rb,
lib/ver/hover_completion.rb,
lib/ver/keymap/keymapped.rb,
lib/ver/methods/autofill.rb,
lib/ver/methods/bookmark.rb,
lib/ver/status/nano_help.rb,
lib/ver/status/separator.rb,
lib/ver/syntax/processor.rb,
lib/ver/executor/encoding.rb,
lib/ver/help/describe_key.rb,
lib/ver/methods/clipboard.rb,
lib/ver/methods/selection.rb,
lib/ver/widget_major_mode.rb,
lib/ver/help/help_for_help.rb,
lib/ver/methods/completion.rb,
lib/ver/vendor/levenshtein.rb,
lib/ver/text/selection/char.rb,
lib/ver/text/selection/line.rb,
lib/ver/layout/tiling/common.rb,
lib/ver/status/nano_position.rb,
lib/ver/vendor/binary_search.rb,
lib/ver/buffer/matching_brace.rb,
lib/ver/status/short_filename.rb,
lib/ver/vendor/eval_completer.rb,
lib/ver/layout/tiling/vertical.rb,
lib/ver/status/buffer_position.rb,
lib/ver/layout/tiling/horizontal.rb,
lib/ver/status/diakonos_position.rb,
lib/ver/executor/fuzzy_file_finder.rb,
lib/ver/methods/search_and_replace.rb,
lib/ver/buffer/markup_underline_link.rb,
lib/ver/buffer/invalid_trailing_whitespace.rb,
config/plugin/git.rb,
config/plugin/soma.rb,
config/plugin/animated_tiling.rb,
config/plugin/smart_autoindent.rb
Overview
Copyright © 2010 Michael Fellinger <[email protected]>
Description:
Shortcuts to use git within VER. This simply opens an urxvt console and embeds it into VER until you finish interacting with git.
Usage:
Put following line into your rc.rb
VER.plugin :git
Defined Under Namespace
Modules: Clipboard, EvalCompleter, Font, Help, Keymapped, Levenshtein, Methods, ModeResolving, Optioned, Platform, Plist, Undo Classes: Action, BinarySearch, Bookmarks, Buffer, Entry, Event, ExceptionView, Executor, Fallback, HoverCompletion, Keymap, MajorMode, MiniBuffer, MinorMode, NotebookLayout, Options, PanedLayout, Register, RegisterList, Snippet, Status, Struct, Syntax, Text, Theme, TilingLayout, ToplevelLayout, Treeview, WidgetEvent, WidgetMajorMode
Constant Summary collapse
- VERSION =
"2010.08"
- DIGRAPHS =
{ "SH" => "\x01", "SX" => "\x02", "EX" => "\x03", "ET" => "\x04", "EQ" => "\x05", "AK" => "\x06", "BL" => "\a", "BS" => "\b", "HT" => "\t", "LF" => "\n", "VT" => "\v", "FF" => "\f", "CR" => "\r", "SO" => "\x0E", "SI" => "\x0F", "DL" => "\x10", "D1" => "\x11", "D2" => "\x12", "D3" => "\x13", "D4" => "\x14", "NK" => "\x15", "SY" => "\x16", "EB" => "\x17", "CN" => "\x18", "EM" => "\x19", "SB" => "\x1A", "EC" => "\e", "FS" => "\x1C", "GS" => "\x1D", "RS" => "\x1E", "US" => "\x1F", "SP" => " ", "Nb" => "#", "DO" => "$", "At" => "@", "<(" => "[", "//" => "\\", ")>" => "]", "'>" => "^", "'!" => "`", "(!" => "{", "!!" => "|", "!)" => "}", "'?" => "~", "DT" => "\x7F", "PA" => "\xC2\x80", "HO" => "\xC2\x81", "BH" => "\xC2\x82", "NH" => "\xC2\x83", "IN" => "\xC2\x84", "NL" => " ", "SA" => "\xC2\x86", "ES" => "\xC2\x87", "HS" => "\xC2\x88", "HJ" => "\xC2\x89", "VS" => "\xC2\x8A", "PD" => "\xC2\x8B", "PU" => "\xC2\x8C", "RI" => "\xC2\x8D", "S2" => "\xC2\x8E", "S3" => "\xC2\x8F", "DC" => "\xC2\x90", "P1" => "\xC2\x91", "P2" => "\xC2\x92", "TS" => "\xC2\x93", "CC" => "\xC2\x94", "MW" => "\xC2\x95", "SG" => "\xC2\x96", "EG" => "\xC2\x97", "SS" => "\xC2\x98", "GC" => "\xC2\x99", "SC" => "\xC2\x9A", "CI" => "\xC2\x9B", "ST" => "\xC2\x9C", "OC" => "\xC2\x9D", "PM" => "\xC2\x9E", "AC" => "\xC2\x9F", "NS" => " ", "!I" => "¡", "Ct" => "¢", "Pd" => "£", "Cu" => "¤", "Ye" => "¥", "BB" => "¦", "SE" => "§", "':" => "¨", "Co" => "©", "-a" => "ª", "<<" => "«", "NO" => "¬", "--" => "", "Rg" => "®", "'m" => "¯", "DG" => "°", "+-" => "±", "2S" => "²", "3S" => "³", "'\\'" => "´", "My" => "µ", "PI" => "¶", ".M" => "·", "'," => "¸", "1S" => "¹", "-o" => "º", ">>" => "»", "14" => "¼", "12" => "½", "34" => "¾", "?I" => "¿", "A!" => "À", "A'" => "Á", "A>" => "Â", "A?" => "Ã", "A:" => "Ä", "AA" => "Å", "AE" => "Æ", "C," => "Ç", "E!" => "È", "E'" => "É", "E>" => "Ê", "E:" => "Ë", "I!" => "Ì", "I'" => "Í", "I>" => "Î", "I:" => "Ï", "D-" => "Ð", "N?" => "Ñ", "O!" => "Ò", "O'" => "Ó", "O>" => "Ô", "O?" => "Õ", "O:" => "Ö", "*X" => "×", "O/" => "Ø", "U!" => "Ù", "U'" => "Ú", "U>" => "Û", "U:" => "Ü", "Y'" => "Ý", "TH" => "Þ", "ss" => "ß", "a!" => "à", "a'" => "á", "a>" => "â", "a?" => "ã", "a:" => "ä", "aa" => "å", "ae" => "æ", "c," => "ç", "e!" => "è", "e'" => "é", "e>" => "ê", "e:" => "ë", "i!" => "ì", "i'" => "í", "i>" => "î", "i:" => "ï", "d-" => "ð", "n?" => "ñ", "o!" => "ò", "o'" => "ó", "o>" => "ô", "o?" => "õ", "o:" => "ö", "-:" => "÷", "o/" => "ø", "u!" => "ù", "u'" => "ú", "u>" => "û", "u:" => "ü", "y'" => "ý", "th" => "þ", "y:" => "ÿ", "A-" => "Ā", "a-" => "ā", "A(" => "Ă", "a(" => "ă", "A;" => "Ą", "a;" => "ą", "C'" => "Ć", "c'" => "ć", "C>" => "Ĉ", "c>" => "ĉ", "C." => "Ċ", "c." => "ċ", "C<" => "Č", "c<" => "č", "D<" => "Ď", "d<" => "ď", "D/" => "Đ", "d/" => "đ", "E-" => "Ē", "e-" => "ē", "E(" => "Ĕ", "e(" => "ĕ", "E." => "Ė", "e." => "ė", "E;" => "Ę", "e;" => "ę", "E<" => "Ě", "e<" => "ě", "G>" => "Ĝ", "g>" => "ĝ", "G(" => "Ğ", "g(" => "ğ", "G." => "Ġ", "g." => "ġ", "G," => "Ģ", "g," => "ģ", "H>" => "Ĥ", "h>" => "ĥ", "H/" => "Ħ", "h/" => "ħ", "I?" => "Ĩ", "i?" => "ĩ", "I-" => "Ī", "i-" => "ī", "I(" => "Ĭ", "i(" => "ĭ", "I;" => "Į", "i;" => "į", "I." => "İ", "i." => "ı", "IJ" => "IJ", "ij" => "ij", "J>" => "Ĵ", "j>" => "ĵ", "K," => "Ķ", "k," => "ķ", "kk" => "ĸ", "L'" => "Ĺ", "l'" => "ĺ", "L," => "Ļ", "l," => "ļ", "L<" => "Ľ", "l<" => "ľ", "L." => "Ŀ", "l." => "ŀ", "L/" => "Ł", "l/" => "ł", "N'" => "Ń", "n'" => "ń", "N," => "Ņ", "n," => "ņ", "N<" => "Ň", "n<" => "ň", "'n" => "ʼn", "NG" => "Ŋ", "ng" => "ŋ", "O-" => "Ō", "o-" => "ō", "O(" => "Ŏ", "o(" => "ŏ", "O\"" => "Ő", "o\"" => "ő", "OE" => "Œ", "oe" => "œ", "R'" => "Ŕ", "r'" => "ŕ", "R," => "Ŗ", "r," => "ŗ", "R<" => "Ř", "r<" => "ř", "S'" => "Ś", "s'" => "ś", "S>" => "Ŝ", "s>" => "ŝ", "S," => "Ş", "s," => "ş", "S<" => "Š", "s<" => "š", "T," => "Ţ", "t," => "ţ", "T<" => "Ť", "t<" => "ť", "T/" => "Ŧ", "t/" => "ŧ", "U?" => "Ũ", "u?" => "ũ", "U-" => "Ū", "u-" => "ū", "U(" => "Ŭ", "u(" => "ŭ", "U0" => "Ů", "u0" => "ů", "U\"" => "Ű", "u\"" => "ű", "U;" => "Ų", "u;" => "ų", "W>" => "Ŵ", "w>" => "ŵ", "Y>" => "Ŷ", "y>" => "ŷ", "Y:" => "Ÿ", "Z'" => "Ź", "z'" => "ź", "Z." => "Ż", "z." => "ż", "Z<" => "Ž", "z<" => "ž", "O9" => "Ơ", "o9" => "ơ", "OI" => "Ƣ", "oi" => "ƣ", "yr" => "Ʀ", "U9" => "Ư", "u9" => "ư", "Z/" => "Ƶ", "z/" => "ƶ", "ED" => "Ʒ", "A<" => "Ǎ", "a<" => "ǎ", "I<" => "Ǐ", "i<" => "ǐ", "O<" => "Ǒ", "o<" => "ǒ", "U<" => "Ǔ", "u<" => "ǔ", "A1" => "Ǟ", "a1" => "ǟ", "A7" => "Ǡ", "a7" => "ǡ", "A3" => "Ǣ", "a3" => "ǣ", "G/" => "Ǥ", "g/" => "ǥ", "G<" => "Ǧ", "g<" => "ǧ", "K<" => "Ǩ", "k<" => "ǩ", "O;" => "Ǫ", "o;" => "ǫ", "O1" => "Ǭ", "o1" => "ǭ", "EZ" => "Ǯ", "ez" => "ǯ", "j<" => "ǰ", "G'" => "Ǵ", "g'" => "ǵ", ";S" => "ʿ", "'<" => "ˇ", "'(" => "˘", "'." => "˙", "'0" => "˚", "';" => "˛", "'\"" => "˝", "A%" => "Ά", "E%" => "Έ", "Y%" => "Ή", "I%" => "Ί", "O%" => "Ό", "U%" => "Ύ", "W%" => "Ώ", "i3" => "ΐ", "A*" => "Α", "B*" => "Β", "G*" => "Γ", "D*" => "Δ", "E*" => "Ε", "Z*" => "Ζ", "Y*" => "Η", "H*" => "Θ", "I*" => "Ι", "K*" => "Κ", "L*" => "Λ", "M*" => "Μ", "N*" => "Ν", "C*" => "Ξ", "O*" => "Ο", "P*" => "Π", "R*" => "Ρ", "S*" => "Σ", "T*" => "Τ", "U*" => "Υ", "F*" => "Φ", "X*" => "Χ", "Q*" => "Ψ", "W*" => "Ω", "J*" => "Ϊ", "V*" => "Ϋ", "a%" => "ά", "e%" => "έ", "y%" => "ή", "i%" => "ί", "u3" => "ΰ", "a*" => "α", "b*" => "β", "g*" => "γ", "d*" => "δ", "e*" => "ε", "z*" => "ζ", "y*" => "η", "h*" => "θ", "i*" => "ι", "k*" => "κ", "l*" => "λ", "m*" => "μ", "n*" => "ν", "c*" => "ξ", "o*" => "ο", "p*" => "π", "r*" => "ρ", "*s" => "ς", "s*" => "σ", "t*" => "τ", "u*" => "υ", "f*" => "φ", "x*" => "χ", "q*" => "ψ", "w*" => "ω", "j*" => "ϊ", "v*" => "ϋ", "o%" => "ό", "u%" => "ύ", "w%" => "ώ", "'G" => "Ϙ", ",G" => "ϙ", "T3" => "Ϛ", "t3" => "ϛ", "M3" => "Ϝ", "m3" => "ϝ", "K3" => "Ϟ", "k3" => "ϟ", "P3" => "Ϡ", "p3" => "ϡ", "'%" => "ϴ", "j3" => "ϵ", "IO" => "Ё", "D%" => "Ђ", "G%" => "Ѓ", "IE" => "Є", "DS" => "Ѕ", "II" => "І", "YI" => "Ї", "J%" => "Ј", "LJ" => "Љ", "NJ" => "Њ", "Ts" => "Ћ", "KJ" => "Ќ", "V%" => "Ў", "DZ" => "Џ", "A=" => "А", "B=" => "Б", "V=" => "В", "G=" => "Г", "D=" => "Д", "E=" => "Е", "Z%" => "Ж", "Z=" => "З", "I=" => "И", "J=" => "Й", "K=" => "К", "L=" => "Л", "M=" => "М", "N=" => "Н", "O=" => "О", "P=" => "П", "R=" => "Р", "S=" => "С", "T=" => "Т", "U=" => "У", "F=" => "Ф", "H=" => "Х", "C=" => "Ц", "C%" => "Ч", "S%" => "Ш", "Sc" => "Щ", "=\"" => "Ъ", "Y=" => "Ы", "%\"" => "Ь", "JE" => "Э", "JU" => "Ю", "JA" => "Я", "a=" => "а", "b=" => "б", "v=" => "в", "g=" => "г", "d=" => "д", "e=" => "е", "z%" => "ж", "z=" => "з", "i=" => "и", "j=" => "й", "k=" => "к", "l=" => "л", "m=" => "м", "n=" => "н", "o=" => "о", "p=" => "п", "r=" => "р", "s=" => "с", "t=" => "т", "u=" => "у", "f=" => "ф", "h=" => "х", "c=" => "ц", "c%" => "ч", "s%" => "ш", "sc" => "щ", "='" => "ъ", "y=" => "ы", "%'" => "ь", "je" => "э", "ju" => "ю", "ja" => "я", "io" => "ё", "d%" => "ђ", "g%" => "ѓ", "ie" => "є", "ds" => "ѕ", "ii" => "і", "yi" => "ї", "j%" => "ј", "lj" => "љ", "nj" => "њ", "ts" => "ћ", "kj" => "ќ", "v%" => "ў", "dz" => "џ", "Y3" => "Ѣ", "y3" => "ѣ", "O3" => "Ѫ", "o3" => "ѫ", "F3" => "Ѳ", "f3" => "ѳ", "V3" => "Ѵ", "v3" => "ѵ", "C3" => "Ҁ", "c3" => "ҁ", "G3" => "Ґ", "g3" => "ґ", "A+" => "א", "B+" => "ב", "G+" => "ג", "D+" => "ד", "H+" => "ה", "W+" => "ו", "Z+" => "ז", "X+" => "ח", "Tj" => "ט", "J+" => "י", "K%" => "ך", "K+" => "כ", "L+" => "ל", "M%" => "ם", "M+" => "מ", "N%" => "ן", "N+" => "נ", "S+" => "ס", "E+" => "ע", "P%" => "ף", "P+" => "פ", "Zj" => "ץ", "ZJ" => "צ", "Q+" => "ק", "R+" => "ר", "Sh" => "ש", "T+" => "ת", ",+" => "،", ";+" => "؛", "?+" => "؟", "H'" => "ء", "aM" => "آ", "aH" => "أ", "wH" => "ؤ", "ah" => "إ", "yH" => "ئ", "a+" => "ا", "b+" => "ب", "tm" => "ة", "t+" => "ت", "tk" => "ث", "g+" => "ج", "hk" => "ح", "x+" => "خ", "d+" => "د", "dk" => "ذ", "r+" => "ر", "z+" => "ز", "s+" => "س", "sn" => "ش", "c+" => "ص", "dd" => "ض", "tj" => "ط", "zH" => "ظ", "e+" => "ع", "i+" => "غ", "++" => "ـ", "f+" => "ف", "q+" => "ق", "k+" => "ك", "l+" => "ل", "m+" => "م", "n+" => "ن", "h+" => "ه", "w+" => "و", "j+" => "ى", "y+" => "ي", ":+" => "ً", "\"+" => "ٌ", "=+" => "ٍ", "/+" => "َ", "'+" => "ُ", "1+" => "ِ", "3+" => "ّ", "0+" => "ْ", "aS" => "ٰ", "p+" => "پ", "v+" => "ڤ", "gf" => "گ", "0a" => "۰", "1a" => "۱", "2a" => "۲", "3a" => "۳", "4a" => "۴", "5a" => "۵", "6a" => "۶", "7a" => "۷", "8a" => "۸", "9a" => "۹", "B." => "Ḃ", "b." => "ḃ", "B_" => "Ḇ", "b_" => "ḇ", "D." => "Ḋ", "d." => "ḋ", "D_" => "Ḏ", "d_" => "ḏ", "D," => "Ḑ", "d," => "ḑ", "F." => "Ḟ", "f." => "ḟ", "G-" => "Ḡ", "g-" => "ḡ", "H." => "Ḣ", "h." => "ḣ", "H:" => "Ḧ", "h:" => "ḧ", "H," => "Ḩ", "h," => "ḩ", "K'" => "Ḱ", "k'" => "ḱ", "K_" => "Ḵ", "k_" => "ḵ", "L_" => "Ḻ", "l_" => "ḻ", "M'" => "Ḿ", "m'" => "ḿ", "M." => "Ṁ", "m." => "ṁ", "N." => "Ṅ", "n." => "ṅ", "N_" => "Ṉ", "n_" => "ṉ", "P'" => "Ṕ", "p'" => "ṕ", "P." => "Ṗ", "p." => "ṗ", "R." => "Ṙ", "r." => "ṙ", "R_" => "Ṟ", "r_" => "ṟ", "S." => "Ṡ", "s." => "ṡ", "T." => "Ṫ", "t." => "ṫ", "T_" => "Ṯ", "t_" => "ṯ", "V?" => "Ṽ", "v?" => "ṽ", "W!" => "Ẁ", "w!" => "ẁ", "W'" => "Ẃ", "w'" => "ẃ", "W:" => "Ẅ", "w:" => "ẅ", "W." => "Ẇ", "w." => "ẇ", "X." => "Ẋ", "x." => "ẋ", "X:" => "Ẍ", "x:" => "ẍ", "Y." => "Ẏ", "y." => "ẏ", "Z>" => "Ẑ", "z>" => "ẑ", "Z_" => "Ẕ", "z_" => "ẕ", "h_" => "ẖ", "t:" => "ẗ", "w0" => "ẘ", "y0" => "ẙ", "A2" => "Ả", "a2" => "ả", "E2" => "Ẻ", "e2" => "ẻ", "E?" => "Ẽ", "e?" => "ẽ", "I2" => "Ỉ", "i2" => "ỉ", "O2" => "Ỏ", "o2" => "ỏ", "U2" => "Ủ", "u2" => "ủ", "Y!" => "Ỳ", "y!" => "ỳ", "Y2" => "Ỷ", "y2" => "ỷ", "Y?" => "Ỹ", "y?" => "ỹ", ";'" => "ἀ", ",'" => "ἁ", ";!" => "ἂ", ",!" => "ἃ", "?;" => "ἄ", "?," => "ἅ", "!:" => "ἆ", "?:" => "ἇ", "1N" => " ", "1M" => " ", "3M" => " ", "4M" => " ", "6M" => " ", "1T" => " ", "1H" => " ", "-1" => "‐", "-N" => "–", "-M" => "—", "-3" => "―", "!2" => "‖", "=2" => "‗", "'6" => "‘", "'9" => "’", ".9" => "‚", "9'" => "‛", "\"6" => "“", "\"9" => "”", ":9" => "„", "9\"" => "‟", "/-" => "†", "/=" => "‡", ".." => "‥", "%0" => "‰", "1'" => "′", "2'" => "″", "3'" => "‴", "1\"" => "‵", "2\"" => "‶", "3\"" => "‷", "Ca" => "‸", "<1" => "‹", ">1" => "›", ":X" => "※", "'-" => "‾", "/f" => "⁄", "0S" => "⁰", "4S" => "⁴", "5S" => "⁵", "6S" => "⁶", "7S" => "⁷", "8S" => "⁸", "9S" => "⁹", "+S" => "⁺", "-S" => "⁻", "=S" => "⁼", "(S" => "⁽", ")S" => "⁾", "nS" => "ⁿ", "0s" => "₀", "1s" => "₁", "2s" => "₂", "3s" => "₃", "4s" => "₄", "5s" => "₅", "6s" => "₆", "7s" => "₇", "8s" => "₈", "9s" => "₉", "+s" => "₊", "-s" => "₋", "=s" => "₌", "(s" => "₍", ")s" => "₎", "Li" => "₤", "Pt" => "₧", "W=" => "₩", "oC" => "℃", "co" => "℅", "oF" => "℉", "N0" => "№", "PO" => "℗", "Rx" => "℞", "SM" => "℠", "TM" => "™", "Om" => "Ω", "AO" => "Å", "13" => "⅓", "23" => "⅔", "15" => "⅕", "25" => "⅖", "35" => "⅗", "45" => "⅘", "16" => "⅙", "56" => "⅚", "18" => "⅛", "38" => "⅜", "58" => "⅝", "78" => "⅞", "1R" => "Ⅰ", "2R" => "Ⅱ", "3R" => "Ⅲ", "4R" => "Ⅳ", "5R" => "Ⅴ", "6R" => "Ⅵ", "7R" => "Ⅶ", "8R" => "Ⅷ", "9R" => "Ⅸ", "aR" => "Ⅹ", "bR" => "Ⅺ", "cR" => "Ⅻ", "1r" => "ⅰ", "2r" => "ⅱ", "3r" => "ⅲ", "4r" => "ⅳ", "5r" => "ⅴ", "6r" => "ⅵ", "7r" => "ⅶ", "8r" => "ⅷ", "9r" => "ⅸ", "ar" => "ⅹ", "br" => "ⅺ", "cr" => "ⅻ", "<-" => "←", "-!" => "↑", "->" => "→", "-v" => "↓", "<>" => "↔", "UD" => "↕", "<=" => "⇐", "=>" => "⇒", "==" => "⇔", "FA" => "∀", "dP" => "∂", "TE" => "∃", "/0" => "∅", "DE" => "∆", "NB" => "∇", "(-" => "∈", "-)" => "∋", "*P" => "∏", "+Z" => "∑", "-2" => "−", "-+" => "∓", "*-" => "∗", "Ob" => "∘", "Sb" => "∙", "RT" => "√", "0(" => "∝", "00" => "∞", "-L" => "∟", "-V" => "∠", "PP" => "∥", "AN" => "∧", "OR" => "∨", "(U" => "∩", ")U" => "∪", "In" => "∫", "DI" => "∬", "Io" => "∮", ".:" => "∴", ":." => "∵", ":R" => "∶", "::" => "∷", "?1" => "∼", "CG" => "∾", "?-" => "≃", "?=" => "≅", "?2" => "≈", "=?" => "≌", "HI" => "≓", "!=" => "≠", "=3" => "≡", "=<" => "≤", ">=" => "≥", "<*" => "≪", "*>" => "≫", "!<" => "≮", "!>" => "≯", "(C" => "⊂", ")C" => "⊃", "(_" => "⊆", ")_" => "⊇", "0." => "⊙", "02" => "⊚", "-T" => "⊥", ".P" => "⋅", ":3" => "⋮", ".3" => "⋯", "Eh" => "⌂", "<7" => "⌈", ">7" => "⌉", "7<" => "⌊", "7>" => "⌋", "NI" => "⌐", "(A" => "⌒", "TR" => "⌕", "Iu" => "⌠", "Il" => "⌡", "</" => "〈", "/>" => "〉", "Vs" => "␣", "1h" => "⑀", "3h" => "⑁", "2h" => "⑂", "4h" => "⑃", "1j" => "⑆", "2j" => "⑇", "3j" => "⑈", "4j" => "⑉", "1." => "⒈", "2." => "⒉", "3." => "⒊", "4." => "⒋", "5." => "⒌", "6." => "⒍", "7." => "⒎", "8." => "⒏", "9." => "⒐", "hh" => "─", "HH" => "━", "vv" => "│", "VV" => "┃", "3-" => "┄", "3_" => "┅", "3!" => "┆", "3/" => "┇", "4-" => "┈", "4_" => "┉", "4!" => "┊", "4/" => "┋", "dr" => "┌", "dR" => "┍", "Dr" => "┎", "DR" => "┏", "dl" => "┐", "dL" => "┑", "Dl" => "┒", "LD" => "┓", "ur" => "└", "uR" => "┕", "Ur" => "┖", "UR" => "┗", "ul" => "┘", "uL" => "┙", "Ul" => "┚", "UL" => "┛", "vr" => "├", "vR" => "┝", "Vr" => "┠", "VR" => "┣", "vl" => "┤", "vL" => "┥", "Vl" => "┨", "VL" => "┫", "dh" => "┬", "dH" => "┯", "Dh" => "┰", "DH" => "┳", "uh" => "┴", "uH" => "┷", "Uh" => "┸", "UH" => "┻", "vh" => "┼", "vH" => "┿", "Vh" => "╂", "VH" => "╋", "FD" => "╱", "BD" => "╲", "TB" => "▀", "LB" => "▄", "FB" => "█", "lB" => "▌", "RB" => "▐", ".S" => "░", ":S" => "▒", "?S" => "▓", "fS" => "■", "OS" => "□", "RO" => "▢", "Rr" => "▣", "RF" => "▤", "RY" => "▥", "RH" => "▦", "RZ" => "▧", "RK" => "▨", "RX" => "▩", "sB" => "▪", "SR" => "▬", "Or" => "▭", "UT" => "▲", "uT" => "△", "PR" => "▶", "Tr" => "▷", "Dt" => "▼", "dT" => "▽", "PL" => "◀", "Tl" => "◁", "Db" => "◆", "Dw" => "◇", "LZ" => "◊", "0m" => "○", "0o" => "◎", "0M" => "●", "0L" => "◐", "0R" => "◑", "Sn" => "◘", "Ic" => "◙", "Fd" => "◢", "Bd" => "◣", "*2" => "★", "*1" => "☆", "<H" => "☜", ">H" => "☞", "0u" => "☺", "0U" => "☻", "SU" => "☼", "Fm" => "♀", "Ml" => "♂", "cS" => "♠", "cH" => "♡", "cD" => "♢", "cC" => "♣", "Md" => "♩", "M8" => "♪", "M2" => "♫", "Mb" => "♭", "Mx" => "♮", "MX" => "♯", "OK" => "✓", "XX" => "✗", "-X" => "✠", "IS" => " ", ",_" => "、", "._" => "。", "+\"" => "〃", "+_" => "〄", "*_" => "々", ";_" => "〆", "0_" => "〇", "<+" => "《", ">+" => "》", "<'" => "「", ">'" => "」", "<\"" => "『", ">\"" => "』", "(\"" => "【", ")\"" => "】", "=T" => "〒", "=_" => "〓", "('" => "〔", ")'" => "〕", "(I" => "〖", ")I" => "〗", "-?" => "〜", "A5" => "ぁ", "a5" => "あ", "I5" => "ぃ", "i5" => "い", "U5" => "ぅ", "u5" => "う", "E5" => "ぇ", "e5" => "え", "O5" => "ぉ", "o5" => "お", "ka" => "か", "ga" => "が", "ki" => "き", "gi" => "ぎ", "ku" => "く", "gu" => "ぐ", "ke" => "け", "ge" => "げ", "ko" => "こ", "go" => "ご", "sa" => "さ", "za" => "ざ", "si" => "し", "zi" => "じ", "su" => "す", "zu" => "ず", "se" => "せ", "ze" => "ぜ", "so" => "そ", "zo" => "ぞ", "ta" => "た", "da" => "だ", "ti" => "ち", "di" => "ぢ", "tU" => "っ", "tu" => "つ", "du" => "づ", "te" => "て", "de" => "で", "to" => "と", "do" => "ど", "na" => "な", "ni" => "に", "nu" => "ぬ", "ne" => "ね", "no" => "の", "ha" => "は", "ba" => "ば", "pa" => "ぱ", "hi" => "ひ", "bi" => "び", "pi" => "ぴ", "hu" => "ふ", "bu" => "ぶ", "pu" => "ぷ", "he" => "へ", "be" => "べ", "pe" => "ぺ", "ho" => "ほ", "bo" => "ぼ", "po" => "ぽ", "ma" => "ま", "mi" => "み", "mu" => "む", "me" => "め", "mo" => "も", "yA" => "ゃ", "ya" => "や", "yU" => "ゅ", "yu" => "ゆ", "yO" => "ょ", "yo" => "よ", "ra" => "ら", "ri" => "り", "ru" => "る", "re" => "れ", "ro" => "ろ", "wA" => "ゎ", "wa" => "わ", "wi" => "ゐ", "we" => "ゑ", "wo" => "を", "n5" => "ん", "vu" => "ゔ", "\"5" => "゛", "05" => "゜", "*5" => "ゝ", "+5" => "ゞ", "a6" => "ァ", "A6" => "ア", "i6" => "ィ", "I6" => "イ", "u6" => "ゥ", "U6" => "ウ", "e6" => "ェ", "E6" => "エ", "o6" => "ォ", "O6" => "オ", "Ka" => "カ", "Ga" => "ガ", "Ki" => "キ", "Gi" => "ギ", "Ku" => "ク", "Gu" => "グ", "Ke" => "ケ", "Ge" => "ゲ", "Ko" => "コ", "Go" => "ゴ", "Sa" => "サ", "Za" => "ザ", "Si" => "シ", "Zi" => "ジ", "Su" => "ス", "Zu" => "ズ", "Se" => "セ", "Ze" => "ゼ", "So" => "ソ", "Zo" => "ゾ", "Ta" => "タ", "Da" => "ダ", "Ti" => "チ", "Di" => "ヂ", "TU" => "ッ", "Tu" => "ツ", "Du" => "ヅ", "Te" => "テ", "De" => "デ", "To" => "ト", "Do" => "ド", "Na" => "ナ", "Ni" => "ニ", "Nu" => "ヌ", "Ne" => "ネ", "No" => "ノ", "Ha" => "ハ", "Ba" => "バ", "Pa" => "パ", "Hi" => "ヒ", "Bi" => "ビ", "Pi" => "ピ", "Hu" => "フ", "Bu" => "ブ", "Pu" => "プ", "He" => "ヘ", "Be" => "ベ", "Pe" => "ペ", "Ho" => "ホ", "Bo" => "ボ", "Po" => "ポ", "Ma" => "マ", "Mi" => "ミ", "Mu" => "ム", "Me" => "メ", "Mo" => "モ", "YA" => "ャ", "Ya" => "ヤ", "YU" => "ュ", "Yu" => "ユ", "YO" => "ョ", "Yo" => "ヨ", "Ra" => "ラ", "Ri" => "リ", "Ru" => "ル", "Re" => "レ", "Ro" => "ロ", "WA" => "ヮ", "Wa" => "ワ", "Wi" => "ヰ", "We" => "ヱ", "Wo" => "ヲ", "N6" => "ン", "Vu" => "ヴ", "KA" => "ヵ", "KE" => "ヶ", "Va" => "ヷ", "Vi" => "ヸ", "Ve" => "ヹ", "Vo" => "ヺ", ".6" => "・", "-6" => "ー", "*6" => "ヽ", "+6" => "ヾ", "b4" => "ㄅ", "p4" => "ㄆ", "m4" => "ㄇ", "f4" => "ㄈ", "d4" => "ㄉ", "t4" => "ㄊ", "n4" => "ㄋ", "l4" => "ㄌ", "g4" => "ㄍ", "k4" => "ㄎ", "h4" => "ㄏ", "j4" => "ㄐ", "q4" => "ㄑ", "x4" => "ㄒ", "zh" => "ㄓ", "ch" => "ㄔ", "sh" => "ㄕ", "r4" => "ㄖ", "z4" => "ㄗ", "c4" => "ㄘ", "s4" => "ㄙ", "a4" => "ㄚ", "o4" => "ㄛ", "e4" => "ㄜ", "ai" => "ㄞ", "ei" => "ㄟ", "au" => "ㄠ", "ou" => "ㄡ", "an" => "ㄢ", "en" => "ㄣ", "aN" => "ㄤ", "eN" => "ㄥ", "er" => "ㄦ", "i4" => "ㄧ", "u4" => "ㄨ", "iu" => "ㄩ", "v4" => "ㄪ", "nG" => "ㄫ", "gn" => "ㄬ", "1c" => "㈠", "2c" => "㈡", "3c" => "㈢", "4c" => "㈣", "5c" => "㈤", "6c" => "㈥", "7c" => "㈦", "8c" => "㈧", "9c" => "㈨", " " => "", "/c" => "", "UA" => "", "UB" => "", "\"3" => "", "\"1" => "", "\"!" => "", "\"'" => "", "\">" => "", "\"?" => "", "\"-" => "", "\"(" => "", "\"." => "", "\":" => "", "\"0" => "", "\"\"" => "", "\"<" => "", "\"," => "", "\";" => "", "\"_" => "", "\"=" => "", "\"/" => "", "\"i" => "", "\"d" => "", "\"p" => "", ";;" => "", ",," => "", "b3" => "", "Ci" => "", "f(" => "", "ed" => "", "am" => "", "pm" => "", "Fl" => "", "GF" => "", ">V" => "", "!*" => "", "?*" => "", "J<" => "", "ff" => "ff", "fi" => "fi", "fl" => "fl", "ft" => "ſt", "st" => "st", }
Class Attribute Summary collapse
-
.bookmarks ⇒ Object
readonly
Returns the value of attribute bookmarks.
-
.buffers ⇒ Object
readonly
Returns the value of attribute buffers.
-
.ctag_stack ⇒ Object
readonly
Returns the value of attribute ctag_stack.
-
.keymap ⇒ Object
readonly
Returns the value of attribute keymap.
-
.layout ⇒ Object
readonly
Returns the value of attribute layout.
-
.layout_class ⇒ Object
Returns the value of attribute layout_class.
-
.log ⇒ Object
Returns the value of attribute log.
-
.minibuf ⇒ Object
readonly
Returns the value of attribute minibuf.
-
.options ⇒ Object
readonly
Returns the value of attribute options.
-
.paths ⇒ Object
readonly
Returns the value of attribute paths.
-
.root ⇒ Object
readonly
Returns the value of attribute root.
-
.status ⇒ Object
readonly
Returns the value of attribute status.
-
.style_name_pools ⇒ Object
readonly
Returns the value of attribute style_name_pools.
-
.style_name_register ⇒ Object
readonly
Returns the value of attribute style_name_register.
Class Method Summary collapse
- .cancel_block(block) ⇒ Object
-
.debug(*args) ⇒ Object
low-level information for developers.
- .defer ⇒ Object
- .dump_options ⇒ Object
- .emergency_bindings ⇒ Object
-
.error(*args) ⇒ Object
a handleable error condition.
- .exit ⇒ Object
-
.fatal(*args) ⇒ Object
an unhandleable error that results in a program crash.
- .find_in_loadpath(basename) ⇒ Object
- .find_or_create_buffer(file, line = nil, column = nil, &block) ⇒ Object
- .first_startup ⇒ Object
- .inactive ⇒ Object
-
.info(*args) ⇒ Object
generic (useful) information about system operation.
- .load(name) ⇒ Object
- .load_all_plugins ⇒ Object
- .load_plugin(name) ⇒ Object
- .load_plugins ⇒ Object
- .loadpath ⇒ Object
- .major_mode(name, &block) ⇒ Object
- .message(*args) ⇒ Object
- .minor_mode(name, &block) ⇒ Object
- .obtain_style_name(widget_name, widget_class) ⇒ Object
- .open_argv ⇒ Object
- .open_session ⇒ Object
- .open_welcome ⇒ Object
- .opened_file(text) ⇒ Object
- .plugin(name) ⇒ Object
- .return_style_name(style_name) ⇒ Object
- .run(given_options = {}, &block) ⇒ Object
- .run_core ⇒ Object
- .run_em(&block) ⇒ Object
- .run_maybe_forking(&block) ⇒ Object
- .run_noem(&block) ⇒ Object
- .run_startup(given_options) ⇒ Object
- .run_startup_hooks ⇒ Object
- .sanitize_options ⇒ Object
- .setup_layout ⇒ Object
- .setup_tk ⇒ Object
- .setup_widgets ⇒ Object
- .startup_hook(&block) ⇒ Object
-
.store_session ⇒ Object
FIXME: there are no buffers anymore when this is called.
- .touch ⇒ Object
-
.warn(*args) ⇒ Object
a warning.
- .when_inactive_for(ms, repetitions = 1) ⇒ Object
Class Attribute Details
.bookmarks ⇒ Object (readonly)
Returns the value of attribute bookmarks.
88 89 90 |
# File 'lib/ver.rb', line 88 def bookmarks @bookmarks end |
.buffers ⇒ Object (readonly)
Returns the value of attribute buffers.
88 89 90 |
# File 'lib/ver.rb', line 88 def buffers @buffers end |
.ctag_stack ⇒ Object (readonly)
Returns the value of attribute ctag_stack.
88 89 90 |
# File 'lib/ver.rb', line 88 def ctag_stack @ctag_stack end |
.keymap ⇒ Object (readonly)
Returns the value of attribute keymap.
88 89 90 |
# File 'lib/ver.rb', line 88 def keymap @keymap end |
.layout ⇒ Object (readonly)
Returns the value of attribute layout.
88 89 90 |
# File 'lib/ver.rb', line 88 def layout @layout end |
.layout_class ⇒ Object
Returns the value of attribute layout_class.
91 92 93 |
# File 'lib/ver.rb', line 91 def layout_class @layout_class end |
.log ⇒ Object
Returns the value of attribute log.
91 92 93 |
# File 'lib/ver.rb', line 91 def log @log end |
.minibuf ⇒ Object (readonly)
Returns the value of attribute minibuf.
88 89 90 |
# File 'lib/ver.rb', line 88 def minibuf @minibuf end |
.options ⇒ Object (readonly)
Returns the value of attribute options.
88 89 90 |
# File 'lib/ver.rb', line 88 def @options end |
.paths ⇒ Object (readonly)
Returns the value of attribute paths.
88 89 90 |
# File 'lib/ver.rb', line 88 def paths @paths end |
.root ⇒ Object (readonly)
Returns the value of attribute root.
88 89 90 |
# File 'lib/ver.rb', line 88 def root @root end |
.status ⇒ Object (readonly)
Returns the value of attribute status.
88 89 90 |
# File 'lib/ver.rb', line 88 def status @status end |
.style_name_pools ⇒ Object (readonly)
Returns the value of attribute style_name_pools.
88 89 90 |
# File 'lib/ver.rb', line 88 def style_name_pools @style_name_pools end |
.style_name_register ⇒ Object (readonly)
Returns the value of attribute style_name_register.
88 89 90 |
# File 'lib/ver.rb', line 88 def style_name_register @style_name_register end |
Class Method Details
.cancel_block(block) ⇒ Object
274 275 276 |
# File 'lib/ver.rb', line 274 def cancel_block(block) @cancel_blocks[block] = true end |
.debug(*args) ⇒ Object
low-level information for developers
560 561 562 563 |
# File 'lib/ver.rb', line 560 def debug(*args) log.debug(*args) p(*args) end |
.defer ⇒ Object
264 265 266 267 268 269 270 271 272 |
# File 'lib/ver.rb', line 264 def defer Tk::After.idle do begin yield rescue Exception => ex error(ex) end end end |
.dump_options ⇒ Object
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
# File 'lib/ver.rb', line 538 def out = [] .each_pair do |key, value| out << [key, case value when Tk::Font "VER::Font[%p]" % [value.actual_hash] when Pathname value.to_s else value end ] end out.each do |pair| puts("VER.options.%s = %p" % pair) end end |
.emergency_bindings ⇒ Object
498 499 500 |
# File 'lib/ver.rb', line 498 def emergency_bindings Tk::Bind.bind(:all, .emergency_exit){ exit } end |
.error(*args) ⇒ Object
a handleable error condition
578 579 580 581 582 583 584 585 586 587 588 589 590 591 |
# File 'lib/ver.rb', line 578 def error(*args) log.error(*args) if args.size == 1 arg = args.first case arg when Exception puts "#{arg.class}: #{arg}", *arg.backtrace else p(:error, *args) end else p(:error, *args) end end |
.exit ⇒ Object
386 387 388 389 390 391 392 |
# File 'lib/ver.rb', line 386 def exit store_session @cancel_blocks.keys.each{|key| @cancel_blocks[key] = true } Tk.exit EM.stop rescue nil Kernel.exit end |
.fatal(*args) ⇒ Object
an unhandleable error that results in a program crash
594 595 596 597 |
# File 'lib/ver.rb', line 594 def fatal(*args) log.fatal(*args) p(:fatal, *args) end |
.find_in_loadpath(basename) ⇒ Object
407 408 409 410 411 412 413 414 |
# File 'lib/ver.rb', line 407 def find_in_loadpath(basename) loadpath.each do |dirname| file = dirname/basename return file if file.file? end nil end |
.find_or_create_buffer(file, line = nil, column = nil, &block) ⇒ Object
492 493 494 495 496 |
# File 'lib/ver.rb', line 492 def find_or_create_buffer(file, line = nil, column = nil, &block) buffer = Buffer.find_or_create(file, line, column, &block) buffer.show buffer end |
.first_startup ⇒ Object
376 377 378 379 380 381 382 383 384 |
# File 'lib/ver.rb', line 376 def first_startup home, core = .home_conf_dir, .core_conf_dir home.mkpath (core/'rc.rb').cp(home/'rc.rb') (core/'scratch').cp(home/'scratch') (core/'tutorial').cp(home/'tutorial') (core/'welcome').cp(home/'welcome') end |
.inactive ⇒ Object
260 261 262 |
# File 'lib/ver.rb', line 260 def inactive (Time.now - @mtime) * 1000 end |
.info(*args) ⇒ Object
generic (useful) information about system operation
566 567 568 569 |
# File 'lib/ver.rb', line 566 def info(*args) log.info(*args) p(:info, *args) end |
.load(name) ⇒ Object
394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/ver.rb', line 394 def load(name) loadpath.each do |path| file = File.join(path, name) begin require(file) return rescue LoadError, TypeError => ex # TypeError happens on JRuby sometimes... end end end |
.load_all_plugins ⇒ Object
307 308 309 310 311 312 313 314 315 |
# File 'lib/ver.rb', line 307 def load_all_plugins loadpath.each do |dirname| (dirname/'plugin/*.rb').glob do |rb| require rb end end rescue => ex error(ex) end |
.load_plugin(name) ⇒ Object
297 298 299 300 301 302 303 304 305 |
# File 'lib/ver.rb', line 297 def load_plugin(name) loadpath.each do |dirname| (dirname/"plugin/#{name}.rb").glob do |rb| return require(rb.to_s) end end rescue => ex error(ex) end |
.load_plugins ⇒ Object
290 291 292 293 294 295 |
# File 'lib/ver.rb', line 290 def load_plugins @load_plugins.each do |plugin| load_plugin(plugin) Tk::Event.generate(root, '<<PluginLoaded>>', data: plugin.to_s) end end |
.loadpath ⇒ Object
138 139 140 |
# File 'lib/ver.rb', line 138 def loadpath .loadpath end |
.major_mode(name, &block) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/ver/major_mode.rb', line 2 def self.major_mode(name, &block) major = MajorMode[name] major.instance_eval(&block) major.handler nil major end |
.message(*args) ⇒ Object
506 507 508 |
# File 'lib/ver.rb', line 506 def (*args) minibuf.(*args) end |
.minor_mode(name, &block) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/ver/minor_mode.rb', line 2 def self.minor_mode(name, &block) minor = MinorMode[name] minor.instance_eval(&block) minor.handler nil minor end |
.obtain_style_name(widget_name, widget_class) ⇒ Object
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
# File 'lib/ver.rb', line 514 def obtain_style_name(, ) suffix = "#{}.#{}" pool = style_name_pools[suffix] ||= [] register = style_name_register unless name = pool.shift begin id = SecureRandom.hex name = "#{id}.#{suffix}" end while register.include?(name) register << name end return name end |
.open_argv ⇒ Object
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/ver.rb', line 416 def open_argv argv = ARGV.dup openend_any = false while arg = argv.shift if argv.first =~ /\+\d+/ line = argv.shift.to_i find_or_create_buffer(arg, line) else find_or_create_buffer(arg) end opened_any = true end opened_any end |
.open_session ⇒ Object
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 |
# File 'lib/ver.rb', line 442 def open_session return unless session_base = .session basename = "sessions/#{session_base}.json" return unless file = find_in_loadpath(basename) JSON::Store.new(file, true).transaction do |session| session['bookmarks'].each do |raw_bm| bm = Bookmarks::Bookmark.new bm.name = raw_bm['name'] bm.file = Pathname(raw_bm['file']) bm.index = raw_bm['index'] l "Loaded %p" % [bm] bookmarks << bm end session['buffers'].each do |buffer| l "Loading Buffer: %p" % [buffer] find_or_create_buffer(buffer['filename'], *buffer['insert']) end end end |
.open_welcome ⇒ Object
434 435 436 437 438 439 440 |
# File 'lib/ver.rb', line 434 def open_welcome return unless .welcome if welcome = find_in_loadpath('welcome') find_or_create_buffer(welcome) true end end |
.opened_file(text) ⇒ Object
502 503 504 |
# File 'lib/ver.rb', line 502 def opened_file(text) @paths << text.filename end |
.plugin(name) ⇒ Object
286 287 288 |
# File 'lib/ver.rb', line 286 def plugin(name) @load_plugins << name.to_s end |
.return_style_name(style_name) ⇒ Object
531 532 533 534 535 536 |
# File 'lib/ver.rb', line 531 def return_style_name(style_name) return unless style_name id, , = style_name.split('.') suffix = "#{}.#{}" style_name_pools[suffix] << style_name end |
.run(given_options = {}, &block) ⇒ Object
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/ver.rb', line 142 def run( = {}, &block) # we fork, redirect all output to log files. log_dir = Pathname.tmpdir/'ver/log' log_dir.mkpath self.log = Logger.new(log_dir/'all.log', 10, 1 << 20) touch setup_tk run_startup() pp if $DEBUG run_maybe_forking do Event.load! .eventmachine ? run_em(&block) : run_noem(&block) end rescue => exception error(exception) exit end |
.run_core ⇒ Object
220 221 222 223 224 225 226 227 228 |
# File 'lib/ver.rb', line 220 def run_core open_argv || open_welcome open_session emergency_bindings load_plugins run_startup_hooks end |
.run_em(&block) ⇒ Object
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/ver.rb', line 173 def run_em(&block) require 'eventmachine' EM.run do if Tk::RUN_EVENTLOOP_ON_MAIN_THREAD run_core EM.defer(&block) if block Tk.mainloop else EM.defer do run_core EM.defer(&block) if block Tk.mainloop end end end end |
.run_maybe_forking(&block) ⇒ Object
163 164 165 166 167 168 169 170 171 |
# File 'lib/ver.rb', line 163 def run_maybe_forking(&block) return yield unless .fork fork do [$stdout, $stderr].each{|io| io.reopen('/dev/null') } trap(:HUP){ l('terminal lost') } yield end end |
.run_noem(&block) ⇒ Object
191 192 193 194 195 |
# File 'lib/ver.rb', line 191 def run_noem(&block) run_core yield if block Tk.mainloop end |
.run_startup(given_options) ⇒ Object
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/ver.rb', line 197 def run_startup() first_startup unless .home_conf_dir.directory? @startup_hooks = [] @paths = Set.new @cancel_blocks = {} @repeat_blocks = {} @load_plugins = Set.new @exception_view = nil @bookmarks = Bookmarks.new @ctag_stack = [] @style_name_register = [] @style_name_pools = {} @buffers = Set.new if [:load_rc] != false load 'rc' else require(.core_conf_dir/'rc') end @options.merge!() end |
.run_startup_hooks ⇒ Object
278 279 280 |
# File 'lib/ver.rb', line 278 def run_startup_hooks @startup_hooks.each(&:call) end |
.sanitize_options ⇒ Object
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
# File 'lib/ver.rb', line 341 def font = .font unless font.respond_to?(:measure) font = Tk::Font.new(font) actual_hash = font.actual_hash .font = Font.cache[actual_hash] = font end tabs = font.measure('0') * .tabstop .tabs = tabs encoding = [:encoding] unless encoding.is_a?(Encoding) external, internal = encoding.to_s.split(':', 2) Encoding.default_external = Encoding.find(external) if external Encoding.default_internal = Encoding.find(internal) if internal end # We supply a reasonable default in case the platform doesn't have the theme # wished for. unless Tk::Tile::Style.theme_names.include?(.tk_theme) .tk_theme = 'default' end letter = /[\w\n.-]/ space = /[^\w.-]/ # make sure Tcl already has the vars set Tk.interp.eval('catch {tcl_endOfWord}') Tk.execute('set', 'tcl_wordchars', letter) Tk.execute('set', 'tcl_nonwordchars', space) end |
.setup_layout ⇒ Object
337 338 339 |
# File 'lib/ver.rb', line 337 def setup_layout @layout = (layout_class || ToplevelLayout).new(root) end |
.setup_tk ⇒ Object
317 318 319 320 |
# File 'lib/ver.rb', line 317 def setup_tk require 'ffi-tk' Thread.abort_on_exception = true end |
.setup_widgets ⇒ Object
322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/ver.rb', line 322 def Tk::Tile.set_theme .tk_theme Tk::Tile::Style.configure('Label', font: .font, sticky: :sw) @root = Tk.root setup_layout load("keymap/#{.keymap}.rb") @minibuf = MiniBuffer.new(@root) @minibuf.pack expand: true, fill: :both # [:Messages, :Scratch, :Completions].each do |name| # Buffer[name].hide # end end |
.startup_hook(&block) ⇒ Object
282 283 284 |
# File 'lib/ver.rb', line 282 def startup_hook(&block) @startup_hooks << block end |
.store_session ⇒ Object
FIXME: there are no buffers anymore when this is called.
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/ver.rb', line 465 def store_session return unless session_base = VER..session basename = "sessions/#{session_base}.json" session_path = loadpath.first/basename session_path.parent.mkpath JSON::Store.new(session_path.to_s, true).transaction do |session| buffers = self.buffers.map do |buffer| l buffer: buffer { 'name' => buffer.name.to_s, 'filename' => buffer.filename.to_s, 'insert' => buffer.at_insert.to_a, } end l "Storing Buffers: %p" % [buffers] session['buffers'] = buffers bookmarks = self.bookmarks.map do |bm| l bookmark: bm { 'name' => bm.name, 'file' => bm.file.to_s, 'index' => bm.index, } end l "Storing Bookmarks: %p" % [bookmarks] session['bookmarks'] = bookmarks end end |
.touch ⇒ Object
256 257 258 |
# File 'lib/ver.rb', line 256 def touch @mtime = Time.now end |
.warn(*args) ⇒ Object
a warning
572 573 574 |
# File 'lib/ver.rb', line 572 def warn(*args) minibuf.warn(*args) end |
.when_inactive_for(ms, repetitions = 1) ⇒ Object
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/ver.rb', line 230 def when_inactive_for(ms, repetitions = 1) block = lambda{ if @cancel_blocks[block] @cancel_blocks.delete(block) else if inactive > ms if @repeat_blocks[block] < repetitions @repeat_blocks[block] += 1 yield Tk::After.ms(ms, &block) else Tk::After.ms(ms, &block) end else @repeat_blocks[block] = 0 Tk::After.ms(ms, &block) end end } @cancel_blocks[block] = false @repeat_blocks[block] = 0 Tk::After.idle(&block) block end |