Skip to content

Strange behavior in Janet files #47

@MaxGyver83

Description

@MaxGyver83

I noticed some strange behavior in Janet files.

Example 1:

(defmacro $<
  [& args]
  (def specs (collect-proc-specs args))
  (tuple $<* ;specs)
  # ~(upscope
  #   (pp ,specs)
  #   (tuple ,$<* ,;specs))
  )

When I select the comment lines (linewise visual mode) and delete them with d, I end up with this:

(defmacro $<
  [& args]
  (def specs (collect-proc-specs args))
  (tuple $<* ;specs)
  ((
  )

These two opening parentheses are unexpected.

Example 2a:

(defn- escape [str]
  (->> str
    (string/replace-all " " "\\ ")
    (string/replace-all `"` `\"`)
    ))

When I put the cursor in line 4 of this snippet and delete/cut the line with dd, I end up with:

(defn- escape [str]
  (->> str
    (string/replace-all " " "\\ ")
    ("
    ))

The (" is not expected.

Example 2b:

When I put the cursor again in line 4 in example 2a and try to copy the line with yyp (instead of deleting it), I end up with:

(defn- escape [str]
  (->> str
    (string/replace-all " " "\\ ")
    (string/replace-all `"` `\"`)
     string/replace-all ` ` `\"`)
    ))

The opening parenthesis in the new line 5 is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions