61 Commits

Author SHA1 Message Date
Le Tan
ae48d18688 fix v_white theme 2017-12-05 22:06:55 +08:00
Le Tan
4ec340a403 refactor preview logics
Use block user data to store preview info.
2017-11-29 21:45:20 +08:00
Le Tan
404b5329a1 replace VEdit and VMdEdit with VEditor and VMdEditor 2017-10-26 19:36:12 +08:00
Le Tan
73ee02d3b2 support editing read-only files 2017-10-22 21:26:39 +08:00
Le Tan
2b299ff9b7 refine heading sequence
1. add toolbar button to enable/disable heading sequence of current
note temporary;
2. Support independent configuration for external files;
3. Change enable_heading_sequence configuration to heading_sequence_type;
2017-10-13 07:23:25 +08:00
Le Tan
183b24915a refactor outline logics 2017-10-13 07:10:04 +08:00
Le Tan
598e8144bb support custom startup pages
- Support continuing where user left off on startup;
    - Support recovering the edit/read mode and the anchor position;
- Support opening user-specified files on startup;
- Add config startup_page_type, startup_pages, and last_opened_files;
2017-10-11 10:44:18 +08:00
Le Tan
93a218655d refine Chinese translations 2017-10-01 10:37:17 +08:00
Le Tan
58e7cdca4b refactor VFileList
- Refine note deletion logics;
- Refine note copy/paste logics;
- Refine note sorting logics;
2017-09-29 19:56:38 +08:00
Le Tan
e5cd014762 support recycle bin folder for extern files
1. Add external_recycle_bin_folder config;
2. By default, each external file will use _v_recycle_bin in the same
directory as its recycle bin folder to hold deleted images;
2017-09-26 19:27:11 +08:00
Le Tan
197e064a1a bug-fix: VFile and document() may have different modification state 2017-09-24 14:46:32 +08:00
Le Tan
01788a5301 support attachments
Support attachments to internal note file.

- Add/Delete/Clear/Sort;
- Support custom attachment folder for each notebook (read-only);
- Support renaming attachment;
2017-09-22 23:30:49 +08:00
Le Tan
a64d01ea86 refactor VFile and VOrphanFile
1. Make VFile a real abstract class;
2. Use VNoteFile for internal note file;
3. Use VOrphanFile for external orphan file;
2017-09-21 19:33:37 +08:00
Le Tan
2b78711eb4 confirm when cleaning up unused images
Add config confirm_images_clean_up.
2017-09-16 14:55:42 +08:00
Le Tan
35fa0a46f6 add recycle bin to each notebook 2017-09-16 14:55:42 +08:00
Le Tan
f178b1c634 support custom base level for heading sequence by heading_sequence_base_level 2017-09-16 14:55:42 +08:00
Le Tan
e9238c921e support color column in fenced code block by config color_column 2017-09-12 08:46:39 +08:00
Le Tan
2eb6476c3d support auto heading sequence by config enable_heading_sequence 2017-09-11 19:49:30 +08:00
Le Tan
07e8f27776 optimize VImagePreviewer by flags 2017-09-08 21:41:46 +08:00
Le Tan
e55b0af00e bug-fix: QTextDocument.clearUndoRedoStacks() will crash in VImagePreviewer 2017-09-08 21:41:19 +08:00
Le Tan
f33c7f86d3 minor-fix: Vim mode and VImagePreviewer
1. In Vim mode use the `undo()` and `redo()` slots of VMdEdit instead of
QTextDocument;
2. VImagePreviewer will clear the undo/redo stacks if it is empty
before;
3. Remove setLineDistanceHeight();
2017-09-06 19:23:14 +08:00
Le Tan
36a0d1dd7e support custom line distance height by line_distance_height config 2017-09-05 20:54:15 +08:00
Le Tan
bb7e6e196c make markdown highlight interval configurable via markdown_highlight_interval 2017-09-05 20:54:15 +08:00
Le Tan
c3408769b0 refactor VImagePreviewer 2017-09-05 20:54:15 +08:00
Le Tan
73630448a6 move vconfig to a local variable 2017-08-29 09:40:28 +08:00
Le Tan
d44549a43f bug-fix: spaces after # are needed for titles in edit mode 2017-08-06 15:33:19 +08:00
Le Tan
d0bcd7a2c6 vim-mode: make cursor block visible after actions 2017-07-19 20:25:28 +08:00
Le Tan
8a56dc8b87 support editing external files 2017-07-15 12:46:04 +08:00
Le Tan
cd2ac10509 vim-mode: refine command line mode
1. Support `/` and `?` to search. `N` and `Shift+N` to find next/previous
occurence.
2. `Ctrl+N` and `Ctrl+Shift+N` to navigate through the command history.
3. `:nohlsearch` or `<leader><space>` to clear search highlight.
4. `#` and `*` to search current word under cursor.
2017-07-13 18:26:38 +08:00
Le Tan
301879c50c edit-tab: init editor at the first time entering edit mode
Do not init the editor if we just open a note in read mode to speed up.
2017-07-10 13:23:07 +08:00
Le Tan
a87048cac2 bug-fix: compare two paths with case convertion on Windows
On Windows, case difference in file name is ignored.
2017-07-03 19:09:50 +08:00
Le Tan
9278149941 vim-mode: support shorcuts to jump between titles
- `[[`: jump to previous title;
- `]]`: jump to next title;
- `[]`: jump to previous title at the same level;
- `][`: jump to next title at the same level;
- `[{`: jump to previous title at a higher level;
- `]}`: jump to next title at a higher level;
2017-06-30 20:31:46 +08:00
Le Tan
d909091f46 vim-mode: add an indicator for Vim status in status bar 2017-06-19 15:56:12 +08:00
Le Tan
ffce4b9611 vim-mode: message for Vim mode 2017-06-18 09:44:11 +08:00
Le Tan
eba2556a3a vim-mode: support DELETE action
Actions related to `d` and `x`.
2017-06-14 17:25:24 +08:00
Le Tan
a8c76d6742 support normal Vim mode
1. Support Insert/Normal/Visual/VisualLine modes:
    - `V`, `v`, `I`, `i`, `A`, `a`, `s`, `Esc`, `Ctrl+[`, `o`, `O`;
2. Support movement commands (with Repeat support):
    - `h`, `j`, `k`, `l`, `gj`, `gk`;
    - `gg`, `G`;
    - `^`, `0`, `$`;
    - `Ctrl+U`, `Ctrl+D`, `PageUp`, `PageDown`, `Ctrl+B`;
2017-06-11 16:31:25 +08:00
Le Tan
443ee772a7 make cursor visible after highlight completed
Highlight may turn originlly visible cursor partially visible. We make
it visible in this case.
2017-06-03 15:55:00 +08:00
Le Tan
97051badf0 refactor TOC logics 2017-06-01 13:21:17 +08:00
Le Tan
6a10c7ab3c refactor DocType 2017-05-29 18:56:43 +08:00
Le Tan
e5021f4501 refactor local image folder
Treat those images which have relative path and locate in directories
that have the same parent directory as the file as internal images.
VNote will only manage the internal images.
2017-05-10 15:53:33 +08:00
Le Tan
2bdf388c7b constrain the width of previewed images to the eidt window's width 2017-05-06 19:13:58 +08:00
Le Tan
a8614839d9 refactor image preview logics by adding VImagePreviewer
1. Support previewing non-relative local images;
2. Support previewing network images;
2017-05-06 12:25:18 +08:00
Le Tan
44257913f7 support code block syntax highlihgt in edit mode
In edit mode, highlight code blocks via parsing the result of HighlightJS.
We only highlight fenced code blocks by token-matching.

Support custom style in MDHL file.
2017-04-19 15:08:26 +08:00
Le Tan
584472f902 fix tab order and TOC level in edit mode
1. Fix tab order of left and right corner widgets;
2. Insert [EMPTY] header when header level is not continuous in edit mode.
2017-04-04 13:21:51 +08:00
Le Tan
c48fbe16da refine editor style
1. Support editor-current-line and editor-selection style in MDHL;
2. Support vim-background in editor-current-line;
2017-03-31 20:44:30 +08:00
Le Tan
d47dd92f59 refine markdown render logics
Add common templates markdown_template.html and
markdown_template.js.

Hoedow provides hoedown.js.
Marked provides marked.js.
2017-03-20 20:45:17 +08:00
Le Tan
ee6fc69bb1 pop up a menu when inserting image or URL 2017-03-20 20:40:52 +08:00
Le Tan
010f4245f6 bugfix: clear image preview blocks having unmatched image path
The syntax highlighter could not recognize image links with spaces in
the URL. When clearing orphan image preview block, we need to clear
thoes blocks which having unmatched image path.

Fix issue: after inserting spaces in the URL of an image link, the
preview block still exists.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2017-01-22 19:40:43 +08:00
Le Tan
180ab46367 bugfix: highlight links and images with spaces in URL
It is said that URL should not contain spaces. Anyway, we use regular
expression syntax highlighting to complement PEG Markdown Highlight.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2017-01-22 19:39:43 +08:00
Le Tan
5a097421e1 bugfix: check hasFocus() when handling clipboard change
When copying the preview image, other tabs should check if they have the focus.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2017-01-13 22:31:54 +08:00