16 Commits

Author SHA1 Message Date
Ingo Karkat dcb9bcadc4 ingo#buffer#{scratch,generate}#Create(): ENH: Support "pedit" as a:windowOpenCommand 2022-06-20 22:22:44 +02:00
Ingo Karkat e05d083dd7 ingo#buffer#scratch#CreateWithWriter(): Nicer output of write errors
Because the write action is executed inside the ingo#actions#ExecuteOrFunc(), an ugly multi-line exception will be printed. We shouldn't use :echoerr here, because then Vim will prepend a line about the failing :autocmd, which is an implementation detail here. So use plain :echomsg.
2019-08-09 14:18:07 +02:00
Ingo Karkat 09b27ebf26 ingo#buffer#scratch#CreateWithWriter(): FIX: Need to actually configure a non-writable scratch buffer, too 2019-07-24 11:28:37 +02:00
Ingo Karkat 92112e713a ENH: Also support Funcref a:contentsCommand / a:scratchCommand for ingo#buffer#generate#Create() and ingo#buffer#scratch#Create\[WithWriter]() 2019-07-24 11:01:00 +02:00
Ingo Karkat ba5cf6b671 ingo#buffer#scratch#CreateWithWriter(): Support empty a:Writer 2019-07-23 22:17:28 +02:00
Ingo Karkat 5d8268c7dd Add optional a:NextFilenameFuncref to ingo#buffer#scratch#Create\[WithWriter]() 2019-07-23 21:48:32 +02:00
Ingo Karkat 7a786d435f Add ingo#buffer#scratch#CreateWithWriter(), a variant of ingo#buffer#scratch#Create() that supports custom persistence 2019-07-10 16:15:41 +02:00
Ingo Karkat 0cba2f4395 Complete separation of buffer#generate from buffer#scratch
Failing tests (WriteBackup/writebackupVewDiffDaysChanges001.vim) alerted me that the implementation is stil incomplete.
ingo#buffer#generate#Create() needs to take an additional a:NextFilenameFuncref argument instead of invoking non-existent ingo#buffer#generate#NextFilename().
ingo#buffer#scratch#NextFilename() needs to invoke ingo#buffer#generate#NextBracketedFilename(), not the eponymous function in its own module.
2017-10-09 11:20:43 +02:00
Ingo Karkat f6e2720334 FIX: Must not :set readonly if no scratch contents
The previous split of ingo#buffer#generate#Create() subtly changed the behavior with empty scratch contents. We must not :setlocal readonly if the scratch buffer is still empty.
Add a:isInitialized argument to ingo#buffer#scratch#SetLocal().
2017-09-11 14:19:49 +02:00
Ingo Karkat f43f89e093 Split off generic ingo#buffer#generate#Create() from ingo/buffer/scratch.vim
This allows reuse for non-scratch buffer creation; i.e. where the buftype / readonly stuff isn't needed. Also, the code is easier to understand now that the two concepts are separated.
2017-09-10 12:02:20 +02:00
Ingo Karkat 466bd46c33 ENH: ingo#buffer#scratch#Create(): Allow to set the scratch buffer contents + directly by passing a List as a:scratchCommand 2017-09-09 21:21:53 +02:00
Ingo Karkat f5dbbe9821 BUG: ingo#buffer#scratch#Create() with existing scratch buffer yields "E95: Buffer with this name already exists" instead of reusing the buffer
Use new a:isFile flag to ingo#escape#file#bufnameescape() and set a:isFullMatch to 1 instead of emulating the full-match for non-existing scratch buffers.
Keep current cursor position when ingo#buffer#scratch#Create() removes the first empty line in the scratch buffer.
2017-05-26 17:36:08 +02:00
Ingo Karkat b3723b93fd 2017-05-26 17:33:59 +02:00
Ingo Karkat 2b20b89684 BUG: ingo#buffer#scratch#Create() with existing scratch buffer yields "E95: Buffer with this name already exists" instead of reusing the buffer
Use new a:isFile flag to ingo#escape#file#bufnameescape() and set a:isFullMatch to 1 instead of emulating the full-match for non-existing scratch buffers.
2017-05-26 17:33:43 +02:00
Ingo Karkat 3265c58299 Move escapings.vim into ingo-library 2017-05-26 17:27:24 +02:00
Ingo Karkat ba1259d6de file creation 2017-05-26 17:25:20 +02:00