diff --git a/autoload/ags.vim b/autoload/ags.vim index 9b624d7..e8ef67f 100644 --- a/autoload/ags.vim +++ b/autoload/ags.vim @@ -63,7 +63,7 @@ function! s:show(lines, ...) let obj = { 'add': a:0 && a:1, 'lines': a:lines } function obj.run() - if self.add + if self.add && line('$') > 1 call append('$', self.lines) else call ags#buf#replaceLines(self.lines) diff --git a/autoload/ags/edit.vim b/autoload/ags/edit.vim index 8425186..0fcde84 100644 --- a/autoload/ags/edit.vim +++ b/autoload/ags/edit.vim @@ -9,6 +9,10 @@ let s:editLines = [] " The actual file line starts after the line number offset let s:offset = 0 +" Line number offset pattern +" Used to remove the line numbers from the file line +let s:offsetPat = '^' + " Cursor operations let s:cur = {}