Commit Graph

473 Commits

Author SHA1 Message Date
Tinmarino
077467877d Util: count_exe 2020-05-17 14:06:41 -04:00
Tinmarino
f4c983b6b5 Feature: VimwikiGenerateLink take pattern optional argument
Issue #803
2020-05-17 13:14:08 -04:00
Tinmarino
3b5537f15a Fix: Link containing only '-'
Issue #835 #876
2020-05-17 12:31:32 -04:00
Tinmarino
ee38764480 Add: ShowVersion: os and vim version for easyer issue debug 2020-05-13 22:43:41 -04:00
Tinmarino
0850ce13ad Fix: retrocompatibility and Vint 2020-05-13 11:35:22 -04:00
Tinmarino
1852c6c542 Fix: clean_url removing Chinese character
Issue: <Enter> create link bug with Chinese characters #849
Thank: @BSDxxxx
2020-05-13 11:35:22 -04:00
Tinmarino
39812e5c96 Fix: renaming tipo: s:get_diary_file -> vimwiki#diary#get_diary_files() 2020-05-13 11:35:22 -04:00
flex
76af17a872 fix base#find_files so that it works for filenames with whitespaces 2020-05-11 22:14:35 -04:00
Patrick Stockwell
ab301801b0 Improve path normalisation with separate substitutions
This change reverts the original regex and simply adds a second regex
which is called on the result. '/\./' is one literal forward slash, one
literal fullstop (escaped with a leading backslash), and one literal
forward slash. In plain text, `/./` will be replaced with `/`.
2020-05-11 21:08:54 -04:00
Patrick Stockwell
b96e82d6cc Generate links when diary & wiki dir are the same
When generating links, we first check that the file is not a diary file
as we don't want to include those in the list. That work is delegated to
the `is_diary_file` function. Prior to this change, the function always
returned true if the file was in the diary directory.
This approach gives false positives for a wiki which has a flat structure
and the wiki files and diary files share a directory. eg:

let wiki.diary_rel_path = './'

This change reuses existing diary functions from the diary.vim module to
get an exact list of diary files to check against.
2020-05-11 21:08:54 -04:00
Tinmarino
1020ac51bf Prettify: Special case in diary not so special
Same as generic case within this PR
2020-04-22 11:22:53 -04:00
Stefan Lehmann
c73107dc10 Fix for Issue #807
creating a new link to an existing page in the diary path now uses the full page name instead of just the first word.
2020-04-22 11:22:53 -04:00
kaphula
35af13c1ef Moved safe_line_html call after the %plainhtml check so it does not convert essential html characters such as < and > to ampersand form. 2020-04-20 22:11:40 -04:00
kaphula
867d81a50c Added new feature to insert plaintext to the final html conversion file. 2020-04-18 13:04:55 -04:00
Mauro Morales
a4738f31d6 Add viewport meta tag to make it responsive 2020-04-17 19:02:59 -04:00
Tinmarino
614287a42b Comment: tipo 2020-04-17 19:01:03 -04:00
Clément Bœsch
7ae02bb4e6 Remove unnecessary echom idx cruft
This was introduced in 3396e87db for debugging and probably forgotten.
2020-04-06 16:50:26 +02:00
Rane Brown
78a41b79c6 Merge branch 'multi_ft' into dev
This allows setting multiple filetypes at the same time e.g. 'vimwiki.md'
Closes #817, resolves #830, resolves #461.
2020-04-03 13:31:36 -06:00
Tinmarino
d9412218e3 Fix relative paths for VimwikiRenameLink. Merge PR #787.
Fixes #90 

__Problem__: VimwikiRenameLink does not rename dir1/toto url in dir2/tata
because the dirs (dir2 and .) were well crossed but badly inspected.
__Solution__: `blob(.ext*)` -> `glob(**/*.ext)` + find the relative URL

* Fasten: VimwikiRenameLink goes faster with cache
More: To compute old_url regex, use a cache dict because it is the same
for files in the same directories

* Util DeleteHiddenBuffer -> do not delete Vader buffer

* Test: Prettify: Util: teardown delete defined function

* Remove unnecessary trailing spaces
Note: list_VimwikiReturn.vader has some necessary trailing spaces
2020-01-04 21:21:52 -07:00
Rane Brown
87c13f570a Ignore verbatim blocks when scanning tags.
Merge pull request #672.
2020-01-03 15:24:47 -07:00
Rane Brown
270f542292 Improve detection of code blocks 2020-01-03 15:14:45 -07:00
Rane Brown
5cdeb9a682 Improve markdown syntax for fenced code blocks. Closes #764 2020-01-01 10:58:56 -07:00
Rane Brown
cf072ebdf2 Update how tags are written to file.
Ensures older vims are still supported.
2019-12-30 10:24:52 -07:00
Rane Brown
b4e0f738a3 Allow markdown syntax to have tags at top of file.
Previously tags that did not fall under a header caused errors because
the generation code expected an anchor.

Update tags test case.

Closes #790
2019-12-30 10:09:04 -07:00
Rane Brown
b9eec79cc6 Update tags file format. Closes #779. 2019-12-30 10:07:20 -07:00
Rane Brown
19f913429f Don't overwrite user setting of list_margin.
Closes #789
2019-12-23 13:35:31 -07:00
Rane Brown
7ad0ad36dc Set default list_margin=0 for markdown 2019-12-21 09:09:16 -07:00
Rane Brown
1a4e1ed1ae Stylistic changes to pass vint tests.
Two non-stylistic errors were also fixed:
  1. Removed duplicate function with invalid argument usage
  2. Added missing quotes to a function call argument
2019-12-20 20:41:03 -07:00
tinmarino
8db9d4b387 VimwikiGoto: Enable VimwikiGoBackLink after 2019-12-15 19:23:50 -03:00
tinmarino
80013f457d Feature: VimwikiGoto completion works with only part of filename
Problem: Could not complete when the user argument was not the begining
of the filepath
Solution: use custom smartcase filter and customlist instead of custom
2019-12-15 02:27:11 -03:00
tinmarino
64eea36b1e Feature: VimwikiGoto completion get also link of files nested in directories
Before: VimwikiGoto <Tab> -> completed only files in current dir
After: complete also files in nested dirs
Changes: glob(*) -> glob(**/*)
2019-12-15 02:27:11 -03:00
Rane Brown
2a51d83397
Merge pull request #780 from rattletat/dev
Only echo message with custom_wiki2html call if the output isn't empty.
2019-12-14 21:56:09 -07:00
Rane Brown
c58d5da049 Set default ext2syntax values for markdown and mediawiki.
Closes #769.

Also fixes an error when adding missing '.' to mapped extensions. The
previous behavior tried to access a value after it was removed from the
dictionary.
2019-12-14 20:31:59 -07:00
Rane Brown
eb26a66be5 Add check to generate_tags() to ensure a header is present.
Prior to this fix a file with tags present before any header would
result in vim errors. Now a single Vimwiki message is printed to alert
the user of the issue.
2019-12-14 10:41:22 -07:00
Rane Brown
460fcb692e Make generation functions compatible with older vims.
PR #634, PR #635, and PR #636 introduced new features that broke
compatibility with older version of Vim. This modifies those changes to
ensure compatibility. Closes #781.

Removes usage of funcref(), closure. Fixes filter() call.
Made globpath calls not use the list argument.
Unlet a variable that is reused (sticky type checking)

v7.4.1989 modified filter() to accept a Funcref
v7.4.2120 Added function "closure" argument
v7.4.2137 add funcref()
2019-12-14 10:31:30 -07:00
Michael Brauweiler
c48637fd99
Add better echoing of custom wiki2html script
This commit adds a check to the call of the wiki2html script,
so that it is only echoed if it actually produces output.
2019-12-08 12:05:25 +08:00
tinmarino
c4a40e7fc7 Fix: VimwikiGoBackLink does not go back to links on the same page #691 2019-10-24 23:24:17 +02:00
tinmarino
53ba047a18 Clean code: : mutualise bash: is_wiki_link: command not found in a script function 2019-10-24 23:24:17 +02:00
Rane Brown
85b220bae1 Merge branch 'issue-420' of https://github.com/ratfactor/vimwiki into ratfactor-issue-420 2019-10-20 20:27:25 -06:00
Rane Brown
141d1aa081 Treat math blocks in the same manner as code blocks 2019-10-19 10:45:45 -06:00
Rane Brown
a42cd58636 Don't insert marker character with o or O within a code block.
Previously if a code block was part of a list and o or O was used a new
list marker would be inserted. Also moved the is_codeblock check
function to utils file for use elsewhere.
2019-10-16 22:27:26 -06:00
Rane Brown
1f85a3c855
Merge pull request #735 from simias/fix-407
Fix off-by-one error in get_next_line and get_prev_line
2019-10-15 12:15:14 -06:00
Dave Gauer
ad95e3463f Add error handling to VimwikiSearch per issue #420
- Create function wrapper around lvimgrep for input checking, pattern
   quoting, and error handling.
 - Add Vader tests for VimwikiSearch.
 - Change syntax loading from try/catch to explicit file check (to
   prevent Vader test bug).
 - Update doc/vimwiki.txt for changes.
 - Change test script to run Vader tests separately
2019-10-12 18:31:43 -04:00
Rane Brown
a17a9826bd Fix 'VimwikiReturn 3 5' behavior within code blocks.
Previously a new list marker would get added when working within a code
block that was part of a list. This change excludes code blocks from
list marker creation.
2019-08-23 14:42:07 -06:00
Rane Brown
5ce7c14a3d Properly handle lists with hard wraps. Fixes #443.
This change modifies the behavior of VimwikiReturn to not insert a new
list marker if not within a list. Mostly useful when mapping <CR> to
VimwikiReturn 3 5 or similar. The behavior of 'o' was also modified to
properly insert a marker in a list with hard line wraps.
2019-08-22 05:52:54 -06:00
Lionel Flandrin
dcd68a6781 Fix off-by-one error in get_next_line and get_prev_line
The functions stopped at the end/start block marker (respectively)
instead of returning the following line. This caused issues when the
function was subsequently called in markdown mode since the start and
end block markers are the same.

This fixes #407
2019-07-31 17:56:08 +01:00
Rane Brown
0678df38e9 Support getbufvar for vim < v7.3.831 2019-07-20 22:13:48 -06:00
Rane Brown
fbec80b7d9 Remove control characters. Fixes #598 2019-07-17 07:15:06 -06:00
Rane Brown
86cad979e5 Better handling of extensions when normalizing links.
For markdown syntax the extension was added to the url multiple times if
the option g:vimwiki_markdown_link_ext was set which is now fixed.
Normalizing links no longer adds the extension to the description field.
2019-07-17 07:10:47 -06:00
Rane Brown
466bdcd4e8 Don't reuse variable in s:clean_url (sticky type checking)
Versions of Vim prior to 7.4.1546 had sticky type checking which
prevented a variables type from changing. Fixes #715.
2019-07-12 13:52:23 -06:00