Paul Jolly wrote:
> > Good luck. Let me know when something doesn't work properly, we can > > still adjust the functionality for a week or so. Well, once you use it > > we should probably not change it anymore. > > Hi Bram, > > Good news: I have delta based updates from govim -> gopls largely working. > > But there appears to be one issue as far as changes made by a > particular plugin is concerned. > > I use https://github.com/jiangmiao/auto-pairs (please do say if there > is a better equivalent!) > > I find this plugin useful. For example given > > const x = > > If I then type the backtick character, autopairs will leave me with: > > const x = `` > > i.e. it will insert the closing backtick, leaving the cursor in between the > two. > > If I then hit return I am left with: > > const x = ` > > ` > > i.e. autopairs introduces a blank line. > > But I'm struggling to reason about the callback that I receive. > > Here I repeat the above experiment, outputting the lines of the buffer > following by the list of changes: > > ['c'] [{'lnum': 1, 'col': 1, 'added': 0, 'end': 2}] > ['co'] [{'lnum': 1, 'col': 2, 'added': 0, 'end': 2}] > ['con'] [{'lnum': 1, 'col': 3, 'added': 0, 'end': 2}] > ['cons'] [{'lnum': 1, 'col': 4, 'added': 0, 'end': 2}] > ['const'] [{'lnum': 1, 'col': 5, 'added': 0, 'end': 2}] > ['const '] [{'lnum': 1, 'col': 6, 'added': 0, 'end': 2}] > ['const x'] [{'lnum': 1, 'col': 7, 'added': 0, 'end': 2}] > ['const x '] [{'lnum': 1, 'col': 8, 'added': 0, 'end': 2}] > ['const x ='] [{'lnum': 1, 'col': 9, 'added': 0, 'end': 2}] > ['const x = '] [{'lnum': 1, 'col': 10, 'added': 0, 'end': 2}] > ['const x = ``'] [{'lnum': 1, 'col': 11, 'added': 0, 'end': 2}, > {'lnum': 1, 'col': 12, 'added': 0, 'end': 2}] > ['const x = `', '', '`'] [{'lnum': 1, 'col': 12, 'added': 1, 'end': > 2}, {'lnum': 2, 'col': 1, 'added': 1, 'end': 2}] > > Based on these changes, I don't see there has been a change/insert on line 3. > > Hopefully I've managed to explain that clearly enough? So the first list are the lines in the buffer? Then it looks correct: > ['const x = ``'] [{'lnum': 1, 'col': 11, 'added': 0, 'end': 2}, {'lnum': 1, > 'col': 12, 'added': 0, 'end': 2}] Here you type the first backtick, and the plugin adds the second backtick. > ['const x = `', '', '`'] [{'lnum': 1, 'col': 12, 'added': 1, 'end': 2}, > {'lnum': 2, 'col': 1, 'added': 1, 'end': 2}] Here you type Enter twice. The first time the existing line is split, so you get lnum = 1 and end = 2. The second time a line is inserted, so you get lnum = 2 and end = 2. You get two entries with "added" equal to one, thus two lines have been added, that is also correct. Perhaps it's confusing that when a line is inserted, the "lnum" is the line above which it is inserted. Imagine doing "O" on a line. Doing "o" on the previous line has the same effect, thus you get the same line numbers. -- Everybody wants to go to heaven, but nobody wants to die. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201905221419.x4MEJSIV030318%40masaka.moolenaar.net. For more options, visit https://groups.google.com/d/optout.
