Skip to content

Commit e72e51c

Browse files
committed
Merge pull request sparksuite#297 from prostoandrei/development
Fix sparksuite#286
2 parents 4ec9ab8 + 318b4c1 commit e72e51c

File tree

6 files changed

+77
-50
lines changed

6 files changed

+77
-50
lines changed

debug/simplemde.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
197197

198198
.CodeMirror-gutters {
199199
position: absolute; left: 0; top: 0;
200+
min-height: 100%;
200201
z-index: 3;
201202
}
202203
.CodeMirror-gutter {
@@ -251,6 +252,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
251252
position: relative;
252253
overflow: visible;
253254
-webkit-tap-highlight-color: transparent;
255+
-webkit-font-variant-ligatures: none;
256+
font-variant-ligatures: none;
254257
}
255258
.CodeMirror-wrap pre {
256259
word-wrap: break-word;

debug/simplemde.debug.js

Lines changed: 27 additions & 19 deletions
Large diffs are not rendered by default.

debug/simplemde.js

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SimpleMDE = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
88
(function (global){
99

10-
; Typo = global.Typo = require("D:\\My Web Sites\\simplemde-markdown-editor\\node_modules\\codemirror-spell-checker\\src\\js\\typo.js");
10+
; Typo = global.Typo = require("/home/prostoandrei/Projects/simplemde-markdown-editor/node_modules/codemirror-spell-checker/src/js/typo.js");
1111
CodeMirror = global.CodeMirror = require("codemirror");
1212
; var __browserify_shim_require__=require;(function browserifyShim(module, define, require) {
1313
// Initialize data globally to reduce memory consumption
@@ -105,7 +105,7 @@ if(!String.prototype.includes) {
105105
}).call(global, module, undefined, undefined);
106106

107107
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
108-
},{"D:\\My Web Sites\\simplemde-markdown-editor\\node_modules\\codemirror-spell-checker\\src\\js\\typo.js":2,"codemirror":7}],2:[function(require,module,exports){
108+
},{"/home/prostoandrei/Projects/simplemde-markdown-editor/node_modules/codemirror-spell-checker/src/js/typo.js":2,"codemirror":7}],2:[function(require,module,exports){
109109
(function (global){
110110
; var __browserify_shim_require__=require;(function browserifyShim(module, exports, require, define, browserify_shim__define__module__export__) {
111111
'use strict';
@@ -1876,6 +1876,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
18761876

18771877
function postUpdateDisplay(cm, update) {
18781878
var viewport = update.viewport;
1879+
18791880
for (var first = true;; first = false) {
18801881
if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
18811882
// Clip forced viewport to actual scrollable area.
@@ -1891,8 +1892,8 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
18911892
updateHeightsInViewport(cm);
18921893
var barMeasure = measureForScrollbars(cm);
18931894
updateSelection(cm);
1894-
setDocumentHeight(cm, barMeasure);
18951895
updateScrollbars(cm, barMeasure);
1896+
setDocumentHeight(cm, barMeasure);
18961897
}
18971898

18981899
update.signal(cm, "update", cm);
@@ -1909,17 +1910,16 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
19091910
postUpdateDisplay(cm, update);
19101911
var barMeasure = measureForScrollbars(cm);
19111912
updateSelection(cm);
1912-
setDocumentHeight(cm, barMeasure);
19131913
updateScrollbars(cm, barMeasure);
1914+
setDocumentHeight(cm, barMeasure);
19141915
update.finish();
19151916
}
19161917
}
19171918

19181919
function setDocumentHeight(cm, measure) {
19191920
cm.display.sizer.style.minHeight = measure.docHeight + "px";
19201921
cm.display.heightForcer.style.top = measure.docHeight + "px";
1921-
cm.display.gutters.style.height = Math.max(measure.docHeight + cm.display.barHeight + scrollGap(cm),
1922-
measure.clientHeight) + "px";
1922+
cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px";
19231923
}
19241924

19251925
// Read the actual heights of the rendered lines, and update their
@@ -4244,10 +4244,10 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
42444244

42454245
if (op.preparedSelection)
42464246
cm.display.input.showSelection(op.preparedSelection);
4247-
if (op.updatedDisplay)
4248-
setDocumentHeight(cm, op.barMeasure);
42494247
if (op.updatedDisplay || op.startHeight != cm.doc.height)
42504248
updateScrollbars(cm, op.barMeasure);
4249+
if (op.updatedDisplay)
4250+
setDocumentHeight(cm, op.barMeasure);
42514251

42524252
if (op.selectionChanged) restartBlink(cm);
42534253

@@ -4624,7 +4624,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
46244624
over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},
46254625
start: function(e){onDragStart(cm, e);},
46264626
drop: operation(cm, onDrop),
4627-
leave: function() {clearDragCursor(cm);}
4627+
leave: function(e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}
46284628
};
46294629

46304630
var inp = d.input.getField();
@@ -8775,9 +8775,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
87758775
},
87768776

87778777
posFromIndex: function(off) {
8778-
var ch, lineNo = this.first;
8778+
var ch, lineNo = this.first, sepSize = this.lineSeparator().length;
87798779
this.iter(function(line) {
8780-
var sz = line.text.length + 1;
8780+
var sz = line.text.length + sepSize;
87818781
if (sz > off) { ch = off; return true; }
87828782
off -= sz;
87838783
++lineNo;
@@ -8788,8 +8788,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
87888788
coords = clipPos(this, coords);
87898789
var index = coords.ch;
87908790
if (coords.line < this.first || coords.ch < 0) return 0;
8791+
var sepSize = this.lineSeparator().length;
87918792
this.iter(this.first, coords.line, function (line) {
8792-
index += line.text.length + 1;
8793+
index += line.text.length + sepSize;
87938794
});
87948795
return index;
87958796
},
@@ -10018,7 +10019,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
1001810019

1001910020
// THE END
1002010021

10021-
CodeMirror.version = "5.12.1";
10022+
CodeMirror.version = "5.13.3";
1002210023

1002310024
return CodeMirror;
1002410025
});
@@ -11069,6 +11070,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
1106911070
{name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
1107011071
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
1107111072
{name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
11073+
{name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]},
1107211074
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
1107311075
{name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]},
1107411076
{name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]},
@@ -14575,9 +14577,7 @@ SimpleMDE.prototype.createToolbar = function(items) {
1457514577
var nonSeparatorIconsFollow = false;
1457614578

1457714579
for(var x = (i + 1); x < items.length; x++) {
14578-
console.log(x);
1457914580
if(items[x] !== "|" && (!self.options.hideIcons || self.options.hideIcons.indexOf(items[x].name) == -1)) {
14580-
console.log(items[x]);
1458114581
nonSeparatorIconsFollow = true;
1458214582
}
1458314583
}
@@ -14892,9 +14892,17 @@ SimpleMDE.prototype.toTextArea = function() {
1489214892
var cm = this.codemirror;
1489314893
var wrapper = cm.getWrapperElement();
1489414894

14895-
wrapper.parentNode.removeChild(this.gui.toolbar);
14896-
wrapper.parentNode.removeChild(this.gui.statusbar);
14897-
wrapper.parentNode.removeChild(this.gui.sideBySide);
14895+
if(wrapper.parentNode) {
14896+
if(this.gui.toolbar) {
14897+
wrapper.parentNode.removeChild(this.gui.toolbar);
14898+
}
14899+
if(this.gui.statusbar) {
14900+
wrapper.parentNode.removeChild(this.gui.statusbar);
14901+
}
14902+
if(this.gui.sideBySide) {
14903+
wrapper.parentNode.removeChild(this.gui.sideBySide);
14904+
}
14905+
}
1489814906

1489914907
cm.toTextArea();
1490014908

dist/simplemde.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/simplemde.min.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/simplemde.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,9 +1989,17 @@ SimpleMDE.prototype.toTextArea = function() {
19891989
var cm = this.codemirror;
19901990
var wrapper = cm.getWrapperElement();
19911991

1992-
wrapper.parentNode.removeChild(this.gui.toolbar);
1993-
wrapper.parentNode.removeChild(this.gui.statusbar);
1994-
wrapper.parentNode.removeChild(this.gui.sideBySide);
1992+
if(wrapper.parentNode) {
1993+
if(this.gui.toolbar) {
1994+
wrapper.parentNode.removeChild(this.gui.toolbar);
1995+
}
1996+
if(this.gui.statusbar) {
1997+
wrapper.parentNode.removeChild(this.gui.statusbar);
1998+
}
1999+
if(this.gui.sideBySide) {
2000+
wrapper.parentNode.removeChild(this.gui.sideBySide);
2001+
}
2002+
}
19952003

19962004
cm.toTextArea();
19972005

@@ -2002,4 +2010,4 @@ SimpleMDE.prototype.toTextArea = function() {
20022010
}
20032011
};
20042012

2005-
module.exports = SimpleMDE;
2013+
module.exports = SimpleMDE;

0 commit comments

Comments
 (0)