Skip to content

Commit

Permalink
fix(document): avoid undefined line
Browse files Browse the repository at this point in the history
Closes #4573
  • Loading branch information
chemzqm committed Sep 1, 2023
1 parent 6bb2e21 commit 8fcbc01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/model/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ export default class Document {

/**
* Returns if current document is opended with previewwindow
*
* @deprecated
*/
public get previewwindow(): boolean {
Expand All @@ -200,11 +199,12 @@ export default class Document {
this.eol = opts.eol == 1
this._uri = getUri(opts.fullpath, this.bufnr, buftype, this.env.isCygwin)
if (Array.isArray(opts.lines)) {
this.lines = opts.lines
this.lines = opts.lines.map(line => line == null ? '' : line)
this._noFetch = true
this._attached = true
this.attach()
} else {
this.lines = []
this._notAttachReason = getNotAttachReason(buftype, this.variables[`coc_enabled`] as number, opts.size)
}
this._filetype = this.convertFiletype(opts.filetype)
Expand Down

0 comments on commit 8fcbc01

Please sign in to comment.