8000 Rename link works for all directories by tinmarino · Pull Request #787 · vimwiki/vimwiki · GitHub
[go: up one dir, main page]

Skip to content

Conversation

tinmarino
Copy link
Member

Fix: VimwikiRenameLink doesn't update links in diary #90.
Not an urgent feature

Seems to work, not so bad. But need some check.... (when someone has time).
Meanwhile, I'll be on a better path management

@ranebrown
Copy link
Contributor
ranebrown commented Dec 21, 2019

@tinmarino Can you update this PR? I updated everything for the Vint checks so make sure to run that on your changes as well. Thanks.

@tinmarino tinmarino force-pushed the merge_rename_link branch 2 times, most recently from 75585e2 to a2f9acf Compare December 22, 2019 13:22
…nght of its content

Used: Later for VimwikiRenameLink for a recursive parent directory visiting
__Problem__: VimwikiRename link do not rename dir1/toto url in dir2/tata
because the dirs (dir2 and .) were well crossed but badly insepcted.
__Solution__: `blob(.ext*)` -> `glob(**/*.ext)` + find the relative URL
Fix: Vader console (with nice color) cannot open for futur test
VimwikiRenameLink
More: To compute old_url regex, use a cache dict because it is the same
for files in the same directories
@tinmarino
Copy link
Member Author

Done.
The key change it to loop thought ALL wikis file (if not a temporary wiki) with let fsources = vimwiki#base#find_files(a:wiki_nr, 0) in function! s:update_wiki_links(wiki_nr, dir, old_url, new_url)

@tinmarino
Copy link
Member Author

@ranebrown

  • Vinting all (1a4e1ed) was a pretty hard job but I am sure it remove many bugs.
  • Testing framework removed many bugs in this PR actually

Copy link
Contributor
@ranebrown ranebrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the specific comments can you also:

  1. Ensure Vint checks are passing (currently 5 warnings)
  2. Update the changelog
  3. Remove trailing whitespace (specifically from new Vader test file but elsewhere if present)

@tinmarino
Copy link
Member Author

(Very) nice review. I'll work on that.

Note: list_VimwikiReturn.vader has seom necessary trailing spaces
Note: was used to sort strings by len, in order to get the most nested
directory in rename_link.
But the new implementation of rename_link with glob(**) in wiki_root do
not need it anymore
Note: No more unecessary trailing whitespaces
    Only necessary in test/list_VimwikiReturn.vader

Cmd: `ag ' $'`
Returns:
test/list_VimwikiReturn.vader
2:#
126:  1.
129:    1.
147:  2.
152:
155:  1.
156:  2.
159:    1.
160:    2.
178:
183:  2.
187:  1.
191:    1.
209:  2.
214:  2.
237:
242:
268:  2.
273:  2.
279:  1.
@tinmarino
Copy link
Member Author
tinmarino commented Jan 4, 2020

Your excellent review gave me some pro advises. Thank you for that.

  1. Ensure Vint checks are passing (currently 5 warnings)
    14529ee <- my bad

  2. Update the changelog
    47eb1c9 <- I did not understand the usefulness of a changelog in collaborative environment. Actually I was thinking: must be boring for maintainers to copy paste all the PR titles, do they have a script ... Well thanks for doing it for newbies like me few minutes ago

  3. Remove trailing spaces
    d782777 <- zero unnecessary trailing spaces. The few currently remaining, for test survival, are in the commit message

Note: At merging, close #90 (I referred to it in the changelog)

@ranebrown ranebrown merged commit d941221 into vimwiki:dev Jan 5, 2020
@ranebrown
Copy link
Contributor

Thanks for this. Keep up the good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0