Giter Site home page Giter Site logo

E490 foldopen error can’t be caught about vim HOT 3 CLOSED

vim avatar vim commented on May 22, 2024
E490 foldopen error can’t be caught

from vim.

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 22, 2024
>     try | foldopen | catch | echom v:exception

Of course, here should be trailing `| endtry`.

Original comment by [email protected] on 13 Jan 2012 at 4:20

from vim.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 22, 2024
Bram,
the problem is, the do{} while loop in ex_docmd.c in do_cmdline (line 1289).

If you look at this line:
&& !(did_emsg && used_getline
    && (getline_equal(fgetline, cookie, getexmodeline)
       || getline_equal(fgetline, cookie, getexline)))
Then the loop will always terminate, if did_emsg is set, even so a catch later 
on
might actually catch the error. So one probably also needs to check whether a 
try-clause if active and if those, let the loop continue.

Something like this patch:

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1295,9 +1295,14 @@
                && cstack.cs_trylevel == 0
 #endif
            )
-           && !(did_emsg && used_getline
+           && !(used_getline
                            && (getline_equal(fgetline, cookie, getexmodeline)
-                              || getline_equal(fgetline, cookie, getexline)))
+                              || getline_equal(fgetline, cookie, getexline))
+           && did_emsg
+#ifdef FEAT_EVAL
+           && cstack.cs_trylevel == 0
+#endif
+           )
            && (next_cmdline != NULL
 #ifdef FEAT_EVAL
                        || cstack.cs_idx >= 0

This almost works, except when using an unknown command like this:
try | foobar|catch|echom v:exception|endtry
then the loop won't terminate.
I am not sure, what the correct abort condition needs to be
in this case.
(and I don't understand all conditions in that loop).

Original comment by [email protected] on 19 Aug 2012 at 12:57

from vim.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 22, 2024
Fixed by 7.3.637

Original comment by [email protected] on 29 Sep 2014 at 4:58

  • Changed state: Fixed

from vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.