Skip to content

Commit fc1c4df

Browse files
committed
Last commit with InsertLinesAtMark, and old Surround function
1 parent aa33f69 commit fc1c4df

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/utils.vim

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ export def Surround(pre: string, post: string, text_object: string = '')
9999
endif
100100
enddef
101101

102-
103-
104102
export def FormatWithoutMoving(a: number = 0, b: number = 0)
105103
var view = winsaveview()
106104
if a == 0 && b == 0
@@ -123,10 +121,8 @@ export def FormatWithoutMoving(a: number = 0, b: number = 0)
123121
endif
124122
endif
125123
winrestview(view)
126-
127124
enddef
128125

129-
130126
export def RemoveSurrounding(A: string, B: string, lead: number, trail: number)
131127
# Remove 'lead' chars from before mark 'A and 'trail' chars after mark 'B
132128
if line(A) == line(B)
@@ -350,6 +346,7 @@ export def GetTextBetweenMarks(A: string, B: string): list<string>
350346
enddef
351347

352348
export def InsertLinesAtMark(marker: string, lines: list<string>)
349+
# ----- NOT WORKING ----------------------
353350
var pos = getpos(marker) # Get (line, column) position of the marker
354351
var line_num = pos[1] # Line number
355352
var col = pos[2] # Column number
@@ -541,7 +538,7 @@ export def DeleteTextBetweenMarks(A: string, B: string): string
541538
# instead of 'a to jump to the exact marker position
542539
var exact_A = substitute(A, "'", "`", "")
543540
var exact_B = substitute(B, "'", "`", "")
544-
execute $'norm! {exact_A}v{exact_B}d _'
541+
execute $'norm! {exact_A}v{exact_B}"_d'
545542
# This to get rid off E1186
546543
return ''
547544
enddef

0 commit comments

Comments
 (0)