Commit Graph

149 Commits

Author SHA1 Message Date
Brennen Bearnes 11350f572b is_diary_file(): use filereadable() to check a single file
Intended to address #1267 - "get_diary_files() takes very long to
execute on Windows - this leads to very slow link-creation using the
Enter key".

In theory, this should be a performance improvement for link creation on
systems with very slow filesystem access (this came up under Windows, but
ought to be a general optimization).  It does nothing for generating the
entire list of diary files, which by nature has to get the whole list
anyway.

  - Uses a filereadable() call against a path instead of checking the
    results of get_diary_files() for most calls.

  - Introduces is_among_diary_files() for the case where you want to
    check against a get_diary_files() list.

  - is_diary_file() will pass through to is_among_diary_files() if it gets
    invoked with a second parameter, to retain backwards compatibility on
    the off chance anyone has scripted against this behavior.  I'm not sure
    this is necessary, but trying to be cautious with the implicit API
    here.

  - Includes a test/api_base_is_diary_file.vader

My original version of this change assumed that input would be in the
form of "2023-01-01", instead of a fully-qualifed filename.  As it is,
it expects a full path to the file, in keeping with the list returned by
vimwiki#diary#get_diary_files().

Bug: #1267
2023-03-30 17:08:58 -06:00
Tinmarino dec6a9ecab CI: Lint run_test: reorder function in top>down 2023-03-22 01:22:25 -03:00
Tinmarino 57107c7c56 CI: Lint run_test: all in function 2023-03-22 01:17:20 -03:00
Tinmarino 72d02207b0 Syntax: Fasten highlighting, from 200ms to 20ms for first screen update
Problem:

The loading of a .md file was slow due to multiple nested lookback.
It is advised in vim help to prefer \zs, see :h /\@<
Anyway, it is useless to nest them.

089.080  000.085  000.085: sourcing /home/mtourneb/.vim/after/syntax/vimwiki.vim
089.264  005.184: opening buffers
089.322  000.058: BufEnter autocommands
089.323  000.001: editing files in windows
089.414  000.091: VimEnter autocommands
089.415  000.001: before starting main loop
303.698  214.283: first screen update
303.700  000.002: --- VIM STARTED ---

Solution:

Remove the function s:expand_delimiter in vars.vim.
It was doing a duplicate job with vimwiki#u#hi_expand_regex
And ... well avoid lookback as much as possible

091.784  000.087  000.087: sourcing /home/mtourneb/.vim/after/syntax/vimwiki.vim
091.991  006.034: opening buffers
092.050  000.059: BufEnter autocommands
092.052  000.002: editing files in windows
092.172  000.120: VimEnter autocommands
092.173  000.001: before starting main loop
112.574  020.401: first screen update
112.578  000.004: --- VIM STARTED ---
2023-03-18 01:50:53 -03:00
Tinmarino f4bd841a4c Tags: improve VimwikiSearchTags which was not using user configuration (issue #1316) (v2) 2023-03-17 22:05:47 -03:00
Tinmarino 8640988c5c Markdown typeface: match closer to GFM specification, also add tests 2023-03-17 16:08:27 -03:00
Tinmarino f5399ffdfa Improve typeface specification closer to GFM and test 2023-03-17 13:44:05 -03:00
Tinmarino 8374bcfccf Feature: Support for <mark> in Markdown (issue #1261) 2023-03-17 03:46:56 -03:00
Tinmarino cde5dbc92a Feature: permit blockquote automatic continuation (issue #1274) (fixed) 2023-03-17 02:27:08 -03:00
Tinmarino 035b2f15c7 Permit tags in heading #1316 2023-03-17 00:05:48 -03:00
Tinmarino eab70aedaa CI: Add basic syntax test 2023-03-17 00:05:48 -03:00
Tinmarino 5db16850da Fix VimwikiAddHeaderLevel map (like 3=), borken by previous 5e564bb10d, (Issue #1270) 2023-03-15 02:06:57 -03:00
Tinmarino 7f1357472d Yaml metadata, fix regex (#1287) 2023-03-15 00:54:49 -03:00
Tinmarino 2f1f497f88 CI: Fix former test to match the new equation syntax #150 2023-03-13 20:03:38 -03:00
Tinmarino f55e700828 Fix Math inline border cases (Issue #150) 2023-03-13 19:43:43 -03:00
Tinmarino 8bf4d6363c Syntax: Add highlithing for YAML metadata block (#1287) 2023-03-13 16:52:57 -03:00
Tinmarino 6d4208157d CI: Add Typos check and fix some typo 2023-03-12 01:15:28 -03:00
Tinmarino acff8a5b1d Check: Change .travis CI to GitHub Actions CI (GHA) 2023-03-10 13:55:18 -03:00
Brennen Bearnes 0629b39815 switch to calver; add g:vimwiki_version; tidy version hardcoding
Setting a global for g:vimwiki_version doesn't seem too egregious, and
lets us reference it cleanly elsewhere.

Removes version header from vimwiki.txt and hardcoding in tagfile
generation.

There's still one instance of that left in test/tag.vader that we should
clean up eventually.
2022-12-02 14:46:35 -07:00
Brennen Bearnes 221377f4fa version to 2.6.0; rewrite docs for rolling release
This:

  - Changes version number everywhere I could find it.
  - Reworks get_version() to dispense with stable / dev division.
  - Rewrites CONTRIBUTING.md to describe a new release workflow.

The development/release workflow stuff could use some thought.  It's
clunky at best.  There's sort of an inherent tension between semver-style
version numbers and the rolling release thing - maybe we should just use
commit hash or something date-based?

Still, it's a start.
2022-11-29 22:57:10 -07:00
Philipp Oberdiek 61c513d8d0 Add vader test for updating generated tag links 2022-04-09 20:14:04 -04:00
Philipp Oberdiek a905ee71e0 Update tag link captions in tag vader tests 2022-04-09 20:14:04 -04:00
Philipp Oberdiek c19e63b1e9 Make tag links relative to current file #794 (#1162)
Also add a vader test case and update the changelog as well as the list
of contributors.

Co-authored-by: Tinmarino <tinmarino@gmail.com>
2021-12-18 12:11:01 -03:00
Tinmarino 45c89ebca4 Feature: Table cells permiting escaped separator (i.e. \|) #281 2021-06-11 10:50:53 -04:00
Tinmarino d43fdd14d2 Test: Demo: Renaming link text in markdown #1138 2021-06-11 09:22:52 -04:00
Tinmarino a182f7db8f Test: Fix bad space removed 2021-06-10 17:28:46 -04:00
Tinmarino 7eb6fed581 Pretty: Delete trailing space 2021-06-10 17:17:57 -04:00
Tinmarino 4cc6edf3eb Fix RenameFile with relative to root (prefix with /) #617 2021-06-10 17:15:29 -04:00
Tinmarino 114ead874c Test: Fix: for Vim <= 7.3 the linkify function 2021-06-09 13:13:05 -04:00
Tinmarino 1fbe1bc6a8 Feature: Syntax: Provide vimwiki language escape sequences -> \token #1044 2021-06-09 12:42:51 -04:00
Tinmarino 62baafe259 Test: link creation with dot #924 2021-06-09 09:45:25 -04:00
Tinmarino 0181009dba Feature: vimwiki#base#linkify() with markdown syntax setting #994 2021-06-09 09:26:52 -04:00
Tinmarino 573e3d1952 Test comment last 2021-06-08 17:44:38 -04:00
Tinmarino 760cab232d Test for links_space_char #1132 2021-06-08 17:14:43 -04:00
Steven Stallion 8fef79bcbd VimwikiGoto: Support wiki pages with spaces (#1128) 2021-05-20 14:50:10 -05:00
Tinmarino 1f77b7e6f6 Table: Fix exception if i<Tab> at end of line if next line is bad (Issue #1126) 2021-05-17 10:36:12 -04:00
Stefan Schuhbäck f6c419fb87 Add wikilocal option showing description in generated links 2021-05-06 20:36:42 -04:00
Brennen Bearnes f396e8a494 Fix resolution of leading-slash links, add link tests (#1108)
Hopefully this solves #1084, "Page links with leading slash lead to a
file in working directory, not a page at the root of the wiki", introduced
in 850aace.

It also adds a set of tests for different kinds of wiki links:

  - api_base_resolve_link.vader
  - link_syntax_markdown.vader
  - link_syntax_vimwiki.vader

Includes some fixes for locally-failing tests, removes a test from
test/map.vader and comments out test/config_vars.vader entirely for the
moment.

Code by : Brennen Bearnes <code@p1k3.com>
2021-04-06 22:09:37 -04:00
Brennen Bearnes 618893be00 Vimwiki2HTML: remove string concat from variable substitution (#1110)
Problem: I noticed that running :Vimwiki2HTML for a file with a `"` in
the `%title` line would error out.  For example, a title like:

    %title this will die: "

Causes:

    Error detected while processing function vimwiki#html#Wiki2HTML[1]..<SNR>177_convert_file[15]..<SNR>177_convert_file_to_lines
_template:
    line    8:
    E116: Invalid arguments for function substitute(v:val, "%title%", "this will die: "", "g")

Solution: It seems like the string concatenation here was unnecessary.
At least on my vim 8.1, the evaluated code seems to have access to the
correct variables.

I'm sure there are bigger problems with the HTML generation here, but this
allows my ~2000 pages with titles to render without throwing errors.

Also adds a brief test and removes some unnecessary DeleteFile() calls
from html_convert_default.vader.

Co-authored-by: Brennen Bearnes <code@p1k3.com>
2021-04-05 22:07:38 -05:00
Tinmarino 0a9488f3f1 Feature VimwikiColorize maps in visual and normal mode #990
Colorize working for visual selection
Add map (,wc), test and doc
2021-01-10 19:03:37 -03:00
Tinmarino e91711eb79 Test: Fix error in previous typeface hi 2021-01-10 13:16:34 -03:00
Tinmarino e7124290a2 Fix: Typeface font highlight VimwikiBoldItalicUnderline was not bold
Fix 2: s:setup_cleared_syntax() was reconfiguring badly
Test: for hi VimwikiBold -> cterm=bold
2021-01-10 12:27:35 -03:00
Tinmarino 788a961052 Test: Add option to configure date string format #1073 2021-01-07 22:15:35 -03:00
Tinmarino 5996fdf26a Test: #1048 <Plug>VimwikiTableNextCell 2021-01-06 14:36:06 -03:00
Amit Beka 96713548cc configure expression for Todo words (#1053)
Enable the user to conveniently set the regular expression used for the
`VimwikiTodo` syntax group, instead of the defaults which might be
more suitable to code.

This setting is now also local per wiki.

Signed-off-by: Amit Beka <--->

Co-authored-by: Amit Beka <--->
2020-11-20 09:02:55 -03:00
Tomas Janousek 2a31984369 Feature: Optionally disable todo propagation to parents/children (Issue #954)
taskwiki integrates vimwiki with taskwarrior, and in doing so changes
the semantics of checkboxes a bit:

    * [ ] Install Taskwiki   |   pending task
    * [X] Install Taskwiki   |   completed task
    * [D] Install Taskwiki   |   deleted task
    * [S] Install Taskwiki   |   started task
    * [W] Install Taskwiki   |   waiting task

It's still desirable for vimwiki to automatically insert `* [ ]` on
`i_<CR>`, `o` and `O` and to syntax highlight all these five as
checkboxes, so I have this in my .vimrc:

    let g:vimwiki_listsym_rejected = 'D'
    let g:vimwiki_listsyms = ' WSX'

but it results in undesirable behaviour with task hierarchies: when I
add a new subtask (using `i_<CR>`, `o` or `O`)
or mark a subtask done, the parent's checkbox is updated to reflect its
overall completion, to one of ` `, `W`, `S` or `X`, depending on
subtasks completion. This makes little sense in taskwiki. One usually
doesn't want to touch the "parent" task in taskwarrior until the
"subtasks" are done. Setting

    let g:vimwiki_listsym_rejected = 'W'
    let g:vimwiki_listsyms = ' SX'

results in slightly less illogical behaviour, but it still assumes that
(1) all subtasks are visible (not necessarily true in taskwiki) and
(2) that it's a parent/subtask relationship, not a dependency
relationship (not true in taskwarrior, questionable in taskwiki).

This commit adds an option to disable this behaviour.
2020-10-24 19:43:01 -03:00
mtourneb 990b25ce37 Fix: Folding by 'syntax' does nothing with Markdown syntax (Issue #1009) 2020-09-05 16:19:21 -04:00
Ryan Winograd 1ea97303fd Fix: HTML Conversion: List with wrapped lines (#1008)
Track how many leading spaces a list item has in order to determine whether we should start a blockquote.

Note the extra close tag in the added test: this is a pre-existing issue
already present on `dev`.
2020-09-05 11:45:50 -04:00
mtourneb a7f34cd8cf Feature: Add command VimwikiColorize (Issue #990)
Only colorize the current line to start
2020-09-03 23:43:56 -04:00
Tinmarino dc63a5dacc Fix: Html convertion: Blockquote: multiline and in number list (Issue #55)
- Issue 5 indented multiline

Transoform blockquotes by precode
```
<blockquote>
Block quote line 1
Block quote line 2
</blockquote>
```
->

```
<pre><code>line 1
line 2
</code></pre>
```

- Issue 2: BlockQuote restarts list numbering

Allow indent precode in list
2020-08-24 01:14:18 -04:00