On Wednesday, November 11, 2015 at 11:11:02 AM UTC-6, Jérôme Reybert wrote:
>
> I already tried the 'acwrite' mode. But the buffer content can be modified by
> both the user and the plugin. Then, if I set the 'acwrite' mode, I get a
> warning when I close the buffer.
If you expect the user to
On Wednesday, November 11, 2015 at 5:05:06 PM UTC+1, Ben Fritz wrote:
> On Wednesday, November 11, 2015 at 9:32:55 AM UTC-6, Jérôme Reybert wrote:
> > I am trying to catch write commands, to perform some specific commands when
> > user enters a write command (:w, :x, o
I am trying to catch write commands, to perform some specific commands when
user enters a write command (:w, :x, or anything else).
In my plugin, I use a buffer with parameter buftype=nofile
I tried BufWriteCmd and BufWritePre, but these hooks come too late, I always
get:
> E382: Cannot wr
On Wednesday, November 11, 2015 at 9:32:55 AM UTC-6, Jérôme Reybert wrote:
> I am trying to catch write commands, to perform some specific commands when
> user enters a write command (:w, :x, or anything else).
>
> In my plugin, I use a buffer with parameter buftype=nofile
At ':help :catch' we see this example to catch error E123:
:catch /^Vim\%((\a\+)\)\=:E123/
Isn't the above wrong? Why not just:
:catch /E123:/
The help example has ':E123' but it means 'E123:'?
What is the '^Vim...' stuff for? The messages on my system do
not start with 'Vim' (use :s
On 07/05/12 04:08, John Beckett wrote:
At ':help :catch' we see this example to catch error E123:
:catch /^Vim\%((\a\+)\)\=:E123/
Isn't the above wrong? Why not just:
:catch /E123:/
The help example has ':E123' but it means 'E123:'?
What is the '^Vim...' stuff for? The messages
to continue
What has happened to the expected output of the
catch /E486:/ command.
Why am I getting the regular E486: error message?
= xxx file follows
From - Mon Feb 28 22:58:36 2011
X-Account-Key: account2
X-UIDL: AG1ck0UAASZMTWxp+Q0nlBRtsX8
X-Mozilla-Status:
X
come up with smaller examples. For this one:
== xxx ==
a
b
c
===
== zzz ==
try
g/notfound/d
catch /E486:/
echo 'this is not caught'
endtry
===
If it weren't obvious where the error was occurring, you could
systematically add:
finish
to each line
Hi,
I would like to do something like this, to process exceptions:
try
if catch /pattern/
do this and that
else
do the ordinary thing
endif
endtry
Of course this is not real code, but catches do act like an ``if'', but I do
not know of a clean way to do
On 31/03/11 08:13, howard Schwartz wrote:
Hi,
I would like to do something like this, to process exceptions:
try
if catch /pattern/
do this and that
else
do the ordinary thing
endif
endtry
Of course this is not real code, but catches do act like an ``if'', but
I do not know of a clean way
/^#,\(.*,\)\=\s*fuzzy/s/,\s*fuzzy//'
catch /^Vim\%((\a\+)\)\=:E486/ based on example from :help catch
endtry
but I still get:
E486: Pattern not found: ^#,\(.*,\)\=\s*fuzzy
I can work around it by reversing the order, let the substitute global
do its work and then remove any '^#$' lines left
'
call setline(linenum, substitute(line, ',\s*fuzzy', '', ))
endif
endfor
endf
I tried (no pun intended) to replace the 'for' loop with:
try
execute ':'',''global/^#,\(.*,\)\=\s*fuzzy/s/,\s*fuzzy//'
catch /^Vim\%((\a\+)\)\=:E486/ based on example from :help catch
Dasn wrote:
On 16/03/09 22:18 +0100, Bram Moolenaar wrote:
This works just fine for me:
try
let reply = input(what )
catch /Vim:Interrupt/
let reply = caught . v:exception
endtry
echo reply
It seems not work for me, When I press C-c
On 17/03/09 20:19 +0100, Bram Moolenaar wrote:
Dasn wrote:
On 16/03/09 22:18 +0100, Bram Moolenaar wrote:
This works just fine for me:
try
let reply = input(what )
catch /Vim:Interrupt/
let reply = caught . v:exception
endtry
echo reply
Hi,
:h catch-interrupt
shows an example of catching interrupts, but it works not as it was
described. The document says:
If you press CTRL-C at the prompt, the script is terminated.
But the problem is: when I press CTRL-C at the prompt, the script is not
terminated, instead, it will give you
()
else
echo \nIllegal command: command
continue
endif
catch /^Vim:Interrupt$/
echo \nThis is the nested try/catch/endtry
echo Command interrupted
endtry
catch
16 matches
Mail list logo