Skip to content

REPL: Duplicate newlines when evaluating expressions #1052

@wookayin

Description

@wookayin

Debug adapter definition and debug configuration

This bug has nothing to do with any particular adapters, but one can use lua adapter for simple reproducibility:

  local dap = require('dap')

  dap.configurations.lua = {
    {
      type = 'nlua',
      request = 'attach',
      name = "Attach to running Neovim instance",
    }
  }

  dap.adapters.nlua = function(callback, config)
    callback({
      type = 'server',
      host = config.host or "127.0.0.1",
      port = config.port or 8086
    })
  end

Debug adapter version

https://github.com/jbyuki/one-small-step-for-vimkind

Steps to Reproduce

  1. Open a DAP session and enter the REPL window
  2. Type any expressions to evaluate, press <CR> to enter the line in the REPL

e.g., evaluate a local variable a, and constant expressions 1, 2, 3, etc.

Expected Result

dap> a
7
dap> 1
1
dap> 2
2
dap> 3
3
dap> |

(| means the current cursor)

Actual Result

Extra "dap> " lines are added before the evaluation result being printed:

dap> a
dap>
7
dap> 1
dap>
1
dap> 2
dap>
2
dap> 3
dap>
3
dap> |

75a94b8 (#889) is the first bad commit after bisecting
/cc @ktakiman @mfussenegger

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions