| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
Problem: Doubled semicolons.
Solution: Reduce to one. (Dominique Pelle)
https://github.com/vim/vim/commit/945ec093cd4ddefab930239990564b12eb232153
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly
improves responsiveness when :! spams MB or GB of output:
:!yes
:!while true; do date; done
:!git grep ''
:grep -r '' *
After ~10KB of data is seen from a single :! invocation, output will be skipped
for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the
behavior alternates at every:
* 10KB received
* ~1s throttled
This also avoids out-of-memory which could happen with large :! outputs.
Note: This commit does not change the behavior of execute(':!foo').
execute(':!foo') returns the string ':!foo^M', it captures *only* Vim
messages, *not* shell command output. Vim behaves the same way.
Use system('foo') for capturing shell command output.
Closes #1234
Helped-by: oni-link <knil.ino@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Contains the exit value nvim will use.
Before exiting, it is v:null. That way jobs or autocmds (in VimLeavePre or
VimLeave) can check if Neovim is about to quit and with what exit value.
Closes #4666.
|
| |
|
|
|
|
|
|
|
|
| |
Problem: A plugin does not know when VimEnter autocommands were already
triggered.
Solution: Add the v:vim_did_enter variable.
https://github.com/vim/vim/commit/1473551a4457d4920b235eeeb9f279e196ee7225
|
|
|
|
|
|
|
|
|
| |
Eliminate mb_init():
Set "enc_utf" and "has_mbyte" early. Eliminate "enc_unicode" and "enc_latin1like".
init_chartab() and screenalloc() are already invoked elsewhere
in the initialization process.
The EncodingChanged autocmd cannot be triggered.
At initialization, there is no spellfiles to reload
|
|
|
|
|
|
|
|
|
|
| |
Problem:
When '--embed' passed to command line arguments, stdin and stdout
are used for IPC. But when multiple files are passed as
arguments, nvim wrongly sends 'N files to edit' message to its
stdout. As the result, attaching to process from frontend failed.
Solution:
Remove the message because it doesn't fill any purpose.
|
|
|
|
|
|
|
|
|
| |
Check `exists('b:term_title')` to avoid the BufReadCmd for already-initialized
:terminal buffers.
Move the test for `:argadd`.
Add a test for `:edit<CR>`.
Tweak comments and code style.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`lib/queue.h` implements a basic queue. `event/queue.c` implements
a specialized data structure on top of lib/queue.h; it is not a "normal"
queue.
Rename the specialized multi-level queue implemented in event/queue.c to
"multiqueue", to avoid confusion when reading the code.
Before this change one can eventually notice that "macros (uppercase
symbols) are for the normal queue, lowercase operations are for the
multi-level queue", but that is unnecessary friction for new developers
(or existing developers just visiting this part of the codebase).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because terminfo_stop() already ran, there is not much reason to wait
for the loop to teardown.
Helped-by: Björn Linse <bjorn.linse@gmail.com>
Helped-by: oni-link <knil.ino@gmail.com>
Closes #4778
References #3541
---
Bug report:
> After pressing `ZZ` I can find two threads freezing, occupying 100% CPU:
|-systemd-+
|-nvim,11567 /home/lz/code/1.rs +set title
| `-{nvim},11574
> 11567 has two threads:
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7f7622907780 (LWP 11567) "nvim" 0x00007f76222e66bd in pthread_join () from /usr/lib/libpthread.so.0
2 Thread 0x7f761f5ff700 (LWP 11574) "nvim" 0x00007ffcec9e9c59 in clock_gettime ()
(gdb) thread apply all bt
Thread 2 (Thread 0x7f761f5ff700 (LWP 11574)):
#0 0x00007ffcec9e9c59 in clock_gettime ()
#1 0x00007f76210b9356 in clock_gettime () from /usr/lib/libc.so.6
#2 0x00007f7622513e3c in ?? () from /usr/lib/libuv.so.1
#3 0x00007f7622505e94 in uv_run () from /usr/lib/libuv.so.1
#4 0x00000000004822ed in loop_close (loop=loop@entry=0x7f761f5fe870) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/event/loop.c:87
#5 0x00000000005a7ec0 in tui_main (bridge=0x7f761f6ac000, ui=0x7f761f69ace0) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/tui/tui.c:234
#6 0x00000000005a9b47 in ui_thread_run (data=<optimized out>) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/ui_bridge.c:87
#7 0x00007f7622510d07 in ?? () from /usr/lib/libuv.so.1
#8 0x00007f76222e5474 in start_thread () from /usr/lib/libpthread.so.0
#9 0x00007f76210ac69d in clone () from /usr/lib/libc.so.6
Thread 1 (Thread 0x7f7622907780 (LWP 11567)):
#0 0x00007f76222e66bd in pthread_join () from /usr/lib/libpthread.so.0
#1 0x00007f7622510dae in uv_thread_join () from /usr/lib/libuv.so.1
#2 0x00000000005aac9e in ui_bridge_stop (b=0x7f761f6ac000) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/ui_bridge.c:104
#3 0x00000000005a90e4 in ui_builtin_stop () at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/ui.c:91
#4 0x000000000052be09 in mch_exit (r=r@entry=1) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os_unix.c:143
#5 0x00000000004db1cc in getout (exitval=exitval@entry=1) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/main.c:623
#6 0x00000000004fa43c in preserve_exit () at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/misc1.c:2652
#7 0x000000000052b77a in deadly_signal (signum=1) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/signal.c:120
#8 0x000000000052b7cf in on_signal (handle=<optimized out>, signum=<optimized out>, data=<optimized out>) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/signal.c:145
#9 0x0000000000484178 in signal_event (argv=<optimized out>) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/event/signal.c:44
#10 0x0000000000483b7f in queue_process_events (queue=0x7f7620417360) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/event/queue.c:142
#11 0x0000000000482208 in loop_poll_events (loop=0x84dec0 <loop>, ms=ms@entry=4000) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/event/loop.c:56
#12 0x000000000052a364 in input_poll (ms=ms@entry=4000) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/input.c:325
#13 0x000000000052a3e2 in inbuf_poll (ms=4000) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/input.c:347
#14 0x000000000052a839 in os_inchar (buf=buf@entry=0x0, maxlen=maxlen@entry=0, ms=ms@entry=-1, tb_change_cnt=tb_change_cnt@entry=0) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/os/input.c:107
#15 0x0000000000592eeb in state_enter (s=s@entry=0x7ffcec9d3560) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/state.c:46
#16 0x0000000000508533 in normal_enter (cmdwin=cmdwin@entry=false, noexmode=noexmode@entry=false) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/normal.c:464
#17 0x00000000004dc17e in main (argc=<optimized out>, argv=<optimized out>) at /tmp/yaourt-tmp-lz/aur-neovim-git/src/neovim-git/src/nvim/main.c:538
|
|
|
|
|
|
|
|
|
|
| |
move `call_shell` to misc1.c
Move some fns to state.c
Move some fns to option.c
Move some fns to memline.c
Move `vim_chdir*` fns to file_search.c
Move some fns to new module, bytes.c
Move some fns to fileio.c
|
|
|
|
| |
header generator.
|
| |
|
|
|
|
|
|
|
| |
Problem: Conflict for "chartab". (Kazunobu Kuriyama)
Solution: Rename the global one to something less obvious. Move it into
src/chartab.c.
https://github.com/vim/vim/commit/88e8f9f14434a7cd538d0c159dc432bea869a5bd
|
| |
|
|
|
|
|
|
|
| |
Problem: ":colorscheme" does not use 'packpath'.
Solution: Also use in "start" and "opt" directories in 'packpath'.
https://github.com/vim/vim/commit/7f8989dd8a627af2185df381195351a913f3777f
|
|
|
|
|
|
|
| |
Problem: Cannot load packages early.
Solution: Add the ":packloadall" command.
https://github.com/vim/vim/commit/2d8f56acb32428d0f965d42dd13b27100b46fa15
|
|
|
|
|
|
|
| |
Problem: It is not easy to use a set of plugins and their dependencies.
Solution: Add packages, ":loadopt", 'packpath'.
https://github.com/vim/vim/commit/f6fee0e2d4341c0c2f5339c1268e5877fafd07cf
|
|
|
|
|
|
|
|
| |
This commit doesn't change any behavior, only moves the init out of main.c We
_could_ move some initialization from tui.c:terminfo_start to an earlier phase,
in order to avoid mis-reporting 't_Co' during startup. But this will be messy,
and gains very little: TERM=linux works "good enough" as long as we correct t_Co
in tui.c:terminfo_start (c5b02d5a7).
|
|
|
|
|
|
|
| |
Problem: 'autochdir' doesn't work for the first file. (Rob Hoelz)
Solution: Call DO_AUTOCHDIR after startup. (Christian Brabandt)
https://github.com/vim/vim/commit/baec5c1768098f9dd867b465aaabfdfb294f10c2
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current name is inappropriate for the following reasons:
1. It is often masked by local `loop` variables.
2. It cannot be searched for. There are many `loop` variables where `loop` is
some local variable. There are many cases when “loop” word is used in
a comment.
3. It is in any case bad idea to use a generic name as a name of the global
variable. Best if global has module prefix: this is why it is in `main.h`:
`main_loop` both stands for “a main loop” and “a loop defined in `main.*`”.
Since I have no idea how to list every occurrence of this variable method used
to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if
some occurrence was hidden under false `#if` branch it was not replaced.
|
| |
|
|
|
|
|
| |
Fixes a bug in #4252: we enabled filetype/syntax if -u was passed,
but not otherwise. So it did not work for an empty or missing vimrc.
|
| |
|
| |
|
|
|
|
| |
Ref #4306
|
|
|
|
|
| |
This reverts commit b01db02de4753908b3595b5ada0a6929e595e930, reversing
changes made to 62321e5132ed29b11f79c8a56ca172d56b9ac042.
|
|
|
|
|
|
|
|
| |
After 87a49405b00b38b58c4c1d8fc4069d1a254a621d, terminal_open() is not
nested by default. The default "term://" handler depended on that, but
it should instead explicitly raise TermOpen.
References #4306
|
|
|
|
|
|
|
| |
Change POROJECT_NAME to 'nvim', and use it as the gettext
domain name. The *.mo files, previously installed as
$runtime/lang/xx/LC_MESSAGES/nvim.mo, are now installed as
$prefix/locale/xx/LC_MESSAGES/nvim.mo.
|
|
|
|
|
|
|
| |
- `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)
|
|
|
|
|
| |
If user invokes :filetype or :syntax before startup defaults are
applied, don't clobber their choices.
|
|
|
|
| |
It is no longer forcing anything.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: On MS-Windows, when 'autochdir' is set, diff mode with files in
different directories does not work. (Axel Bender)
Solution: Remember the current directory and use it where needed. (Christian
Brabandt)
https://github.com/vim/vim/commit/d87c36ea5eae50580f3c733734669250cc969019
---
see: "autochdir + encoding=utf8 messes up diff"
https://groups.google.com/d/msg/vim_dev/QrE4Y2LMJR8/uxigns5KGxYJ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
The former no longer exists in this repo; see the top of
src/nvim/README.md.
|
|\
| |
| | |
Remove all invalid nvimrc references
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
"vimrc" refers to all files that are used to configure Neovim. The main
configuration file is init.vim nowadays.
All nvimrc references that are left refer to a local ".nvimrc" which is read
if 'exrc' is set. ".ngvimrc" references were completely wiped.
Closes #3552.
|
|/
|
|
|
| |
I don't want anyone getting the idea that the `-X` flag they might have
used has anything to do with why the `+` is working for them
|
|
|
|
|
| |
`do_user_initialization()` ignored changes to the value of the `exrc` option
caused by the processing of environment variables or sourcing of files.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From a very high level point of view, Vim/Nvim can be described as state
machines following these instructions in a loop:
- Read user input
- Peform some action. The action is determined by the current state and can
switch states.
- Possibly display some feedback to the user.
This is not immediately visible because these instructions spread across dozens
of nested loops and function calls, making it very hard to modify the state
machine(to support more event types, for example).
So far, the approach Nvim has taken to allow more events is this:
- At the very core function that blocks for input, poll for arbitrary events.
- If the event received from the OS is user input, just return it normally to
the callers.
- If the event is not direct result of user input(possibly a vimscript function
call coming from a msgpack-rpc socket or a job control callback), return a
special key code(`K_EVENT`) that is handled by callers where it is safer to
perform arbitrary actions.
One problem with this approach is that the `K_EVENT` signal is being sent across
multiple states that may be unaware of it. This was partially fixed with the
`input_enable_events`/`input_disable_events` functions, which were added as a
mechanism that the upper layers can use to tell the core input functions that it
is ready to accept `K_EVENT`.
Another problem is that the mapping engine is implemented in getchar.c
which is called from every state, but the mapping engine is not aware of
`K_EVENT` so events can break mappings.
While it is theoretically possible to modify getchar.c to make it aware of
`K_EVENT`, this commit fixes the problem with a different approach: Model Nvim
as a pushdown automaton(https://en.wikipedia.org/wiki/Pushdown_automaton). This
design has many advantages which include:
- Decoupling the event loop from the states reponsible for handling events.
- Better control of state transition with less dependency on global variable
hacks(eg: 'restart_edit' global variable).
- Easier removal of global variables and function splitting. That is because
many variables are for state-specific information, and probably ended up being
global to simplify communication between functions, which we fix by storing
state-specific information in specialized structures.
The final goal is to let Nvim have a single top-level event loop represented by
the following pseudo-code:
```
while not quitting
let event = read_event
current_state(event)
update_screen()
```
This closely mirrors the state machine description above and makes it easier to
understand, extend and debug the program.
Note that while the pseudo code suggests an explicit stack of states that
doesn't rely on return addresses(as suggested by the principles of
automata-based programming:
https://en.wikipedia.org/wiki/Automata-based_programming), for now we'll use the
call stack as a structure to manage state transitioning as it would be very
difficult to refactor Nvim to use an explicit stack of states, and the benefits
would be small.
While this change may seem like an endless amount of work, it is possible to
do it incrementally as was shown in the previous commits. The general procedure
is:
1- Find a blocking `vgetc()`(or derivatives) call. This call represents an
implicit state of the program.
2- Split the code before and after the `vgetc()` call into functions that match
the signature of `state_check_callback` and `state_execute_callback.
Only `state_execute_callback` is required.
3- Create a `VimState` "subclass" and a initializer function that sets the
function pointers and performs any other required initialization steps. If
the state has no local variables, just use `VimState` without subclassing.
4- Instead of calling the original function containing the `vgetc()`,
initialize a stack-allocated `VimState` subclass, then call `state_enter` to
begin processing events in the state.
5- The check/execute callbacks can return 1 to continue normally, 0 to break the
loop or -1 to skip to the next iteration. These callbacks contain code that
execute before and after the old `vgetc()` call.
The functions created in step 2 may contain other `vgetc()` calls. These
represent implicit sub-states of the current state, but it is fine to remove
them later in smaller steps since we didn't break compatibility with existing
code.
|
|
|
|
|
|
| |
The new function contains logic that must be executed after handling input in
normal mode and also before the first main loop iteration. Also rename
`main_loop` to `normal_enter` and move it to normal.c
|
| |
|
| |
|
| |
|
| |
|