54 Commits

Author SHA1 Message Date
Le Tan
68dc2425a9 Editor: support highlighting tabs 2018-09-18 19:27:42 +08:00
Le Tan
a2ee5413a1 support search
- Ctrl+E C to toggle the search dock;
2018-03-13 20:45:44 +08:00
Le Tan
bda61a994c support overriding icon color in theme 2017-12-06 20:35:01 +08:00
Le Tan
141b404240 support file change check 2017-11-16 11:34:13 +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
e66b70b6ff support Insert Link tool bar button
Support Ctrl+L to insert a link.
2017-10-19 19:42:50 +08:00
Le Tan
92bc044cac metaword: support Ctrl+E M in editor to evaluate metawords
Add shortcut configuration MagicWord.
2017-10-19 19:41:57 +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
197e064a1a bug-fix: VFile and document() may have different modification state 2017-09-24 14:46:32 +08:00
Le Tan
26d14f81d5 bug-fix: findFirstVisibleBlock() return invalid block when fails
A huge block as the last block may lead to failure to find first visible
block.
2017-09-16 15:07:31 +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
7fd2273aad support line number in code block in both read and edit mode 2017-09-12 20:28:40 +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
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
7c2f1a8927 vim-mode: scroll to center after Ctrl+O/I 2017-08-08 20:12:15 +08:00
Le Tan
d0bcd7a2c6 vim-mode: make cursor block visible after actions 2017-07-19 20:25:28 +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
c53950fe77 refine find/replace logics
Do not select the found target. Use highlight instead.
2017-07-12 13:16:14 +08:00
Le Tan
0d0f6d4e47 refine line number area 2017-07-11 19:47:43 +08:00
Le Tan
4374f2d8f1 editor: add line number and editor-line-number config 2017-07-07 17:21:15 +08:00
Le Tan
f9f7a365f8 add toolbar for text editing
Bold, italic, underline, strikethrough, inline code.

Underline and strikethrough are not implemented yet.
2017-07-04 14:07:48 +08:00
Le Tan
c48d646a55 vim-mode: auto disable input method in non-Insert mode
Add config "enable_smart_im_in_vim_mode".
2017-07-02 13:59:07 +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
88fa722868 dragging mouse with Ctrl and left button pressed to scroll in read and edit mode 2017-06-13 16:24:48 +08:00
Le Tan
c15908a724 support highlighting current line by whole block in Vim non-Insert mode 2017-06-11 19:58:43 +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
306b3cca92 refactor VEditTab
1. Make VEditTab an abstract class.
2. Use VMdTab inheriting from VEditTab for Markdown file.
3. Use VHtmlTab inheriting from VEditTab for Html file.
2017-05-30 21:05:24 +08:00
Le Tan
73530355fd support highlighting trailing space 2017-05-25 19:52:10 +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
882faeb5eb bugfix
1. Do not add additional actions if QTextEdit has selection;
2. Add Q_DECL_OVERRIDE to supress the warnings.
3. Fix getTemplateCssUrl().
2017-04-24 22:34:02 +08:00
Le Tan
c642d60757 add SaveAndRead and DiscardAndRead to the context menu in edit mode 2017-04-22 11:43:26 +08:00
Le Tan
3406eab29c Captain mode 2017-03-27 19:44:23 +08:00
Le Tan
77d8daa5ec do not focus VEdit when navigating through the outline
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2017-01-13 22:24:10 +08:00
Le Tan
901c477705 utilize ExtraSelection for special highlighting
1. Highlight current line;
2. Highlight selected word;
3. Highlight searched word;

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2017-01-12 21:00:06 +08:00
Le Tan
3769ac5311 support search wrap
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2017-01-10 23:52:54 +08:00
Le Tan
3005d9bf5c implement Find/Replace logics
Supports Find/Replace in both edit and preview modes.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2017-01-08 21:09:00 +08:00
Le Tan
26016dd44a support Vim mode key bindings
After hitting `Ctrl+D` or keeping pressing `Ctrl+Alt`, VNote will enter Vim
normal pending mode.

1. Support <num>h,j,k,l to move cursor around;

TODO: Design a finite state machine to handle more Vim commands
elegantly.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-20 22:23:41 +08:00
Le Tan
5ff46d6237 implement insert image menu action
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-12 23:14:53 +08:00
Le Tan
a884991150 refactor: add VMdEdit to inherit VEdit for markdown edit
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-12-11 14:42:01 +08:00
Le Tan
e7c42ba5be refactor: add VFile and VDirectory
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-30 22:58:00 +08:00
Le Tan
ac2552603b clear unused images when finishing editing markdown
1. Clear existing images deleted by this edit;
2. Clear newly inserted images which were deleted before saving the
file;

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-20 21:48:07 +08:00
Le Tan
eee2d5342a fix outline navigation in edit mode
Jump to EndOfBlock instead of EndOfLine.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-16 22:02:26 +08:00
Le Tan
d77b333343 fix outline bug in edit mode
Avoid taking the # in code block as a header by mistake.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-11 22:08:03 +08:00
Le Tan
1a77056f4a support outline in edit mode
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-11-10 21:59:37 +08:00
Le Tan
047c26b598 support pasting image in markdown
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-31 22:43:59 +08:00