0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

142 Commits

Author SHA1 Message Date
ichizok
663d18d610
patch 9.1.0984: exception handling can be improved
Problem:  exception handling can be improved
Solution: add v:stacktrace and getstacktrace()

closes: #16360

Co-authored-by: Naruhiko Nishino <naru123456789@gmail.com>
Signed-off-by: ichizok <gclient.gaap@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-02 18:06:00 +01:00
Yegappan Lakshmanan
734286e4c6
patch 9.1.0462: eval5() and eval7 are too complex
Problem:  eval5() and eval7 are too complex
Solution: Refactor eval5() and eval7() in eval.c
          (Yegappan Lakshmanan)

closes: #14900

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-03 18:52:22 +02:00
nwounkn
36b6676719
patch 9.1.0459: Vim9: import autoload does not work with symlink
Problem:  Vim9: import autoload does not work with symlink
          (Olivier Dormond)
Solution: set sn_autoload_prefix in check_script_symlink
          (nwounkn)

fixes: #14775
closes: #14885

Signed-off-by: nwounkn <nwounkn@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-02 16:10:07 +02:00
Yegappan Lakshmanan
8c35c26c1f
patch 9.1.0403: Vim9: not able to import file from start dir
Problem:  Vim9: not able to import file from start dir
          (Danielle McLean)
Solution: Allow to import from start directory
          (Yegappan Lakshmanan)

fixes: #13313
closes: #14740

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-10 13:10:54 +02:00
zeertzjq
f68517c167
patch 9.1.0372: Calling CLEAR_FIELD() on the same struct twice
Problem:  Calling CLEAR_FIELD() on the same struct twice.
Solution: Remove the second CLEAR_FIELD().  Move the assignment of
          cookie.sourceing_lnum (zeertzjq).

closes: #14627

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-25 21:34:10 +02:00
Yegappan Lakshmanan
f135fa28e4
patch 9.1.0359: MS-Windows: relative import in a script sourced from a buffer doesn't work
Problem:  MS-Windows: Relative import in a script sourced from a buffer
          doesn't work (Ernie Rael)
Solution: Set a filename, so that we are not trying to use
          script-relative filename (Yegappan Lakshmanan)

When a script is sourced from a buffer, the file name is set to ":source
buffer=". In MS-Windows, the ":" is a path separator character (used
after a drive letter). This results in the code trying to use the ":"
prefix to import the script on MS-Windows. To fix this, when importing a
script from a script sourced from a buffer with nofile, don't use
a script relative path name.

fixes #14588
closes: #14603

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-20 18:31:21 +02:00
Ernie Rael
9a90179a11
patch 9.1.0338: Vim9: import through symlinks not correctly handled
Problem:  Vim9: import through symlinks not correctly handled
Solution: Check for script being a symlink but only once
          (Ernie Rael)

closes: #14565

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-16 22:11:56 +02:00
Ernie Rael
16cdfa69e0
patch 9.1.0255: Vim9: no indication of script nr in stack trace of classes
Problem:  Vim9: no indication of script nr in stack trace of classes
Solution: Prefix the class name with the script name in the stack trace.
          (Ernie Rael)

fixes: #14376
closes: #14390

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-02 19:05:39 +02:00
Yegappan Lakshmanan
fa63008727
patch 9.1.0165: Vim9: Importing an autoload imported script fails
Problem:  Vim9: Importing an autoload imported script fails
          (Song-Tianxiang)
Solution: Return the script ID in this case
          (Yegappan Lakshmanan)

fixes: #14171
closes: #14174

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-10 19:22:38 +01:00
Zoltan Arpadffy
6fdb628082
patch 9.0.2180: POSIX function name in exarg causes issues
Problem:  POSIX function name in exarg struct causes issues
          on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
          remove isinf() workaround for VMS

There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.

Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.

The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.

closes: #13704

Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-19 20:53:07 +01:00
Christian Brabandt
4e5c3cf07b
patch 9.0.2120: un-used assignment in do_source_buffer_init
Problem:  un-used assignment in do_source_buffer_init
Solution: Remove it

Coverity warns about assigning NULL to line in scriptfile.c:1408,
because right after that assignment, in the next iteration of the loop,
line will be overwritten by the next value from vim_strsave().

And in case this was the last iteration, the line variable is no longer
used until the function returns. So we can safely remove that assignment.

closes: #13547

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-21 19:59:54 +01:00
Ernie Rael
21d3212361
patch 9.0.1842: Need more accurate profiling
Problem:  Need more accurate profiling
Solution: Improve profiling results

closes: #12192

Reduce overhead of checking if a function should be profiled,
by caching results of checking (which are done with regexp).

Cache uf_hash for uf_name in ufunc_T.

Cache cleared when regexps are changed.

Break at first match for has_profiling lookup.

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
2023-09-02 15:09:18 +02:00
LemonBoy
0ffc17aa47
patch 9.0.1758: vim9 no class identifiers in stack dumps
Problem:  vim9 no class identifiers in stack dumps
Solution: Prefix class members in stack traces with the class name
          followed by a dot.

closes: #12866
closes: #12078

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
2023-08-20 18:09:11 +02:00
zeertzjq
be5cdd1d63
patch 9.0.1734: :runtime completion fails for multiple args
Problem: :runtime completion fails for multiple args
Solution: Make it work

closes: #12616

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 23:48:58 +02:00
zeertzjq
008c91537b
patch 9.0.1730: passing multiple patterns to runtime not working
Problem: passing multiple patterns to runtime not working
Solution: prepend prefix to each argument separately

closes: #12617

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17 23:08:53 +02:00
zeertzjq
276410e78f patch 9.0.1523: some error messages are not marked for translation
Problem:    Some error messages are not marked for translation.
Solution:   Surround the messages in _(). (closes #12356)
2023-05-07 21:59:33 +01:00
ichizok
7e5fe38efc patch 9.0.1454: code indenting is confused by macros
Problem:    Code indenting is confused by macros.
Solution:   Put semicolon after the macros instead of inside. (Ozaki Kiichi,
            closes #12257)
2023-04-15 13:17:50 +01:00
zeertzjq
39c9ec16ea patch 9.0.1434: crash when adding package already in 'runtimepath'
Problem:    Crash when adding package already in 'runtimepath'.
Solution:   Change order for using 'runtimepath' entries. (closes #12215)
2023-04-01 13:52:03 +01:00
zeertzjq
2d68b722e3 patch 9.0.1431: getscriptinfo() loops even when specific SID is given
Problem:    getscriptinfo() loops even when specific SID is given.
Solution:   Only loop when needed.  Give a clearer error message.
            (closes #12207)
2023-03-30 21:50:37 +01:00
Yegappan Lakshmanan
14113fdf9c patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected file
Problem:    FOR_ALL_ macros are defined in an unexpected file.
Solution:   Move FOR_ALL_ macros to macros.h.  Add FOR_ALL_HASHTAB_ITEMS.
            (Yegappan Lakshmanan, closes #12109)
2023-03-07 17:13:51 +00:00
Yegappan Lakshmanan
fadc02a2a5 patch 9.0.1251: checking returned value of ga_grow() is inconsistent
Problem:    Checking returned value of ga_grow() is inconsistent.
Solution:   Check for FAIL instaed of "not OK". (Yegappan Lakshmanan,
            closes #11897)
2023-01-27 21:03:12 +00:00
zeertzjq
5c8771bc5a patch 9.0.1238: :runtime completion can be further improved
Problem:    :runtime completion can be further improved.
Solution:   Also complete the {where} argument values and adjust the
            completion for that. (closes #11874)
2023-01-24 12:34:03 +00:00
Yegappan Lakshmanan
6ec6666047 patch 9.0.1237: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11858)
2023-01-23 20:46:21 +00:00
zeertzjq
3770f4c9cd patch 9.0.1231: completion of :runtime does not handle {where} argument
Problem:    Completion of :runtime does not handle {where} argument.
Solution:   Parse the {where} argument. (closes #11863)
2023-01-22 18:38:51 +00:00
root
a6759381a5 patch 9.0.1227: no cmdline completion for :runtime
Problem:    No cmdline completion for :runtime.
Solution:   Add completion for :runtime. (closes #11853, closes #11447)
            Improve the resulting matches.
2023-01-21 21:56:06 +00:00
Bram Moolenaar
a2942c7468 patch 9.0.1131: build failure without the +eval feature
Problem:    Build failure without the +eval feature.
Solution:   Move code inside #ifdef.
2023-01-02 13:41:49 +00:00
Bram Moolenaar
39c82ea656 patch 9.0.1130: unexpected output when autoloading a script
Problem:    Unexpected output when autoloading a script for an interactive
            operation.
Solution:   Reset "KeyTyped" while loading a script and when handling a nested
            function. (closes #11773)
2023-01-02 13:08:01 +00:00
dundargoc
c57b5bcd22 patch 9.0.0828: various typos
Problem:    Various typos.
Solution:   Correct typos. (closes #11432)
2022-11-02 13:30:51 +00:00
Bram Moolenaar
a4e0b9785e patch 9.0.0634: evaluating "expr" options has more overhead than needed
Problem:    Evaluating "expr" options has more overhead than needed.
Solution:   Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr',
            "expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr',
            'formatexpr', 'indentexpr' and 'charconvert'.
2022-10-01 19:43:52 +01:00
Bram Moolenaar
aeef1f7f6d patch 9.0.0468: exectution stack underflow without the +eval feature
Problem:    Exectution stack underflow without the +eval feature. (Dominique
            Pellé)
Solution:   Add to execution stack without FEAT_EVAL. (closes #11135)
2022-09-15 12:20:18 +01:00
Yegappan Lakshmanan
2f892d8663 patch 9.0.0303: it is not easy to get information about a script
Problem:    It is not easy to get information about a script.
Solution:   Make getscriptinf() return the version.  When selecting a specific
            script return functions and variables. (Yegappan Lakshmanan,
            closes #10991)
2022-08-28 18:52:10 +01:00
Yegappan Lakshmanan
520f6ef60a patch 9.0.0269: getscriptinfo() does not include the version
Problem:    getscriptinfo() does not include the version.  Cannot select
            entries by script name.
Solution:   Add the "version" item and the "name" argument. (Yegappan
            Lakshmanan, closes #10962)
2022-08-25 17:40:40 +01:00
Bram Moolenaar
5214b29461 patch 9.0.0256: compiler warning for uninitialized variables
Problem:    Compiler warning for uninitialized variables.
Solution:   Initilize the variables.
2022-08-24 17:32:35 +01:00
Bram Moolenaar
0af2ecfe44 patch 9.0.0255: build failure without the eval feature
Problem:    Build failure without the eval feature.
Solution:   Add #ifdef.
2022-08-24 17:05:56 +01:00
Bram Moolenaar
753885b6c5 patch 9.0.0253: a symlink to an autoload script results in two entries
Problem:    A symlink to an autoload script results in two entries in the list
            of scripts, items expected in one are actually in the other.
Solution:   Have one script item refer to the actually sourced one.
            (closes #10960)
2022-08-24 16:30:36 +01:00
zeertzjq
a247142ae4 patch 9.0.0248: duplicate code in finding a script in the execution stack
Problem:    Duplicate code in finding a script in the execution stack.
Solution:   Reduce duplicate code. (closes #10961)
2022-08-23 19:26:05 +01:00
Yegappan Lakshmanan
f768c3d19c patch 9.0.0244: cannot easily get the list of sourced scripts
Problem:    Cannot easily get the list of sourced scripts.
Solution:   Add the getscriptinfo() function. (Yegappan Lakshmanan,
            closes #10957)
2022-08-22 13:15:13 +01:00
Bram Moolenaar
887748742d patch 9.0.0222: no good reason why text objects are only in larger builds
Problem:    No good reason why text objects are only in larger builds.
Solution:   Graduate +textobjects.
2022-08-16 20:24:29 +01:00
zeertzjq
5a4fff4d94 patch 9.0.0217: 'shellslash' works differently when sourcing a script again
Problem:    'shellslash' works differently when sourcing a script again.
Solution:   Use the name from the script item. (closes #10920)
2022-08-15 17:53:55 +01:00
Yegappan Lakshmanan
ee47eaceaa patch 9.0.0003: functions are global while they could be local
Problem:    Functions are global while they could be local.
Solution:   Add "static".  Add a few tests. (Yegappan Lakshmanan,
            closes #10612)
2022-06-29 12:55:36 +01:00
Bram Moolenaar
4748c4bd64 patch 8.2.4974: ":so" command may read after end of buffer
Problem:    ":so" command may read after end of buffer.
Solution:   Compute length of text properly.
2022-05-17 17:47:07 +01:00
Bram Moolenaar
31e5c60a68 patch 8.2.4753: error from setting an option is silently ignored
Problem:    Error from setting an option is silently ignored.
Solution:   Handle option value errors better.  Fix uses of N_().
2022-04-15 13:53:33 +01:00
LemonBoy
eca7c60d68 patch 8.2.4749: <script> is not expanded in autocmd context
Problem:    <script> is not expanded in autocmd context.
Solution:   Add the context to the pattern struct. (closes #10144)
            Rename AutoPatCmd to AutoPatCmd_T.
2022-04-14 15:39:43 +01:00
Bram Moolenaar
8944551534 patch 8.2.4748: cannot use an imported function in a mapping
Problem:    Cannot use an imported function in a mapping.
Solution:   Recognize <SID>name.Func.
2022-04-14 12:58:23 +01:00
LemonBoy
6013d0045d patch 8.2.4726: cannot use expand() to get the script name
Problem:    Cannot use expand() to get the script name.
Solution:   Support expand('<script>'). (closes #10121)
2022-04-09 21:42:10 +01:00
Bram Moolenaar
c0ceeeb839 patch 8.2.4650: "import autoload" only works with using 'runtimepath'
Problem:    "import autoload" only works with using 'runtimepath'.
Solution:   Also support a relative and absolute file name.
2022-03-30 21:12:27 +01:00
Bram Moolenaar
2bdad61267 patch 8.2.4647: "source" can read past end of copied line
Problem:    "source" can read past end of copied line.
Solution:   Add a terminating NUL.
2022-03-29 19:52:12 +01:00
Yegappan Lakshmanan
454ce6737c patch 8.2.4617: no completion for :scriptnames
Problem:    No completion for :scriptnames.
Solution:   Implement :scriptnames completion. (Yegappan Lakshmanan,
            closes #10005)
2022-03-24 11:22:13 +00:00
Yegappan Lakshmanan
35dc17634d patch 8.2.4607: sourcing buffer lines may lead to errors for conflicts
Problem:    Sourcing buffer lines may lead to errors for conflicts.
Solution:   Add the ++clear argument. (Yegappan Lakshmanan, closes #9991)
2022-03-22 12:13:54 +00:00
Yegappan Lakshmanan
85b43c6cb7 patch 8.2.4603: sourcing buffer lines is too complicated
Problem:    Sourcing buffer lines is too complicated.
Solution:   Simplify the code. Make it possible to source Vim9 script lines.
            (Yegappan Lakshmanan, closes #9974)
2022-03-21 19:45:17 +00:00