Commit Graph

299 Commits

Author SHA1 Message Date
AdnoC
954aeafa89 Linting 2016-05-17 16:36:41 -04:00
AdnoC
244cfe86b5 syntax: Add support for the "special" color used for undercurls 2016-05-17 16:31:42 -04:00
Michael Ennen
087623aa3c vim-patch: 7.4.1036
Problem:    Only terminals with up to 256 colors work properly.
Solution:   Use the 256 color behavior for all terminals with 256 or more
            colors. (Robert de Bath)

fa03fd6c4a
2016-05-17 11:30:08 -07:00
Justin M. Keyes
d02cfe8061 Merge pull request #4733 from AdnoC/hi-link-cleared-group
Fix linking a cleared highlight group

Closes #4549
Closes #2756
Closes #4236
2016-05-12 02:55:22 -04:00
AdnoC
e63e49d49b syntax: Allow cleared highlight groups to be linked 2016-05-10 16:08:53 -04:00
Justin M. Keyes
aa8ccef719 Merge pull request #4730 from jbradaric/vim-7.4.1052
vim-patch:7.4.1052
2016-05-12 01:08:01 -04:00
Jurica Bradaric
dd9dc7ae87 vim-patch:7.4.1054
Problem:    Illegal memory access.
Solution:   Check for missing pattern. (Dominique Pelle)

2795e21eaa
2016-05-10 21:27:17 +02:00
Jurica Bradaric
6bdf82bf6f vim-patch:7.4.1052
Problem:    Illegal memory access with weird syntax command. (Dominique Pelle)
Solution:   Check for column past end of line.

04bff88df6
2016-05-10 21:21:54 +02:00
ZyX
cf4e1fb0f4 *: Fix new linter errors
Originally there were 128 new errors, so I thought this is a good idea to fix 
all of them. Of course, this commit also fixes many suppressed errors.
2016-05-01 20:35:51 +03:00
watiko
0e15d1cefa syntax.c: Avoid the 'background' adjustment when true color enabled 2016-03-08 21:16:04 +09:00
Jurica Bradaric
75fbc23ead vim-patch:7.4.1141
Problem:    Using searchpair() with a skip expression that uses syntax
            highlighting sometimes doesn't work. (David Fishburn)
Solution:   Reset next_match_idx. (Christian Brabandt)

6773a348da
2016-03-03 22:34:26 +01:00
Justin M. Keyes
9648bf795a coverity/135578: Memory - illegal accesses
Harmless issue, but doesn't hurt to satisfy coverity here.
2016-02-16 04:25:59 -05:00
Justin M. Keyes
cc2dce45d0 startup: Avoid VimL global. Introduce TriState enum.
- `syntax_on` is documented. Rather than introduce a new undocumented
  VimL global `g:syntax_off`, use a module-local flag.
- Rename "maybe" functions to follow style guidelines (use standard
  module prefix)
2016-02-14 16:23:04 -05:00
Justin M. Keyes
cae0904160 syntax: avoid extra global macro 2016-02-14 15:20:31 -05:00
watiko
d115b58cdc vim-patch:7.4.828
Problem:    Crash when using "syn keyword x c". (Dominique Pelle)
Solution:   Initialize the keyword tabble. (Raymond Ko, PR 397)

670acbc70f

---

see: "fix crash due to hash table not being initialized"
     https://github.com/vim/vim/pull/397

To reproduce:

```sh
nvim -u NONE -c ow -c 'sy keyword x c'
```
2016-02-11 19:06:54 +09:00
Marco Hinz
8b5cc1230a Syntax: skip over ]
The ported patch for 7.4.825 removed code that is needed to walk over "]" by
accident.

0: 52692d3cd3
1: 1560d07045

Fixes #4207.
2016-02-09 15:28:52 +01:00
Justin M. Keyes
b9701c2a2b Merge #4152 'vim-patch:7.4.{798,800,805,810,811,814,815,816,817,820,825}'. 2016-02-09 01:58:54 -05:00
Jurica Bradaric
0429b7714f vim-patch:7.4.760
Problem:    Spelling mistakes are not displayed after ":syn spell".
Solution:   Force a redraw after ":syn spell" command. (Christian Brabandt)

5081d20247
2016-02-09 01:36:29 -05:00
Jurica Bradaric
52692d3cd3 vim-patch:7.4.825
Problem:    Invalid memory access for ":syn keyword x a[".
Solution:   Do not skip over the NUL. (Dominique Pelle)

1560d07045
2016-02-02 20:33:43 +01:00
Jurica Bradaric
ce2ff1ac01 vim-patch:7.4.814
Problem:    Illegal memory access with "sy match a fold".
Solution:   Check for empty string. (Dominique Pelle)

382197865c
2016-02-02 19:58:30 +01:00
Michael Reed
53ee6425c8 src/*: Remove VIM - Vi improved ... header
Regarding the individual items in the header:

`Vim - Vi improved	by Bram Moolenar`
  Bram Moolenar is already mentioned throughout the documentation, as
  well as the intro screen.

`:help uganda`
  It's already shown to all users who don't use `shortmess+=I` upon
  starting nvim, and is already placed prominently in help.txt, i.e.,
  `:help` run with no arguments.

`:help credits`
  Already mentioned near the top of help.txt.

`README.md`
  Already mentioned in develop.txt.
2015-11-27 16:25:10 -05:00
Rui Abreu Ferreira
4f24b9e06f Remove unnecessary includes for errno.h 2015-11-25 16:38:33 -05:00
Michael Reed
af5483089e src: README.txt -> README.md
The former no longer exists in this repo; see the top of
src/nvim/README.md.
2015-11-23 21:38:08 -05:00
Michael Reed
5e60180a1e Remove char_u: ex_docmd:do_cmdline_cmd() 2015-05-13 15:29:49 -04:00
David Bürgin
96997fffbd vim-patch:7.4.524 #2559
Problem:    When using ":ownsyntax" spell checking is messed up. (Issue 78)
Solution:   Use the window-local option values. (Christian Brabandt)

https://github.com/vim/vim/commit/v7-4-524

See also https://code.google.com/p/vim/issues/detail?id=78
2015-05-09 10:23:23 -04:00
David Bürgin
b3519ca73b vim-patch:7.4.519
Problem:    Crash when using syntax highlighting.
Solution:   When regprog is freed and replaced, store the result.

https://github.com/vim/vim/tree/v7-4-519

Helped-by: Scott Prager <splinterofchaos@gmail.com>
2015-04-27 01:41:42 -04:00
Felipe Oliveira Carvalho
c96b933acc Improve comments and fix ascii_* attributes 2015-04-24 22:17:02 -03:00
Felipe Oliveira Carvalho
caabcae0b7 Replace VIM_ISDIGIT() and vim_isdigit() with ascii_isdigit() defined in ascii.h 2015-04-24 20:37:13 -03:00
Felipe Oliveira Carvalho
93bf201119 Replace vim_iswhite with ascii_iswhite() defined in ascii.h 2015-04-24 20:37:13 -03:00
Thiago de Arruda
34c48aaf12 memory: Add free wrapper and refactor project to use it
We already use wrappers for allocation, the new `xfree` function is the
equivalent for deallocation and provides a way to fully replace the malloc
implementation used by Neovim.
2015-04-13 08:22:44 -03:00
Marco Hinz
fb6e931268 Remove obsolete CENT macro #2397
The CENT macro was set condionally depending on the FEAT_GUI constant that was
removed a long time ago.

Other small refactorings:

  - remove obsolete TERM= flags
  - sort and indent lines in array for readability
  - 'Conceal' and 'WildMenu' were moved from highlight_init_{dark,light}[]
    to highlight_init_both[] since the same values were used anyway
2015-04-12 11:00:11 -04:00
Marco Hinz
cd7b910e81 Add new highlight groups TermCursor/TermCursorNC
These highlight groups replace the old mechanism of setting:

  - {g,b}:terminal_focused_cursor_highlight
  - {g,b}:terminal_unfocused_cursor_highlight
2015-04-09 16:38:32 +02:00
Thiago de Arruda
cdedd89d22 terminal: New module that implements a terminal emulator
This commit integrates libvterm with Neovim and implements a terminal emulator
with nvim buffers as the display mechanism. Terminal buffers can be created
using any of the following methods:

- Opening a file with name following the "term://[${cwd}//[${pid}:]]${cmd}"
  URI pattern where:
  - cwd is the working directory of the process
  - pid is the process id. This is just for use in session files where a pid
    would have been assigned to the saved buffer title.
  - cmd is the command to run
- Invoking the `:terminal` ex command
- Invoking the `termopen` function which returns a job id for automating the
  terminal window.

Some extra changes were also implemented to adapt with terminal buffers. Here's
an overview:

- The `main` function now sets a BufReadCmd autocmd to intercept the term:// URI
  and spawn the terminal buffer instead of reading the file.
- terminal buffers behave as if the following local buffer options were set:
  - `nomodifiable`
  - `swapfile`
  - `undolevels=-1`
  - `bufhidden=hide`
- All commands that delete buffers(`:bun`, `:bd` and `:bw`) behave the same for
  terminal buffers, but only work when bang is passed(eg: `:bwipeout!`)
- A new "terminal" mode was added. A consequence is that a new set of mapping
  commands were implemented with the "t" prefix(tmap, tunmap, tnoremap...)
- The `edit` function(which enters insert mode) will actually enter terminal
  mode if the current buffer is a terminal
- The `put` operator was adapted to send data to the terminal instead of
  modifying the buffer directly.
- A window being resized will also trigger a terminal resize if the window
  displays the terminal.
2015-03-25 18:57:35 -03:00
Thiago de Arruda
5cf3dec9a9 syntax: Fix possible invalid read in hl_combine_attr 2015-03-25 18:57:34 -03:00
Björn Linse
19ca54b969 syntax: let first syntax item seqnr be 1 instead of 0
in screen.c:win_line seqnr 0 represents the state: no current syntax
item
2015-03-21 13:48:29 +01:00
oni-link
a916696a13 syntax.c: Prevent use after free for variable g:colors_name.
ASan spotted a problem when using 'set background={light,dark}' with
color scheme solarized.
While loading the colors for color scheme 'g:colors_name', the pointer
on the value for this variable can become invalid, because of an 'unlet
colors_name' (part of an :highlight clear, syntax.c:6173).

To prevent the use of the freed value, decouple the value from
'g:colors_name' before calling load_colors() with it.
2015-03-13 17:26:54 -04:00
Anton Ovchinnikov
9925b3a047 Remove redundant casts 2015-03-09 00:40:50 +01:00
Michael Reed
49e7164165 Macro cleanup: USER_HIGHLIGHT 2015-03-05 19:03:36 -05: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
Eliseo Martínez
7dd48d7af0 Enable -Wconversion: mark.c.
Refactoring summary:
- MB_STRNICMP: Inlined.
- MB_STRNCMP: Inlined.
2015-02-18 20:54:13 -05: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
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
Björn Linse
f468fb70cb api/vim: allow guis and tests to retrieve the entire color table 2015-02-02 14:56:58 -03:00
Marco Hinz
4d70aae770 Add EndOfBuffer hl group for ~ lines after the last line in buffers
This makes it possible to highlight the lines starting with ~ at the end
of buffers and other elements highlighted using NonText.

As proposed by mhinz at
https://groups.google.com/forum/#!topic/vim_dev/p3de1iU1GXI/discussion
2015-02-02 01:16:41 -05:00
Eliseo Martínez
31dacda874 Remove long_u: (various): Refactor long_u. 2015-01-19 19:41:27 +01:00
Justin M. Keyes
5c6348e999 Merge pull request #1816 from Pyrohh/macro_cleanup
Macro cleanup
2015-01-15 09:59:45 -05:00
Michael Reed
d2e7cce560 Macro cleanup: Miscellaneous
These were found with -Wunused-macros. There are many more macros which
triggered that warning, but they were primarily part of larger sets of
macros so leave them alone.
2015-01-14 22:23:16 -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
Thiago de Arruda
3e9c55b51b main: Fix color schemes for abstract_ui
- Set 't_Co' to 256 at startup. The value can be changed by the user for
  compatibility with terminals that are less capable.
- `has('gui_running')` will return 1 if at least one rgb UI is attached.

Even though these changes are hacky, they are necessary to make the transition
to the new UI architecture smoother.
2015-01-13 21:21:20 -03:00
Thiago de Arruda
8f3e61a043 syntax: Refresh UI when the color scheme changes 2015-01-13 21:21:20 -03:00