commit
a742993ffb
5 changed files with 20 additions and 14 deletions
|
|
@ -146,8 +146,13 @@ var CommandManager = function(platform, commands) {
|
||||||
if (this.recording) {
|
if (this.recording) {
|
||||||
this.macro.pop();
|
this.macro.pop();
|
||||||
this.exec = this.normal_exec;
|
this.exec = this.normal_exec;
|
||||||
|
|
||||||
|
if (!this.macro.length)
|
||||||
|
this.macro = this.oldMacro;
|
||||||
|
|
||||||
return this.recording = false;
|
return this.recording = false;
|
||||||
}
|
}
|
||||||
|
this.oldMacro = this.macro;
|
||||||
this.macro = [];
|
this.macro = [];
|
||||||
this.normal_exec = this.exec;
|
this.normal_exec = this.exec;
|
||||||
this.exec = function(command, editor, args) {
|
this.exec = function(command, editor, args) {
|
||||||
|
|
@ -158,10 +163,10 @@ var CommandManager = function(platform, commands) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.replay = function(editor) {
|
this.replay = function(editor) {
|
||||||
if (this.$inReplay)
|
if (this.$inReplay || !this.macro)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!this.macro || this.recording)
|
if (this.recording)
|
||||||
return this.toggleRecording();
|
return this.toggleRecording();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@
|
||||||
|
|
||||||
.ace_editor textarea {
|
.ace_editor textarea {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 2000;
|
z-index: 0;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ var TextInput = function(parentNode, host) {
|
||||||
text.setAttribute("x-palm-disable-auto-cap", true);
|
text.setAttribute("x-palm-disable-auto-cap", true);
|
||||||
|
|
||||||
text.style.left = "-10000px";
|
text.style.left = "-10000px";
|
||||||
parentNode.appendChild(text);
|
parentNode.insertBefore(text, parentNode.firstChild);
|
||||||
|
|
||||||
var PLACEHOLDER = String.fromCharCode(0);
|
var PLACEHOLDER = String.fromCharCode(0);
|
||||||
sendText();
|
sendText();
|
||||||
|
|
|
||||||
|
|
@ -50,16 +50,17 @@ var ScrollBar = function(parent) {
|
||||||
this.inner = dom.createElement("div");
|
this.inner = dom.createElement("div");
|
||||||
this.element.appendChild(this.inner);
|
this.element.appendChild(this.inner);
|
||||||
|
|
||||||
parent.appendChild(this.element);
|
|
||||||
|
|
||||||
// in OSX lion the scrollbars appear to have no width. In this case resize
|
// in OSX lion the scrollbars appear to have no width. In this case resize
|
||||||
// the to show the scrollbar but still pretend that the scrollbar has a width
|
// the to show the scrollbar but still pretend that the scrollbar has a width
|
||||||
// of 0px
|
// of 0px
|
||||||
// in Firefox 6+ scrollbar is hidden if element has the same width as scrollbar
|
// in Firefox 6+ scrollbar is hidden if element has the same width as scrollbar
|
||||||
// make element a little bit wider to retain scrollbar when page is zoomed
|
// make element a little bit wider to retain scrollbar when page is zoomed
|
||||||
|
// and insert it before other siblings to not cover them
|
||||||
this.width = dom.scrollbarWidth(parent.ownerDocument);
|
this.width = dom.scrollbarWidth(parent.ownerDocument);
|
||||||
this.element.style.width = (this.width || 15) + 5 + "px";
|
this.element.style.width = (this.width || 15) + 5 + "px";
|
||||||
|
|
||||||
|
parent.insertBefore(this.element, parent.firstChild);
|
||||||
|
|
||||||
event.addListener(this.element, "scroll", this.onScroll.bind(this));
|
event.addListener(this.element, "scroll", this.onScroll.bind(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
|
|
||||||
this.adjustWrapLimit = function() {
|
this.adjustWrapLimit = function() {
|
||||||
var availableWidth = this.$size.scrollerWidth - this.$padding * 2;
|
var availableWidth = this.$size.scrollerWidth - this.$padding * 2;
|
||||||
var limit = Math.floor(availableWidth / this.characterWidth) - 1;
|
var limit = Math.floor(availableWidth / this.characterWidth);
|
||||||
return this.session.adjustWrapLimit(limit);
|
return this.session.adjustWrapLimit(limit);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -333,7 +333,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var style = this.$printMarginEl.style;
|
var style = this.$printMarginEl.style;
|
||||||
style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding * 2) + "px";
|
style.left = ((this.characterWidth * this.$printMarginColumn) + this.$padding) + "px";
|
||||||
style.visibility = this.$showPrintMargin ? "visible" : "hidden";
|
style.visibility = this.$showPrintMargin ? "visible" : "hidden";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -362,7 +362,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var bounds = this.content.getBoundingClientRect();
|
var bounds = this.content.getBoundingClientRect();
|
||||||
var offset = this.layerConfig.offset;
|
var offset = this.layerConfig.offset;
|
||||||
|
|
||||||
textarea.style.left = (bounds.left + pos.left + this.$padding) + "px";
|
textarea.style.left = (bounds.left + pos.left) + "px";
|
||||||
textarea.style.top = (bounds.top + pos.top - this.scrollTop + offset) + "px";
|
textarea.style.top = (bounds.top + pos.top - this.scrollTop + offset) + "px";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -548,7 +548,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
|
|
||||||
this.$gutterLayer.element.style.marginTop = (-offset) + "px";
|
this.$gutterLayer.element.style.marginTop = (-offset) + "px";
|
||||||
this.content.style.marginTop = (-offset) + "px";
|
this.content.style.marginTop = (-offset) + "px";
|
||||||
this.content.style.width = longestLine + "px";
|
this.content.style.width = longestLine + 2 * this.$padding + "px";
|
||||||
this.content.style.height = minHeight + "px";
|
this.content.style.height = minHeight + "px";
|
||||||
|
|
||||||
// scroller.scrollWidth was smaller than scrollLeft we needed
|
// scroller.scrollWidth was smaller than scrollLeft we needed
|
||||||
|
|
@ -590,11 +590,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$getLongestLine = function() {
|
this.$getLongestLine = function() {
|
||||||
var charCount = this.session.getScreenWidth() + 1;
|
var charCount = this.session.getScreenWidth();
|
||||||
if (this.$textLayer.showInvisibles)
|
if (this.$textLayer.showInvisibles)
|
||||||
charCount += 1;
|
charCount += 1;
|
||||||
|
|
||||||
return Math.max(this.$size.scrollerWidth, Math.round(charCount * this.characterWidth));
|
return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth));
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateFrontMarkers = function() {
|
this.updateFrontMarkers = function() {
|
||||||
|
|
@ -715,7 +715,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToX = function(scrollLeft) {
|
this.scrollToX = function(scrollLeft) {
|
||||||
if (scrollLeft <= this.$padding)
|
if (scrollLeft <= this.$padding + 2 * this.layerConfig.characterWidth)
|
||||||
scrollLeft = 0;
|
scrollLeft = 0;
|
||||||
|
|
||||||
this.scroller.scrollLeft = scrollLeft;
|
this.scroller.scrollLeft = scrollLeft;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue