Skip to content

Conversation

dvdhansen
Copy link

No description provided.

@@ -759,7 +759,8 @@ Return nil if point is not in a function, otherwise point."
(while (and (not (eobp))
(forward-line 1)
(or (julia-syntax-comment-or-string-p)
(> (current-indentation) beg-defun-indent)))))
(> (current-indentation) beg-defun-indent)
(looking-at-p "^\\s-*\\(?:#.*\\)*$")))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this just use forward-comment?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to move over empty lines including those with “only but
not enough” whitespaces. forward-comment won’t do the job.
Replacing looking-at-p with (forward-comment 1) will move the
cursor to the line with the return statement and return nil.

function f()

    x = 42
    return x
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bug in cases like

f(x)::Int8 =
# no comment
    x*x

function forty_two()
 # no comment
    return 42
end

where end-of-defun jumps from first to end of second. It also gets stuck when point is just prior to the first function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For forward-comment I had been thinking along the lines of

(while (and (not (eobp))
                    (forward-line 1)
                    (or (forward-comment 5)
                        (julia-syntax-comment-or-string-p)
                        (> (current-indentation) beg-defun-indent)))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants