-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Suggested change] mark/unmark resources to not call kubectl and refresh #98
Comments
Thank you for sharing! |
I also had this problem I patched it like this: @@ -1129,20 +1130,24 @@
"Mark or unmark the item under cursor."
(interactive)
(let ((item (kubel--get-resource-under-cursor)))
(unless (-contains? kubel--selected-items item)
(progn
(push item kubel--selected-items)
+ (setf (aref (tabulated-list-get-entry) 0)
+ (kubel--propertize-status item))
(forward-line 1)
- (kubel)))))
+ (tabulated-list-print t t)))))
(defun kubel-unmark-item ()
"Unmark the item under cursor."
(interactive)
(let ((item (kubel--get-resource-under-cursor)))
(when (-contains? kubel--selected-items item)
(progn
(setq kubel--selected-items (delete item kubel--selected-items))
- (kubel)))))
+ (setf (aref (tabulated-list-get-entry) 0)
+ (substring-no-properties item))
+ (tabulated-list-print t t)))))
(defun kubel-mark-all ()
"Mark all items."
@@ -1153,13 +1158,19 @@
(while (not (eobp))
(push (kubel--get-resource-under-cursor) kubel--selected-items)
(forward-line 1)))
- (kubel))
+ (dolist (entry tabulated-list-entries)
+ (cl-destructuring-bind (id descs) entry
+ (setf (aref descs 0) (kubel--propertize-status (aref descs 0)))))
+ (tabulated-list-print t t))
(defun kubel-unmark-all ()
"Unmark all items."
(interactive)
(setq kubel--selected-items '())
- (kubel))
+ (dolist (entry tabulated-list-entries)
+ (cl-destructuring-bind (id descs) entry
+ (setf (aref descs 0) (string-remove-prefix "*" (substring-no-properties (aref descs 0))))))
+ (tabulated-list-print t t))
;; popups I thought that maybe setting Hopefully this helps |
Hey! Great work on this package, its simpler than kubernetes-el and works with all resources which is a must for me.
One thing I don't like is that marking and unmarking calls the kubel command, causing a full refresh. This is very slow when marking multiple pods.
I hacked together a simple solution:
Which basically uses highlighting as the mark indicator, which is instant and does not require calling propertize status and refreshing kubel.
the
delete-marked-items
function is just something i wanted for easier visibility of my k8s resources.I definitley did not look through the entire package, so im not sure if there is some other reason the current implementation
The text was updated successfully, but these errors were encountered: