MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / resolveScrollEnvironment

Function resolveScrollEnvironment

cli/src/utils/chat-scroll-accel.ts:33–52  ·  view source on GitHub ↗
(
  env: CliEnv = getCliEnv(),
)

Source from the content-addressed store, hash-verified

31}
32
33const resolveScrollEnvironment = (
34 env: CliEnv = getCliEnv(),
35): ScrollEnvironment => {
36 let multiplier = parseFloat(env.CODEBUFF_SCROLL_MULTIPLIER ?? '')
37
38 if (Number.isNaN(multiplier)) {
39 multiplier = 1
40 }
41
42 for (const hintVar of ENVIRONMENT_TYPE_VARS) {
43 const value = env[hintVar]
44 for (const environment of ENVIRONMENTS) {
45 if (value?.includes(environment)) {
46 return { type: environment, multiplier }
47 }
48 }
49 }
50
51 return { type: 'default', multiplier }
52}
53
54type ConstantScrollAccelOptions = {
55 /** How fast to scale the scrolling. */

Callers 1

Calls 1

getCliEnvFunction · 0.90

Tested by

no test coverage detected