Commit graph

861 commits

Author SHA1 Message Date
Tomas Babej
bdba08ee4f
meta: Update requirements for tasklib 2021-10-10 10:37:46 -04:00
Tomas Babej
b16922040b
ci: Expand test matrix 2021-10-10 10:37:45 -04:00
Tomas Janousek
c4392c36c0 ci: Revert unnecessary part of the coveralls "fix"
We already set this via the COVERALLS_SERVICE_NAME environment variable
in the GitHub Actions workflow, as it's really specific to GHA.

And as it turns out, the fix wasn't really necessary anyway as the
Coveralls.io infrastructure was just temporarily down.

Fixes: d98d5b18ac ("ci: Fix coveralls submission")
2021-09-22 17:20:21 +02:00
Tomas Babej
d98d5b18ac ci: Fix coveralls submission
See [0] for reference.

[0]: https://github.com/lemurheavy/coveralls-public/issues/1435
2021-09-22 06:49:09 -04:00
Tomas Babej
507addcfbf meta: Bump tasklib requirements
This is required to support newest tzlocal 3.0.
2021-09-22 06:49:09 -04:00
Jasha
70b33f336a add documentation for the new taskwiki_dont_fold toggle 2021-09-20 20:50:24 -04:00
Jasha
5e125960c9 add toggle to disable custom folding for vimwiki files 2021-09-20 20:50:24 -04:00
Tomas Babej
146d0891a6 VimwikiTask: Fix tab handling
Tabs were not correctly accounted for when searching for the parent
task.

Closes #352.
2021-09-18 15:06:52 -04:00
Kaushik Gopal
832293f9f7 specifiy requirements.txt file location explicitly
I ran into a similar snag as https://github.com/tools-life/taskwiki/discussions/332 and realized that more folks might help with the additional tip on where the `requirements.txt` file is located.
2021-08-13 18:24:37 -04:00
Nikolaos Kakouros
f9a1e6ab9f Removes whitespace from urgency marker highlighting
Co-authored-by: Tomáš Janoušek <tomi@nomi.cz>
2021-06-26 20:16:46 -04:00
Tomas Babej
c5d6f58ab9 docs: Document TaskWikiToggle 2021-06-21 19:13:40 -04:00
Tomas Babej
b972e901c7 ftplugin: Expose TaskWikiToggle as a vim command 2021-06-21 19:13:40 -04:00
Tomas Babej
47f7f24b17 SelectedTasks: Implement TaskWikiToggle 2021-06-21 19:13:40 -04:00
Tomas Babej
29bc9aa20c tests: Add test for TaskWikiToggle 2021-06-21 19:13:40 -04:00
Wojciech Francuzik
48e24b03c0 include info about pynvim
I was lost because TaskWiki would not work with my nvim. It turned out that my python3 provider was not available. Installing this dependency - pynvim, solved the issue. I hope I can save other nvm users time by providing this info.
2021-05-22 07:39:05 -04:00
salman69e27
ae28d398d5 Basic inspect functionality for preset headers 2021-05-22 07:38:48 -04:00
Tomas Babej
23a3c20a7d
LICENCE: Update copyright 2021-04-02 22:41:20 -04:00
Jonathan Dowland
67e5444cdf Only adjust conceallevel if taskwiki_disable_concealcursor unset
`g:taskwiki_disable_concealcursor` is used to control whether or not
Taskwiki sets `concealcursor`. Move the setting of `conceallevel` to
also dpend upon `g:taskwiki_disable_concealcursor`, the reasoning
being that if the user does not want Taskwiki to set `concealcursor`,
they most likely don't want `conceallevel` changed either.

Fixes #325.
2021-04-02 22:37:28 -04:00
Nikolaos Kakouros
a3ae9c52cd Adds count viewport setting 2021-01-28 20:54:48 -05:00
Tomas Janousek
72397a8c23 tests: Workaround for recent coveralls-python breaking GH Actions
https://github.com/TheKevJames/coveralls-python/issues/252
2021-01-14 15:10:17 -05:00
Tomas Janousek
b5094a70f2 tests: Update test matrix
There's no 2.5.x branch any more. Change the default to master, i.e. the
latest release, now that the branch actually reflects the release and
no longer includes patches accidentally merged to the wrong branch.

Keep v2.5.1 around just for safety as it probably is the most widely
used release around.

Would be nice if the 2.6.0 branch was named dev or devel and wasn't
about to disappear as soon as 2.6.0 is released... :-/
2021-01-14 15:10:17 -05:00
Ben Harris
b280e28ac8 Update README.md
Add a bit of explanation for the supported markdown syntax.
2020-12-30 08:17:25 -05:00
Tomas Janousek
4c7cc5f551 completion: Fix omni completion of non-ascii tasks
vim uses bytes as column offsets, so we need to work with encoded
strings instead.
2020-12-29 18:16:19 -05:00
Tomas Janousek
679e564194 cache: Empty preset cache on reset()
Forgotten in 4372d52298.
2020-12-26 20:52:04 -05:00
Tomas Janousek
57a5c405ea completion: Add omni completion for new task modstrings 2020-12-26 20:52:04 -05:00
Tomas Janousek
12d363df5e completion: Fix compatibility with taskwarrior 2.4.4 2020-12-26 20:52:04 -05:00
Tomas Janousek
6cedc13b58 completion: Add tab completion for TaskWikiMod 2020-12-26 20:52:04 -05:00
Tomas Janousek
a6907bac85 ftplugin: Avoid changing global viewoptions
As mentioned in an earlier commit, viewoptions is global, so it's
probably best to override it only temporarily for mkview.

(loadview is moved to autoload just for symmetry and in case we need to
do something more complex, like saving/restoring foldmethod, later)
2020-12-18 17:55:09 -05:00
Tomas Janousek
7b72ee47b9 syntax: Move setl foldtext to BufWinEnter autocmd
Vimwiki now resets fold{method,text} on BufWinEnter:

8d4cb7f11d/plugin/vimwiki.vim (L177)
8d4cb7f11d/plugin/vimwiki.vim (L325)

so we should do that as well otherwise we get overridden.

If the user actually configured vimwiki to use its folding, by setting
g:vimwiki_folding to something else than '' or 'custom', we should not
replace that. It would be nice if we could somehow augment
VimwikiFoldText and leave the rest intact, but we can't, so it's best to
keep off. Using foldmethod=syntax gets extremely laggy with just a few
hundreds of lines, so we must not force it.

Also, we now need to increase foldlevel in tests because the folding is
no longer being overridden in the default vimwiki configuration, so we'd
get closed folds in tests...
2020-12-18 17:55:09 -05:00
Tomas Janousek
792ca80a2b syntax: Move setl viewoptions to ftplugin
Doesn't belong in syntax, and shouldn't be set unless we need it for
mkview, so move it next to that mkview.

(BTW, it's a bit confusing that we use setlocal for a global option. Are
we hoping it's going to be made local one day? If not, we may as well
change it to `set` to avoid confusion.)
2020-12-18 17:55:09 -05:00
Tomas Janousek
2ab876a80a syntax: Move TaskwikiFoldText to autoload
Avoids useless reloading of the function. In practice, probably
harmless, but it doesn't belong there, and neither does setting
foldmethod/foldtext, and that is actually harmful (see further commits).
2020-12-18 17:55:09 -05:00
Tomas Janousek
94409fd372 requirements: Add six
None of our dependencies installs this for us any more.

(We should get rid of it, too.)
2020-12-18 17:49:10 -05:00
Tomas Janousek
6c3c299118 tests: Update test matrix
Python 3.5 is EOL since Sep 2020.
Python 3.9 is out since Oct 2020.
taskwarrior 2.5.2 is out since Dec 2020 (released only on GitHub though).

It's a bit stupid to have to update it manually, but until we figure it
out something better...
2020-12-18 17:49:10 -05:00
Nikolaos Kakouros
4fd11afda1 Shows uuid for tasks with no id 2020-10-01 15:56:06 -04:00
Tomas Janousek
377aac68ba tests: Do not load vimwiki/taskwiki twice in TestSelectAfterBufferSwitch
This was forgotten in 7d5b902c89.
(Found when writing the test in the previous commit.)
2020-09-23 02:18:46 -04:00
Tomas Janousek
d66a7b5b94 cache: Mark buffer as modified on push
When a (task)wiki file is opened, viewports are refreshed but the buffer
is not marked as modified and therefore a subsequent :xa doesn't update
the file. This is, IMO, undesired.

vim documentation for the 'modified' option:

    This option is not set when a change is made to the buffer as the
    result of a BufNewFile, BufRead/BufReadPost, BufWritePost,
    FileAppendPost or VimLeave autocommand event.  See |gzip-example| for
    an explanation.
2020-09-23 02:18:46 -04:00
Tomas Janousek
1e3ccb16f8 vwtags: Distinguish (tag kinds) between header, preset and viewport
For tagbar to correctly nest the tags, we need to remember kinds of
parent scopes as well. This wasn't done in the original taskwiki
implementation.
2020-09-23 02:03:47 -04:00
Tomas Janousek
07dc2b8ceb vwtags: Viewports/presets shown using their name only
In other words hide the parts behind `|`. Handle vimwiki links
correctly.
2020-09-23 02:03:47 -04:00
Tomas Janousek
91f98d54b3 tests: Add basic tests for vwtags 2020-09-23 02:03:47 -04:00
Tomas Janousek
b48123fd58 vwtags: Drop help and import from __future__
We don't need the help message as g:tagbar_type_vimwiki is set by
taskwiki itself, and as we're going to refactor this, maintaining the
help is extra work that makes little sense here.

The import isn't needed in python3.
2020-09-23 02:03:47 -04:00
Tomas Janousek
3cbf59e8ea vwtags: Revert to current vimwiki/utils master
The implementation that was here had several limitations:

* headers containing `[[vimwiki|links]]` are incorrectly marked as
  viewports

* headers/viewports nested below such headers aren't correctly nested in
  tagbar as they use `header:` to refer to their parent scope

* presets are marked as viewports, and viewports nested under presets
  don't correctly nest for the same reason as above

* the logic for marking headers/viewports as `i:inside` is incorrect,
  and the motivation for it is unclear

Let's revert to
6c419fba6f/vwtags.py
and then we'll add tests and implement support for viewports and presets
in a way that actually works.
2020-09-23 02:03:47 -04:00
Tomas Janousek
da3a1bbd8b main: Pass correct markup_syntax to extra/vwtags.py
Hardcoding 'default' defeats the purpose of having the parameter,
doesn't it?
2020-09-18 11:31:49 -04:00
Tomas Janousek
7b67d510cc cache: Get markup_syntax from vimwiki, drop g:taskwiki_markup_syntax
I don't see the point of forcing the user to select this manually in
both vimwiki and taskwiki.
2020-09-18 11:31:49 -04:00
Tomas Janousek
5807945a40 cache: Drop unnecessary decode_bytes invocations
These were made redundant in 61d0d89be9
but never dropped. It's time.
2020-09-18 11:31:49 -04:00
Tomas Janousek
92785f10f7 ftplugin: Minor cleanup 2020-09-18 11:28:39 -04:00
Tomas Janousek
94fe6ed8e8 ftplugin: Postpone initial refresh to better preserve folds
Vim preserves folds by writing line jumps into the view script, so it's
better to load this script with the original file contents and only then
refresh from taskwarrior. The folding is still often broken when the
buffer is updated, but that can now be considered a vim bug and may
perhaps one day be fixed (or even worked around, if one is persistent
enough). Loading the view after modifying the buffer is simply wrong,
that can never ever work.
2020-09-18 11:28:39 -04:00
Tomas Janousek
f3fe7aca21 ftplugin: Only load the python plugin once
This makes opening wiki pages significantly faster and also prevents
clearing the entire cache every time.
2020-09-18 11:28:39 -04:00
Tomas Janousek
b722c29f9e ftplugin: Make commands buffer-local
Consistency with vimwiki, less confusion/clutter.
2020-09-18 11:28:39 -04:00
Tomas Janousek
2942ba776d ftplugin: Use buffer local autocmds
* simplifies code a bit
* avoids triggering autocmds on *.wiki files outside of registered vimwiki
* prevents reordering of autocmds when switching wiki pages

The last bit is my main motivation: I need to add a BufEnter autocmd (to
~/.vim/after, not to taskwiki itself) and I'd love to rely on
`cache.load_current()` having been called already.
2020-09-18 11:28:39 -04:00
Tomas Janousek
d00234b60d ci: Don't hash TASK_DEVEL_SHA for tags (reuses old docker images)
This isn't really necessary but it seems cleaner anyway. :-)
2020-09-18 11:26:08 -04:00