Browse Source

Use columns as well as lines when registering breakpoints

workspaces
Nicolas Petton 3 years ago
parent
commit
49717cbb80
Signed by: nico GPG Key ID: 233587A47C207910
4 changed files with 7 additions and 2 deletions
  1. +1
    -0
      indium-breakpoint.el
  2. +2
    -1
      indium-script.el
  3. +2
    -0
      indium-structs.el
  4. +2
    -1
      test/unit/indium-structs-test.el

+ 1
- 0
indium-breakpoint.el View File

@ -41,6 +41,7 @@ When CONDITION is non-nil, the breakpoint will be hit when
CONDITION is true."
(let* ((brk (make-indium-breakpoint :file (indium-location-file location)
:line (indium-location-line location)
:column (indium-location-column location)
:condition (or condition ""))))
(indium-breakpoint--add-overlay brk)
(when-indium-connected


+ 2
- 1
indium-script.el View File

@ -159,7 +159,8 @@ sourcemap."
If no location can be found, return nil."
(indium-script-generated-location
(make-indium-location :file buffer-file-name
:line (1- (line-number-at-pos)))))
:line (1- (line-number-at-pos))
:column (current-column))))
(defun indium-script-sourcemap (script)
"Return the sourcemap object associated with SCRIPT.


+ 2
- 0
indium-structs.el View File

@ -216,11 +216,13 @@ If LINE is not provided, return all breakpoints in FILE."
(:constructor make-indium-breakpoint
(&key id
line
column
file
condition
overlay
&aux (location (make-indium-location
:line line
:column column
:file file)))))
(id nil :type string)
(overlay nil)


+ 2
- 1
test/unit/indium-structs-test.el View File

@ -57,6 +57,7 @@
(let ((brk (make-indium-breakpoint
:id 'id
:line 5
:column 2
:file "foo.js")))
(expect (indium-breakpoint-id brk) :to-be 'id)
(expect (indium-location-file (indium-breakpoint-location brk))
@ -64,7 +65,7 @@
(expect (indium-location-line (indium-breakpoint-location brk))
:to-equal 5)
(expect (indium-location-column (indium-breakpoint-location brk))
:to-equal 0))))
:to-equal 2))))
(describe "Manipulating breakpoints"
(it "can register breakpoints"


Loading…
Cancel
Save