Commit Graph

3383 Commits

Author SHA1 Message Date
Scott Prager
74aef89720 term: use an argument vector for termopen().
Old behaviour: termopen('cmd') would run `&shell &shcf "cmd"`, which
caused the functional tests to fail on some systems due to the process
not "owning" the terminal. Also, it is inconsistent with jobstart().

Modify termopen() so that &shell is not invoked, but maintain the old
behaviour with :terminal. Factor the common code for building the
argument vector from jobstart() and modify the functional tests to call
termopen() instead of :terminal (fixes #2354).

Also:
 * Add a 'name' option for termopen() so that `:terminal {cmd}` produces
   a buffer named "term//{cwd}/{cmd}" and termopen() users can customize
   the name.
 * Update the documentation.
 * Add functional tests for `:terminal` sinse its behaviour now differs
   from termopen(). Add "test/functional/fixtures/shell-test.c" and move
   "test/functional/job/tty-test.c" there, too.

Helped-by: Justin M. Keyes <@justinmk>
2015-05-02 09:47:29 -04:00
Michael Reed
2054668302 Merge pull request #2493 from Pyrohh/cleanup-patches-misc
[RFC] vim-patch: 7.4.{389, 659} + small cleanup
2015-05-01 16:49:37 -04:00
Michael Reed
71592a06fd src: Misc. cleanup
These macros (and global) haven't been used since
3baba1e7bc
2015-05-01 16:45:02 -04:00
Michael Reed
98b3dc0571 vim-patch:7.4.659 + test
Problem:    When 'ruler' is set the preferred column is reset. (Issue 339)
Solution:   Don't set curswant when redrawing the status lines.

https://code.google.com/p/vim/source/detail?r=v7-4-659

Helped-by: David Bürgin <676c7473@gmail.com>
Based on #2347 by @pvinis
2015-05-01 16:45:02 -04:00
Michael Reed
28e60462c8 vim-patch:7.4.389
based on #2429 by @Hettomei

Problem:    Still sometimes Vim enters Replace mode when starting up.
Solution:   Use a different solution in detecting the termresponse and
            location response. (Hayaki Saito)

https://code.google.com/p/vim/source/detail?r=v7-4-389

The upstream patch touched a lot of files which don't exist in nvim,
hence the small size of this commit.
2015-05-01 16:45:02 -04:00
David Bürgin
cc76c5b0cf Remove obsolete vi options #2553
These options were never implemented in Vim. They are documented under
|missing-options| in runtime/doc/vi_diff.txt:
  'autoprint'
  'beautify'
  'flash'
  'graphic'
  'hardtabs'
  'mesg'
  'novice'
  'open'
  'optimize'
  'redraw'
  'slowopen'
  'sourceany'
  'w300'
  'w1200'
  'w9600'

References #2548.
2015-05-01 16:17:03 -04:00
Eliseo Martínez
88827f5834 Merge #2545: Fix clang analysis warnings. (12)
Reviewed-by: oni-link <knil.ino@gmail.com>
2015-05-01 19:38:55 +02:00
Eliseo Martínez
4fb79b1f76 Merge #2490: Add support for '%zu' in vim_snprintf().
Reviewed-by: Gustaf Lindstedt <gustaflindstedt@gmail.com>
Reviewed-by: Scott Prager <splinterofchaos@gmail.com>
2015-05-01 18:50:40 +02:00
Eliseo Martínez
2fec6b7d4e Fix warnings: Support '%zu' in vim_snprintf(): Add support. 2015-05-01 17:02:40 +02:00
Eliseo Martínez
b158fbb280 Support '%zu' in vim_snprintf(): Cleanup.
Some style changes and minimal refactoring, to tidy up code.
No behavioural changes intended.
2015-05-01 17:02:05 +02:00
Eliseo Martínez
1eaaff3fc5 Fix warnings: ex_docmd.c: ex_tabonly(): Np dereference: FP.
Problem    : Dereference of null pointer @ 5816.
Diagnostic : False positive.
Rationale  : first_tabpage is assumed to be NULL after calling
             goto_tabpage(), which should not be possible (first_tabpage
             should be not NULL before calling it, and only changed to
             another valid tab page).
Resolution : Assert first_tabpage after calling goto_tabpage().

Helped-by: oni-link <knil.ino@gmail.com>
2015-05-01 11:23:46 +02:00
Eliseo Martínez
33adbf3139 Fix warnings: ex_cmds2.c: ex_listdo(): Np dereference: FP.
Problem    : Dereference of null pointer @ 1909.
Diagnostic : False positive.
Rationale  : Suggested path error first assumes tp == NULL and later one
             valid_tabpage(tp), which is not possible.
Resolution : Assert tp != NULL if valid_tabpage(tp).
2015-05-01 11:23:46 +02:00
Eliseo Martínez
21d40475bb Fix warnings: ex_cmds2.c: ex_listdo(): Np dereference: FP.
Problem    : Dereference of null pointer @ 1903.
Diagnostic : False positive.
Rationale  : Suggested error path first assumes wp == NULL and later one
             win_valid(wp), which is not possible.
Resolution : Assert wp != NULL if win_valid(wp).
2015-05-01 11:23:46 +02:00
Bastian Winkler
df3abf4df0 vim-patch:7.4.706 #2546
Problem:    Window drawn wrong when 'laststatus' is zero and there is a
            command-line window. (Yclept Nemo)
Solution:   Set the status height a bit later. (Christian Brabandt)

https://github.com/vim/vim/commit/v7-4-706
2015-04-30 15:20:16 -04:00
Felipe Morales
46871d159a Mark some patches re: command-ranges as included #2546
reported by @glts at https://github.com/neovim/neovim/pull/2041#issuecomment-97747833
2015-04-30 15:01:55 -04:00
Florian Walch
64a4ef679a vim-patch:7.4.653 #2527
Problem:    Insert mode completion with complete() may have CTRL-L work like
	    CTRL-P.
Solution:   Handle completion with complete() differently. (Yasuhiro
	    Matsumoto, Christian Brabandt, Hirohito Higashi)

https://github.com/vim/vim/commit/v7-4-653
2015-04-30 14:26:35 -04:00
Justin M. Keyes
b427dcdda2 Merge pull request #2465 from fwalch/fix-jemalloc
Force je_ prefix for jemalloc functions, small CMake fixes.
2015-04-30 10:46:01 -04:00
Florian Walch
8130eb1191 jemalloc: Force use of prefixed functions.
* Set JEMALLOC_NO_DEMANGLE to be able to use `je_*` functions,
  regardless of how jemalloc was compiled (--with-jemalloc-prefix)
* Show jemalloc information in Neovim's version output.

Resolve #2449.
2015-04-29 22:26:55 +03:00
Florian Walch
5b5d353151 CMake: Don't request static linking for dependencies.
For built-in dependencies, shared libraries are removed and static
linking is always used.

For systemwide dependencies, static linking should not be used.
2015-04-29 22:26:55 +03:00
Florian Walch
9a08aa80f7 deps: Remove shared libraries. 2015-04-29 22:26:55 +03:00
Florian Walch
2446b997c6 CMake: Remove duplicate PkgConfig lookups. 2015-04-29 22:26:55 +03:00
Florian Walch
07d4142a18 CMake: Refer to Unibilium instead of LibUnibilium. 2015-04-29 22:26:55 +03:00
Justin M. Keyes
45b617afad Merge pull request #2041 from fmoralesc/command-ranges
Command ranges (was PR #1793)
2015-04-29 02:11:30 -04:00
Felipe Morales
b46746b93e vim-patch:7.4.595
Problem:    The test_command_count test fails when using Japanese.
Solution:   Force the language to C. (Hirohito Higashi)

https://code.google.com/p/vim/source/detail?name=v7-4-595
2015-04-28 23:08:32 -03:00
Felipe Morales
0c44d0ebfc vim-patch:7.4.588
Problem:    ":0argedit foo" puts the new argument in the second place
instead of the first.
Solution:   Adjust the range type. (Ingo Karkat)

https://code.google.com/p/vim/source/detail?name=v7-4-588
2015-04-28 23:08:32 -03:00
Felipe Morales
7e850a2f2a vim-patch:7.4.585
Problem:    Range for :bdelete does not work. (Ronald Schild)
Solution:   Also allow unloaded buffers.

https://code.google.com/p/vim/source/detail?name=v7-4-585
2015-04-28 23:08:32 -03:00
Felipe Morales
838c9aa31d vim-patch:7.4.580
Problem:    ":52wincmd v" still gives an invalid range error. (Charles
            Campbell)
Solution:   Skip over white space.

https://code.google.com/p/vim/source/detail?name=v7-4-580
2015-04-28 23:08:32 -03:00
Felipe Morales
e01ebf245e vim-patch:7.4.572
Problem:    Address type of :wincmd depends on the argument.
Solution:   Check the argument.

https://code.google.com/p/vim/source/detail?r=v7-4-572
2015-04-28 23:08:32 -03:00
Felipe Morales
e42b00dc3b vim-patch:7.4.568
Problem:    Giving an error for ":0wincmd w" is a problem for some
            plugins.
Solution:   Allow the zero in the range. (Marcin Szamotulski)

https://code.google.com/p/vim/source/detail?r=v7-4-568
2015-04-28 23:08:32 -03:00
Felipe Morales
ff70129d96 vim-patch:7.4.566
Problem:    :argdo, :bufdo, :windo and :tabdo don't take a range.
Solution:   Support the range. (Marcin Szamotulski)

https://code.google.com/p/vim/source/detail?r=v7-4-566
2015-04-28 23:08:31 -03:00
Felipe Morales
ca883df007 vim-patch:7.4.565
Problem:    Ranges for arguments, buffers, tabs, etc. are not checked to
            be valid but limited to the maximum.  This can cause the
wrong
            thing to happen.
Solution:   Give an error for an invalid value. (Marcin Szamotulski)
            Use windows range for ":wincmd".

https://code.google.com/p/vim/source/detail?r=v7-4-565
2015-04-28 23:08:31 -03:00
Felipe Morales
d2ad709a1e vim-patch:7.4.561
Patch 7.4.561
Problem:    Ex range handling is wrong for buffer-local user commands.
Solution:   Check for CMD_USER_BUF. (Marcin Szamotulski)

https://code.google.com/p/vim/source/detail?name=v7-4-561
2015-04-28 23:08:31 -03:00
Felipe Morales
87953bf5ff vim-patch:7.4.546
Problem:    Repeated use of vim_snprintf() with a number.
Solution:   Move these vim_snprintf() calls into a function.

https://code.google.com/p/vim/source/detail?name=v7-4-546
2015-04-28 23:08:31 -03:00
Felipe Morales
7fc952ab67 vim-patch:7.4.542
Problem:    Using a range for window and buffer commands has a few
            problems.
            Cannot specify the type of range for a user command.
Solution:   Add the -addr argument for user commands.  Fix problems.
            (Marcin Szamotulski

https://code.google.com/p/vim/source/detail?name=v7-4-542
2015-04-28 23:08:31 -03:00
Felipe Morales
c525085773 vim-patch:7.4.539
Patch 7.4.539 (after 7.4.530)
Problem:    Crash when computing buffer count.  Problem with range for
            user commands.  Line range wrong in Visual area.
Solution:   Avoid segfault in compute_buffer_local_count().  Check for
            CMD_USER when checking type of range. (Marcin Szamotulski)

https://code.google.com/p/vim/source/detail?name=v7-4-539
2015-04-28 23:08:31 -03:00
Felipe Morales
f6c55022ff vim-patch:7.4.535
Patch 7.4.535 (after 7.4.530)
Problem:    Can't build with tiny features.
Solution:   Add #ifdefs and skip a test.

https://code.google.com/p/vim/source/detail?name=v7-4-535

This is also a refactor of some code in 7.4.530.
2015-04-28 23:08:31 -03:00
Felipe Morales
86330fdd3f vim-patch:7.4.530-531
Specify different kinds of counts for commands.
Updated ex commands generator scripts.

Includes fixes to comments from patch 7.4.531

Original message:

Problem:    Many commands take a count or range that is not using line
            numbers.
Solution:   For each command specify what kind of count it uses.  For
            windows, buffers and arguments have "$" and "." have a
relevant
            meaning. (Marcin Szamotulski)

https://code.google.com/p/vim/source/detail?r=v7-4-530
https://code.google.com/p/vim/source/detail?r=v7-4-531

Add legacy tests for 7.4.530

https://code.google.com/p/vim/source/detail?r=1e6d87a36dcdca231721dde8cbbc26610fb3df27
2015-04-28 23:08:30 -03:00
Florian Walch
6a8862ded4 vim-patch:7.4.633 #2526
Problem:    After 7.4.630 the problem persists.
Solution:   Also skip redo when calling a user function.

https://github.com/vim/vim/commit/v7-4-633
2015-04-28 21:03:00 -04:00
Florian Walch
13e148687c vim-patch:7.4.630 #2524
Problem:    When using Insert mode completion combined with autocommands the
            redo command may not work.
Solution:   Do not save the redo buffer when executing autocommands. (Yasuhiro
            Matsumoto)

https://github.com/vim/vim/commit/v7-4-630
2015-04-28 20:55:45 -04:00
Eliseo Martínez
158d267533 Merge #2529: Fix coverity issues. (8)
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
2015-04-28 20:11:30 +02:00
Eliseo Martínez
87b4093970 coverity/109843: Nesting indent mismatch: RI.
Introduction of asserts broke bracketless if's.
2015-04-28 19:56:57 +02:00
Florian Walch
a903407471 vim-patch.sh: Fix indentation, use GH URL for tagged versions. #2525
* Link to the commit details on GitHub for a tagged version.
* Non-tagged patches (runtime updates) are still linked to
  Google Code because they are identified by a Mercurial commit hash.
2015-04-28 17:29:20 +03:00
Justin M. Keyes
7315b9d872 Merge pull request #2383 from mhinz/fix-left-click
Fix visual selection after left click on tabline
2015-04-28 10:09:31 -04:00
Marco Hinz
6fb66f4416 UI test: visual selection after left click in tabline 2015-04-28 14:16:37 +02:00
Marco Hinz
6449921943 UI test: left click in tabline 2015-04-28 14:16:37 +02:00
Marco Hinz
c1d1992b1c Fix visual selection after left click on tabline
After left clicking on a tab in the tabline, the "in_tab_line" variable wasn't
set to 'false' and every following mouse action assumed still being on the
tabline which messed up visual selection etc.
2015-04-28 14:16:37 +02:00
Eliseo Martínez
2d4a6843fc Merge #2516: Fix clang analysis warnings. (11)
Reviewed-by: oni-link <knil.ino@gmail.com>
2015-04-28 11:54:59 +02:00
Eliseo Martínez
3450762f0a Merge #2518: Enable -Wconversion. (3)
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
2015-04-28 10:31:42 +02:00
Eliseo Martínez
46f510350e Fix warnings: ex_getln.c: getexmodeline(): HI.
Problem    : Dead increment @ 1795.
Diagnostic : Harmless issue.
Rationale  : Line was necessary before (indent was used by the following
             while loop), but now that loop is removed, assignment is
             indeed dead.
Resolution : Remove line.
2015-04-27 19:50:33 +02:00
Eliseo Martínez
7c956dcbe8 Enable -Wconversion: normal.c.
Refactor summary:
- extern int opcount --> extern long opcount
- bool find_decl(..., int len, ...) --> bool find_decl(..., size_t len, ...)
  * int find_ident_under_cursor(...) --> size_t find_ident_under_cursor(...)
    - int find_ident_at_pos(...) --> size_t find_ident_at_pos(...)
    - int modify_fname(..., int *usedlen, ..., int *fnamelen) --> int modify_fname(..., size_t *usedlen, ..., size_t *fnamelen)
      * char_u *eval_vars(..., int *usedlen, ...) --> char_u *eval_vars(..., size_t *usedlen, ...)
        - int find_cmdline_var(..., int *usedlen) --> ssize_t find_cmdline_var(..., size_t *usedlen)
        - static char_u *repl_cmdline(..., int srclen, ...) --> static char_u *repl_cmdline(..., size_t srclen, ...)
    - bool get_visual_text(..., int *lenp) --> bool get_visual_text(..., size_t *lenp)
      * char_u *find_file_name_in_path(..., int len, ...) --> char_u *find_file_name_in_path(..., size_t len, ...)
        - static char_u *eval_includeexpr(..., int len) --> static char_u *eval_includeexpr(..., size_t len)
        - char_u *find_file_in_path(..., int len, ...) --> char_u *find_file_in_path(..., size_t len, ...)
          * char_u *find_file_in_path_option(..., int len, ...) --> char_u *find_file_in_path_option(..., size_t len, ...)
            - char_u *find_directory_in_path(..., int len, ...) --> char_u *find_directory_in_path(..., size_t len, ...)
      * int spell_move_to(...) --> size_t spell_move_to(...)
        - int spell_check(...) --> size_t spell_check(...)
        - static int spell_bad_len --> static size_t spell_bad_len
    - void find_pattern_in_path(..., int len, ...) --> void find_pattern_in_path(..., size_t len, ...)

Helped-by: Justin M. Keyes <justinkz@gmail.com>
2015-04-27 19:27:07 +02:00