Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 14 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 28, 2012
@mishoo parse more lines at once, stuff is pretty fast nowadays 524f45a
Commits on Mar 10, 2012
@mishoo small tweaks in lisp mode 4c870ca
Commits on Mar 18, 2012
@mishoo minor 3084c73
Commits on Mar 24, 2012
@mishoo other small fixes f156628
View
45 src/css/themes/emacs-adwaita.css
@@ -0,0 +1,45 @@
+.Ymacs-Theme-adwaita .Ymacs_Frame { color: #2d3335; background-color: #ececec; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .type { color: #2e8a57; font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .builtin { color: #9f1fef; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .function-name { color: #00568d; font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .variable-name { color: #0083c7; font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .constant { color: #f4656c; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .string { color: #4d9905; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .string-starter { color: #4d9905; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .string-stopper { color: #4d9905; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .regexp { color: #4d9905; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .regexp-starter { color: #4d9905; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .regexp-stopper { color: #4d9905; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .regexp-modifier { color: #4d9905; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .keyword { color: #a42929; font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .comment { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .mcomment { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .comment-starter { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .mcomment-starter { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .mcomment-stopper { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .number { color: #f4656c; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .operator { }
+.Ymacs-Theme-adwaita .Ymacs_Frame .error { color: #f4656c; font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-open-tag { color: #00568d; font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-close-tag { color: #00568d; font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-attribute { color: #0083c7; font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-entity-starter { color: #f4656c; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-entity-stopper { color: #f4656c; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-entity { color: #f4656c; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-open-bracket { }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-close-bracket { }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-closetag-slash { }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-cdata { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-cdata-starter { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .xml-cdata-stopper { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .lisp-keyword { color: #f4656c; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-heading1 { }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-heading2 { }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-heading3 { }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-heading4 { font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-heading5 { font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-heading6 { font-weight: bold; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-blockquote { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-blockquote1 { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-blockquote2 { color: #1f4986; }
+.Ymacs-Theme-adwaita .Ymacs_Frame .markdown-blockquote3 { color: #1f4986; }
View
38 src/css/themes/emacs-standard.css
@@ -1,41 +1,41 @@
.Ymacs-Theme-standard .Ymacs_Frame { color: #000000; background-color: #ffffff; }
.Ymacs-Theme-standard .Ymacs_Frame .type { color: #228b22; }
-.Ymacs-Theme-standard .Ymacs_Frame .builtin { color: #da70d6; }
+.Ymacs-Theme-standard .Ymacs_Frame .builtin { color: #483d8b; }
.Ymacs-Theme-standard .Ymacs_Frame .function-name { color: #0000ff; }
-.Ymacs-Theme-standard .Ymacs_Frame .variable-name { color: #b8860b; }
-.Ymacs-Theme-standard .Ymacs_Frame .constant { color: #5f9ea0; }
-.Ymacs-Theme-standard .Ymacs_Frame .string { color: #bc8f8f; }
-.Ymacs-Theme-standard .Ymacs_Frame .string-starter { color: #bc8f8f; }
-.Ymacs-Theme-standard .Ymacs_Frame .string-stopper { color: #bc8f8f; }
-.Ymacs-Theme-standard .Ymacs_Frame .regexp { color: #bc8f8f; }
-.Ymacs-Theme-standard .Ymacs_Frame .regexp-starter { color: #bc8f8f; }
-.Ymacs-Theme-standard .Ymacs_Frame .regexp-stopper { color: #bc8f8f; }
-.Ymacs-Theme-standard .Ymacs_Frame .regexp-modifier { color: #bc8f8f; }
+.Ymacs-Theme-standard .Ymacs_Frame .variable-name { color: #a0522d; }
+.Ymacs-Theme-standard .Ymacs_Frame .constant { color: #008b8b; }
+.Ymacs-Theme-standard .Ymacs_Frame .string { color: #8b2252; }
+.Ymacs-Theme-standard .Ymacs_Frame .string-starter { color: #8b2252; }
+.Ymacs-Theme-standard .Ymacs_Frame .string-stopper { color: #8b2252; }
+.Ymacs-Theme-standard .Ymacs_Frame .regexp { color: #8b2252; }
+.Ymacs-Theme-standard .Ymacs_Frame .regexp-starter { color: #8b2252; }
+.Ymacs-Theme-standard .Ymacs_Frame .regexp-stopper { color: #8b2252; }
+.Ymacs-Theme-standard .Ymacs_Frame .regexp-modifier { color: #8b2252; }
.Ymacs-Theme-standard .Ymacs_Frame .keyword { color: #a020f0; }
.Ymacs-Theme-standard .Ymacs_Frame .comment { color: #b22222; }
.Ymacs-Theme-standard .Ymacs_Frame .mcomment { color: #b22222; }
.Ymacs-Theme-standard .Ymacs_Frame .comment-starter { color: #b22222; }
.Ymacs-Theme-standard .Ymacs_Frame .mcomment-starter { color: #b22222; }
.Ymacs-Theme-standard .Ymacs_Frame .mcomment-stopper { color: #b22222; }
-.Ymacs-Theme-standard .Ymacs_Frame .number { color: #5f9ea0; }
+.Ymacs-Theme-standard .Ymacs_Frame .number { color: #008b8b; }
.Ymacs-Theme-standard .Ymacs_Frame .operator { }
.Ymacs-Theme-standard .Ymacs_Frame .error { color: #ff0000; font-weight: bold; }
.Ymacs-Theme-standard .Ymacs_Frame .xml-open-tag { color: #0000ff; }
.Ymacs-Theme-standard .Ymacs_Frame .xml-close-tag { color: #0000ff; }
-.Ymacs-Theme-standard .Ymacs_Frame .xml-attribute { color: #b8860b; }
-.Ymacs-Theme-standard .Ymacs_Frame .xml-entity-starter { color: #5f9ea0; }
-.Ymacs-Theme-standard .Ymacs_Frame .xml-entity-stopper { color: #5f9ea0; }
-.Ymacs-Theme-standard .Ymacs_Frame .xml-entity { color: #5f9ea0; }
+.Ymacs-Theme-standard .Ymacs_Frame .xml-attribute { color: #a0522d; }
+.Ymacs-Theme-standard .Ymacs_Frame .xml-entity-starter { color: #008b8b; }
+.Ymacs-Theme-standard .Ymacs_Frame .xml-entity-stopper { color: #008b8b; }
+.Ymacs-Theme-standard .Ymacs_Frame .xml-entity { color: #008b8b; }
.Ymacs-Theme-standard .Ymacs_Frame .xml-open-bracket { }
.Ymacs-Theme-standard .Ymacs_Frame .xml-close-bracket { }
.Ymacs-Theme-standard .Ymacs_Frame .xml-closetag-slash { }
.Ymacs-Theme-standard .Ymacs_Frame .xml-cdata { color: #b22222; }
.Ymacs-Theme-standard .Ymacs_Frame .xml-cdata-starter { color: #b22222; }
.Ymacs-Theme-standard .Ymacs_Frame .xml-cdata-stopper { color: #b22222; }
-.Ymacs-Theme-standard .Ymacs_Frame .lisp-keyword { color: #5f9ea0; }
-.Ymacs-Theme-standard .Ymacs_Frame .markdown-heading1 { font-size: 1.717em; }
-.Ymacs-Theme-standard .Ymacs_Frame .markdown-heading2 { font-size: 1.400em; }
-.Ymacs-Theme-standard .Ymacs_Frame .markdown-heading3 { font-size: 1.175em; }
+.Ymacs-Theme-standard .Ymacs_Frame .lisp-keyword { color: #008b8b; }
+.Ymacs-Theme-standard .Ymacs_Frame .markdown-heading1 { font-weight: bold; }
+.Ymacs-Theme-standard .Ymacs_Frame .markdown-heading2 { font-weight: bold; }
+.Ymacs-Theme-standard .Ymacs_Frame .markdown-heading3 { font-weight: bold; }
.Ymacs-Theme-standard .Ymacs_Frame .markdown-heading4 { font-weight: bold; }
.Ymacs-Theme-standard .Ymacs_Frame .markdown-heading5 { font-weight: bold; }
.Ymacs-Theme-standard .Ymacs_Frame .markdown-heading6 { font-weight: bold; }
View
45 src/css/themes/emacs-tango.css
@@ -0,0 +1,45 @@
+.Ymacs-Theme-tango .Ymacs_Frame { color: #2d3335; background-color: #ededeb; }
+.Ymacs-Theme-tango .Ymacs_Frame .type { color: #1f4986; }
+.Ymacs-Theme-tango .Ymacs_Frame .builtin { color: #744f7a; }
+.Ymacs-Theme-tango .Ymacs_Frame .function-name { color: #a30000; }
+.Ymacs-Theme-tango .Ymacs_Frame .variable-name { color: #b24f00; }
+.Ymacs-Theme-tango .Ymacs_Frame .constant { color: #1f4986; font-weight: bold; }
+.Ymacs-Theme-tango .Ymacs_Frame .string { color: #5b3465; }
+.Ymacs-Theme-tango .Ymacs_Frame .string-starter { color: #5b3465; }
+.Ymacs-Theme-tango .Ymacs_Frame .string-stopper { color: #5b3465; }
+.Ymacs-Theme-tango .Ymacs_Frame .regexp { color: #5b3465; }
+.Ymacs-Theme-tango .Ymacs_Frame .regexp-starter { color: #5b3465; }
+.Ymacs-Theme-tango .Ymacs_Frame .regexp-stopper { color: #5b3465; }
+.Ymacs-Theme-tango .Ymacs_Frame .regexp-modifier { color: #5b3465; }
+.Ymacs-Theme-tango .Ymacs_Frame .keyword { color: #336503; }
+.Ymacs-Theme-tango .Ymacs_Frame .comment { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .mcomment { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .comment-starter { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .mcomment-starter { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .mcomment-stopper { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .number { color: #1f4986; font-weight: bold; }
+.Ymacs-Theme-tango .Ymacs_Frame .operator { }
+.Ymacs-Theme-tango .Ymacs_Frame .error { color: #a30000; }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-open-tag { color: #a30000; }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-close-tag { color: #a30000; }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-attribute { color: #b24f00; }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-entity-starter { color: #1f4986; }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-entity-stopper { color: #1f4986; }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-entity { color: #1f4986; }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-open-bracket { }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-close-bracket { }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-closetag-slash { }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-cdata { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-cdata-starter { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .xml-cdata-stopper { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .lisp-keyword { color: #1f4986; font-weight: bold; }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-heading1 { }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-heading2 { }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-heading3 { }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-heading4 { font-weight: bold; }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-heading5 { font-weight: bold; }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-heading6 { font-weight: bold; }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-blockquote { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-blockquote1 { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-blockquote2 { color: #5e605b; }
+.Ymacs-Theme-tango .Ymacs_Frame .markdown-blockquote3 { color: #5e605b; }
View
45 src/css/themes/emacs-whiteboard.css
@@ -0,0 +1,45 @@
+.Ymacs-Theme-whiteboard .Ymacs_Frame { color: #000000; background-color: #f5f5f5; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .type { color: #00688b; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .builtin { color: #cd6600; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .function-name { color: #cd9b1d; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .variable-name { color: #2e8b57; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .constant { color: #6e8b3d; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .string { color: #8b7355; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .string-starter { color: #8b7355; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .string-stopper { color: #8b7355; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .regexp { color: #8b7355; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .regexp-starter { color: #8b7355; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .regexp-stopper { color: #8b7355; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .regexp-modifier { color: #8b7355; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .keyword { color: #1c86ee; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .comment { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .mcomment { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .comment-starter { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .mcomment-starter { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .mcomment-stopper { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .number { color: #6e8b3d; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .operator { }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .error { color: #ff0000; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-open-tag { color: #cd9b1d; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-close-tag { color: #cd9b1d; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-attribute { color: #2e8b57; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-entity-starter { color: #6e8b3d; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-entity-stopper { color: #6e8b3d; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-entity { color: #6e8b3d; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-open-bracket { }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-close-bracket { }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-closetag-slash { }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-cdata { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-cdata-starter { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .xml-cdata-stopper { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .lisp-keyword { color: #6e8b3d; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-heading1 { }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-heading2 { }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-heading3 { }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-heading4 { font-weight: bold; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-heading5 { font-weight: bold; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-heading6 { font-weight: bold; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-blockquote { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-blockquote1 { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-blockquote2 { color: #7f7f7f; }
+.Ymacs-Theme-whiteboard .Ymacs_Frame .markdown-blockquote3 { color: #7f7f7f; }
View
1  src/css/ymacs-dark.css
@@ -15,6 +15,7 @@
.Ymacs-Theme-dark .Ymacs-caret {
background-color: #aaa;
+ color: #222;
/* outline: 1px solid #f83; */
}
View
6 src/css/ymacs-light.css
@@ -8,9 +8,13 @@
@import url("themes/emacs-scintilla.css");
@import url("themes/emacs-vim-colors.css");
@import url("themes/emacs-standard.css");
+@import url("themes/emacs-tango.css");
+@import url("themes/emacs-adwaita.css");
+@import url("themes/emacs-whiteboard.css");
.Ymacs-Theme-light .Ymacs-caret {
background-color: #888;
+ color: #222;
}
.Ymacs-Theme-light .Ymacs_Frame-focus .Ymacs-caret {
@@ -19,7 +23,7 @@
}
.Ymacs-Theme-light .Ymacs_Frame-focus .Ymacs-current-line {
- background-color: #def;
+ background-color: #eda;
}
.Ymacs-Theme-light .Ymacs-overwrite-mode .Ymacs-caret {
View
2  src/css/ymacs.css
@@ -45,7 +45,7 @@
/* } */
.Ymacs-overwrite-mode .Ymacs-caret {
- -moz-border-radius: 15px;
+ border-radius: 15px;
}
.Ymacs_Overlay { position: absolute; right: 0; opacity: 0.5; filter: alpha(opacity=50); }
View
4 src/js/ymacs-commands-utils.js
@@ -141,9 +141,7 @@ Ymacs_Buffer.newCommands({
}),
save_file: Ymacs_Interactive("FWrite file: ", function(name){
- var files = this.ymacs.ls_getFileDirectory(name, "file");
- files.dir[files.other[0]] = this.getCode();
- this.ymacs.ls_set(files.store);
+ this.ymacs.ls_setFileContents(name, this.getCode());
this.signalInfo("Saved in local storage");
}),
View
16 src/js/ymacs-frame.js
@@ -263,6 +263,7 @@ DEFINE_CLASS("Ymacs_Frame", DlContainer, function(D, P, DOM) {
layout.packWidget(fr, { pos: "top", fill: "*" });
cont.__doLayout();
fr.centerOnCaret();
+ return fr;
};
P.hsplit = function(percent) {
@@ -282,6 +283,7 @@ DEFINE_CLASS("Ymacs_Frame", DlContainer, function(D, P, DOM) {
layout.packWidget(fr, { pos: "left", fill: "*" });
cont.__doLayout();
fr.centerOnCaret();
+ return fr;
};
P.toggleLineNumbers = function() {
@@ -380,6 +382,13 @@ DEFINE_CLASS("Ymacs_Frame", DlContainer, function(D, P, DOM) {
this.__hoverLine = rc.row;
}
+ // hide stale carets :-\
+ // mess everywhere.
+ Array.$(this.getElement().querySelectorAll(".Ymacs-caret, #" + this.__caretId)).foreach(function(el){
+ el.id = "";
+ el.className = "";
+ });
+
// redraw the line where the caret was previously, so that it disappears from there
if (this.__prevCaretLine != null) {
this._on_bufferLineChange(this.__prevCaretLine);
@@ -391,11 +400,6 @@ DEFINE_CLASS("Ymacs_Frame", DlContainer, function(D, P, DOM) {
this._on_bufferLineChange(rc.row);
}
- // var caret = this.getCaretElement();
- // if (caret)
- // DOM.strip(caret);
- // this._on_bufferLineChange(rc.row);
-
if (isActive)
this.__restartBlinking();
@@ -665,7 +669,7 @@ DEFINE_CLASS("Ymacs_Frame", DlContainer, function(D, P, DOM) {
P._on_keyDown = function(ev) {
if (!is_gecko) {
var ki = window.KEYBOARD_INSANITY, code = ev.keyCode;
- if (code in ki.modifiers)
+ if (code == 0 || code in ki.modifiers)
EX();
if ((code in ki.letters || code in ki.digits || code in ki.symbols) && !(ev.ctrlKey || ev.altKey)) {
return; // to be handled by the upcoming keypress event
View
2  src/js/ymacs-keyboard.js
@@ -60,7 +60,7 @@
[ 48, 41 ]
];
- var digits = [ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 ].toHash(function(k, i) {
+ var digits = [ 49, 50, 51, 52, 53, 54, 55, 56, 57, 48 ].toHash(function(k, i) {
return digit_charcodes[i];
});
View
66 src/js/ymacs-mode-lisp.js
@@ -76,15 +76,15 @@
// the duplicate code.
var SPECIAL_FORMS = "\
-defvar defparameter deftype defstruct defclass destructuring-bind \
+defvar defparameter deftype defstruct defclass defsetf destructuring-bind \
defmacro defun defmethod defgeneric defpackage in-package defreadtable in-readtable \
when cond unless etypecase typecase ctypecase \
lambda let load-time-value quote macrolet \
progn prog1 prog2 progv go flet the \
if throw eval-when multiple-value-prog1 unwind-protect let* \
-ignore-errors handler-case case \
+ignore-errors handler-case handler-bind invoke-restart restart-case restart-bind case \
labels function symbol-macrolet block tagbody catch locally \
-return return-from setq multiple-value-call".qw().toHash();
+return return-from setq setf multiple-value-call".qw().toHash();
var COMMON_MACROS = "loop do while".qw().toHash();
@@ -117,17 +117,26 @@ return return-from setq multiple-value-call".qw().toHash();
"defmethod" : "2*",
"defclass" : "2*",
"defmacro" : "2*",
- "progn" : "0*",
- "prog1" : "0*",
- "prog2" : "0*",
+ "progn" : "0+",
+ "prog1" : "1*",
+ "prog2" : "2*",
"let" : "1*",
"labels" : "1*",
"flet" : "1*",
"macrolet" : "1*",
"destructuring-bind" : "2*",
"unwind-protect" : "1*",
+ "catch" : "1*",
"case" : "1*",
- "ecase" : "1*"
+ "ecase" : "1*",
+ "cond" : "0+",
+ "handler-bind" : "1*",
+ "handler-case" : "1*",
+ "restart-bind" : "1*",
+ "restart-case" : "1*",
+ "return-from" : "1*",
+ "block" : "1*",
+ "dotimes" : "1*"
};
var LOCAL_BODYDEF = "labels flet macrolet".qw().toHash();
@@ -263,7 +272,7 @@ return return-from setq multiple-value-call".qw().toHash();
if ($cont.length > 0)
return $cont.peek()();
var ch = stream.peek(), tmp;
- if ((tmp = stream.lookingAt(/^#\\[a-z0-9_-]*/i))) {
+ if ((tmp = stream.lookingAt(/^#\\.[a-z0-9_-]*/i))) {
newArg();
foundToken(stream.col, stream.col += tmp[0].length, "constant");
}
@@ -335,7 +344,7 @@ return return-from setq multiple-value-call".qw().toHash();
type = "type";
}
// there are a lot of macros starting with "with-", so let's highlight this
- else if (/^with[-\x2f]|:with[-\x2f]/i.test(tmp.id)) {
+ else if (/^with(out)?[-\x2f]|:with(out)?[-\x2f]/i.test(tmp.id)) {
type = "builtin";
}
}
@@ -348,55 +357,60 @@ return return-from setq multiple-value-call".qw().toHash();
};
function indentation() {
- // no indentation for continued strings
- if ($inString)
- return 0;
-
var currentLine = stream.lineText();
+ if ($inString) {
+ return Math.max(0, currentLine.search(/[^\s\t\n]/));
+ }
var indent = 0;
+ // XXX: rewrite this mess.
+
var p = $parens.peek();
if (p) {
var line = stream.lineText(p.line);
indent = p.col + 1;
+ if (/[\#\']/.test(line.charAt(p.col - 1))) {
+ return indent;
+ }
var nextNonSpace;
if (isConstituentStart(line.charAt(indent))) {
- indent = p.col + INDENT_LEVEL();
var re = /\s\S/g;
re.lastIndex = p.col;
nextNonSpace = re.exec(line);
if (nextNonSpace) {
- nextNonSpace = nextNonSpace.index + 1;
+ indent = nextNonSpace = nextNonSpace.index + 1;
}
}
if ($list && $list.length) {
- // console.log($list);
var currentForm = isForm();
if (currentForm) {
currentForm = currentForm.replace(/\*$/, "");
var formArgs = FORM_ARGS[currentForm];
if (!formArgs && /^with|:with/.test(currentForm)) {
// "with" macros usually take one argument, then &body
- formArgs = "1*";
+ formArgs = "0*";
}
if (!formArgs && /^def/.test(currentForm)) {
- // "with" macros usually take one argument, then &body
- formArgs = "2*";
+ // definitions usually take two arguments, then &body
+ if (nextNonSpace && /[\(\[\{]/.test(line.charAt(nextNonSpace)))
+ formArgs = "1*";
+ else
+ formArgs = "2*";
}
if (!formArgs) try {
if (Object.HOP(LOCAL_BODYDEF, $backList[$backList.length - 2][0].id)) {
formArgs = "1*";
}
} catch(ex){}
- if (!formArgs) {
- formArgs = "1+"; // kind of sucky now
- }
if (formArgs) {
var n = parseInt(formArgs, 10);
- var hasRest = /\+$/.test(formArgs);
- var hasBody =/\*$/.test(formArgs);
- // console.log("Expecting %d arguments, got %d already (rest=%o, body=%o)", n, $list.length - 1, hasRest, hasBody);
- if ($list.length - 1 < n || hasRest) {
+ var hasRest = /\+/.test(formArgs);
+ var hasBody =/\*/.test(formArgs);
+ indent = p.col + INDENT_LEVEL();
+ if (hasRest && nextNonSpace) {
+ indent = nextNonSpace;
+ }
+ else if ((n > 0 && $list.length - 1 < n)) {
// still in the arguments
if (nextNonSpace)
indent = nextNonSpace;
View
4 src/js/ymacs-tokenizer.js
@@ -226,7 +226,7 @@ DEFINE_CLASS("Ymacs_Tokenizer", DlEventProxy, function(D, P){
var first = true;
var doit = function() {
this.buffer.preventUpdates();
- n = first ? 3 : 20;
+ n = 100;
if (++iteration > 10)
this.showProgress(this.stream.line);
while (true) {
@@ -239,7 +239,7 @@ DEFINE_CLASS("Ymacs_Tokenizer", DlEventProxy, function(D, P){
s.nextLine();
if (--n == 0) {
this.buffer.resumeUpdates();
- this.timerUpdate = setTimeout(doit, first ? 500 : 50);
+ this.timerUpdate = setTimeout(doit, 25);
first = false;
return;
}
View
6 src/js/ymacs.js
@@ -413,6 +413,12 @@ DEFINE_CLASS("Ymacs", DlLayout, function(D, P, DOM){
return code;
};
+ P.ls_setFileContents = function(name, content) {
+ var files = this.ls_getFileDirectory(name, "file");
+ files.dir[files.other[0]] = content;
+ this.ls_set(files.store);
+ };
+
P.ls_getFileDirectory = function(name, create) {
var store, dir = store = this.ls_get();
name = name.replace(/^[~\x2f]+/, "").split(/\x2f+/);
View
18 test/dl/js/thelib.js
9 additions, 9 deletions not shown

No commit comments for this range

Something went wrong with that request. Please try again.