LoginSignup
3
0

More than 3 years have passed since last update.

Boostnote > Editor Theme が変更できない時の対処

Last updated at Posted at 2020-10-10

Prefrences > Interface > Editor > Editor Theme
上記をたどって Editor Theme を変更しても、文字色や背景色が反映されないことがあります。その場合の対象は以下の通り(2019/07/02の段階での対処法)。
無題.png
下記を参考にしています。
Editor themes aren't working since the new release · Issue #3018 · BoostIO/Boostnote · GitHub
コードを見る限り、参照とすべきパスに誤りがあるために設定が反映されないようです。

まずは太文字で示している、
\boost\app-0.11.16\resources\app\compiled\main.js
を開きます。

Octen commented on 24 May
Fix in new release for Windows 7, on the advice of @bwarfson
Edit \boost\app-0.11.16\resources\app\compiled\main.js
Find :

main.js は20万行以上の大きなファイルなため、エディターで開くまでに少し時間がかかるかもしれません。main.js が表示されたら、下記コードを見つけてください。
私は path: path.join(directory.split(/\//g).slice(-3).join('/'), file), で検索しました。

    var themes = paths.map(function (directory) {
      return fs.readdirSync(directory).map(function (file) {
        var name = file.substring(0, file.lastIndexOf('.'));

        return {
          name: name,
          // ↓ 変更前
          path: path.join(directory.split(/\//g).slice(-3).join('/'), file),
          className: 'cm-s-' + name
        };
      });
    }).reduce(function (accumulator, value) {
      return accumulator.concat(value);
    }, []).sort(function (a, b) {
      return a.name.localeCompare(b.name);
    });

該当箇所を見つけたらそこを書き換えます。書きかえると言っても以下の一行のみです。
【変更前】path: path.join(directory.split(/\//g).slice(-3).join('/'), file),
【変更後】path: path.join(CODEMIRROR_THEME_PATH, file),

    var themes = paths.map(function (directory) {
      return fs.readdirSync(directory).map(function (file) {
        var name = file.substring(0, file.lastIndexOf('.'));

        return {
          name: name,
          // ↓ 変更後
          path: path.join(CODEMIRROR_THEME_PATH, file),
          className: 'cm-s-' + name
        };
      });
    }).reduce(function (accumulator, value) {
      return accumulator.concat(value);
    }, []).sort(function (a, b) {
      return a.name.localeCompare(b.name);
    });

これで Editor Theme で設定したテーマが反映されるはずです。確認してみてください。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0