mui-git 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f65a509ed569794ac6dbf4870c84e64683fb9a298f6d775b6fdd0bf18d7426e5
4
- data.tar.gz: 70f1650ec729b6d33e09e9631f6dd9e80ad639e2139c8d5035a67934b30cff6d
3
+ metadata.gz: 0f08ae825a65cf8338058df7cea4da1d44c19222bdc6647f70d089f845dcde4d
4
+ data.tar.gz: 3edc2df456a50a90aff4f2dd7a0fd3951015fe22c00b07207b15b46b2de5bdd1
5
5
  SHA512:
6
- metadata.gz: 34f184cb80f5b402926b9627b6823ec8c1c3e1a941055c4c6640f55f1a95b555ebbd06f9d7efeffe931c12c579f91fea152e4fb6aa26c96ba8b87441022cb785
7
- data.tar.gz: 6e73af2750dc349d17d5daa7516e8ed28e493381cc53d246bcceea1badf7a9cc63be030fde6426b168b8a8500a222209efb6f821c732e2014d69e9718047e0f5
6
+ metadata.gz: f9b6d4dfe853feaee9dc5c5893294b9899723d942b05f60a348bb01bbff78613a0c52ce8417c4a07b1b184fe74b436476556a3fa950f59ba0118cc8755587e26
7
+ data.tar.gz: cd8553bffc5d215798c0eac3a17af3c1622bedc24e34b2cee9ce28e5dd7a000f17888d004a3d6672ee2106221c5b8851fe60e8130dbc34970825762d7eaaf086
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] 2025-12-15
4
+
5
+ ### Changed
6
+ - Use `<Leader>` prefix for plugin keymaps to avoid conflicts with Mui core keybindings
7
+ - `q` → `<Leader>q` for closing git buffers
8
+ - `dv` → `<Leader>d` for vertical diff split
9
+ - `cc` → `<Leader>c` for opening commit message buffer
10
+ - `Enter` → `<Leader>r` for showing commit diff in Log/Blame buffers
11
+
12
+ ### Fixed
13
+ - Fix `handle_quit` to use `close_current_window` method
14
+
15
+ ## [0.1.0] 2025-12-11
16
+
3
17
  ### Added
4
18
  - Initial release
5
19
  - Interactive git status buffer (`:Git` or `:Git status`)
data/README.md CHANGED
@@ -42,25 +42,25 @@ gem install mui-git
42
42
  | `s` | Stage file under cursor |
43
43
  | `u` | Unstage file under cursor |
44
44
  | `-` | Toggle stage/unstage |
45
- | `dv` | Open diff in vertical split |
46
- | `cc` | Open commit message buffer |
47
- | `q` | Close buffer |
45
+ | `<Leader>d` | Open diff in vertical split |
46
+ | `<Leader>c` | Open commit message buffer |
47
+ | `<Leader>q` | Close buffer |
48
48
  | `R` | Refresh status |
49
49
 
50
50
  ## Keymaps (Log/Blame Buffer)
51
51
 
52
52
  | Key | Description |
53
53
  |-----|-------------|
54
- | `Enter` | Show commit diff in vertical split |
55
- | `q` | Close buffer |
54
+ | `<Leader>r` | Show commit diff in vertical split |
55
+ | `<Leader>q` | Close buffer |
56
56
 
57
- In the log buffer (`:Git log`), pressing `Enter` on a commit line opens the full commit diff with syntax highlighting.
57
+ In the log buffer (`:Git log`), pressing `<Leader>r` on a commit line opens the full commit diff with syntax highlighting.
58
58
 
59
- In the blame buffer (`:Git blame`), pressing `Enter` on any line shows the diff for that line's commit. Uncommitted changes (shown as `00000000`) are skipped.
59
+ In the blame buffer (`:Git blame`), pressing `<Leader>r` on any line shows the diff for that line's commit. Uncommitted changes (shown as `00000000`) are skipped.
60
60
 
61
61
  ## Commit Message Buffer
62
62
 
63
- When you press `cc` in the status buffer, a commit message editor opens:
63
+ When you press `<Leader>c` in the status buffer, a commit message editor opens:
64
64
 
65
65
  1. Write your commit message at the top of the buffer
66
66
  2. Lines starting with `#` are comments and will be ignored
@@ -6,12 +6,9 @@ module Mui
6
6
  # Base class for Git buffers (inherits from Mui::Buffer)
7
7
  # Provides common functionality for git-related buffers
8
8
  class Base < Mui::Buffer
9
- attr_accessor :pending_key
10
-
11
9
  def initialize(name)
12
10
  super(name)
13
11
  @readonly = true
14
- @pending_key = nil
15
12
  end
16
13
 
17
14
  # Update buffer content (works even for readonly buffers)
@@ -20,16 +17,6 @@ module Mui
20
17
  @lines = [""] if @lines.empty?
21
18
  @modified = false
22
19
  end
23
-
24
- # Set pending key for multi-key sequences (like dv, cc)
25
- def set_pending(key)
26
- @pending_key = key
27
- end
28
-
29
- # Clear pending key
30
- def clear_pending
31
- @pending_key = nil
32
- end
33
20
  end
34
21
  end
35
22
  end
@@ -118,7 +118,7 @@ module Mui
118
118
  end
119
119
 
120
120
  lines << ""
121
- lines << "Press: s=stage, u=unstage, -=toggle, dv=diff, cc=commit, q=quit, R=refresh"
121
+ lines << "Press: s=stage, u=unstage, -=toggle, \\d=diff, \\c=commit, \\q=quit, R=refresh"
122
122
 
123
123
  lines.join("\n")
124
124
  end
@@ -10,6 +10,8 @@ module Mui
10
10
  def setup
11
11
  register_commands
12
12
  register_keymaps
13
+ # Debug: keymaps registered to config
14
+ File.write("/tmp/mui-git-setup.log", "config.keymaps[:normal].keys: #{Mui.config.keymaps[:normal]&.keys}\n", mode: "a")
13
15
  end
14
16
 
15
17
  private
@@ -52,39 +54,24 @@ module Mui
52
54
  true
53
55
  end
54
56
 
55
- # Diff (first key of 'dv')
56
- keymap(:normal, "d") do |ctx|
57
+ # Diff vertical split (<Leader>d)
58
+ keymap(:normal, "<Leader>d") do |ctx|
57
59
  next unless git_buffer?(ctx.buffer)
58
60
 
59
- ctx.buffer.set_pending("d")
60
- true
61
- end
62
-
63
- # Diff vertical split (when 'v' pressed after 'd')
64
- keymap(:normal, "v") do |ctx|
65
- next unless git_buffer?(ctx.buffer)
66
- next unless ctx.buffer.pending_key == "d"
67
-
68
- ctx.buffer.clear_pending
69
61
  handle_diff_vertical(ctx)
70
62
  true
71
63
  end
72
64
 
73
- # Commit (first key of 'cc')
74
- keymap(:normal, "c") do |ctx|
65
+ # Commit (<Leader>c)
66
+ keymap(:normal, "<Leader>c") do |ctx|
75
67
  next unless status_buffer?(ctx.buffer)
76
68
 
77
- if ctx.buffer.pending_key == "c"
78
- ctx.buffer.clear_pending
79
- handle_commit(ctx)
80
- else
81
- ctx.buffer.set_pending("c")
82
- end
69
+ handle_commit(ctx)
83
70
  true
84
71
  end
85
72
 
86
73
  # Quit buffer
87
- keymap(:normal, "q") do |ctx|
74
+ keymap(:normal, "<Leader>q") do |ctx|
88
75
  next unless git_buffer?(ctx.buffer)
89
76
 
90
77
  handle_quit(ctx)
@@ -102,7 +89,7 @@ module Mui
102
89
 
103
90
  def register_log_blame_keymaps
104
91
  # Enter key to show commit diff in Log/Blame buffers
105
- keymap(:normal, "\r") do |ctx|
92
+ keymap(:normal, "<Leader>r") do |ctx|
106
93
  next unless log_buffer?(ctx.buffer) || blame_buffer?(ctx.buffer)
107
94
 
108
95
  handle_show_commit(ctx)
@@ -222,7 +209,7 @@ module Mui
222
209
  end
223
210
 
224
211
  def handle_quit(ctx)
225
- ctx.editor.window_manager.close_window(ctx.window)
212
+ ctx.editor.window_manager.close_current_window
226
213
  end
227
214
 
228
215
  def handle_refresh(ctx)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Mui
4
4
  module Git
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mui-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - S-H-GAMELINKS
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubygems_version: 4.0.0.beta2
73
+ rubygems_version: 3.6.9
74
74
  specification_version: 4
75
75
  summary: Git integration plugin for Mui editor (fugitive.vim-like)
76
76
  test_files: []