Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: rewrite grapple #89

Merged
merged 146 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
ffdca17
feat: initial rewrite
Feb 20, 2024
da28f5b
refactor: remove old code
Feb 20, 2024
a251c4f
refactor: scope grapple types
Feb 20, 2024
23da087
fix: add empty api so that plugin can be loaded
Feb 20, 2024
7b24913
feat: add wrapper for vim.fs.joinpath
Feb 21, 2024
81680ee
fix: remove container during reset
Feb 21, 2024
e84ce98
Implement tag reconciliation when window closes
Feb 21, 2024
b526425
refactor: update relationship between window and content
Feb 21, 2024
49cc05c
refactor: tag actions
Feb 21, 2024
e195316
fix: grapple.vim.win_opts title can only be a string
Feb 21, 2024
a4dd5aa
refactor: identify when window is rendered with content + dynamic con…
Feb 21, 2024
9e2273e
fix: delete old code
Feb 22, 2024
720e61b
refactor: more ui work
Feb 22, 2024
ef33292
refactor: temporarily remove old specs
Feb 22, 2024
55237ca
test: update test harness and helper functions
Feb 22, 2024
da43b91
work: add .neoconf.json to improve spec intellisense
Feb 22, 2024
2afb14d
fix: improve absolute path resolution + add spec
Feb 22, 2024
3537192
work: add stylua.toml
Feb 22, 2024
7bc5865
refactor: Util.absolute and Util.relative can now error
Feb 22, 2024
01a1ca5
refactor: code organization + improve rendered tag content
Feb 22, 2024
b019223
feat: fix cursor to a minimum column position
Feb 22, 2024
87e01d7
refactor: functions are nillable + begin public api + functional scop…
Feb 24, 2024
dc8df7d
fix(test): Util.absolute is nillable
Feb 24, 2024
bffeefe
refactor: attempt to update on quit + loads more
Feb 25, 2024
cebc5f6
fix: tag#update pulls the cursor from the current window
Feb 25, 2024
e02d8d0
refactor: create grapple.app module
Feb 25, 2024
4688f72
feat: add scope fallback
Feb 25, 2024
5bbe9c8
fix: add annotations for grapple.app
Feb 25, 2024
8362e50
refactor: rename TagManager:container to TagManager:load
Feb 25, 2024
f869694
refactor: allow scope resolver to return a nil id
Feb 25, 2024
3d6de2d
fix: use ExitPre to save cursor instead of QuitPre
Feb 25, 2024
a22bf67
refactor: removing cursor hack (yay!)
Feb 25, 2024
db29a15
refactor: redundant definition of tag update callback
Feb 25, 2024
b1d7033
fix: only set title from content if returning true
Feb 25, 2024
3f665a9
feat: add user settings + add user command
Feb 25, 2024
ba3f635
feat: use lua file for loading grapple
Feb 25, 2024
ef65a57
refactor: simplify state error handling
Feb 25, 2024
ffb3203
fix: apply_changes returns a string, not a table
Feb 25, 2024
0171b6c
fix: remove debug save_path + fix cwd scope resolver + early exit git…
Feb 25, 2024
c411343
chore: remove unused selene.toml
Feb 25, 2024
31e6f7a
feat: allow toggling icons in settings
Feb 25, 2024
6b19b90
feat: add :len and :is_empty to TagContainer
Feb 25, 2024
cc7eb71
feat: emit GrappleUpdate on container transaction
Feb 25, 2024
3ddbaca
fix: prefer BufWinLeave over BufLeave when closing window
Feb 25, 2024
0702128
feat: use api opts for tag/untag/toggle/select + add cycle forward an…
Feb 25, 2024
64bfa26
doc: don't prefix type documentation with "vim.api"
Feb 26, 2024
b3370db
refactor: sort buffer options
Feb 26, 2024
05be36f
fix: invalidate mark when line is deleted
Feb 26, 2024
d3732b2
refactor: sort win_opts in settings
Feb 26, 2024
cd65d74
fix: remove files added from rebase
Feb 26, 2024
c78ddb4
fix: delete autocmds file for the nth time
Feb 27, 2024
e8a4754
feat: add Path module
Feb 27, 2024
1cae066
test: run tests sequentially
Feb 27, 2024
d043aa2
refactor: replace Util with Path in TagContent
Feb 27, 2024
c4ef103
feat: add Path.short, Path.exists, and Path.is_uri (unstable)
Feb 27, 2024
e6c2931
refactor: replace Util with Path in Tag
Feb 27, 2024
e0ffb14
refactor: replace Util with Path in TagAction
Feb 27, 2024
dc1e20a
refactor: replace Util with Path in TagContainer
Feb 27, 2024
94ac7ee
feat: support title padding
Feb 27, 2024
b51f27b
feat: scope caching
Feb 27, 2024
13fe61d
fix: remove debugging
Feb 27, 2024
f546497
refactor: delete unused util module
Feb 27, 2024
17d1d75
refactor: repurpose util module for helpful methods and predicates
Feb 27, 2024
4c3001f
refactor: default use scope id as title
Feb 27, 2024
7341032
fix: defer closing closing window
Feb 27, 2024
91618bb
fix: window doesn't use BufUnload
Feb 27, 2024
1033cdd
refactor: use concise name for callback function
Feb 27, 2024
b7c69c7
docs: rename some lua classes
Feb 27, 2024
8e45fd1
fix: remove unused opts from autocmd
Feb 27, 2024
6f62e9c
fix: remove Grapple.setup overhead from Grapple.initialize
Feb 27, 2024
55d8f9d
docs: update README and some settings documentation
Feb 27, 2024
2f9843e
docs: basic markdownlint config
Feb 27, 2024
7053840
fix: remove debug statements
Feb 27, 2024
88ab3f5
docs: continue updating README
Feb 27, 2024
dbfebbf
fix: ensure default scopes are not overridden + properly update settings
Feb 28, 2024
cfcc10d
refactor: use App.enter to clean up duplicate top-level error handlin…
Feb 28, 2024
05a83b4
refactor: rename StateManager as State
Feb 28, 2024
2a93505
fix: trim whitespace from lines before parsing
Feb 28, 2024
7a5ae7f
feat: use "{{ titie }}" in settings to indicate use of content title
Feb 28, 2024
edfde59
fix: better line parsing for tag content
Feb 28, 2024
07200de
refactor: move initialize to bottom + all api accepts grapple.options
Feb 28, 2024
e966217
refactor: window manages state instead of the content
Feb 28, 2024
5e5086b
fix: Window:is_rendered() requires is_open and has_content + remove c…
Feb 28, 2024
617e3bb
fix: improve window title resolution
Feb 28, 2024
af67d38
feat: basic scopes window + scope description
Feb 28, 2024
1cf8093
feat: scope actions :)
Feb 28, 2024
e185756
fix: use initial neovim working directory for the "static" scope
Feb 28, 2024
fa738a7
fix: prevent re-entering the current buffer on tag selection
Feb 28, 2024
5827b36
fix: ensure window boundaries are valid
Feb 28, 2024
e3403c0
feat: add Grapple.quickfix
Feb 28, 2024
8d5ede5
fix(docs): double "and and"
Feb 28, 2024
44f62ae
fix: sort scopes by name in scope content
Feb 28, 2024
ad6c1fc
refactor: use correct name of State instead of StateManager
Feb 28, 2024
dc21210
feat: container window + permit storing URIs
Feb 28, 2024
66c6d1d
fix: assume URIs are already as short as possible
Feb 28, 2024
e9030aa
feat: add split and vsplit commands to tag window
Feb 28, 2024
36aff86
refactor: rename TagManager.update to TagManager.update_all
Feb 28, 2024
9aa3fac
fix: remove old comments
Feb 28, 2024
19bcde8
refactor: prefix scope and container titles with Grapple
Feb 29, 2024
1b93a14
fix: use container name when sorting
Feb 29, 2024
88c1f4a
docs: update settings + update tag window keybinds + add container wi…
Feb 29, 2024
d80e1e9
docs: minor improvements and style fixes
Feb 29, 2024
c3b4d4e
feat: allow "cache = true" to cache indefinitely in scope definition
Feb 29, 2024
1391081
feat: support tag names
Feb 29, 2024
d9930a4
docs: update readme
Feb 29, 2024
9be582b
fix: do normal path joining for Windows paths
Feb 29, 2024
1b96db7
fix: error out when icons = true and nvim-web-devicons is not available
Feb 29, 2024
0e207c0
refactor: allow container transactions without syncing state
Feb 29, 2024
611318a
refactor: some code reorganization in TagContainer
Feb 29, 2024
38483fa
refactor: cleanup TagActions.select
Feb 29, 2024
bf3f42a
fix: filter modified entries before iterating when diffing content
Feb 29, 2024
1cc9a50
fix: telescope extension
Feb 29, 2024
b8f270e
docs: add todo item
Feb 29, 2024
164ca5c
fix: ensure cache is closed when redefining a scope
Feb 29, 2024
e6f267a
docs: update grapple.scope_definition
Feb 29, 2024
7a8abf4
feat: add Grapple.define_scope
Feb 29, 2024
e3dd593
refactor: address some linting errors
Feb 29, 2024
40f4181
refactor: add deprecated commands. Will remove in a future release
Feb 29, 2024
c956ed6
feat: exclude tagging buffer by options
Feb 29, 2024
9bc9023
fix: silly mistake
Feb 29, 2024
f0dcbb6
fix: extract path from options in Grapple.exists and Grapple.name_or_…
Feb 29, 2024
5116618
fix: use vim.loop as vim.uv is a nightly feature
Feb 29, 2024
17c1cf4
fix: vim.fs.joinpath is nightly too
Feb 29, 2024
8115215
fix: extmark opt "invalidate" is a nightly feature
Feb 29, 2024
67c5bd9
refactor: cleanup Path.join and add nvim-0.10 comment
Feb 29, 2024
fdeb3e6
fix: vim.system is a nightly feature, use vim.fn.system instead
Feb 29, 2024
d427630
feat: add debounce to cache
Feb 29, 2024
59928d3
docs: update statusline section in readme
Feb 29, 2024
d5e0bd9
docs: cleanup telescope and contributors section
Feb 29, 2024
4239f08
docs: add luadocs for top-level API methods
Feb 29, 2024
f1d5dea
fix: use "git" as the default scope
Feb 29, 2024
2d00499
refactor: actions should use the top-level grapple api, not the other…
Feb 29, 2024
a31f6c3
docs: update readme showcase
Mar 1, 2024
261a4aa
docs: update grapple windows screenshot
Mar 1, 2024
063ac13
docs: update link to Scopes API
Mar 1, 2024
679352b
feat: add dedicated statusline method
Mar 1, 2024
143d24d
refactor: rename containers window to loaded scopes window
Mar 1, 2024
a0fb01d
feat: add actions for loaded scopes window
Mar 1, 2024
9a7d880
feat: add simple reset scope action to loaded scopes window
Mar 1, 2024
52ede03
refactor: move some code around
Mar 1, 2024
9112efe
docs: update readme
Mar 1, 2024
4bf0601
fix: don't worry if path doesn't exist for tag selection
Mar 1, 2024
d89e0f1
docs: update readme
Mar 1, 2024
b7a009e
fix: use cwd for "static" scope
Mar 1, 2024
a7b3b8d
fix: ensure grapple state directory is created on startup
Mar 1, 2024
7f5cc63
docs: use "loaded scope" instead of "container" in readme
Mar 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.tests
.luarc.json
10 changes: 10 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MD013:
line_length: 120

MD033:
allowed_elements:
- "a"
- "b"
- "details"
- "img"
- "summary"
13 changes: 13 additions & 0 deletions .neoconf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"neodev": {
"library": {
"plugins": ["plenary.nvim"]
}
},
"lspconfig": {
"lua_ls": {
"Lua.runtime.version": "LuaJIT",
"Lua.workspace.checkThirdParty": false
}
}
}
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
ifneq ($(strip $(spec)),)
spec_file = $(spec)_spec.lua
endif

test:
echo $(spec_file)
nvim --headless --clean --noplugin \
-u "tests/minimal_init.vim" \
-c "PlenaryBustedDirectory tests/spec/$(spec_file) { minimal_init = 'tests/minimal_init.vim' }"
printf "\n======\n\n" ; \
nvim --version | head -n 1 && echo '' ; \
nvim --headless \
-u "tests/minimal_init.lua" \
-c "PlenaryBustedDirectory tests { minimal_init = 'tests/minimal_init.lua', sequential = true }"

test_file:
printf "\n======\n\n" ; \
nvim --version | head -n 1 && echo '' ; \
nvim --headless \
-u "tests/minimal_init.lua" \
-c "PlenaryBustedDirectory $(FILE) { minimal_init = 'tests/minimal_init.lua', sequential = true }"

clean:
rm -rf .tests
Loading
Loading