Fix autozoom in codemirror editors on mobile

This commit is contained in:
yflory 2022-12-22 14:15:16 +01:00
parent bad1170212
commit fd6fa31ad9

View File

@ -140,10 +140,15 @@ define([
return text.trim();
};
var isMobile = window.orientation || (typeof(screen) !== "undefined" && screen.orientation);
module.mkIndentSettings = function (editor, metadataMgr) {
var setIndentation = function (units, useTabs, fontSize, spellcheck, brackets) {
if (typeof(units) !== 'number') { return; }
var doc = editor.getDoc();
if (isMobile && fontSize < 16) {
fontSize = 16;
}
editor.setOption('indentUnit', units);
editor.setOption('tabSize', units);
editor.setOption('indentWithTabs', useTabs);