Commit Graph

19394 Commits

Author SHA1 Message Date
Rui Abreu Ferreira
6e9af3c5dc Don't use env vars for configuration time options
- As a general rule of thumb one shouldn't use environment variables
  for setting configuration options for CMake. The reason for this is
  we don't know when CMake will be executed and re-evaluate that variable.
- e.g. If we run cmake a first time with a var set, and then run make on
  a second session (with no var) and cmake is called because a
  dependency changed, the option would be disabled
- This commit removes the use of environment vars from
  src/nvim/CMakeLists.txt entirely
- Removed SKIP_UNITTEST since it could only be used to remove a target
  at configuration time (and the target was optional anyway)
- Turned SANITIZE into an option, clang-asan.sh now passes cmake
  -DSANITIZE=ON
- Removed SKIP_EXEC since it was disabling a target at configuration time
  (not being used)
2014-12-02 14:36:47 +00:00
Thiago de Arruda
6436908ffe mouse: Remove CHECK_DOUBLE_CLICK conditionals
This is now always defined.
2014-12-02 07:21:34 -03:00
Thiago de Arruda
14f88b6865 term: Move more mouse functions to mouse.c 2014-12-02 07:21:28 -03:00
Thiago de Arruda
8a5a8dbf0f term: Remove most calls to settmode
Nvim now relies much less on setting terminal mode to cooked mode, remove most
calls to settmode, except for those that happen on startup or when suspending.
Eventually even those will be handled by the UI layer.
2014-12-02 07:15:07 -03:00
Thiago de Arruda
05f8d261fe term: Move "set_shellsize" to screen.c as "screen_resize" 2014-12-02 07:15:06 -03:00
Justin M. Keyes
212cb13ca4 Merge pull request #1582 from LBEaston/FixSegFault
Fix SegFault when entering Command(q:) or Search(q/) History
2014-12-01 07:35:44 -05:00
LBEaston
8f0e76fc50 Fix SegFault when getting full path for files 2014-12-01 13:01:01 +11:00
Justin M. Keyes
3e665efea4 Merge pull request #1497 from splinterofchaos/const-attr
constify and func-attribute memory.c and strings.c
2014-11-29 22:48:23 -05:00
Rui Abreu Ferreira
05d72e9826 Refactor declaration generation
- Call compiler from CMake instead of lua script to generate a
  preprocessor file - allows for better/early error detection if
  the compiler fails
- Preprocessor files are saved along with the headers as .i files
- Accept preprocessor lines with trailing chars after # as is
  the case in Clang/Windows
- The fourth argument to gendeclarations.lua is now the path to
  the proprocessor output file
2014-11-29 23:39:52 +00:00
Justin M. Keyes
414199c54b Merge pull request #1491 from Pyrohh/os2-and-misc-cleanup
Remove MiNT, NeXTSTEP, OS/2 References
2014-11-28 15:38:43 -05:00
Justin M. Keyes
371594fe9a Merge pull request #1533 from elmart/fix-sub-newline-abort
Fix newline substitution causing abort
2014-11-28 15:38:22 -05:00
Justin M. Keyes
ad848ced11 Merge pull request #1186 from splinterofchaos/write
Non-unix-specific os_unix function.
2014-11-28 14:50:09 -05:00
Scott Prager
275f6e3a6b mch_early_init() -> early_init().
Move general initialization functions to early_init, which simplifies
test/unit/helpers.lua, which requires all these functions.
2014-11-28 14:27:58 -05:00
Scott Prager
d5ea183633 update mch_suspend
Use the portable uv_kill.
Don't bother with archaic BeOS.
2014-11-28 14:27:58 -05:00
Scott Prager
8d271bb57b mch_init -> term_init 2014-11-28 14:27:16 -05:00
Scott Prager
a3ef5723a9 mch_write -> term_write
Switch from POSIX's write() to fwrite(stdout,...) and disable buffering
since vim buffers output explicitly and flushes when needed, like when a
key is typed.
2014-11-28 14:24:27 -05:00
Eliseo Martínez
2072fd3058 Fix newline substitution.
Problem  : Command `s/\n//` is being translated into a call to do_join
           with a count of 1. But do_join asserts its precondition count
           >= 2, which is causing the program to abort.
Note     : This in fact revealed bigger problems: generated join command
           line count, as well as reported substitutions/lines were
           wrong in several cases, since patch 7.4.232.
           See:
           [patch] http://markmail.org/message/vo7ruair5raccawp
           [issue] https://code.google.com/p/vim/issues/detail?id=287
Solution : - Don't generate join command for single-line-range case.
           - Make generated join command include:
             * lines in range + 1, when range doesn't end at last line.
             * lines in range, when range ends at last line.
           - Make reported substitutions/lines always be
             number-of-lines-joined - 1.
2014-11-28 20:00:06 +01:00
Justin M. Keyes
3ef8e4f33e Wconversion: fix #1578 2014-11-28 18:19:38 +00:00
Michael Reed
ba1e2ce287 Remove OS/2 references
Paul Slootman was removed from the top of os_unix.c as OS/2 is no longer
supported, but is still credited in runtime/doc/intro.txt.
2014-11-27 23:42:40 -05:00
Michael Reed
83a4c9d58c Remove Atari MiNT references 2014-11-27 23:42:40 -05:00
Michael Reed
c8d57e25e9 Remove NeXTSTEP references
Remove trailing whitespace as well.
2014-11-27 23:42:40 -05:00
Justin M. Keyes
68cee4c28d Merge pull request #1492 from fwalch/fix-wconversion
Fix some more -Wconversion warnings.
2014-11-27 21:02:30 -05:00
Justin M. Keyes
5e4809f5a4 Merge pull request #1566 from splinterofchaos/fix-save-tv-as-string
eval: Fix coverity false positive.
2014-11-27 21:00:38 -05:00
Justin M. Keyes
49b65b0fcd Merge pull request #1516 from fmoralesc/new-patches
vim-patch:7.4.425,435,467,472,473,478
2014-11-27 20:58:39 -05:00
Thiago de Arruda
7b0f7ea87c ui: Move check_col/check_row functions to mbyte.c
These functions were only being used by mbyte.c, so move them and add the
"static" modifier.
2014-11-27 20:33:11 -03:00
Thiago de Arruda
6f7fe5d1b9 Remove code defined under USE_IM_CONTROL #ifdefs
This is not being used and should not be part of the core anyway.
2014-11-27 20:26:10 -03:00
Felipe Morales
9ab44e74ab vim-patch:7.4.478: Use character lenght for 'showbreak'
vim-patch:7.4.478

Problem:    Using byte length instead of character length for
'showbreak'.
Solution:   Compute the character length. (Marco Hinz)

https://code.google.com/p/vim/source/detail?r=v7-4-478
2014-11-27 19:40:51 -03:00
Felipe Morales
c82eb31a5d vim-patch:7.4.473
vim-patch:7.4.473

Problem:    Cursor movement is incorrect when there is a number
            column/sign/fold column and 'sbr' is displayed.
Solution:   Adjust the column for 'sbr'. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=v7-4-473
2014-11-27 19:40:51 -03:00
Felipe Morales
42dc00b767 vim-patch:7.4.472: Only draw "precedes" entry in 'listchar' when 'list' is on
vim-patch:7.4.472

Problem:    The "precedes" entry in 'listchar' will be drawn when
'showbreak is set and list is not.
Solution:   Only draw this character when 'list' is on. (Christian
Brabandt)

https://code.google.com/p/vim/source/detail?r=af998690a8841d4df95cea0bed4246f2ba98e247
2014-11-27 19:40:51 -03:00
Felipe Morales
35e2398441 vim-patch:7.4.467: Avoid a problem with unwanted linebreaks in block mode
vim-patch:7.4.467

Avoid a problem with unwanted linebreaks in block mode

https://code.google.com/p/vim/source/detail?r=v7-4-467
2014-11-27 19:40:51 -03:00
Felipe Morales
cfa8b4a186 vim-patch:7.4.435: Disable linebreak temporarily when formatting lines.
vim-patch:7.4.435

Problem:    Line formatting behaves differently when 'linebreak' is set.
            (mvxxc)
Solution:   Disable 'linebreak' temporarily. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=v7-4-435
2014-11-27 19:40:51 -03:00
Felipe Morales
ef7eab1ec6 vim-patch:7.4.425: Adjust virtcol when showbreak is set
vim-patch:7.4.425

Problem:    When 'showbreak' is used "gj" may move to the wrong
position. (Nazri Ramliy)
Solution:   Adjust virtcol when 'showbreak' is set. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=v7-4-425
2014-11-27 19:40:51 -03:00
Scott Prager
927c6a148d eval: Fix coverity false positive.
** CID 74786:  Resource leak  (RESOURCE_LEAK)
/src/nvim/eval.c: 10614 in f_jobsend()
/src/nvim/eval.c: 10616 in f_jobsend()

save_tv_as_string() should return NULL and input_len <= 0 for an empty
string or error. Callers should check that input != NULL instead of
input_len > 0 and assert(input == NULL) when the length must be checked.
2014-11-27 15:12:35 -05:00
Florian Walch
ce5d6506ba Wconversion: Change long to int64_t in cursor_shape.c, digraph.c.
Warnings were fixed in #1488.
2014-11-27 21:08:07 +01:00
Florian Walch
dc75324997 Wconversion: Remove regexp_nfa.c from list. 2014-11-27 21:08:07 +01:00
Florian Walch
10b938bdb5 Wconversion: Fix warnings in indent_c.c. 2014-11-27 21:08:07 +01:00
Florian Walch
e3fca96e18 Wconversion: Fix warnings in file_search.c. 2014-11-27 21:08:07 +01:00
Florian Walch
cfe4cada30 Wconversion: Fix warnings in ex_eval.c. 2014-11-27 21:06:27 +01:00
Scott Prager
f75de5e671 strings: Enable -Wconvert. 2014-11-27 14:38:26 -05:00
Scott Prager
ecf81c3f20 strings/memory: constify and func_attr.
Fix MB_COPY_cHAR() to accept const pointers.
2014-11-27 14:38:26 -05:00
Thiago de Arruda
bf6bb27e79 ui: Remove redundant ui.h includes
Also move read_error_exit to os/input.c
2014-11-27 15:00:30 -03:00
Thiago de Arruda
a3534138a8 ui: Extract mouse.c/mouse.h 2014-11-27 14:48:30 -03:00
Thiago de Arruda
1865b8c1c1 ui: Remove ui_delay, ui_breakcheck and ui_set_shellsize
These functions only used to call another os_* function, so remove them and
replace all occurences in the project.
2014-11-27 14:27:18 -03:00
Thiago de Arruda
541eaf598c ui: Remove ui_inchar/ui_char_avail
Also:

- Remove NO_CONSOLE_INPUT/NO_CONSULE preprocessor conditionals
- Remove ctrl_c_interrupts variable, check for mapped_ctrl_c directly in
  process_interrupts()
- Move ui_inchar profiling to input_poll which is where Nvim blocks for input.
2014-11-27 14:12:59 -03:00
Rui Abreu Ferreira
e644369f6e Add Boolean argument escape_csi to vim_feedkeys
- By default vim_feedkeys escaped all input for CSI/K_SPECIAL bytes
  before using it. However since vim_replace_termcodes() also escapes
  the input string chaining these functions together escapes input twice
- vim_feedkeys() now takes a third Boolean argument to enable/disable
  escaping
- Breaks API compatibility
2014-11-27 08:33:53 -03:00
Justin M. Keyes
3bbbeaf2c9 Merge pull request #1552 from equalsraf/tb-fix-1530
add missing refcount increment for systemlist()
2014-11-25 16:16:08 -05:00
Rui Abreu Ferreira
ea8cc88e6a Add missing refcount increment for systemlist()
- get_system_output_as_rettv() was missing a refcount increment when
  returning an empty list, i.e. when there was no output
- we now use rettv_list_aloc() instead of list_alloc()
- issue #1530
2014-11-25 20:00:27 +00:00
Eliseo Martínez
389470bd14 Fix substitute newline: Memory functions: Improve style.
`try_malloc` was changed in 8bb2c2c074 to
avoid a warning when size is 0. Then, this improves some things on that:

- Use local vars instead of changing parameters.
- Homogenize style for other related functions.
2014-11-24 17:20:09 +01:00
Julian Mehne
6b5785b149 Fix Makefile for running valgrind with old tests. 2014-11-22 13:07:04 +01:00
Thiago de Arruda
f09a33bbc1 event: No longer process K_EVENT automatically
Two new functions, `event_enable_deferred()`/`event_disable_deferred()` have to
be called by code that is capable of handling asynchronicity. User-dialog states
like "press ENTER to continue" or the swap file confirmation no longer will
generate K_EVENT.
2014-11-21 15:41:02 -03:00