posit-dev / posit-dev/positron

Moving lines should ignore folded code

Open
#9,779 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: editor area: ui enhancement support
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 11h
Merged PRs (30d)
206

Description

System details:

Positron and OS details:

Positron Version: 2025.09.0 build 139
Code - OSS Version: 1.103.0
Commit: 30e3d0a74e09a0f6640929822cb57a326671360e
Date: 2025-08-29T18:34:16.368Z
Electron: 37.2.3
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Linux x64 6.12.10-76061203-generic

Session details:
R version 4.5.0 (2025-04-11)
Platform: x86_64-pc-linux-gnu
Running under: Pop!_OS 22.04 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=es_PE.UTF-8       LC_NUMERIC=C               LC_TIME=es_PE.UTF-8       
 [4] LC_COLLATE=es_PE.UTF-8     LC_MONETARY=es_PE.UTF-8    LC_MESSAGES=es_PE.UTF-8   
 [7] LC_PAPER=es_PE.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=es_PE.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Lima
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.5.0    cli_3.6.5         tools_4.5.0       rlang_1.1.6       sessioninfo_1.2.3

Describe the issue:

When moving line(s) up/down they should omit folded code

Steps to reproduce the issue:

  1. Write a function in the first lines of a script.
  2. Fold the function definition.
  3. Write some random text below the function
  4. Put the cursor in the lines containing the random text.
  5. Move line up/down the lines with the keyboard shortcut for Move Line Up (Alt + UpArrow)

In Positron:

Image

In RStudio:

Image

Expected or desired behavior:

It should go straight to the lines above the function instead of going through the function def.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in Positron with a folded function and the Move Line Up or Move Line Down shortcut. Trace the editor behavior for moving lines across folded ranges; done means moved lines skip folded code and go directly to the visible preceding or following lines, matching the expected behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.