@@ -65,7 +65,7 @@ let s:VERSION = '11.3.0'
6565 let s: has_async_patch = has (' patch-7.4-2344' ) || v: version >= 800
6666 let s: has_async = s: has_async_patch && exists (' *job_start' )
6767 let s: nvim_async = exists (' *jobstart' )
68-
68+
6969 " AI vs Human line change tracking
7070 let s: is_ai_code_generating = s: false
7171 let s: lines_in_files = {}
@@ -541,15 +541,15 @@ EOF
541541 let heartbeat.lineno = cursor [1 ]
542542 let heartbeat.cursorpos = cursor [2 ]
543543 let heartbeat.lines = line (" $" )
544-
544+
545545 " Add AI vs Human line changes
546- if has_key (s: ai_line_changes , file ) && s: ai_line_changes [file ] != 0
547- let heartbeat.ai_line_changes = s: ai_line_changes [file ]
548- endif
549- if has_key (s: human_line_changes , file ) && s: human_line_changes [file ] != 0
550- let heartbeat.human_line_changes = s: human_line_changes [file ]
551- endif
552-
546+ " if has_key(s:ai_line_changes, file) && s:ai_line_changes[file] != 0
547+ " let heartbeat.ai_line_changes = s:ai_line_changes[file]
548+ " endif
549+ " if has_key(s:human_line_changes, file) && s:human_line_changes[file] != 0
550+ " let heartbeat.human_line_changes = s:human_line_changes[file]
551+ " endif
552+
553553 let s: heartbeats_buffer = s: heartbeats_buffer + [heartbeat]
554554 call s: SetLastHeartbeat (a: now , a: now , file )
555555
691691 let [&shell , &shellcmdflag , &shellredir ] = [sh , shellcmdflag , shrd]
692692
693693 let s: last_sent = localtime ()
694-
694+
695695 " Clear line changes after sending
696696 let s: ai_line_changes = {}
697697 let s: human_line_changes = {}
@@ -849,11 +849,11 @@ EOF
849849 if ! s: config_file_already_setup
850850 return
851851 endif
852-
852+
853853 " Update line numbers and detect AI code generation
854854 call s: UpdateLineNumbers ()
855855 call s: DetectAICodeGeneration ()
856-
856+
857857 let file = s: GetCurrentFile ()
858858 if ! empty (file ) && file !~ " -MiniBufExplorer-" && file !~ " --NO NAME--" && file !~ " ^term:"
859859 let last = s: GetLastHeartbeat ()
@@ -1049,18 +1049,18 @@ EOF
10491049 if empty (file )
10501050 return
10511051 endif
1052-
1052+
10531053 let current_lines = line (' $' )
1054-
1054+
10551055 " Initialize line count for this file if not present
10561056 if ! has_key (s: lines_in_files , file )
10571057 let s: lines_in_files [file ] = current_lines
10581058 return
10591059 endif
1060-
1060+
10611061 let prev_lines = s: lines_in_files [file ]
10621062 let delta = current_lines - prev_lines
1063-
1063+
10641064 " Track line changes based on AI state
10651065 if s: is_ai_code_generating
10661066 if ! has_key (s: ai_line_changes , file )
@@ -1073,7 +1073,7 @@ EOF
10731073 endif
10741074 let s: human_line_changes [file ] = s: human_line_changes [file ] + delta
10751075 endif
1076-
1076+
10771077 " Update current line count
10781078 let s: lines_in_files [file ] = current_lines
10791079 endfunction
@@ -1082,20 +1082,20 @@ EOF
10821082 " Simple heuristic: detect large pastes that might be AI-generated
10831083 let current_time = localtime ()
10841084 let paste_threshold = 5 " lines
1085-
1085+
10861086 " Get recent change information from v:register or other sources
10871087 " This is a simplified detection mechanism
10881088 " In a real implementation, you might hook into specific AI tools
1089-
1089+
10901090 if exists (' g:wakatime_ai_detected' ) && g: wakatime_ai_detected
10911091 let s: is_ai_code_generating = s: true
10921092 let s: ai_debounce_count = s: ai_debounce_count + 1
1093-
1093+
10941094 " Clear existing timer and set new one
10951095 if s: ai_debounce_timer != -1
10961096 call timer_stop (s: ai_debounce_timer )
10971097 endif
1098-
1098+
10991099 let s: ai_debounce_timer = timer_start (1000 , function (' s:StopAIDetection' ))
11001100 endif
11011101 endfunction
0 commit comments