Skip to content

Commit 4cd54c3

Browse files
committed
delete new line character
1 parent 0e54e05 commit 4cd54c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

SourceEditorExtension/VoiceCodeSourceEditorCommand.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ class SourceEditorCommand: NSObject, XCSourceEditorCommand {
219219

220220
break
221221
case "editor:insert-from-line-number":
222-
//TODO: this is not quite working
223222
let range = buffer.selections[0] as! XCSourceTextRange
224223
if isInsertionPoint(range: range) {
225224
var currentLine = buffer.lines[range.start.line] as! String
226-
let textToInsert = buffer.lines[line] as! String //TODO: if line is out of range nothing should happen here
225+
var textToInsert = buffer.lines[line] as! String //TODO: if line is out of range nothing should happen here
227226
let insertIndex = currentLine.index(currentLine.startIndex, offsetBy: range.start.column)
228227
currentLine.insert(contentsOf: textToInsert.characters, at: insertIndex)
228+
currentLine.remove(at: currentLine.endIndex) //TODO: check thisworks...delete new line
229229
buffer.lines.replaceObject(at: range.start.line, with: currentLine)
230230
}
231231
break

0 commit comments

Comments
 (0)