Commit Graph

157 Commits

Author SHA1 Message Date
Anton Ovchinnikov
9925b3a047 Remove redundant casts 2015-03-09 00:40:50 +01:00
Thiago de Arruda
3baba1e7bc refactor: Remove term modules and termcap options
- Removed term.c, term.h and term_defs.h
- Tests for T_* values were removed. screen.c was simplified as a
  consequence(the best strategy for drawing is implemented in the UI layer)
- Redraw functions now call ui.c functions directly. Updates are flushed with
  `ui_flush()`
- Removed all termcap options(they now return empty strings for compatibility)
- &term/&ttybuiltin options return a constant value(nvim)
- &t_Co is still available, but it mirrors t_colors directly
- Remove cursor tracking from screen.c and the `screen_start` function. Now the
  UI is expected to maintain cursor state across any call, and reset it when
  resized.
- Remove unused code
2015-02-21 05:08:21 -03:00
Felipe Morales
6e992876ea shadow previously set signs #1893 2015-02-13 14:56:43 -05:00
Michael Reed
cd8e91b87e Macro cleanup: HAS_SWAP_EXISTS_ACTION
Neovim always ships with all features[0], so this serves no purpose.
Besides, this always evaluated to true.

[0]: https://github.com/neovim/neovim/wiki/Differences-from-vim
2015-01-14 15:08:19 -05:00
Michael Reed
d86ebc7afb Macro cleanup: PROTO
Regarding dict_lookup() in eval.c: both definitions are the same, the
only difference being the spacing between the indirection operator and
the indentation level.
2015-01-14 15:07:16 -05:00
Eliseo Martínez
7f7262e933 Cleanup: Rename getdigits() family functions. 2015-01-11 21:04:08 +01:00
Eliseo Martínez
04c0658024 Cleanup: Refactor getdigits().
Problem  : getdigits() currently returns a long, but at most places,
           return value is casted (unsafely) into an int. Making casts
           safe would introduce a lot of fuss in the form of assertions
           checking for limits.
Note     : We cannot just change return type to int, because, at some
           places, legitimate long values are used. For example, in
           diff.c, for line numbers.
Solution : Introduce new functions:
           - get_digits()      : Gets an intmax_t from a string.
           - get_int_digits()  : Wrapper for ints.
           - get_long_digits() : Wrapper for longs.
           And replace getdigits() invocations by the appropiate
           wrapper invocations.
2015-01-11 17:18:39 +01:00
Marco Hinz
7e31044cd8 vim-patch:7.4.456
Problem:  'backupcopy' is global, cannot write only some
          files in a different way.
Solution: Make 'backupcopy' global-local. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=v7-4-456
2014-12-20 16:31:59 +01:00
Marco Hinz
7fc7f026ad vim-patch:7.4.455
Problem:  Completion for :buf does not use 'wildignorecase'. (Akshay H)
Solution: Pass the 'wildignorecase' flag around.

https://code.google.com/p/vim/source/detail?r=v7-4-455
2014-12-20 09:41:51 +01:00
Felipe Oliveira Carvalho
0bc40e660c Simple refatorings that didn't fit the pattern of the last commit 2014-12-13 23:36:11 -03:00
Felipe Oliveira Carvalho
77135447e0 Reduce indentation level by early returning or continuing loop
Replace code like this

```c
func() {
    if (cond) {
	...
	...
	...
    }
    return ret;
}
```

```c
for (...) {
    if (cond) {
	...
	...
	...
    }
}
```

with

```c
func() {
    if (!cond) {
	return ret;
    }
    ...
    ...
    ...
}
```

```c
for (...) {
    if (!cond) {
	continue;
    }
    ...
    ...
    ...
}
```
2014-12-13 23:36:11 -03: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
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
Wayne Rowcliffe
63e2558870 Convert some values from buffer_defs.h to bools 2014-11-12 00:38:34 -06:00
Victor Fonseca
9097b69088 Fix sign column redraw
Fixed a bug introduced in SHA:aa66f2487edde49b9a5ba10cd70d706d06a94e25,
due to a misapplied patch. buf_del_sign should redraw the window if the
sign deleted was the last one in the buffer.
Also moved the curwin verification to the correct function.
2014-10-20 17:23:09 -02:00
Justin M. Keyes
5e65e3eae0 Merge pull request #1208 from war1025/dev/remove_for_all_windows
Remove FOR_ALL_WINDOWS and replace with FOR_ALL_WINDOWS_IN_TAB(curtab)
2014-10-03 13:44:50 -04:00
Justin M. Keyes
d97a8e312e Merge pull request #1209 from atwupack/vp-7.4.320
vim-patch:7.4.320
2014-09-26 16:05:49 -04:00
Wayne Rowcliffe
9b6f192693 Replace FOR_ALL_WINDOWS with FOR_ALL_WINDOWS_IN_TAB(curtab) 2014-09-24 19:00:50 -05:00
Wayne Rowcliffe
683bc797a0 FOR_ALL_WINDOWS_IN_TAB and local variables in FOR_ALL_TAB_WINDOWS 2014-09-22 09:31:09 -05:00
André Twupack
2b937fe00d vim-patch:7.4.320
Problem:    Possible crash when an BufLeave autocommand deletes the buffer.
Solution:   Check for the window pointer being valid.  Postpone freeing the
            window until autocommands are done. (Yasuhiro Matsumoto)

https://code.google.com/p/vim/source/detail?r=v7-4-320
2014-09-21 10:42:27 +02:00
Shougo Matsushita
aa66f2487e vim-patch:7.4.369
Problem:    Using freed memory when exiting while compiled with EXITFREE.
Solution:   Set curwin to NULL and check for that. (Dominique Pelle)

https://code.google.com/p/vim/source/detail?r=v7-4-369
2014-09-17 07:01:01 +09:00
Wayne Rowcliffe
ac0b9714ed Additional FOR_ALL_WINDOWS usage 2014-09-08 17:27:41 -05:00
Stefan Hoffmann
3cf7a17a44 fileid: rename os_file_id_equal 2014-08-31 15:47:36 +02:00
Stefan Hoffmann
4e43095ab2 fileid: rename os_get_file_id 2014-08-31 15:43:40 +02:00
Justin M. Keyes
e1c330a486 Merge pull request #1024 from war1025/dev/for_all_buffers
Add FOR_ALL_BUFFERS helper
2014-08-19 23:49:25 -04:00
Wayne Rowcliffe
888a31ba45 FOR_ALL_BUFFERS use locally declared buffer pointer 2014-08-17 11:13:42 -05:00
André Twupack
9c8da794e1 vim-patch:7.4.201
Problem:    'lispwords' is a global option.
Solution:   Make 'lispwords' global-local. (Sung Pae)

https://code.google.com/p/vim/source/detail?r=06e5f65c34d8136c3a9d2219429b7eca35cb3a21
2014-08-15 18:56:05 +02:00
Wayne Rowcliffe
3599a834d5 Return bool from find_win_for_buf #1023 2014-08-07 00:42:13 -04:00
Wayne Rowcliffe
8cf45786b1 Add FOR_ALL_BUFFERS helper 2014-08-02 20:19:33 -05:00
Wayne Rowcliffe
0761142246 Minor buffer.c style cleanups 2014-07-26 16:43:29 -05:00
Wesley Wiser
c7eb8c5cd7 coverity/62610: Remove dead code from setfname() 2014-07-20 04:49:38 -04:00
Pavel Platto
47084ea765 Use strict function prototypes #945
`-Wstrict-prototypes` warn if a function is declared or defined without
specifying the argument types.

This warning disallow function prototypes with empty parameter list.
In C, a function declared with an empty parameter list accepts an
arbitrary number of arguments when being called. This is for historic
reasons; originally, C functions didn't have prototypes, as C evolved
from B, a typeless language. When prototypes were added, the original
typeless declarations were left in the language for backwards
compatibility.
Instead we should provide `void` in argument list to state
that function doesn't have arguments.

Also this warning disallow declaring type of the parameters after the
parentheses because Neovim header generator produce no declarations for
old-stlyle prototypes: it expects to find `{` after prototype.
2014-07-14 20:28:40 +02:00
Brandon Coleman
0fff487690 move errno.h include out of vim.h 2014-07-09 00:18:20 +02:00
Brandon Coleman
bf219e1442 move <inttypes.h> include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
82b71a3056 move ascii.h include out of vim.h 2014-07-09 00:18:18 +02:00
Brandon Coleman
a4f441e547 remove stdbool.h include from vim.h and globals.h 2014-07-09 00:18:17 +02:00
Klemen Košir
ef34a0ab13 Replace int with bool in some files. #654 2014-07-08 17:25:48 +00:00
Stefan Hoffmann
a294a0e1c5 FileID: refactor buffer.c to use FileID 2014-06-27 13:59:28 +02:00
Stefan Hoffmann
d8ec5ef88d FileID: remove INVALID_DEVICE_ID macro 2014-06-27 13:59:28 +02:00
Felipe Oliveira Carvalho
a26a1697c7 No OOM in home_replace_save() 2014-06-16 01:36:32 -03:00
Douglas Schneider
1a1725765c Replace vim_strncpy calls: buffer.c 2014-06-13 18:08:21 -04:00
Will Stamper
5b3b3fd3ed spelling fixes #827 2014-06-12 20:26:35 -04:00
oni-link
b09334d571 vim-patch:7.4.277
Problem:    Using ":sign unplace *" may leave the cursor in the wrong position
            (Christian Brabandt)
Solution:   Update the cursor position when removing all signs.

https://code.google.com/p/vim/source/detail?r=373204662d82e894b27ee76bc3319bc62c91f6ae
2014-06-04 06:57:37 +00:00
ZyX
dca28e55c7 Fix some styles 2014-06-02 11:04:18 -03:00
ZyX
70929f7e16 Add automatic generation of headers
- The 'stripdecls.py' script replaces declarations in all headers by includes to
  generated headers.
  `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'`
  was used for this.
- Add and integrate gendeclarations.lua into the build system to generate the
  required includes.
- Add -Wno-unused-function
- Made a bunch of old-style definitions ANSI

This adds a requirement: all type and structure definitions must be present
before INCLUDE_GENERATED_DECLARATIONS-protected include.

Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is
the only exception.
2014-06-02 11:04:17 -03:00
Hinidu
50429aee6e Remove FEAT_LISTCMDS
Vim commands for the buffer list and the argument list: ":buffer",
":bnext", ":bdel", ":argdelete", etc.
2014-05-28 13:08:54 -04:00
Hinidu
5f2ccb94d2 Remove FEAT_CURSORBIND
Synchronization of cursor in split windows for diff mode
2014-05-28 13:08:54 -04:00
Hinidu
9d6c5de4f1 Remove FEAT_CMDL_INFO
'showcmd' and 'ruler' options
2014-05-28 13:08:54 -04:00
Hinidu
dd7657c160 Removed FEAT_WINDOWS
Support for multiple windows and status line.
2014-05-28 13:08:53 -04:00
Hinidu
e62722922b Extract cursor.h from misc{1,2}.h and memline.h 2014-05-28 10:42:06 -04:00