5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Atomでvim-modeを有効にしていると、undoの挙動がおかしい問題を回避

Posted at

修正対象ファイル

/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js

修正内容

History.prototype.beginTransaction = function() {
  if (++this.transactionDepth === 1) {
      return this.currentTransaction = new Transaction();
  }
};

↓↓↓

History.prototype.beginTransaction = function() {
  /**
   * ここでtransactionDepthを0にしないと、vim-mode利用時の
   * undoで変更が前に戻りすぎるというのがおきる
   */
  this.transactionDepth = 0;
  if (++this.transactionDepth === 1) {
      return this.currentTransaction = new Transaction();
  }
};

最後に

もっといい方法あれば教えて下さい

5
5
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
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?