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" =>         "",
  "fi" =>         "",
  "fl" =>         "",
  "ft" =>         "",
  "st" =>         "",
}

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.bookmarksObject (readonly)

Returns the value of attribute bookmarks.



88
89
90
# File 'lib/ver.rb', line 88

def bookmarks
  @bookmarks
end

.buffersObject (readonly)

Returns the value of attribute buffers.



88
89
90
# File 'lib/ver.rb', line 88

def buffers
  @buffers
end

.ctag_stackObject (readonly)

Returns the value of attribute ctag_stack.



88
89
90
# File 'lib/ver.rb', line 88

def ctag_stack
  @ctag_stack
end

.keymapObject (readonly)

Returns the value of attribute keymap.



88
89
90
# File 'lib/ver.rb', line 88

def keymap
  @keymap
end

.layoutObject (readonly)

Returns the value of attribute layout.



88
89
90
# File 'lib/ver.rb', line 88

def layout
  @layout
end

.layout_classObject

Returns the value of attribute layout_class.



91
92
93
# File 'lib/ver.rb', line 91

def layout_class
  @layout_class
end

.logObject

Returns the value of attribute log.



91
92
93
# File 'lib/ver.rb', line 91

def log
  @log
end

.minibufObject (readonly)

Returns the value of attribute minibuf.



88
89
90
# File 'lib/ver.rb', line 88

def minibuf
  @minibuf
end

.optionsObject (readonly)

Returns the value of attribute options.



88
89
90
# File 'lib/ver.rb', line 88

def options
  @options
end

.pathsObject (readonly)

Returns the value of attribute paths.



88
89
90
# File 'lib/ver.rb', line 88

def paths
  @paths
end

.rootObject (readonly)

Returns the value of attribute root.



88
89
90
# File 'lib/ver.rb', line 88

def root
  @root
end

.statusObject (readonly)

Returns the value of attribute status.



88
89
90
# File 'lib/ver.rb', line 88

def status
  @status
end

.style_name_poolsObject (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_registerObject (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

.deferObject



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_optionsObject



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 dump_options
  out = []

  options.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_bindingsObject



498
499
500
# File 'lib/ver.rb', line 498

def emergency_bindings
  Tk::Bind.bind(:all, options.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

.exitObject



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_startupObject



376
377
378
379
380
381
382
383
384
# File 'lib/ver.rb', line 376

def first_startup
  home, core = options.home_conf_dir, options.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

.inactiveObject



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_pluginsObject



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_pluginsObject



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

.loadpathObject



138
139
140
# File 'lib/ver.rb', line 138

def loadpath
  options.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 message(*args)
  minibuf.message(*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(widget_name, widget_class)
  suffix = "#{widget_name}.#{widget_class}"
  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_argvObject



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_sessionObject



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 = options.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_welcomeObject



434
435
436
437
438
439
440
# File 'lib/ver.rb', line 434

def open_welcome
  return unless options.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, widget_name, widget_class = style_name.split('.')
  suffix = "#{widget_name}.#{widget_class}"
  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(given_options = {}, &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(given_options)
  pp options if $DEBUG

  run_maybe_forking do
    Event.load!
    options.eventmachine ? run_em(&block) : run_noem(&block)
  end
rescue => exception
  error(exception)
  exit
end

.run_coreObject



220
221
222
223
224
225
226
227
228
# File 'lib/ver.rb', line 220

def run_core
  sanitize_options
  setup_widgets
  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 options.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(given_options)
  first_startup unless options.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 given_options[:load_rc] != false
    load 'rc'
  else
    require(options.core_conf_dir/'rc')
  end
  @options.merge!(given_options)
end

.run_startup_hooksObject



278
279
280
# File 'lib/ver.rb', line 278

def run_startup_hooks
  @startup_hooks.each(&:call)
end

.sanitize_optionsObject



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 sanitize_options
  font = options.font

  unless font.respond_to?(:measure)
    font = Tk::Font.new(font)
    actual_hash = font.actual_hash
    options.font = Font.cache[actual_hash] = font
  end

  tabs = font.measure('0') * options.tabstop
  options.tabs = tabs

  encoding = options[: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?(options.tk_theme)
    options.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_layoutObject



337
338
339
# File 'lib/ver.rb', line 337

def setup_layout
  @layout = (layout_class || ToplevelLayout).new(root)
end

.setup_tkObject



317
318
319
320
# File 'lib/ver.rb', line 317

def setup_tk
  require 'ffi-tk'
  Thread.abort_on_exception = true
end

.setup_widgetsObject



322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/ver.rb', line 322

def setup_widgets
  Tk::Tile.set_theme options.tk_theme
  Tk::Tile::Style.configure('Label', font: options.font, sticky: :sw)

  @root = Tk.root
  setup_layout
  load("keymap/#{options.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_sessionObject

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.options.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

.touchObject



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