Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 2c27974e39f8ee7c4586a662f13b6d078e36b178
Merge: fd80660c 2123b99
Author: wongjiahau <[email protected]>
Date:   Tue Aug 22 14:49:02 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit fd80660c38056e0becbc9c84456fbe8668758eb1
Merge: 10f302df 57952c4
Author: wongjiahau <[email protected]>
Date:   Mon Jul 31 10:03:49 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit 10f302dfb0b81012051fb65dbf8481ce7c885ed3
Merge: 99e3db45 b266628
Author: wongjiahau <[email protected]>
Date:   Tue Jul 25 20:23:02 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit 99e3db451f071a4b95acc168b952e95bd5b014d1
Merge: 08850573 df09490
Author: wongjiahau <[email protected]>
Date:   Fri Jun 16 13:58:28 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit 08850573d3b0ce36b3a0abc9c3b1f5106bda175c
Author: wongjiahau <[email protected]>
Date:   Tue May 16 15:59:05 2023 +0800

    perf(tree/reveal-item): remove over-conservative refresh
    - Refer: helix-editor/helix#5768 (comment)

commit d86abf1ea9d981c6c81b6411332e49c797df5927
Author: wongjiahau <[email protected]>
Date:   Fri May 12 16:37:32 2023 +0800

    chore(explorer): minor code changes

    - Resolves helix-editor/helix#5768 (comment)

commit 4fe98965f3389a8f7757b94061aa41f5e0a2c5ab
Author: wongjiahau <[email protected]>
Date:   Fri May 12 10:43:55 2023 +0800

    chore(book/src/configuration.md): remove accidental addition

    - Resolves https://github.com/helix-editor/helix/pull/5768/files#r1186734898

commit 2d1ca230809db637d743055e31f98e3d6889cb65
Author: wongjiahau <[email protected]>
Date:   Fri May 12 10:40:16 2023 +0800

    refactor(explorer/tests): use tempfile instead

    - Resolves helix-editor/helix#5768 (comment)
    - Resolves https://github.com/helix-editor/helix/pull/5768/files#r1133063153

commit e2c37579ed77856e7dae8db1abed1fa7eabca625
Merge: cf9669f2 5938e2c
Author: wongjiahau <[email protected]>
Date:   Fri May 12 09:57:34 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit cf9669f276dc223323d526d3dcf7c1bbc67a3922
Author: wongjiahau <[email protected]>
Date:   Mon Mar 27 08:54:03 2023 +0800

    fix(ci): clippy error

commit 88ac941407406442c8e84f3d98d67553bc780a1f
Merge: f37c795c 9a65118
Author: wongjiahau <[email protected]>
Date:   Sat Mar 25 11:57:22 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit f37c795c96dc84deec65255eb1cb5c964b343c4d
Author: wongjiahau <[email protected]>
Date:   Thu Mar 23 08:52:13 2023 +0800

    chore(ui/prompt): use &str instead of Cow<str>
    - Resolve https://github.com/helix-editor/helix/pull/5768/files#r1140994104

commit eebff622de41884a8e76ee8e164b26e866235ed9
Author: wongjiahau <[email protected]>
Date:   Wed Mar 22 11:46:18 2023 +0800

    chore(doc/configuration/explorer/position): remove `overlay` option

commit a331e52971b07910cbb92cb56d4817966d37af58
Author: wongjiahau <[email protected]>
Date:   Wed Mar 22 11:40:16 2023 +0800

    chore(keymap): remove "<space>E"

    - Personally, I never uses this shortcut
    - Secondly, we are running out of keys for mappings, so I would like to
      reserve "<space>E" for other more useful mappings

commit f5aec54fe2b20305a9288f6fba0bd376d3fa491b
Author: wongjiahau <[email protected]>
Date:   Wed Mar 22 11:38:30 2023 +0800

    chore(commands): revert accidental typo

    - Resolve https://github.com/helix-editor/helix/pull/5768/files#r1143859919

commit 33542e9ddbd5776727531eb19d2eda83449a592e
Author: wongjiahau <[email protected]>
Date:   Wed Mar 22 11:34:59 2023 +0800

    refactor: remove unnecessary dev-dependencies

    - Resolve https://github.com/helix-editor/helix/pull/5768/files#r1126720143

commit 898c1670d141bf61e3aa1b6e325fd589b71d93bf
Author: wongjiahau <[email protected]>
Date:   Wed Mar 22 10:54:22 2023 +0800

    fix(integration-test/test_goto_file_impl): failing due to untested changes

commit 404f950b09c65ff49c4997cc4b646a24cb8ca651
Author: wongjiahau <[email protected]>
Date:   Wed Mar 22 09:08:51 2023 +0800

    fix(tests/explorer/new_folder): failing on Windows

    Co-authored-by: LEI <[email protected]>
    Reference: helix-editor/helix#5768 (comment)

commit ee34720a31bb4e89802973f22e6c9e9a766e5416
Author: wongjiahau <[email protected]>
Date:   Sat Mar 18 13:30:56 2023 +0800

    style(explorer): move title to statusline
    - so that the UI is more consistent with other component of the editor
    - also it may improve the focus indication

commit 1be2ac286bfb549954e99f40a14394ce765d444d
Author: wongjiahau <[email protected]>
Date:   Sat Mar 18 13:21:54 2023 +0800

    fix(ui/explorer): tree search cursor not rendered

commit e5dfde2a9b08bfa1fc108745622b0ee4eca46890
Author: wongjiahau <[email protected]>
Date:   Fri Mar 17 17:53:06 2023 +0800

    refactor(explorer): remove overlay option

commit afda68a11d68d260a3864b32181686b7d2d5ebbd
Author: wongjiahau <[email protected]>
Date:   Fri Mar 17 09:47:40 2023 +0800

    chore: cargo fmt

commit f5af209f09b54617ab735d5591ba32393a6cde9c
Author: wongjiahau <[email protected]>
Date:   Fri Mar 17 09:19:45 2023 +0800

    refactor(explorer): remove preview

    - Also moved Tree search prompt to bottom

commit 52be2e0c43a03a06688080c6be431f045a3bc6f7
Author: wongjiahau <[email protected]>
Date:   Thu Mar 16 09:38:45 2023 +0800

    refactor(ui/tree): remove filter

commit 41ebc30ea69969fec80d5c1d2cce97dbed466102
Author: wongjiahau <[email protected]>
Date:   Tue Mar 14 12:38:19 2023 +0800

    fix(ui/tree/clone): `is_openend` should not be false

    Resolve helix-editor/helix#5768 (comment)

commit 8b561e2e88f3c39428779816ea5adaeeb1ae1310
Author: wongjiahau <[email protected]>
Date:   Tue Mar 14 12:37:41 2023 +0800

    fix: type error

commit 9a1aff25bd11c10d44b6a47dfdbd231f34c4b9eb
Author: wongjiahau <[email protected]>
Date:   Tue Mar 14 12:33:45 2023 +0800

    refactor(ui/explorer/close_documents): concise code

    Resolve helix-editor/helix#5768 (comment)

commit 178086767f6f22408906f3c1120276bdf3ed3d21
Author: wongjiahau <[email protected]>
Date:   Tue Mar 14 12:25:02 2023 +0800

    refactor(ui/explorer/handle_prompt_event): remove unnecessary function

    Resolve helix-editor/helix#5768 (comment)

commit c4c3e8075e8770c4d9c1e7acb0fa12d0b2ca190f
Author: wongjiahau <[email protected]>
Date:   Tue Mar 14 12:21:22 2023 +0800

    style(explorer/delete): capitalize default choice

    Resolve helix-editor/helix#5768 (comment)

commit 54b16936db68bdc97de7fb211643590c5f803ee6
Merge: 20241fb2 75ebc1f
Author: wongjiahau <[email protected]>
Date:   Tue Mar 14 12:06:42 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit 20241fb256d52b99f246e311fd00e9e4f19b3255
Merge: eb9287d8 4f066b1
Author: wongjiahau <[email protected]>
Date:   Mon Mar 13 11:14:56 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit eb9287d8169841158791acf4c9de2c2bbe4ea1e6
Author: wongjiahau <[email protected]>
Date:   Thu Mar 9 18:21:12 2023 +0800

    fix(ci): cargo fmt and windows test

commit 1108c883c44316d3881c5e3abea62c309feb59f5
Merge: d043ea4d 2cf4ce2
Author: WJH <[email protected]>
Date:   Thu Mar 9 14:04:02 2023 +0800

    Merge branch 'master' into tree_explore

commit d043ea4db44f1ce395ec6fa5ee9d975f9a799322
Merge: 10032eb1 44ff8a1
Author: wongjiahau <[email protected]>
Date:   Wed Mar 8 11:10:13 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit 10032eb156e7dafd6a477cbe86801b69139252f5
Author: wongjiahau <[email protected]>
Date:   Wed Mar 8 11:09:59 2023 +0800

    fix(ci): cargo fmt

commit 7ccee10297d27597c2498c84d85e52aa0d4e1d76
Author: wongjiahau <[email protected]>
Date:   Tue Mar 7 15:21:45 2023 +0800

    chore: correction of e991ed9

commit 9726ae7dbba4c1b88bba1199b49198fa2dc4dd2d
Author: wongjiahau <[email protected]>
Date:   Tue Mar 7 15:16:53 2023 +0800

    fix(ci/test): failing on Windows

commit e991ed9b17a0da4e89a86c95088e4516ae6f47ce
Author: wongjiahau <[email protected]>
Date:   Tue Mar 7 15:13:13 2023 +0800

    refactor(runtime/themes): revert changes to theme files

    - This is because explorer specific styling has been abandoned for
      simplicity

commit d1e6a21016f640c5ad9262debbcfc4981a47bd49
Merge: d62b4873 136d116
Author: wongjiahau <[email protected]>
Date:   Tue Mar 7 15:13:02 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit d62b487321fbd82e24d4ac3295239f29cd14d806
Author: wongjiahau <[email protected]>
Date:   Tue Mar 7 14:57:55 2023 +0800

    feat(ui/tree): undo breaking changes
    - bind tree-based movements to other keys, namely J,K,H,L

commit 80a2f8642cd48e4487463a7a577b6b5877bf5ed2
Merge: aa6780e1 31c0e844
Author: wongjiahau <[email protected]>
Date:   Tue Mar 7 10:26:35 2023 +0800

    Merge branch 'tree_explore' of github.com:pinelang/helix-tree-explorer into tree_explore

commit aa6780e1499b3581a82aee6baeccf30e9dff25a7
Author: wongjiahau <[email protected]>
Date:   Tue Mar 7 09:36:14 2023 +0800

    feat(ui/tree): tree-based movements

commit bc62b7615d7fe77c6b4e4b6a28eb355305989656
Author: wongjiahau <[email protected]>
Date:   Mon Mar 6 10:45:17 2023 +0800

    fix(ci): failing windows test & clippy

commit 31c0e84461f586e99f3d2a5ea3017940533481b7
Author: wongjiahau <[email protected]>
Date:   Mon Mar 6 10:45:17 2023 +0800

    fix(ci): failing windows test & clippy

commit d3db1b6204c51837609fb0e2288de8c0abb1e7a1
Author: wongjiahau <[email protected]>
Date:   Mon Mar 6 10:41:13 2023 +0800

    style(tree): improve ancestor contrast

commit 8ef95ee56a4c6d1396c71fe81e8dcbc6079e1f9a
Merge: a4943a72 39d5fb0
Author: wongjiahau <[email protected]>
Date:   Mon Mar 6 09:53:45 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit a4943a722658bb0ca5037ee9ee0db2f9916e9dbd
Author: wongjiahau <[email protected]>
Date:   Thu Mar 2 16:56:57 2023 +0800

    fix(explorer/overlay): prompt overflow

    - Previously the prompt appears within the float, which has very limited
      space
    - Now, the prompt will be rendered at the editor command area

commit c2e2f050da1d92ad33b5d4759c9015af960a6e7d
Author: wongjiahau <[email protected]>
Date:   Thu Mar 2 10:21:36 2023 +0800

    feat(explorer/delete): no need to press Enter, just press y

    Reference: helix-editor/helix#5768 (comment)

commit 43b226a2ab20fa8f379d90e83dd0b20da84615b8
Author: wongjiahau <[email protected]>
Date:   Thu Mar 2 10:04:01 2023 +0800

    feat(explorer/keymap): combine 'a' with 'A'

    Reference: helix-editor/helix#5768 (comment)

commit a2cb28d1d1528fdd26d77c7e0c306a3fe7e7ff51
Author: wongjiahau <[email protected]>
Date:   Wed Mar 1 09:02:44 2023 +0800

    chore(keymap): merge with the correct version

commit 19d436ee569f823ab526799bfec0bd5bdae2c2e9
Merge: b18a9746 8dab8a0
Author: wongjiahau <[email protected]>
Date:   Wed Mar 1 08:54:24 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit b18a9746e9a3e589ac40f0057484161ada6cd286
Author: wongjiahau <[email protected]>
Date:   Tue Feb 28 18:17:05 2023 +0800

    fix(explorer): go to previous root does not update state.current_root

commit 8379669742f5843b8596306361ce9055655a029d
Merge: fae49904 a976786
Author: wongjiahau <[email protected]>
Date:   Tue Feb 28 11:27:37 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit fae4990444c09c3bbca6632ebf6f0821ecf1f8df
Author: wongjiahau <[email protected]>
Date:   Tue Feb 28 11:19:33 2023 +0800

    test(tree): search prompt and filter prompt

commit 7e4feb02efcfb17faad01a26b1816a8c4c716d36
Author: wongjiahau <[email protected]>
Date:   Mon Feb 27 09:57:21 2023 +0800

    fix(explore): search using previous search word after filter does not work

    - Also implemented restore_saved_view for filter and search

commit 4a0c620b77237e16aa0f85539f981e8016e8a723
Author: wongjiahau <[email protected]>
Date:   Sun Feb 26 23:10:39 2023 +0800

    fix(explorer/filter): not working for newly opened folder

commit c0073edebf5eeae7ef92b568fff232fb0e1e15b4
Merge: d578f8af c3b8be97
Author: wongjiahau <[email protected]>
Date:   Sun Feb 26 23:09:43 2023 +0800

    Merge branch 'tree_explore' of github.com:pinelang/helix-tree-explorer into tree_explore

commit c3b8be978e5de70a74d5210afbf74838ae498626
Author: WJH <[email protected]>
Date:   Sun Feb 26 22:55:15 2023 +0800

    fix(ci): clippy + failure on Windows

commit d578f8af6165d12de01004cae573f97b3c0854c6
Author: wongjiahau <[email protected]>
Date:   Sun Feb 26 20:34:28 2023 +0800

    chore: fix clippy warning

commit 5d600fef0fdbf794644044a01ca6157284c1ad0c
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 16:42:12 2023 +0800

    doc(helix-term/.gitignore): document purpose of test-explorer

commit ef1850295bdaa5cb415f87cb6f2743e7a74d0488
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 16:41:28 2023 +0800

    chore: remove temp file

commit 601f2c4e5f90e92964c55576cf02fa43edc4b006
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 16:41:00 2023 +0800

    chore(ui/tree): remove useless comments

commit ba00a8003746f242edc2d9d0eeda546863913f98
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 16:38:35 2023 +0800

    fix(tree): shouldn't use patched font

commit 72b845da15d34fced74ac5738b3700e1d4660fff
Merge: 24b50bb5 621ab0e
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 13:32:00 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

commit 24b50bb52589b93ef3a74a09207bbf25787dbe85
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 13:26:34 2023 +0800

    feat(explorer): toggle preview

commit 38ef079099400684eebaf59294a97fa4e697b9ea
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 13:12:56 2023 +0800

    feat(tree): jump forward

commit b5d92aca450995021db189e634ffc1a00434878a
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 12:56:49 2023 +0800

    chore: fix clippy warnings

commit 36769cb3f6d1fe56162a1692d1ef85cea1599235
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 12:47:52 2023 +0800

    fix(explorer/keymap): change 'b' to 'B'
    - to not clash with Tree 'zb'

commit dffbc15067621ae4e4a613ed11edf2e9398da8fa
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 12:34:33 2023 +0800

    refactor(explorer,tree): remove unwrap to avoid panics

commit cf9b60a3d1da94889aa9e9b50e4cd4b2f0a324fa
Author: wongjiahau <[email protected]>
Date:   Sat Feb 25 12:14:48 2023 +0800

    feat(tree): sticky ancestors

commit 92051175055259fcb0a77736dcdcd6bb880212a4
Author: wongjiahau <[email protected]>
Date:   Thu Feb 23 11:12:58 2023 +0800

    fix: failing tests

commit 6af9a06e74a658e03bc116c940eb427f5805e01f
Author: wongjiahau <[email protected]>
Date:   Thu Feb 23 10:52:18 2023 +0800

    feat(explorer): bind "="/"_" to "Zoom in"/"Zoom out"

commit 899491ba254ffc04759e5536e1f0e13446905aa3
Author: wongjiahau <[email protected]>
Date:   Thu Feb 23 10:49:10 2023 +0800

    feat(tree): add C-n/C-p keybinding

commit f9ff01dd9cff70e5a69b2e79b70357f884d466ed
Author: wongjiahau <[email protected]>
Date:   Thu Feb 23 10:31:52 2023 +0800

    chore(ui/tree): bind 'o' to Toggle

commit 7b63fda7d2f7e6e7ed63e85300a7d7435f79648b
Author: wongjiahau <[email protected]>
Date:   Thu Feb 23 10:28:33 2023 +0800

    test(explorer): add integration tests

commit 6321dc9adec5c7026ed75f50345f278910ffe2ab
Author: wongjiahau <[email protected]>
Date:   Wed Feb 22 14:05:53 2023 +0800

    chore: rename explore to explorer

commit 78bb29732a83d8f6c98d375ea5fa5134975da267
Merge: bcb16723 1a87d14
Author: wongjiahau <[email protected]>
Date:   Wed Feb 22 10:37:15 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into add-integration-test

commit bcb1672378dda84ed782ed34cf795e4fd2f4cafe
Author: wongjiahau <[email protected]>
Date:   Wed Feb 22 10:36:17 2023 +0800

    fix(explore):
    - preview panics when term height becomes too small
    - preview content not sorted

commit a259c205c0fe8a4271f20862989f53b282bb8ba9
Author: wongjiahau <[email protected]>
Date:   Wed Feb 22 10:05:54 2023 +0800

    fix(explore): help overflow

    - render with Info

commit 2e7709e5052dc9376cb42bcf8f1c4f915f326119
Author: wongjiahau <[email protected]>
Date:   Tue Feb 21 10:27:50 2023 +0800

    MULTI
    - refactor(explore):Move filter to Tree
    - feat(explore): Implement mkdir -p (but not tested yet)
    - feat(ui/tree): Implement jump backward
    - test(ui/tree): Refresh

commit 2e654a0775cfebb0d2b770657a87fee69ba5d1a2
Author: wongjiahau <[email protected]>
Date:   Mon Feb 20 11:29:03 2023 +0800

    refactor(explore): move search function to Tree

commit 2a60662e8bcb0979b44504d1b5fb485422b32249
Author: wongjiahau <[email protected]>
Date:   Mon Feb 20 11:27:06 2023 +0800

    feat(explore): add focus indicator

commit 64059fba4759a8c05996c79db2a3b21cf44ccf7e
Author: wongjiahau <[email protected]>
Date:   Sun Feb 19 18:24:26 2023 +0800

    feat(tree): move left/right

commit c88164f2fa8325f9199df5868bc88c3401f364da
Author: wongjiahau <[email protected]>
Date:   Thu Feb 16 11:54:53 2023 +0800

    feat(tree-view): add unit tests

commit 4dfa8696bdd75de403cbfa74b230b3db7ebe7698
Author: wongjiahau <[email protected]>
Date:   Thu Feb 16 09:28:41 2023 +0800

    style(tree): increase indentation

commit f0a4b109ad8570f14ed46f0130cae2238bc8dd6b
Merge: 70984fd1 0f8e0a51
Author: wongjiahau <[email protected]>
Date:   Wed Feb 15 11:10:18 2023 +0800

    Merge branch 'refactor-tree-explorer' of github.com:pinelang/helix-tree-explorer into refactor-tree-explorer

commit 70984fd14889f5c9d8849b1edb14eff25ea06377
Merge: ef73559a 715c4b2
Author: wongjiahau <[email protected]>
Date:   Wed Feb 15 11:09:18 2023 +0800

    Merge branch 'master' of https://github.com/helix-editor/helix into refactor-tree-explorer

commit 0f8e0a51ba4854d3f7a9d112ff0cd23bfe1adacb
Author: wongjiahau <[email protected]>
Date:   Wed Feb 15 10:08:12 2023 +0800

    fix(tree): deleting last file causes panic

commit ef73559a8e0a9ad222ed1e459ddbd5bb505e32ca
Author: wongjiahau <[email protected]>
Date:   Wed Feb 15 09:58:54 2023 +0800

    fix(explore): cannot focus explorer if no opened document

commit 30bac647ef5279c9f7e2f8721291ad84a2073316
Author: wongjiahau <[email protected]>
Date:   Wed Feb 15 09:31:10 2023 +0800

    Revert "style(explore): make Right the default position"

    This reverts commit 374b8ddd4e43d008c361348c307367c678da5963.

commit c8578ba3ccdde295adf92dfbae00cf0051ad3aea
Author: wongjiahau <[email protected]>
Date:   Wed Feb 15 09:26:36 2023 +0800

    fix: warnings

commit 374b8ddd4e43d008c361348c307367c678da5963
Author: wongjiahau <[email protected]>
Date:   Wed Feb 15 09:25:01 2023 +0800

    style(explore): make Right the default position

    Refer https://twitter.com/JustinWGrote/status/1346575528560455682

commit 94e2c2989b6fc664754b849bb53a56dc324daf73
Author: wongjiahau <[email protected]>
Date:   Wed Feb 15 09:23:38 2023 +0800

    fix(command): space e does not focus explorer when no files are opened

commit 72495363f1de906401b9bf9fc8475237ed02a91e
Author: wongjiahau <[email protected]>
Date:   Tue Feb 14 19:29:15 2023 +0800

    fix(explore): 'h' does not realign preview properly

commit 9bd534bb6fb438734ee48911fa04a56418baad34
Author: wongjiahau <[email protected]>
Date:   Tue Feb 14 18:53:56 2023 +0800

    fix(explore): filter

commit 85fa1c56b76357c5ff69fee19904d731e0de06dd
Author: wongjiahau <[email protected]>
Date:   Tue Feb 14 17:11:28 2023 +0800

    feat(explore):
    - filter
    - close document if the file is deleted or renamed

commit a079477a23d96f90ddcaa93b3443d3f43dcd4f81
Author: wongjiahau <[email protected]>
Date:   Tue Feb 14 12:44:36 2023 +0800

    fix(compile): warnings

commit 56056e8556a751b8c105b302ce02dd87e5128236
Author: wongjiahau <[email protected]>
Date:   Tue Feb 14 09:41:48 2023 +0800

    fix(explore): increase size will cause panic

commit b38a9419550832d98d5ff930c8e26527e163350a
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 22:03:28 2023 +0800

    feat(explore): close without clearing previous state

commit 790192dfd48fb4c4d7de583ce917c1c20d1e6e84
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 21:36:15 2023 +0800

    doc(explorer): up to date

commit 2c221f0af1ff7379aea79c41ea6d7d02c3c0ed0d
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 21:32:01 2023 +0800

    fix(explore): help page overflow

commit 35ffc6036d3b6d1a425a35187f97226298e3936d
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 21:17:07 2023 +0800

    feat(explore): increase/decrease explorer size

commit 2bafac0c4e077f0328ee700154200e74e4c5a781
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 20:55:52 2023 +0800

    feat(explore): go to previous root

commit ddb7564809dd068deabf48513e29de40bba0df3f
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 17:58:25 2023 +0800

    feat(explore): add help

commit ec2059bf93ce841348ad55eeb8315314ae05255d
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 17:13:26 2023 +0800

    style(ui/tree): highlight ancestor

commit 52a26ff72c1922fccb95ac5fadf4485ac12840b7
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 16:13:47 2023 +0800

    feat(explore): refresh

commit 5a5a1de4b8420844e26bd3e8d090c3376240c354
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 16:10:08 2023 +0800

    fix(explore/rename): should regenarate index

commit 44b46dda6aedabe76b13de406f9c9a9784b2640c
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 15:51:02 2023 +0800

    feat(explore): rename file/folder

commit 2af8b410074e8b39e41dcee63b72d87351353c83
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 10:44:27 2023 +0800

    feat(explore): remove files/folder

commit 458fa1ca58bb4f3ed7ce4930e5103db3e8f383d6
Author: wongjiahau <[email protected]>
Date:   Mon Feb 13 08:46:57 2023 +0800

    feat(explore): add folder/file

commit 0f8b641a5d67027cfc69aaeeb22e46f7fbd26eaf
Author: wongjiahau <[email protected]>
Date:   Sun Feb 12 21:09:21 2023 +0800

    feat(tree): filter

commit 82fe4a309daec0e6fce55e164bf6c7e871e7487c
Author: wongjiahau <[email protected]>
Date:   Sun Feb 12 20:24:50 2023 +0800

    test(ui/tree): find

commit bdab93e856148f2624175fdb0c697fd23e197ec9
Author: wongjiahau <[email protected]>
Date:   Sun Feb 12 19:59:17 2023 +0800

    feat(explore): search

commit aa397ef8013a73b1deb567bf4d41ca9f72714bcb
Author: wongjiahau <[email protected]>
Date:   Sun Feb 12 18:44:52 2023 +0800

    feat(explore): reveal current file

commit d04a1ce2148d7afd11573267d62c730f6ccfa1de
Author: wongjiahau <[email protected]>
Date:   Sat Feb 11 15:17:43 2023 +0800

    refactor(tree): change internal implementation

    Previous: Vec+Tree hybrid, hard to debug and understand
    Now: Pure Tree structure, easy to understand and test

commit c446c396453f3fd8f52aab900202b9835806e22e
Author: wongjiahau <[email protected]>
Date:   Mon Feb 6 22:11:48 2023 +0800

    feat(explorer/position): right

    According to helix-editor/helix#5768 (comment)

commit d9d4daa87de012cf398a821c141e8c8cd085b44e
Author: wongjiahau <[email protected]>
Date:   Wed Feb 1 23:51:07 2023 +0800

    feat(ui/explore): implement "focus current file"

commit b652f96449d721c9f21e5bc1719b884e69a510bb
Author: cossonleo <[email protected]>
Date:   Sun Apr 3 15:55:08 2022 +0800

    tree helper and file explorer
  • Loading branch information
usagi-flow committed May 18, 2024
1 parent 2301430 commit 64b89e0
Show file tree
Hide file tree
Showing 12 changed files with 4,393 additions and 27 deletions.
6 changes: 6 additions & 0 deletions book/src/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ This layer is a kludge of mappings, mostly pickers.
| `R` | Replace selections by clipboard contents | `replace_selections_with_clipboard` |
| `/` | Global search in workspace folder | `global_search` |
| `?` | Open command palette | `command_palette` |
| `e` | Reveal current file in explorer | `reveal_current_file` |


> 💡 Global search displays results in a fuzzy picker, use `Space + '` to bring it back up after opening a file.
Expand Down Expand Up @@ -479,3 +481,7 @@ Keys to use within prompt, Remapping currently not supported.
| `Tab` | Select next completion item |
| `BackTab` | Select previous completion item |
| `Enter` | Open selected |

# File explorer

Press `?` to see keymaps. Remapping currently not supported.
45 changes: 45 additions & 0 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ impl MappableCommand {
command_palette, "Open command palette",
goto_word, "Jump to a two-character label",
extend_to_word, "Extend to a two-character label",
open_or_focus_explorer, "Open or focus explorer",
reveal_current_file, "Reveal current file in explorer",
);
}

Expand Down Expand Up @@ -2883,6 +2885,49 @@ fn file_picker_in_current_directory(cx: &mut Context) {
cx.push_layer(Box::new(overlaid(picker)));
}

fn open_or_focus_explorer(cx: &mut Context) {
cx.callback = Some(Box::new(
|compositor: &mut Compositor, cx: &mut compositor::Context| {
if let Some(editor) = compositor.find::<ui::EditorView>() {
match editor.explorer.as_mut() {
Some(explore) => explore.focus(),
None => match ui::Explorer::new(cx) {
Ok(explore) => editor.explorer = Some(explore),
Err(err) => cx.editor.set_error(format!("{}", err)),
},
}
}
},
));
}

fn reveal_file(cx: &mut Context, path: Option<PathBuf>) {
cx.callback = Some(Box::new(
|compositor: &mut Compositor, cx: &mut compositor::Context| {
if let Some(editor) = compositor.find::<ui::EditorView>() {
(|| match editor.explorer.as_mut() {
Some(explorer) => match path {
Some(path) => explorer.reveal_file(path),
None => explorer.reveal_current_file(cx),
},
None => {
editor.explorer = Some(ui::Explorer::new(cx)?);
if let Some(explorer) = editor.explorer.as_mut() {
explorer.reveal_current_file(cx)?;
}
Ok(())
}
})()
.unwrap_or_else(|err| cx.editor.set_error(err.to_string()))
}
},
));
}

fn reveal_current_file(cx: &mut Context) {
reveal_file(cx, None)
}

fn buffer_picker(cx: &mut Context) {
let current = view!(cx.editor).doc;

Expand Down
56 changes: 56 additions & 0 deletions helix-term/src/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,47 @@ impl<'a> Context<'a> {
tokio::task::block_in_place(|| helix_lsp::block_on(self.editor.flush_writes()))?;
Ok(())
}

/// Purpose: to test `handle_event` without escalating the test case to integration test
/// Usage:
/// ```
/// let mut editor = Context::dummy_editor();
/// let mut jobs = Context::dummy_jobs();
/// let mut cx = Context::dummy(&mut jobs, &mut editor);
/// ```
#[cfg(test)]
pub fn dummy(jobs: &'a mut Jobs, editor: &'a mut helix_view::Editor) -> Context<'a> {
Context {
jobs,
scroll: None,
editor,
}
}

#[cfg(test)]
pub fn dummy_jobs() -> Jobs {
Jobs::new()
}

#[cfg(test)]
pub fn dummy_editor() -> Editor {
use crate::config::Config;
use arc_swap::{access::Map, ArcSwap};
use helix_core::syntax::{self, Configuration};
use helix_view::theme;
use std::sync::Arc;

let config = Arc::new(ArcSwap::from_pointee(Config::default()));
Editor::new(
Rect::new(0, 0, 60, 120),
Arc::new(theme::Loader::new(&[])),
Arc::new(syntax::Loader::new(Configuration { language: vec![] })),
Arc::new(Arc::new(Map::new(
Arc::clone(&config),
|config: &Config| &config.editor,
))),
)
}
}

pub trait Component: Any + AnyComponent {
Expand Down Expand Up @@ -73,6 +114,21 @@ pub trait Component: Any + AnyComponent {
fn id(&self) -> Option<&'static str> {
None
}

#[cfg(test)]
/// Utility method for testing `handle_event` without using integration test.
/// Especially useful for testing helper components such as `Prompt`, `TreeView` etc
fn handle_events(&mut self, events: &str) -> anyhow::Result<()> {
use helix_view::input::parse_macro;

let mut editor = Context::dummy_editor();
let mut jobs = Context::dummy_jobs();
let mut cx = Context::dummy(&mut jobs, &mut editor);
for event in parse_macro(events)? {
self.handle_event(&Event::Key(event), &mut cx);
}
Ok(())
}
}

pub struct Compositor {
Expand Down
1 change: 1 addition & 0 deletions helix-term/src/keymap/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ pub fn default() -> HashMap<Mode, KeyTrie> {
"C" => toggle_block_comments,
"A-c" => toggle_line_comments,
"?" => command_palette,
"e" => reveal_current_file,
},
"z" => { "View"
"z" | "c" => align_view_center,
Expand Down
70 changes: 63 additions & 7 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
keymap::{KeymapResult, Keymaps},
ui::{
document::{render_document, LinePos, TextRenderer, TranslatedPosition},
Completion, ProgressSpinners,
Completion, Explorer, ProgressSpinners,
},
};

Expand All @@ -21,7 +21,7 @@ use helix_core::{
};
use helix_view::{
document::{Mode, SavePoint, SCRATCH_BUFFER_NAME},
editor::{CompleteAction, CursorShapeConfig},
editor::{CompleteAction, CursorShapeConfig, ExplorerPosition},
graphics::{Color, CursorKind, Modifier, Rect, Style},
input::{KeyEvent, MouseButton, MouseEvent, MouseEventKind},
keyboard::{KeyCode, KeyModifiers},
Expand All @@ -43,6 +43,7 @@ pub struct EditorView {
spinners: ProgressSpinners,
/// Tracks if the terminal window is focused by reaction to terminal focus events
terminal_focused: bool,
pub(crate) explorer: Option<Explorer>,
}

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -72,6 +73,7 @@ impl EditorView {
completion: None,
spinners: ProgressSpinners::default(),
terminal_focused: true,
explorer: None,
}
}

Expand Down Expand Up @@ -1310,6 +1312,11 @@ impl Component for EditorView {
event: &Event,
context: &mut crate::compositor::Context,
) -> EventResult {
if let Some(explore) = self.explorer.as_mut() {
if let EventResult::Consumed(callback) = explore.handle_event(event, context) {
return EventResult::Consumed(callback);
}
}
let mut cx = commands::Context {
editor: context.editor,
count: None,
Expand Down Expand Up @@ -1467,6 +1474,8 @@ impl Component for EditorView {
surface.set_style(area, cx.editor.theme.get("ui.background"));
let config = cx.editor.config();

let editor_area = area.clip_bottom(1);

// check if bufferline should be rendered
use helix_view::editor::BufferLine;
let use_bufferline = match config.bufferline {
Expand All @@ -1475,15 +1484,43 @@ impl Component for EditorView {
_ => false,
};

// -1 for commandline and -1 for bufferline
let mut editor_area = area.clip_bottom(1);
if use_bufferline {
editor_area = editor_area.clip_top(1);
}
let editor_area = if use_bufferline {
editor_area.clip_top(1)
} else {
editor_area
};

let editor_area = if let Some(explorer) = &self.explorer {
let explorer_column_width = if explorer.is_opened() {
explorer.column_width().saturating_add(2)
} else {
0
};
// For future developer:
// We should have a Dock trait that allows a component to dock to the top/left/bottom/right
// of another component.
match config.explorer.position {
ExplorerPosition::Left => editor_area.clip_left(explorer_column_width),
ExplorerPosition::Right => editor_area.clip_right(explorer_column_width),
}
} else {
editor_area
};

// if the terminal size suddenly changed, we need to trigger a resize
cx.editor.resize(editor_area);

if let Some(explorer) = self.explorer.as_mut() {
if !explorer.is_focus() {
let area = if use_bufferline {
area.clip_top(1)
} else {
area
};
explorer.render(area, surface, cx);
}
}

if use_bufferline {
Self::render_bufferline(cx.editor, area.with_height(1), surface);
}
Expand Down Expand Up @@ -1562,9 +1599,28 @@ impl Component for EditorView {
if let Some(completion) = self.completion.as_mut() {
completion.render(area, surface, cx);
}

if let Some(explore) = self.explorer.as_mut() {
if explore.is_focus() {
let area = if use_bufferline {
area.clip_top(1)
} else {
area
};
explore.render(area, surface, cx);
}
}
}

fn cursor(&self, _area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
if let Some(explore) = &self.explorer {
if explore.is_focus() {
let cursor = explore.cursor(_area, editor);
if cursor.0.is_some() {
return cursor;
}
}
}
match editor.cursor() {
// all block cursors are drawn manually
(pos, CursorKind::Block) => {
Expand Down
Loading

0 comments on commit 64b89e0

Please sign in to comment.