Commit Graph

2882 Commits

Author SHA1 Message Date
Justin M. Keyes
b1d079c83b Merge #1979 'Enable -Wconversion' 2015-02-18 20:54:15 -05:00
Eliseo Martínez
36340803af Enable -Wconversion: os_unix.c. 2015-02-18 20:54:14 -05:00
Eliseo Martínez
cbabf9491b Enable -Wconversion: keymap.c. 2015-02-18 20:54:13 -05:00
Eliseo Martínez
94db26edbd Enable -Wconversion: indent.c.
Note: Clint was failing because of recommending not to use long. But
converting to long is the proper refactoring here, in as far as other
longs exist. We could, then, disable clint rule, or remove this file
from checking. We choose the former, as it's being discussed what to do
with longs, but a decision has not been taken. So, it seems most
reasonable to allow longs for now, to enable proper refactorings, and
then, when a decision is taken, refactor all longs to some other thing.
2015-02-18 20:54:13 -05:00
Eliseo Martínez
7dd48d7af0 Enable -Wconversion: mark.c.
Refactoring summary:
- MB_STRNICMP: Inlined.
- MB_STRNCMP: Inlined.
2015-02-18 20:54:13 -05:00
Eliseo Martínez
690e43b461 Enable -Wconversion: Passing-by: Remove dead code (MACOS_CONVERT).
MacOS (pre Mac OS X) is not supported anymore.
2015-02-18 20:54:12 -05:00
Eliseo Martínez
7a7c933b86 Enable -Wconversion: ui.c.
Refactoring summary:
- ui_write(): len: int --> size_t
    * parse_abstract_ui_codes(): len: int --> size_t
    * string_convert(): lenp: int * --> size_t *
        - string_convert_ext(): lenp      : int * --> size_t *
                                unconvlenp: int * --> size_t *
            * utf8len_tab_zero: char[] --> uint8_t[]
            * iconv_string(): slen      : int --> size_t
                              unconvlenp: int * --> size_t *
                              resultlenp: int * --> size_t *
        - mch_print_text_out(): len: int --> size_t
    * out_pos: int --> size_t
2015-02-18 20:54:12 -05:00
Thiago de Arruda
366662d932 Merge PR #2007 'Fixes for the new TUI' 2015-02-18 13:31:39 -03:00
Thiago de Arruda
e7c945ab59 input: Escape utf8 sequences that contain CSI/K_SPECIAL 2015-02-18 13:16:30 -03:00
Thiago de Arruda
25ceadab37 tui: Remove support for overriding escape sequences with nvim options
- Add xterm/iterm sequences for changing cursor shape(with tmux wrapping).
  Enabled by setting the NVIM_TUI_ENABLE_CURSOR_SHAPE environment variable.
- Remove nvim_override parameter from unibi_out. In the future another way of
  overriding the terminal strings will be added.
2015-02-18 10:46:20 -03:00
Thiago de Arruda
761ccba86f tui: Fix use after free(reported by clang static analyzer) 2015-02-18 10:31:36 -03:00
Thiago de Arruda
59fb8f8172 tui: Add support bracketed paste
Inspired by the vim-bracketed-paste plugin but adapted for the new TUI. Also
initialize some variables of type `Error` that were uninitialized
2015-02-18 09:07:16 -03:00
Thiago de Arruda
26371f4ccc tui: Fix to_status_line terminfo sequence for xterm
Moving the cursor to the status line(to set the title) requires a different
sequence for xterm than the one used by urxvt.
2015-02-17 23:09:36 -03:00
Thiago de Arruda
7ea91de054 tui: Fix background clear for some terminals
Some terminals will perform clearing functions using the current attributes.
Ensure the default attributes are set before clearing.
2015-02-17 23:09:36 -03:00
Justin M. Keyes
66a03a7385 fix rebase hiccup #1911 2015-02-17 01:10:49 -05:00
Justin M. Keyes
662b7227b5 Merge #1717 'TabNew, TabNewEntered, TabClosed' 2015-02-16 23:24:31 -05:00
Felipe Morales
3ffc5d81c3 Add TabClosed event
TabClosed is triggered when a tab page closes.
2015-02-16 23:24:31 -05:00
Felipe Morales
66d94869a0 Add TabNewEntered
TabNewEntered is triggered after vim has entered a buffer in new tab.
2015-02-16 23:24:30 -05:00
Felipe Morales
817be96be5 Add TabNew event
TabNew triggers when entering a new tab page, but not when entering an
already created one.
2015-02-16 23:24:30 -05:00
Thiago de Arruda
0429857689 Merge PR #1820 'Reimplement builtin terminal UI with termkey/unibilium' 2015-02-16 23:42:25 -03:00
Thiago de Arruda
40b7990553 test: Fix 051_highlight_spec.lua
- The syntax `gui=` is invalid when setting properties of highlight group.
- Wait for the initial "-- More --" prompt before continuing. Required to avoid
  a race condition
2015-02-16 23:17:39 -03:00
Thiago de Arruda
419da839e0 cleanup: Remove unused functions and builtin termcaps 2015-02-16 23:17:39 -03:00
Thiago de Arruda
d8f3458ec7 syntax: Refactor to store all term and gui attributes independently
Now the attrentry_T structure will store all attributes in separate fields for
cterm and rgb UIs.
2015-02-16 23:17:39 -03:00
Thiago de Arruda
9a2dd7c498 ui: Rewrite the builtin terminal UI
Now all terminal-handling code was moved to src/nvim/tui, which implements a
new terminal UI based on libtermkey and unibilium
2015-02-16 23:17:39 -03:00
Thiago de Arruda
e0e41b30c6 ui: Remove/adapt some old code for a big UI refactor
- Remove abstract_ui global, now it is always active
- Remove some terminal handling code
- Remove unused functions
- Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs
- Remove tgetent/terminfo from version.c
- Remove curses/terminfo dependencies
- Only start/stop termcap when starting/exiting the program
- msg_use_printf will return true if there are no attached UIs(
  messages will be written to stdout)
- Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
2015-02-16 23:17:39 -03:00
Thiago de Arruda
6383ea6e8e ui: Remove redundant cursor_goto calls 2015-02-16 23:17:38 -03:00
Thiago de Arruda
d225349dc6 input: Remove input_buffer_{save,restore}
The input buffer is only used for data that really came from another process and
is only visible to os/input.c. Remove the input_buffer_{save,restore} functions,
they are not necessary(Also can result in problems if data comes while the
typeahead is saved).
2015-02-16 23:17:38 -03:00
Thiago de Arruda
e17f92eb29 input: Fix handle_mouse_event function
Ignore all keys that aren't prefixed with KS_EXTRA.
2015-02-16 23:17:38 -03:00
Thiago de Arruda
2b6ffa61bf input: Prefer keycodes in input_enqueue key translation
This is required to correctly handle certain keys such as <delete>
2015-02-16 23:17:38 -03:00
Thiago de Arruda
8f31ebc4f7 macro: Add MAX macro and rename min to MIN 2015-02-16 23:17:38 -03:00
Thiago de Arruda
98dca8a827 test: Increase default_screen_timeout when running on travis
Some screen tests such as system/ctrl+c(viml_system_spec.lua) can take some time
to respond(default kill timeout is 2 seconds for an interrupted job) and fail
when running under a slow environment such as travis.
2015-02-16 23:17:38 -03:00
Thiago de Arruda
291e15c60a test: Remove unnecessary tests from viml_system_spec.lua
The `system` function is never executed with these tests because the ctrl+c is
queued with the input string that calls it(The `process_interrupts` function
will destroy all previous input when a ctrl+c is found).
2015-02-16 23:17:38 -03:00
Thiago de Arruda
e974b00283 test: Fix race condition in window_spec.lua
Without waiting for the 'gg' command to be processed, its possible that the
following assertion will fail.
2015-02-16 23:17:38 -03:00
Thiago de Arruda
e6208df73e test: Add synchronization helper for functional tests
The `wait` function will only return after all input has been processed by nvim.
It is useful to time assertions correctly.
2015-02-16 23:17:38 -03:00
Michael Reed
af46564dd6 Remove 'edcompatible' #1911
Closes #1902
2015-02-16 21:00:30 -05:00
Justin M. Keyes
3bb77befe5 Merge #1981 'treat NULL initialized vimscript string as api type String' 2015-02-16 20:13:55 -05:00
Björn Linse
f4f0f646c3 api: always return empty string as api type String 2015-02-16 20:13:54 -05:00
Björn Linse
f56d1dc838 test: NULL-initialized vimscript strings should eval to empty strings 2015-02-16 20:13:53 -05:00
Seth Woodworth
fd636fc6dc runtime: make the spellfile creation use .nvim folder #1990 2015-02-15 12:19:55 -05:00
Justin M. Keyes
1b055c54a0 FEAT_SIGNS: restore :signs wildmenu, and add test. 2015-02-15 02:49:59 -05:00
Felipe Morales
6e992876ea shadow previously set signs #1893 2015-02-13 14:56:43 -05:00
Justin M. Keyes
2d22e1f035 vim-patch:7.4.601 #1950
Problem:    It is not possible to have feedkeys() insert characters.
  Solution:   Add the 'i' flag.

  https://code.google.com/p/vim/source/detail?r=v7-4-601
2015-02-12 23:21:09 -05:00
Justin M. Keyes
5483cb4e62 api/vim.c: use FOR_ALL_* sugar #1963 2015-02-12 23:00:57 -05:00
Thiago de Arruda
ec2c2994e6 Merge pull request #1977 from jakerr/api-exception
Discard exceptions once they are converted to API errors
2015-02-12 09:16:55 -03:00
Jake Kerr
9330579dcf Discard exceptions once they are converted to API errors
Fixes: #1976
2015-02-12 20:06:54 +09:00
John Szakmeister
f1f1f711c7 Merge pull request #1965 from jszakmeister/fix-fs-spec-test-for-freebsd
Fix an fs_spec test under FreeBSD and a symlinked home directory.
2015-02-11 19:45:26 -05:00
Eliseo Martínez
e177357fc8 Merge #1947: Fix coverity issues. (4) 2015-02-11 19:47:43 +01:00
Eliseo Martínez
bbfaa78dcd coverity/102149: Out-of-bounds access: FP.
Problem    : Out-of-bounds access @ 5815.
Diagnostic : False positive.
Rationale  : Error occurs when event_name2nr() returns NUM_EVENTS, which
             means an event with that name was not found. That cannot
             happen, as previous check using find_end_event() @ 5744
             ensures event name exists.
Resolution : Assert event_name2nr() result is less thatn NUM_EVENTS.
2015-02-11 19:10:36 +01:00
Thiago de Arruda
81d27d4c6b coverity/{68484,68485}: Read from pointer after free: RI.
Problem    : Read from pointer after free @ {242, 391}.
Diagnostic : Real issues.
Rationale  : Channel gets indeed freed on error case, producing
             incorrect accesses to freed pointer later on.
Resolution : Implement reference counting mechanism to know when to free
             channel.
2015-02-11 19:10:36 +01:00
Eliseo Martínez
77ace65bdc coverity/13773: Resource leak: RI.
Problem    : Resource leak @ 3324.
Diagnostic : Real issue.
Rationale  : Stack is not being freed on error cases.
Resolution : Free stack before invoking EMSG_RET_NULL.
2015-02-11 19:10:36 +01:00