Commit Graph

2123 Commits

Author SHA1 Message Date
Christian Brabandt
c44bbc66f5
main: make sure winnr is available in s:context for check_mode function 2018-10-16 10:26:26 +02:00
Christian Brabandt
61e2c7f86a
Merge pull request #1813 from fishioon/master
Remove trailing space
2018-10-15 15:53:12 +02:00
fish
4d825bdb64 Remove trailing space 2018-10-15 20:35:28 +08:00
Christian Brabandt
07ac69570b
main: make FocusLost autocommand configurable
references #1807
2018-10-15 14:23:45 +02:00
Christian Brabandt
68f5f1e50d
mode: Update doc, sort dict 2018-10-15 14:17:49 +02:00
Lars Michelsen
3f34ff56b8 Improve update logic after ale finished
Previously the ale refresh was triggered after user interactions only.
When linting takes some time and the user is not actively working the
ale information was not updated while the things ale directly controls
were updated. This change makes showing linting results a loot smoother.
2018-10-14 20:19:39 +02:00
Christian Brabandt
f045452743
main: disable airline on FocusLost
When switching away from Vim and your terminal supports the FocusLost
autocommand, set the statusline to inactive, so it won't distract you
too much when working with another application.

In the gui, the FocusLost autocommand should always trigger.

This is now the default, if people start complaining, that behaviour
should probably be made configurable.

closes #1807
2018-10-03 12:31:45 +02:00
Christian Brabandt
13993d120e
Merge pull request #1805 from doronbehar/exteralize-quickfix-type-func
Externalize quickfix function returning text
2018-10-02 20:17:56 +02:00
Doron Behar
7190164451 Externalize quickfix function returning text
Useful when one wants to use this function for something else and to
know if a QuickFix window is actually a Location list with qf as
`&filetype`.
2018-09-28 12:56:49 +03:00
Christian Brabandt
a0298263b7
autocomd: do not re-evaluate modelines
fixes #1804
2018-09-25 16:03:30 +02:00
Liam Fleming
2390022e33
wordcount: do not rely on english in old versions
for older Vims, the wordcount extension falls back to `g<c-g>` and
parses the messaage that is generated.

When doing so, it expects the English locale, which might not be true.
Therefore, try to regex parse the result without using the english words
(assuming the output is still in the same order as in English).
2018-09-23 20:10:32 +02:00
Christian Brabandt
57bbe050c7
Merge pull request #1801 from flemingfleming/wordcount-fixes
The rest of the wordcount fixes, and some improvements
2018-09-23 17:38:11 +02:00
Christian Brabandt
dd508340ea
Merge pull request #1803 from dfalling/master
Add dictionary key check for d.severity
2018-09-23 17:37:25 +02:00
Dennis Falling
2f17e368b5 Add dictionary key check for d.severity 2018-09-23 10:50:15 -04:00
Liam Fleming
0f6cfcdfc2 wordcount: Fix the visual count matching pattern 2018-09-22 13:57:53 +01:00
Liam Fleming
264c1fefd2 wordcount: Compatibility fixes and General upkeep
Compatibility:
- Don't use a script-local function to update the format strings
- Protect against `:normal!' moving the cursor on on the wordcount check

Bugfix:
- Let to_string() try to return something for all values
  - Now returns correctly when passed both 0 and '0'

Upkeep:
- Simplify check again no valid key from winwidth()
- Old wordcount check: use matchstr() - more expressive and fewer steps
- Improve documentation style/clarity/detail
2018-09-22 03:34:27 +01:00
Christian Brabandt
ae024293e4
wordcount: fix wrong normal mode command 2018-09-21 21:37:21 +02:00
Christian Brabandt
ecf10d0e58
wordcount: check that the retun value has the dict key
else it will throw an error.
2018-09-21 11:49:42 +02:00
Christian Brabandt
11e6492849
Merge pull request #1797 from flemingfleming/wordcount-improvements
wordcount: Update documentation
2018-09-20 17:34:02 +02:00
Liam Fleming
dcf76b0992 wordcount: Update documentation
- g:airline#extensions#wordcount#filetypes is now documented as a list
- New to_string() function for formatters
2018-09-20 15:51:41 +01:00
Christian Brabandt
82a6097b01
wordcount: work-around non-existing v:t_list
v:t_list is an internal variable describing the type of a list.
Unfortunately, this is not available in older vims. So let's fall back
to using `type([])`

see #1795
2018-09-20 11:44:17 +02:00
Christian Brabandt
7957bd1d32
wordcount: only add fmt function once to statusline functions
This prevents a warning message, when the function is tried to add
several times. Also while at it, add a '!' so that no error is thrown if
the file is sourced a second times.
2018-09-20 10:41:50 +02:00
Christian Brabandt
110594c91a
tabline: remove spurious variable 2018-09-20 10:31:14 +02:00
Christian Brabandt
012229fe08
tabline: Ignore buffers in buflist matching ignore_bufadd_pat
closes #1777
2018-09-20 10:26:32 +02:00
Christian Brabandt
a60eabb82f
tabline: do not show terminal buffers by default 2018-09-20 10:25:47 +02:00
Christian Brabandt
fce8585239
main: detect some more modes 2018-09-20 10:13:59 +02:00
Christian Brabandt
326b37cf13
help: document tag airline#extensions#tabline#exclude_buffers 2018-09-20 10:13:59 +02:00
Christian Brabandt
1b8ecb6336
Merge pull request #1796 from flemingfleming/wordcount-improvements
[WIP] Rewrite wordcount plugin
2018-09-20 10:04:53 +02:00
Liam Fleming
0756b9a4aa wordcount: Re-enable updating the format string 2018-09-18 20:12:17 +01:00
Christian Brabandt
251ed064e8
Make mode return only single letter except for virt replace mode
commit bcd37fc115 changed the detection of modes slightly in that it
allowed not only single letters but also several letters.

While in theory, it might be okay to have extra modes displayed like
Insert Completion or Normal Insert, or Operator Pending, let's for now
just revert it to the default. We can always enhance it later if
requested.
2018-09-18 20:00:46 +02:00
Liam Fleming
c33c1de079 wordcount: Simplify update strategy
Checking for wordcount changes now uses a b:changedtick comparison in
the statusline funcref. The autocommand strategy that used to do this is
removed, simplifying the code.
2018-09-18 16:05:01 +01:00
Liam Fleming
9903fee60e wordcount: Optimise formatter calls, cleanup code
- Formatter is now only called when the wordcount changes
- ...#apply() now only compares against the filetype list when necessary
- Old format() function is no longer called for (unsupported) counting
  of visual words
- Misc code quality improvements
2018-09-18 15:13:43 +01:00
Liam Fleming
487d262901 wordcount: formatter: code quality improvements
- Rename new formatting function: transform() -> to_string()
- Optimise separator selection
- Other quality improvements
2018-09-18 02:04:35 +01:00
Christian Brabandt
a1c112cafd
main: replace and virt replace mode should use same coloring
fixes #1794
2018-09-16 20:01:00 +02:00
Christian Brabandt
bcd37fc115
mode: add support for virt replace mode
fixes #1792
2018-09-16 18:25:27 +02:00
Christian Brabandt
aec0a1a15a
languageclient: Check severity key before accessing it
closes #1793
2018-09-16 18:17:04 +02:00
Christian Brabandt
da8035d8a8
Merge pull request #1789 from danielwe/master
Fix bug introduced in #1788: Don't use the read-only `count` as local variable
2018-09-10 09:52:34 +02:00
Daniel Wennberg
cda5647a29 Don't use the read-only count as local variable
The variable name `count` is always equivalent to `v:count`, which is
a read-only variable and cannot be assigned to.
2018-09-09 23:51:11 -07:00
Christian Brabandt
f5676d1fa1
Merge pull request #1788 from hallettj/extension/languageclient
Extension to report errors and warnings from LanguageClient plugin
2018-09-10 07:36:15 +02:00
Jesse Hallett
a92b12e1c6 Implement extension to report errors and warnings from LanguageClient plugin 2018-09-09 23:53:08 -04:00
Christian Brabandt
d342c3cb1e
Merge pull request #1785 from smancill/conditional-vimtex-loading
Load vimtex only when the extension is enabled
2018-09-07 08:01:33 +02:00
Sebastián Mancilla
c3434164b2 Load vimtex only when the extension is enabled
Do not force loading the full vimtex autoload script for all users.
First check if the extension is enabled.
2018-09-06 13:15:38 -03:00
Liam Fleming
8715d13cc5 wordcount: Refactor updating and autocmds
Various improvements:
 - Seperate out visual mode detection.
 - Use TextChanged rather than CursorMoved where supported.
 - Let users specify the filetypes for which wordcounting is enabled
   with a list rather than a pattern.
 - Move the filetype check to when airline is refreshed, as opposed to
   on every update; autocommands are not created if wordcounting is
   disabled
2018-07-28 19:26:24 +01:00
Liam Fleming
44da0a4761 wordcount: Replace formatter interface
Currently the formatter, and not the wordcount plugin, is responsible
for providing the wordcount as well as formatting it. The default
formatter allows visual mode word counting, although this is not
documented.

The new interface - a transform() function, allows the main wordcount
plugin to internalise this logic. Providing the wordcount simplifies
formatter implementations:
 - All formatters can display the visual wordcount.
 - Formatters do not have to worry about compatibility with different
   vim versions.

The old format() function can now be deprecated, although the wordcount
plugin retains compatibility with formatters using it. The default
formatter will also be used as a fallback if no suitable function is
found.

The default formatter is rewritten to use the new interface.
2018-07-28 18:24:12 +01:00
Christian Brabandt
c7fb175d35
Add a specific color for commandline mode
closes #1768

Colors for the other themes need to be defined however
2018-07-26 10:22:40 +02:00
Christian Brabandt
59f3669a42
Merge pull request #1770 from shyun3/pullreq
Add vim-grepper extension
2018-07-24 19:16:22 +02:00
Mo Hyun
60eb44c94e Fix build error 2018-07-23 14:27:59 -07:00
Mo Hyun
723987eca9 Add vim-grepper extension
- Displays a segment when a grepper search is running
2018-07-23 13:05:34 -07:00
Christian Brabandt
964f53a418
Merge pull request #1767 from tpope/fugitive-real-path
Update to new Fugitive real path API
2018-07-23 08:11:18 +02:00
Tim Pope
a8ccef61ba Update to new Fugitive real path API 2018-07-22 15:39:54 -04:00