Commit Graph

247 Commits

Author SHA1 Message Date
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
Thiago de Arruda
ed99198ff1 API: Refactor: Register/unregister created/destroyed buffers
- Add the 'handle' field to `buf_T`
- Add declare/implement functions for registering/unregistering/retrieving
  buffers
- Register/unregister buffers when they are created/destroyed.
2014-05-23 16:06:58 -03:00
Justin M. Keyes
e2e47803bd Merge #708 'Remove NULL/non-NULL tests after vim_str(n)save'
- replace alloc with xmalloc
2014-05-22 13:00:51 -04:00
John Schmidt
85338fe1d5 Remove cryptography
As discussed in #694, vim encryption uses old,
obsolete algorithms that are poorly implemented.
Since insecure cryptography is worse than no
cryptgraphy, the community voted in favor of
removing all crypto.

Various alternatives to the old crypto is
being discussed in #701.

Closes #694.
2014-05-20 08:31:06 -03:00
Felipe Oliveira Carvalho
a80d7e86c1 Remove NULL/non-NULL tests after calls to vim_str(n)save() 2014-05-19 14:50:23 -03:00
Eliseo Martínez
762a8ad0f3 Introduce nvim namespace: Fix unmasked strings.h issue.
Problem:  Now that nvim/strings.h is correctly namespaced, an issue
          that had been masked until now arises:

          When compiling, we get a lot of errors because of everywhere
          the functions in nvim/strings.h are used, there's no include
          to import them.

          But, how could this compile and work previously, then? It
          turns out that:
          - In every such case, we are also including vim.h, which in
            turn includes os_unix_defs.h.
          - os_unix_defs.h includes <string.h> and also <strings.h> in
            some systems (e.g. OSX).
          - Build had been modified previously to (even when importing
            system headers), prefer equally-named local ones. That was
            in fact done as a previous attempt to solve the same issue
            we are trying to solve another way now.

          So, we were including our "strings.h" as a side-effect of
          including <strings.h> through "vim.h" --> "os_unix_defs.h".

Solution: Correctly include "nvim/strings.h" in every file needing it.
2014-05-15 20:46:02 +02:00
Eliseo Martínez
409cc138f2 Introduce nvim namespace: Fix project-local includes.
Prepend 'nvim/' in all project-local (non-system) includes.
2014-05-15 20:46:01 +02:00
Eliseo Martínez
da51dc9cf2 Introduce nvim namespace: Move files.
Move files from src/ to src/nvim/.
- src/nvim/ becomes the new root dir for nvim executable sources.
- src/libnvim/ is planned to become root dir of the neovim library.
2014-05-15 20:46:01 +02:00