Commit graph

329 commits

Author SHA1 Message Date
Ben Jackson
2ad1a3e502 Display a different sign when there's a breakpoint on the PC line
Vim only renders a single sign-per-line. If we have the PC _and_ a
breakpoint, we should make that clear. Do this using a vimspectorPCBP
sign which combines both vimspectorPC and vimspectorBP (sort of).

We can't (unfortuantely) render the breakpoint blob in a different
colour, but it's at least obvious when we toggle on the PC line.
2020-09-19 15:18:05 +01:00
Ben.Jackson
4424969028 Fix installation issues on windows - find npm.cmd 2020-09-18 20:59:21 +01:00
Ben Jackson
3aa949431e Upgrade chrome debugger to 4.12.10 2020-09-03 22:11:57 +01:00
Ben Jackson
97bdb0d0cc Show launch failure reason in the splash 2020-09-03 22:09:22 +01:00
Ben Jackson
733843a6d4 Support completion for console and watches.
Add omnifunc for prompt buffers

This synchronous completion can be used with any completion system
including built-in CTRL-X CTRL-O.

The filetype of the prompt buffers is set to VimspectorPrompt so that it
can be identified by completion systems. For example, this works well
with YCM:

let g:ycm_semantic_triggers =  {
  \   'VimspectorPrompt': [ '.', '->', ':', '<' ]
  \ }
2020-09-03 17:48:46 +01:00
Ben Jackson
dffd65f241 Use CursorLine highlihgt to highlight current PC line 2020-09-01 16:31:25 +01:00
Ben Jackson
b2456b587f Centralise the default settings 2020-09-01 16:31:04 +01:00
Ben Jackson
f538102d33 Don't leak buffers when creating output view 2020-09-01 15:40:16 +01:00
Ben Jackson
c1b544fb3c Allow customisation of the signs
Too many plugins use the default priority of 10 so they race/chase.
Allow uses to configure the priorities and make sure that the defaults
are documented.
2020-09-01 13:56:12 +01:00
tamago324
8b488d479d To enable the Windows GUI to display the balloon correctly
Refer https://github.com/vim/vim/issues/1512#issuecomment-492070685
2020-08-29 22:19:46 +09:00
tamago324
9b7540fbf6 Format flake8 2020-08-29 15:22:19 +09:00
tamago324
95fa0c5105 Fix balloon display ... 2020-08-29 15:17:24 +09:00
Ben Jackson
51cc6c4d3a Add VimspectorToggleLog 2020-08-28 14:32:17 +01:00
Ben Jackson
ef94b1bc49 Fix neovim (again) - incompatible exception behabiour
Neovim does not raise:

* KeyError when accessing a vim dict
* KeyboardInterrupt when ctrl-c at a prompt

Instead it raises some internal subclass of vim.errro which cannot
easily be identified, so we just catch any vim.error.
2020-08-24 18:31:47 +01:00
Ben Jackson
dae5760900 Ensure signs are only padded when 1 display cell 2020-08-23 13:42:40 +01:00
Ben Jackson
ca63c08d6a Add a way to force a str in case #json is really required in a key 2020-08-05 22:24:35 +01:00
Ben Jackson
be44a22903 Allow coercing a type in vimspector config
Initially I considered using #i, #s, etc. to coerce to specific types,
but then it wasn't clear of the semantics (particularly for bool, where
JSON bool true/false, Python bool True/False).

But it turns out that we can just coerce any key from a JSON string.
Users can _probably_ type JSON strings for most things, or use variables
to run scripts to generate them, this allows essentially complete
flexibility to define the data types needed to populate the launch spec.

The purpose of this is to allow some level of automated setup by
requesting data from the user and then (subsequently) saving the
flattneed config to the vimspector config file.
2020-08-05 22:19:38 +01:00
Ben Jackson
3a160aa77a Fix: Crash when deleting a watch that never got a result 2020-07-31 22:19:10 +01:00
Ben Jackson
10e9a75fc7 Tidy UI - use some unicode symbols and organise winbar 2020-07-31 22:19:10 +01:00
Ben Jackson
6593f383cf Use any python for debugpy 2020-07-31 22:19:10 +01:00
Ben Jackson
aa26d4bc1a Add ability to specify defaults for variables 2020-07-31 22:19:10 +01:00
Ben Jackson
1e43cd4870 Use a junction, as symlinks require escalated priviledges on some windows 2020-07-24 21:27:47 +01:00
Ben Jackson
f9d20b9537 Upgrade gadgets when they change
This adds a --upgrade option to install_gadget.py and makes
VimspectorUpdate only update things which have changed.

To do this, we record the gadget spec in a manfiest file and compare it
with the current spec when in upgrade mode.

'Changed' in this case means that the gadget spec has changed from the
last time the installer was run. It does _not_ actually check the
presence of the gadget.
2020-07-24 17:12:07 +01:00
Ben Jackson
8f5b928e4b Allow a statically configured list of gadgets
Useful for storing config in source control
2020-07-23 16:37:03 +01:00
Ben Jackson
29cb5c914b Add bang versions of install commands to leave the output open 2020-07-22 22:18:19 +01:00
Ben Jackson
26d7e95adc Fix windows installer issues - use symlinks not junctions and fix dumb use of PIPE with check_call 2020-07-22 19:27:42 +01:00
Ben Jackson
c50c99ef34 Don't spam echo when jobs finish, revert sudo exit 2020-07-22 16:01:44 +01:00
Ben Jackson
000f7a9232 Prettify the output with some syntax and quiet option 2020-07-22 14:40:23 +01:00
Ben Jackson
4144631d03 Add :VimspectorUpdate 2020-07-22 12:50:44 +01:00
Ben Jackson
98bef3db03 Fix - don't switch windows/buffers to create a new hidden buffer 2020-07-22 10:54:06 +01:00
Ben Jackson
375ff4aa27 Suggest installing gadget if possible 2020-07-22 10:52:48 +01:00
Ben Jackson
05bbafd60c Close the intaller output when complete 2020-07-22 10:52:48 +01:00
Ben Jackson
ca4ab52f8d Fix regression: Don't render winbar if the window isn't valid 2020-07-22 10:52:48 +01:00
Ben Jackson
0140a607b1 Raise autocommand when installer completes. use this in testing 2020-07-22 10:52:48 +01:00
Ben Jackson
23e5f6bbf4 Switch to running the actual install_gadget.py
This re-uses the OutputView code to run the installer script. Refactor
to remove connection from the base OutputView (and other places, it
wasn't used - only used after ConnectionUp).

This also consolidates the stdout and stderr buffers for running jobs.
The distinction was always arbitrary and probably an error, based on the
fact that they were separate in the APIs not based on usability.
2020-07-22 10:52:48 +01:00
Ben Jackson
025d193493 Add VimspectorInstall command with sort-of completion 2020-07-22 10:48:12 +01:00
Ben Jackson
f945dbcfdd Move gadget config file writing too 2020-07-22 10:48:12 +01:00
Ben Jackson
6b89df173f Remove pointless calls to GetOS() everywhere 2020-07-22 10:48:12 +01:00
Ben Jackson
d3fd0a38f0 Refactor installer fully into installer module 2020-07-22 10:48:12 +01:00
Ben Jackson
e885c95daa Put the cursor at the end of the buffer after evaluations 2020-07-18 18:14:39 +01:00
Ben Jackson
99b582378a Allow ctrl-c to cancel when asked for a variable 2020-07-18 14:39:54 +01:00
Ben Jackson
47ace82364 FixUp: output window should set the global win id 2020-07-18 13:55:00 +01:00
Ben Jackson
3726766694 Documentation for the UI customisation 2020-07-18 13:41:22 +01:00
Ben Jackson
80afb153b9 FixUp: Closing the output window causes errors on output 2020-07-18 13:21:17 +01:00
Ben Jackson
f8cbb7c5b6 Add options to control window sizes
This adds the following options, allowing the default sizes to be
overridden:

- g:vimspector_sidebar_width: Controls the width of the left utility
  windows (variables, watches, stack trace)
- g:vimspector_bottombar_height: Controls the height of the output
  window below the code window

The terminal is typically created as a vertical split of the code
window.  The following control the sizing of the terminal window used
for debuggee input/output when using Vim's built-in terminal.

- g:vimspector_code_minwidth: Minimum number of columns to try and
  maintain for the code window.
- g:vimspector_terminal_maxwidth: Maximum number of columns to use for
  th terminal, when vertically splitting the code window.
- g:vimspector_terminal_minwidth: Minimum number of columns to use when
  it is not possible to fit g:vimspector_terminal_maxwidth columns next
  to the code window with g:vimspector_code_minwidth columns.
2020-07-17 16:52:41 +01:00
Ben Jackson
7a9f75a06e Don't change the value of equalalways
We were trying to avoid equalalways from changing the UI layout by
unsetting it and resetting it after changes. However, re-setting
equalalways actually resizes all the windows, so this never worked.

Instead we judiciously use rightbelow, leftabove, etc. and specify the
exact window sizes we want.

As a side-effect we make the terminal sizing a little more pleasant by
default, ensuring that it is no wider than 80 chars, and tries to use
any remianing vertical space after reserving 80 chars for the code
window.
2020-07-16 16:05:04 +01:00
Ben Jackson
9df680089b Allow default configuraiton to be specified; document selection 2020-07-16 08:33:49 +01:00
Ben Jackson
3beb25f949 Raise an autocommand for the terminal too 2020-07-16 08:33:49 +01:00
Ben Jackson
727214c599 Add a bunch of tests for the ui customisation 2020-07-16 08:33:49 +01:00
Ben Jackson
2c5937c2c1 Support basic UI customisation via a User autocommand 2020-07-16 08:33:49 +01:00